際際滷

際際滷Share a Scribd company logo
why we need to branch
 write new code without affecting old code
 build and test new code in staging
environments without affecting production
why we branch by abstraction
 to avoid porting code from one branch to the
other
 to minimise merge operations performed by
our SCM
we branch by abstraction
not to be changing our code
but
to configure our code
when do we branch by abstraction
 we have to develop a new feature
 we have to change an existing feature
how do we branch by abstraction
feature flagged
feature flagged
NOT feature
flagged
how do we test feature flags
how do we test feature flags
what happens when we release
 remove feature flag from command
 remove feature flag from model
 remove feature flag from the command test
 remove feature flag from the model test
 run the tests again to see that everything is
still working
 ...and we LOST the previous
implementation!
we branch by abstraction
not to be changing our code
but not
to configure our code
a possible solution: NO FLAGS!
a possible solution: CONFIGURATION
Robotlegs
Parsley
Solution ProsCons
Pros:
 focusing only on the needed
behavior without touching the
previous class
 rely on previous implementations
and tests
 cleaner tests against cleaner
classes
 only one place for feature flags
 easy to revert/promote code
from/to release
 no feature loss
Cons:
 not a silver bullet for everything
for sure
 any suggestion?
we branch by abstraction
not to be changing our code
but
to configure our code

More Related Content

Branching by abstraction

  • 1. why we need to branch write new code without affecting old code build and test new code in staging environments without affecting production
  • 2. why we branch by abstraction to avoid porting code from one branch to the other to minimise merge operations performed by our SCM
  • 3. we branch by abstraction not to be changing our code but to configure our code
  • 4. when do we branch by abstraction we have to develop a new feature we have to change an existing feature
  • 5. how do we branch by abstraction feature flagged feature flagged NOT feature flagged
  • 6. how do we test feature flags
  • 7. how do we test feature flags
  • 8. what happens when we release remove feature flag from command remove feature flag from model remove feature flag from the command test remove feature flag from the model test run the tests again to see that everything is still working ...and we LOST the previous implementation!
  • 9. we branch by abstraction not to be changing our code but not to configure our code
  • 10. a possible solution: NO FLAGS!
  • 11. a possible solution: CONFIGURATION Robotlegs Parsley
  • 12. Solution ProsCons Pros: focusing only on the needed behavior without touching the previous class rely on previous implementations and tests cleaner tests against cleaner classes only one place for feature flags easy to revert/promote code from/to release no feature loss Cons: not a silver bullet for everything for sure any suggestion?
  • 13. we branch by abstraction not to be changing our code but to configure our code