Ways of Working — SDD · TDD · Agentic
Three concepts, one sentence each:
SDD = write the spec first ·
TDD = write the test first ·
Agentic = the engine that runs both.
Pick SDD or TDD per task; Agentic is always on.
At a glance
| SDD (spec-first) | TDD (test-first) | Agentic (engine) | |
|---|---|---|---|
Write first |
the spec/design |
a failing test |
— (it runs SDD/TDD) |
The "contract" is |
the approved SDD |
the test |
the standard + skills + gates |
Best for |
new module/feature · cross-cutting · contract/schema change · unknowns |
bug fix · one business rule · protocol msg w/ known spec · bounded change |
every task — it’s how we deliver |
Gate before "done" |
CTO approves SDD before code |
red → green → refactor |
audit + |
FT grade |
architecture-led |
TDD-led |
|
❌ Don’t when |
it’s a one-line fix (over-process) |
the design is unknown (you’d test the wrong thing) |
n/a — it’s always on; the only misuse is skipping a gate (no SDD, code without tests, or |
SDD — spec-first ⭐
For work where getting the design right matters more than typing speed. The spec is reviewed and approved before any code; see how to write one.
Goal : bulk-disable CPEs by serial list (ops needs it for incidents)
Scope : in = REST endpoint + service; out = UI, scheduling
Design : new api/Cpe action `disable` (PUT), batch via existing CpeWriteService; no new dep
Data : no schema change; audit cols already present; one IT against the emulator
Tests : should_disable_all_when_serials_valid; should_report_unknown_serials
Risks : large lists → cap at 1000 (J-DB batch tier)
TDD — test-first
For work with a known expected behaviour. The failing test pins the spec; you write the minimum to make it pass, then refactor with the test as a safety net.
// RED — write this first, watch it fail
@Test @DisplayName("rejects a write to a read-only path")
void should_reject_when_path_is_read_only() {
var result = handler.apply(new WriteTaskRequest(READ_ONLY_PATH, value));
assertThat(result).isInstanceOf(OperationResult.Denied.class);
}
// GREEN — minimal guard in WriteTaskHandler, then refactor
Agentic — the engine that runs both
Agentic isn’t an alternative to SDD/TDD — it’s how the work gets done: detect → grade → (SDD or TDD) → delegate to the stack coding agent (which reads the authoritative skill) → verify behind the same gates. Full fleet in Claude Toolkit.
| Guardrail | What it guarantees |
|---|---|
Approval gate (every grade) |
no production code is delegated before the user approves the plan — the verified SDD for architecture-led, a mini-plan confirm for TDD-led / simple-addition |
Requirements elicitation |
every blocking unknown is asked before design; assumptions are explicit in SDD §0 |
Adversarial checkpoints |
independent |
Authoritative skills |
the coding agent enforces |
Tests with the code |
|
Test-adequacy adversary |
after the coding agent reports green, |
Audit + review |
the baseline gate (no NEW failures vs baseline) + |
| Next → Writing an SDD · Java standard · the agent fleet. |