This change series allows you to make untestable code become easy to test, by decreasing coupling. Low-coupling code is easier to move incrementally between systems and share between teams.

Habit: Healthy Unit Tests 1 — Readable Tests

Organization ROI: Communication between developers and product owners become easier.

Engineer ROI: Instantly know why each test exists and what code to change when requirements change.

Habit: Healthy Unit Tests 2 — Stop Testing Internals

Organization ROI: Tests tell you where you will pay costs on future stories.

Engineer ROI: Refactoring never requires updating tests.

Habit: Healthy Unit Tests 3 — Test Long Methods

Organization ROI: Begin automatically verifying your most important chunks of code. Reduce the cost of future changes.

Engineer ROI: Test responsibilities independently, even when they are in the same method.

Habit: Healthy Unit Tests 4 — Decoupling and Microtesting

Organization ROI: Tests speed up, have fewer false positives, and cover more of the code.

Engineer ROI: Every test passes 100% of the time when the code is right, fails 100% of the time when it is wrong, and executes in <1ms, in parallel with any other tests.

Habit: No More Mocking

Organization ROI: Tests tell you where stories will cause non-local interaction bugs.

Engineer ROI: When the product is broken a test will fail. No longer have 2 parts of the code have different expectations.

Habit: No Emergent Behaviors

Organization ROI: Reduce regression bugs and surprising interactions. New features no longer destabilize existing capabilities.

Engineer ROI: Test behaviors that arise from functionality split into different units.