branching by abstraction

13
why we need to branch write new code without affecting old code build and test new code in staging environments without affecting production

Upload: piergiorgio-niero

Post on 25-Jan-2015

48 views

Category:

Documents


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Branching by abstraction

why we need to branch

● write new code without affecting old code

● build and test new code in staging environments without affecting production

Page 2: Branching by abstraction

why we branch by abstraction

● to avoid porting code from one branch to the other

● to minimise merge operations performed by our SCM

Page 3: Branching by abstraction

we branch by abstractionnot to be changing our code

butto configure our code

Page 4: Branching by abstraction

when do we branch by abstraction

● we have to develop a new feature

● we have to change an existing feature

Page 5: Branching by abstraction

how do we branch by abstraction

feature flagged

feature flagged

NOT feature flagged

Page 6: Branching by abstraction

how do we test feature flags

Page 7: Branching by abstraction

how do we test feature flags

Page 8: Branching by abstraction

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!

Page 9: Branching by abstraction

we branch by abstractionnot to be changing our code

but notto configure our code

Page 10: Branching by abstraction

a possible solution: NO FLAGS!

Page 11: Branching by abstraction

a possible solution: CONFIGURATION

Robotlegs

Parsley

Page 12: Branching by abstraction

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?

Page 13: Branching by abstraction

we branch by abstractionnot to be changing our code

butto configure our code