Skip to content

Branch by Abstraction

Levente Révész edited this page Apr 10, 2025 · 1 revision

https://martinfowler.com/bliki/BranchByAbstraction.html

This is a technique for introducing a breaking change continuously into the system. Useful in CI/trunk based development.

  1. Add a new API over the old implementation
  2. Convert the users to the new API one-by-one
  3. Gradually add a new implementation (not yet used by users). This can be part of releases before it is complete, it does not matter. Write tests for it.
  4. Swap the old implementation to the new one.
  5. Remove the old implementation and remove the abstraction layer.

You can do the same for public APIs, just provide the legacy API for some time, and do a major version bump when you finally remove that.


See also Versioning Software

Clone this wiki locally