maketest
maketest
Choose tests that would detect plausible defects in behavior the project promises. Keep the feedback loop fast and leave evidence of what the tests exercise.
1. Establish the oracle and scope
Read the user request, relevant requirements, project instructions, nearby tests, and the runner or CI configuration. An oracle is the basis for deciding whether an outcome is correct: a requirement, agreed example, published contract, domain invariant, or independently justified property. Use code to find the public seam, fixtures, and affected paths. Decide expectations from the oracle, even if that exposes a bug in the code or an existing test.
Use the table to choose a workflow and combine rows where useful. For example, TDD controls the implementation sequence while a decision table supplies the test cases. In a short plan or working note, identify the oracle, the unit of behavior, and the stopping rule. Say which risks the chosen seam cannot observe. Keep this lightweight for a single test.
| Workflow | Oracle | Test unit | Stop when |
|---|---|---|---|
| TDD for requested implementation | Requirement or agreed example | One observable behavior per cycle | The behavior list for the requested scope is covered or gaps are explicit |
| BDD / ATDD | Agreed acceptance rules and examples | One scenario with a distinct user outcome | Agreed outcomes have evidence at a suitable layer |
| Specification-based design | Specification and input or state model | One meaningful partition, boundary, rule, or transition | Selected technique items and material risks are covered or recorded as gaps |
| Contract | Published interface or actual consumer requirements | One interaction or compatibility requirement | Used interactions and relevant error variants have verification evidence |
| Domain / DDD | Business rules and invariants | One rule across a domain operation or sequence | Relevant invariants and their important violation paths are exercised |
| Regression for a known defect | Issue, agreed corrected outcome, or other independent oracle | A minimal case that distinguishes buggy and correct behavior | The defect is detected on a known bad version when available, and related cases add distinct value |
| Characterization before refactoring | Observed public behavior, explicitly labeled | One existing behavior whose change would be costly | Risky behaviors in the refactor's scope are pinned; uncertain behavior stays explicit |