Skip to content

v1.15.8

Choose a tag to compare

@Alan-TheGentleman Alan-TheGentleman released this 31 Mar 16:17
2808971

Fix: SDD TDD Agent — Assertion Quality Enforcement

The SDD apply agent was generating trivial tests that gave false confidence:

  • expect(true).toBe(true) — tautologies that prove nothing
  • Assertions over empty arrays (queryAllByTestId returning []) inside loops that never iterate
  • Stopping at GREEN without triangulating (incomplete TDD cycle)

Changes

sdd-apply/strict-tdd.md

  • Added Assertion Quality Rules section with explicit banned patterns: tautologies, orphan empty checks, type-only assertions, ghost loops, incomplete TDD cycles
  • Defined What Makes a REAL Assertion (3 criteria: calls production code, asserts specific value, breaks when logic changes)
  • Empty Collection Rule: toEqual([]) only valid with precondition + companion non-empty test
  • Tightened triangulation: minimum 2 test cases per behavior, skip ONLY for purely structural tasks
  • Trivial GREEN detection: warns about tests passing because setup doesn't exercise the code path

sdd-verify/strict-tdd-verify.md

  • Added Step 5f: Assertion Quality Audit — scans test files for all banned patterns
  • Ghost loops (assertions inside for over empty queryAll results) flagged as CRITICAL
  • Incomplete TDD cycles (component not rendered due to state) flagged as CRITICAL
  • Checks triangulation variance — warns if all test cases assert the same trivial value
  • New Assertion Quality Report Table in verification output

Evidence: prowler-cloud/prowler#10517