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 abstractionnot to be changing our code
butto 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 abstractionnot to be changing our code
but notto configure our code
a possible solution: NO FLAGS!
a possible solution: CONFIGURATION
Robotlegs
Parsley
Solution Pros\Cons
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 abstractionnot to be changing our code
butto configure our code