feat(tdd): add TPP + ZOMBIES next-test selection to the /tdd skill#108
feat(tdd): add TPP + ZOMBIES next-test selection to the /tdd skill#108Hyperman012 wants to merge 1 commit into
Conversation
The red-green-refactor loop says to write a failing test and make it pass; it does not say which test to write next. This adds the two complementary selection heuristics as a new progressive-disclosure reference for the /tdd skill: - Transformation Priority Premise (Robert C. Martin): the ranked list of code transformations, simplest first. Pick the test whose passing requires the highest-priority transformation still available. - ZOMBIES (James Grenning): Zero -> One -> Many plus Boundaries, Interface, Exceptions, Simple, as the concrete ordering for the same simplest-first selection. Wiring follows the skill's existing seams: Step 2 orders a behavior's candidate tests Zero -> One -> Many, Step 3 uses the ranking to find Beck's "one step test", and the frontmatter description gains TPP and ZOMBIES trigger vocabulary. The reference reconciles the heuristics with the skill's outside-in user-value ordering (user value picks the behavior, TPP picks the test), the implementation gears (Fake It is nil -> constant, Triangulate forces constant -> scalar), and the observed-failure gate (a confirming first-run pass is the behavior-already-exists arm). Long-form doc gains the key concept and the two sources. Ported from the nWave nw-tpp-methodology skill (nWave-ai/nWave#67) and "The Next Test" (meresoftware.substack.com/p/the-next-test). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Hi @Hyperman012 - this is great! i hadn't heard about these forms of test selection, but after reading everything in this PR, it makes sense. I think somewhere in my career, i ended up picking up some informal version of these ideas. i'll give this update a few runs over the next few days and let you know if i have any feedback. thank you! |
Absolutely! I love this stuff! and i've been loving these Han skills. so thank you for publishing so i can add on! |
Summary
The
/tddskill's loop says to write a failing test and make it pass; it does not say which test to write next. This PR adds the two complementary test-selection heuristics as a new progressive-disclosure reference for the skill:What's included
han-coding/skills/tdd/references/test-selection.md(new): the canonical 14-transformation table, the "as the tests get more specific, the code gets more generic" principle, the decision-point rule with the bubble-sort/quicksort demonstration, the ZOMBIES table and Z-O-M ordering rule, diagnostic signals, a workedsum()example, and sources (Martin, Grenning, Langr).han-coding/skills/tdd/SKILL.md: three hooks at the skill's existing seams. Step 2 orders a behavior's candidate tests Zero -> One -> Many; Step 3 uses the ranking to pick among qualifying items (and to detect a missing smaller test); the frontmatter description gains TPP and ZOMBIES trigger vocabulary.docs/skills/han-coding/tdd.md: a Key concepts bullet and two Sources entries, per the long-form-doc coverage rule.Alignment with the skill's existing discipline
The reference reconciles the heuristics with the skill rather than importing them wholesale:
nil -> constant; Triangulate adds the example that forcesconstant -> scalar.Field test
Exercised by driving the modified skill through the Prime Factors kata (Ruby/minitest), with per-cycle logging and one commit per cycle for an auditable order. Results:
of(1)(Z,nil -> constant),of(2)(O,unconditional -> if),of(3)(O,constant -> scalarvia triangulation),of(4)(M,if -> while),of(9)(M, divisor generalization),of(12)(confirming test).6 runs, 6 assertions, 0 failures, 0 errors, 0 skips.Two pre-existing observations from the same run, out of scope here but noted for maintainers: on a first-run pass the "cross it off and pick the next one" instruction skips that cycle's otherwise non-skippable refactor statement, and Step 5 gives no instruction for projects with no lint or build command configured.
Credit and sources
Ported from Dale Stewart's
nw-tpp-methodologyskill for nWave (nWave-ai/nWave#67) and his write-up "The Next Test" (https://meresoftware.substack.com/p/the-next-test), adapted to this skill's loop, reference conventions, and writing voice. Primary sources: Martin's "The Transformation Priority Premise", "Transformation Priority and Sorting", and "The Cycles of TDD"; Grenning's "TDD Guided by ZOMBIES"; Langr's Modern C++ Programming with Test-Driven Development.🤖 Generated with Claude Code