Skip to main content

Trunk-Based Development (TBD)

Following the discussion on continuous integration, trunk-based development (TBD) further enhances the cognitive benefits by streamlining the version control process. Whereas CI focuses on integrating and testing changes frequently, TBD centralizes all development efforts on a single branch or trunk, which complements and amplifies the benefits of CI.

  • Streamlined Version Control: TBD simplifies the version control environment by eliminating the need for managing multiple branches. This reduces the cognitive overhead associated with remembering and coordinating changes across various branches. With a single source of truth, developers can focus more on their immediate tasks without the distraction of complex branching strategies.

  • Continuous Code Quality and Integration: By committing directly to the trunk, developers are encouraged to integrate small changes frequently. This practice not only builds on the CI principle of regular integration but also ensures that each integration is manageable and less prone to errors, reducing the cognitive burden of handling large merges and complex conflicts.

  • Enhanced Focus on Code Health: With everyone committing to the trunk, there’s a collective responsibility to maintain the health of the codebase. This shared responsibility fosters a culture of quality and accountability, where developers are more mindful of their contributions. The immediate feedback from CI systems and other developers on the integrated trunk helps identify issues early, allowing for quicker fixes that require less cognitive effort compared to those identified later in the development cycle.

Incorporating TBD as part of CI creates a robust framework for development that minimizes cognitive load. This combination ensures that the codebase remains clean and stable, facilitating a smoother development process that allows developers to concentrate more effectively on delivering quality software.

It is thus preferred to use TBD (trunk-based development) over PRs (pull requests) and long-lived branches (feature, team or other). Not only does it reduce the cognitive load of all involved, it also increases the overall productivity of the entire workforce! For more information on the effects of using async code reviews in relation to productivity, here are some resources: