Skip to content

feat: Add TDD code generation workflow as optional path#78

Open
DrakeRHEE wants to merge 1 commit intoawslabs:mainfrom
DrakeRHEE:feature/tdd-code-generation
Open

feat: Add TDD code generation workflow as optional path#78
DrakeRHEE wants to merge 1 commit intoawslabs:mainfrom
DrakeRHEE:feature/tdd-code-generation

Conversation

@DrakeRHEE
Copy link

Add Test-Driven Development (TDD) as a selectable code generation strategy in the Construction phase. Users can now choose between TDD and standard approaches before code generation begins.

Changes:

  • Add tdd-code-generation.md with full TDD workflow (Red-Green-Refactor)
  • Add TDD selection prompt (Step 0) in core-workflow.md
  • Add TDD artifact detection in build-and-test.md

Validation:

  • Internal large-scale TTT conducted comparing TDD vs Standard paths. Teams using TDD completed development in significantly less time with more complete results (100% improvement).
  • Field feedback confirmed that TDD-based AI-DLC runs produced finished outputs in a single pass or with minimal issues.
  • Stability verified through multiple customer 1-day workshops with consistent, reliable results.

Co-authored-by: Jeongho Han <hjeongho@amazon.com>
Co-authored-by: Hyojin Jung <jhyojin@amazon.com>

Add Test-Driven Development (TDD) as a selectable code generation
strategy in the Construction phase. Users can now choose between
TDD and standard approaches before code generation begins.

Changes:
- Add tdd-code-generation.md with full TDD workflow (Red-Green-Refactor)
- Add TDD selection prompt (Step 0) in core-workflow.md
- Add TDD artifact detection in build-and-test.md

Validation:
- Internal large-scale TTT conducted comparing TDD vs Standard paths.
  Teams using TDD completed development in significantly less time
  with more complete results (100% improvement).
- Field feedback confirmed that TDD-based AI-DLC runs produced
  finished outputs in a single pass or with minimal issues.
- Stability verified through multiple customer 1-day workshops
  with consistent, reliable results.

Co-authored-by: Jeongho Han <hjeongho@amazon.com>
Co-authored-by: Hyojin Jung <jhyojin@amazon.com>
@DrakeRHEE
Copy link
Author

Problem

Through three rounds of AI-DLC Unicorn Gym sessions, we observed that the Construction phase's Code
Generation stage occasionally missed implementing required features. This led to incomplete
deliverables and required manual intervention to identify and implement the missing functionality.

Solution

Integrated Test-Driven Development (TDD) methodology as an optional workflow in the AI-DLC Code
Generation phase. Users can now choose between two approaches based on their project needs:

A) TDD Approach (Test-Driven Development)

  • Time/Token cost: 1.5~2x standard approach
  • Quality: High (prevents feature omissions, test-first design)
  • Recommended for: Complex business logic, long-term maintenance projects

B) Standard Approach

  • Time/Token cost: Baseline
  • Quality: Standard
  • Recommended for: Simple prototypes, one-off scripts

The TDD workflow adds a test-first methodology where:

  • Test cases are generated from functional requirements before implementation
  • Each feature must have corresponding test coverage
  • Implementation is validated against pre-defined test criteria
  • Feature omissions are caught early through failing tests

Changes

Core workflow (1 file):

  • core-workflow.md — Added Step 0: TDD Selection (MANDATORY) before Code Generation
    • Present user with A/B choice
    • Load tdd-code-generation.md if TDD selected
    • Load code-generation.md if Standard selected

Construction phase (2 files):

  • tdd-code-generation.md (NEW) — Complete TDD workflow with 20 explicit steps:

    • Part 1: Planning (Steps 1-9) — Create test-first code generation plan
    • Part 2: Generation (Steps 10-20) — Execute TDD cycle (test → code → verify)
    • Includes Brownfield support, workspace root reading, structure patterns
    • Fully replaces standard code-generation.md when selected
  • build-and-test.md — Added TDD artifact detection

    • Recognizes TDD-generated test files
    • Adjusts test execution instructions accordingly

Test Evidence

Korea Tech TTT Session (January 30, 2026)

  • Participants: ~50 Korea Tech roles
  • Setup:
    • 24 participants used TDD-enhanced steering
    • 14 participants used default steering
  • Results:
    • 100% completion rate for TDD group on Table Order Service project (single day)
    • TDD group completed the project in significantly shorter wall-clock time compared to the standard group, which spent considerable time on error correction and tracking unimplemented features
    • TDD-generated deliverables were complete and functional on the first pass, with no or only minimal issues requiring correction
    • CSAT: 4.9/5.0 (38 respondents)

Partner Workshop (February 4, 2026)

  • Participants: 70 engineers from 14 partner companies
  • Results:
    • 100% completion rate within one day using TDD approach
    • Participants completed working deliverables faster than expected, leaving time for brownfield extensions — several teams implemented additional features (discount games, UX enhancements) on their table order service
    • TDD-based execution produced near-zero defect outputs in a single run, minimizing rework cycles
    • CSAT: 4.6/5.0
    • 13/14 partner companies expressed interest in future AI-DLC Unicorn Gym sessions

Key Findings

  • TDD methodology eliminated feature omission issues observed in previous sessions
  • Faster end-to-end completion despite higher per-step token cost — While TDD adds 1.5~2x token cost per generation step, the standard approach frequently required extensive time on error correction cycles and tracking unimplemented features. TDD teams completed the full development lifecycle in significantly shorter wall-clock time with more complete deliverables.
  • Near-zero defect deliverables in a single pass — Field feedback confirmed that TDD-based AI-DLC execution consistently produced complete, working deliverables on the first run, or with only minimal issues requiring correction. This contrasts sharply with the standard approach where multiple iteration cycles were the norm.
  • Stability validated through multiple customer-facing 1-day workshops — Across two large-scale sessions (120+ total participants from internal teams and 14 partner companies), TDD delivered consistent, reliable results with uniformly positive feedback (CSAT 4.6~4.9/5.0), demonstrating production-readiness of the methodology.
  • Optional selection allows flexibility — users choose based on project complexity and time constraints
  • Token efficiency — TDD file only loads when selected, avoiding context bloat for simple projects
  • The test-first approach provided clear validation criteria at each implementation step

Design Decisions

  • Optional, not mandatory — Respects AI-DLC's adaptive intelligence principle
  • Separate file (tdd-code-generation.md) — Follows existing rule-details pattern, loads only when needed
  • User choice at runtime — Presented as structured A/B question in Korean for Korea field validation
  • Full replacement — TDD file completely replaces standard workflow when selected (no hybrid confusion)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant