![Page 1: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/1.jpg)
Branches are for trees. How to develop so4ware without them. Chris Bushell. September 2010.
![Page 2: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/2.jpg)
Feature branching
F1
F2
F3
Merge
Commit
Release
![Page 3: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/3.jpg)
What’s the problem?
![Page 4: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/4.jpg)
Trunk development
Commit
Release
![Page 5: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/5.jpg)
Breaking changes
![Page 6: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/6.jpg)
Branch by abstracIon 1 – Introduce an abstracIon over area of the system you want to change
3 – Make a new implementaIon of the abstracIon
2 – Update all code to rely on the abstracIon
4 – Remove the old implementaIon
5 – Remove the abstracIon if it’s inelegant
![Page 7: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/7.jpg)
Cherry picking
![Page 8: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/8.jpg)
Toggles/flippers/flags/bits
![Page 9: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/9.jpg)
Advantages • Decouples code deployment from feature
• No need to roll back a release, just disable problemaIc feature
• A/B tesIng
• Private betas e.g. turn on a feature for 5% of users
• Dark launches
• ConInuous deployment/delivery
![Page 10: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/10.jpg)
Things to keep in mind….. • Complexity and overhead explosion if toggles aren’t acIvely decommissioned
• Don’t overload toggles e.g. enItlements (totally different life spans)
• Just because a feature is dormant doesn’t mean quality is not as important
• Avoid coupling features e.g. feature b can only be enabled if feature a is enabled
![Page 11: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/11.jpg)
Conclusion • Branching in VCS isn’t bad • Long lived branches in VCS are bad
• Working in isolaIon for prolonged periods of Ime is bad
• There’s always another way, it just might require some careful thought and design
![Page 12: Branches are for Trees. How to develop software without them](https://reader033.vdocuments.site/reader033/viewer/2022052820/54c41fb64a7959e8508b45ec/html5/thumbnails/12.jpg)
References • hap://marInfowler.com/bliki/FeatureBranch.html • hap://paulhammant.com/blog/branch_by_abstracIon.html • hap://www.se-‐radio.net/2008/09/episode-‐109-‐ebays-‐architecture-‐principles-‐with-‐randy-‐shoup/ • hap://velocityconference.blip.tv/file/2284377 (Flickr, 10+ releases per day) • hap://www.infoq.com/presentaIons/Feature-‐Bits
• ImplemenIng Lean So4ware Development: From Concept To Cash, Mary Poppendieck, Tom Poppendieck