The unit of work is a behavior with a test that fails without it.
The durable artifacts are the tests, the fakes, and the CI results. The main hazard is a green suite that proves less than people believe.
Trace a bug fix. Reproduce the bug as a failing test, change the code until it passes, run the whole suite, and read the diff for weakened tests. The first step is the one an agent skips most often.
Capture the baseline with ./gradlew test. Remove the guard from JobsModel on a scratch branch and confirm the race test fails. Restore the guard. Do the same for the drain guard in the outbox.
Read the test diff first. Ask whether each new test would fail without the change, whether it asserts the behavior or only that nothing threw, and whether any existing test lost an assertion, gained an ignore, or changed an expected value.
When a test fails after a change, decide whether the code or the test is wrong before touching either. Read the failure message, reproduce it alone, and check whether it fails for the reason the test name claims.
Test the refusals as well as the accepts. Every parser, policy, and gate in this repository has a refused list, and a refused list that only grows is healthy. Check that no test contains a real credential, address, or customer name.
Layer the checks and name them. Say which questions each layer answers and which questions are still unanswered. Run the fast layer on every change and the slow layers on a schedule or before release.
Review flaky tests as defects. Never merge a retry loop around an assertion. Keep a short list of tests that must never be weakened without a named reviewer.
- Time and randomness are parameters.
- Fakes implement the real interfaces.
- Races and failures are tested on purpose.
- Test diffs are reviewed first.
- The release notes name what was not tested.
- Why is
Instant.now()inside a use case a testing problem? - What does a fake offer that a mock does not?
- What does the stale-result test prove?
- What can a green JVM suite never prove?
Continue with the book
Explore the full treatment, worked examples, and exercises in Agentic Android App Development.
Companion article for Agentic Android App Development, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.
