Trunk-based development (TBD) is a software development practice where all developers work on a single shared codebase branch called "trunk" or "mainline" instead of creating long-lived feature branches. In TBD, developers commit their changes to the trunk frequently, often multiple times a day, after ensuring that their changes don't break the existing codebase by running automated tests. This enables early detection and resolution of conflicts and integration issues, resulting in a more stable codebase and faster delivery of features.
TBD also emphasizes keeping the trunk in a releasable state at all times, meaning that the code in the trunk should be tested and ready for deployment at any given moment. This encourages developers to prioritize quality and testing as part of their development process, rather than as a separate phase of development.
Trunk-based development practices
Adoption expectations
System Components | MVP | MVP+ |
---|---|---|
Adopt new branching strategy and policies to limit number of branches |
+ |
+ |
Simplify and streamline code review |
+ |
+ |
Optimize CI process to take less than 15 min |
|
+ |
Establish a rule in the team to merge changes back into the trunk at least once a day |
|
+
|
Tools
Functionality | Tool Name |
---|---|
Version Control System |
Git |
Version Control Collaboration |
Azure DevOps Repo, Bitbucket |
Artifact Management System |
JFrog Artifactory, Azure Artifacts
|
Roles
Name | Responsibilities |
---|---|
Scrum Master/Team Coach |
Coach and support usage of the best engineering practices to support trunk-based development |
Developer |
Adopt practices to develop new changes in a small easy to implement and test steps |
Build Engineer |
Integrate automated quality gates and deployment process |
Test Automation Engineer (TAE) |
Implement automated tests in advance allowing continuous testing process
|