Our Dev Masterclass section summarizes the best contributions from well-known experts in the development space, including their advice for other developers.
Patterns for Managing Source Code Branches: Martin Fowler shows teams how to dramatically reduce the time they spend merging dozens of branches together. He does so by exploring a number of workflow patterns that software development teams can use to more efficiently manage a codebase in a series of lengthy blog posts. These patterns (Mainline Integration, Feature Branching, Continuous Integration, Reviewed Commits, Release Branch, Environment Branch, Hotfix Branch, Production Branch, Release Train, Experimental Branch, and Future Branch) will be incorporated in future posts as a part of a larger series.
In yesterday's masterclass, we covered Mainline Integration, Featuring Branching, and Integration Frequency. This followed last week's masterclass, where Fowler broadly introduced us to the importance of efficiently managing source code, discussed the mainline, and concepts like Self-Testing Code.
Today, Fowler covers Continuous Integration:
Fowler: An alternative to feature branching, those who adopt Continuous Integration integrate each time they've made a solid amount of progress on a feature every day, often many times. Using this approach requires that you become comfortable with the idea of reaching frequent integration points with a feature that hasn't yet been built without exposing it in the running system. For instance, if you are working on a feature asking if somebody is a smoker, build and test the logic first, and work on asking the question at the end.
Other ways to make sure it's not exposed:
What About Bugs?
If you're concerned about introducing bugs to the mainline by integrating partly features that aren't fully built yet, Fowler again emphasizes that Continuous Integration requires Self Testing Code:
- Write tests for these features as you write the code and commit both into the mainline together, possibly using Test Driven Development.
- Most who use Continuous Integration don't use a separate local branch, although Fowler adds it's OK to work from and open a feature branch, and frequently integrate it back into the local master and mainline.
- "The difference between feature branching and continuous integration isn't whether or not there's a feature branch, but when developers integrate with mainline," he says.
When To Use It:
In the next installment, Fowler compares the pros and cons of feature branching and continuous integration to answer this question. To read this, plus the other quick summaries of what Fowler has to say about Mainline Integration, Feature Branching, Continuous Integration, Reviewed Commits, the Release Branch, Maturity Branches and Environment Branch, upgrade to premium!