Testing — Middle¶
Use integration tests for database, queue, filesystem, and framework behavior. Use consumer-driven contracts for independently deployed services. Acceptance and BDD examples align business rules; end-to-end tests validate a few critical journeys, not every branch.
Property-based tests explore invariants across generated inputs. Mutation testing checks whether assertions notice meaningful code changes. Snapshot tests work for reviewed, stable output but become weak when updated blindly.
Test yourself¶
- Which boundary needs a real dependency?
- What does a contract test protect?
- Name one useful domain property.
- What does a surviving mutant reveal?
Continue to senior.md.