Skip to content

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

Open
DrakeRHEE wants to merge 3 commits intoawslabs:mainfrom
DrakeRHEE:feature/tdd-code-generation
Open

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

Conversation

@DrakeRHEE
Copy link
Copy Markdown

@DrakeRHEE DrakeRHEE commented Feb 12, 2026

Add Test-Driven Development (TDD) as an opt-in extension for the Code Generation stage. When enabled, TDD replaces the standard code generation workflow with a RED-GREEN-REFACTOR cycle that prevents feature gaps and ensures high code quality.

Changes:

  • Add extensions/testing/tdd/tdd-code-generation.md with full TDD workflow as extension rules
  • Add extensions/testing/tdd/tdd-code-generation.opt-in.md for Requirements Analysis opt-in
  • Per-unit TDD applicability check for multi-unit project flexibility
  • No modifications to core-workflow.md, code-generation.md, or build-and-test.md

Design:

  • Follows existing extension pattern (security-baseline, property-based-testing)
  • Opt-in at Requirements Analysis phase (project level)
  • Per-unit applicability check at Code Generation entry (unit level)
  • Stage Applicability: Functional Design (testable property identification), Code Generation (workflow replacement), Build and Test (TDD artifact recognition)

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


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

@DrakeRHEE
Copy link
Copy Markdown
Author

DrakeRHEE commented Feb 12, 2026

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 opt-in extension in the AI-DLC extensions framework. Users can enable TDD during Requirements Analysis, and the extension replaces the standard code generation workflow with a TDD-driven RED-GREEN-REFACTOR cycle.

Extension Design

  • Opt-in: tdd-code-generation.opt-in.md — presented during Requirements Analysis (project level)
  • Rules: tdd-code-generation.md — cross-cutting extension with Stage Applicability:
    • Functional Design: testable property identification
    • Code Generation: workflow replacement (TDD instead of standard)
    • Build and Test: TDD artifact recognition, skip re-running passed tests
  • Per-unit flexibility: At Code Generation entry, each unit is evaluated for TDD applicability. Simple config-only units can skip TDD and fall back to standard workflow.
  • No core file modifications: core-workflow.md, code-generation.md, build-and-test.md are unchanged.

TDD vs Standard Comparison

TDD Standard
Token cost ~1.5-2x baseline Baseline
Feature completeness High (test-first prevents gaps) Occasional omissions
Wall-clock time Faster (fewer rework cycles) Slower (error correction overhead)
Recommended for Complex business logic, long-term projects Simple prototypes, one-off scripts

Test Evidence

Korea Tech TTT Session (January 30, 2026)

  • Participants: ~50 Korea Tech roles
  • Setup: 24 participants used TDD-enhanced steering, 14 used default steering
  • Results: 100% completion rate for TDD group, completed in significantly shorter wall-clock time
  • 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, near-zero defect outputs
  • CSAT: 4.6/5.0, 13/14 companies expressed interest in future sessions

Changes

  • extensions/testing/tdd/tdd-code-generation.opt-in.md (NEW) — Opt-in prompt for Requirements Analysis
  • extensions/testing/tdd/tdd-code-generation.md (NEW) — Full TDD extension rules with:
    • Stage Applicability table (Functional Design, Code Generation, Build and Test)
    • Per-unit TDD applicability check (Step 0)
    • Part 1: TDD Planning (contracts, test plan, generation plan)
    • Part 2: TDD Generation (RED-GREEN-REFACTOR cycle per method)
    • Blocking TDD finding behavior
    • Verification/compliance summary format

@harmjeff
Copy link
Copy Markdown
Contributor

@DrakeRHEE Please move this to be an extensions capability.

@DrakeRHEE DrakeRHEE force-pushed the feature/tdd-code-generation branch from 294f21a to 0ef9266 Compare March 23, 2026 05:35
@DrakeRHEE DrakeRHEE requested review from a team as code owners March 23, 2026 05:35
@DrakeRHEE
Copy link
Copy Markdown
Author

DrakeRHEE commented Mar 23, 2026

@DrakeRHEE Please move this to be an extensions capability.

@harmjeff Done :)

@DrakeRHEE DrakeRHEE force-pushed the feature/tdd-code-generation branch from 0ef9266 to 8813a79 Compare March 25, 2026 15:33
Add Test-Driven Development (TDD) as an opt-in extension under
extensions/testing/tdd/. Users can enable TDD during Requirements
Analysis, and the extension replaces the standard code generation
workflow with a TDD-driven RED-GREEN-REFACTOR cycle.

Changes:
- Add tdd-code-generation.md with full TDD workflow as extension rules
- Add tdd-code-generation.opt-in.md for Requirements Analysis opt-in
- Per-unit TDD applicability check for multi-unit flexibility
- No modifications to core-workflow.md or other existing files

Validation:
- Internal TTT: TDD group achieved 100% completion with significantly
  less time and more complete results vs standard approach
- Partner workshops: 100% completion rate, near-zero defect outputs
- CSAT: 4.6-4.9/5.0 across 120+ participants

Co-authored-by: Jeongho Han <hjeongho@amazon.com>
Co-authored-by: Hyojin Jung <jhyojin@amazon.com>
@DrakeRHEE DrakeRHEE force-pushed the feature/tdd-code-generation branch from 1f4a649 to 2d94876 Compare March 26, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants