Trunk-Based Development Model

From GM-RKB
Jump to navigation Jump to search

A Trunk-Based Development Model is a software development model that uses a single, shared revision control branch.

  • Context:
    • It can (typically) have a Main Branch that all developer target for their Merge Requests (which is always built and covered by extensive Unit Tests and UI Tests run the CI).
    • It can require developers to commit and integrate their changes frequently, usually daily, to keep the Main Branch stable.
    • It can result in branching from the main line is minimized, short-lived, and used mainly for experimental features or bug fixes.
    • It can focus is on fast integration and automated testing to catch issues early.
    • ..
  • Example(s):
    • As practiced at Adyen (de Boer, 2021).
    • Used by many companies like Google, Facebook, Github.
    • ...
  • Counter-Example(s):
  • See: Code Branching Strategy, Continuous Integration.


References

2022

  • https://trunkbaseddevelopment.com/
    • QUOTE: ...A source-control branching model, where developers collaborate on code in a single branch called ‘trunk’ *, resist any pressure to create other long-lived development branches by employing documented techniques. They therefore avoid merge hell, do not break the build, and live happily ever afte ...

2021

  • (de Boer, 2021) ⇒ Toon de Boer. (2021). “From Trunk-Based to Merge Requests: A Field Study at Adyen.” Student thesis.
    • ABSTRACT: Many development models exist, but finding which one is the right for a specific project or software company is difficult. Every project has its requirements and might need its own development model. The most popular development models are trunk-based development and merge requests. There are no clear science-based guidelines on when to adopt one model or the other and challenges that teams face when migrating from one to another. We perform a field study as this master thesis aims to provide more understanding on the impact of migrating from one development model to another at a large company. More specifically, a migration from trunk-based development to merge request-based development at a large software engineering company. During this research, we interview 19 developers, eleven before the migration and eight after the migration, survey 46 developers to triangulate our findings of the interview before the migration, and analyzed the differences in the code reviews made by developers before and after the migration. We show what benefits and challenges developers experience using the trunk-based model and what they expect from the merge request-based model before the migration. Also, we show the change of motivation for code reviews after the migration. Moreover, quantitative data shows that code reviews are completed faster and with more code comments in the merge request-based model. Finally, we provide the perceptions of developers after the migration.
    • QUOTE: The trunk-based development model is a model where there is a single master ’trunk’ branch on which every developer contributes code. There are no separate branches, so when a developer pushes a commit, this code is immediately on the master branch.
    • QUOTE: Merge requests are widely used in the software engineering industry. This section is dedicated to a selection of research done in these areas related to merge requests and code reviews as an important part that comes along with merge requests is the code review. On a short note, this empirical research is based on the methods described by the lectures on Empirical Software Engineering by Ferrari [12] and papers that conduct empirical research [1, 2, 18, 29, 35, 37].