π Step 7: Testing & Quality#455 / 498
TDD
Test-Driven Development (TDD)
πOne-line summary
A development approach of writing a failing test first, writing code to pass it, then refactoring.
β¨Example
// TDD
β μ€ν¨νλ ν μ€νΈλ₯Ό λ¨Όμ μ°κ³ , ν΅κ³Όμν€λ μ½λλ₯Ό μ§ λ€ μ 리νλ μμλ‘ κ°λ°νλ λ°©μ
Tests: 1 passed
β‘Vibe coding prompt examples
>_
Build a cart total function (discounts, coupons, shipping) with TDD: write Vitest tests first and make them pass one by one.
>_
Create a prompt template that makes an AI coding tool work in TDD (test first β confirm failure β implement β refactor).
>_
Explain why TDD works especially well with vibe coding and when it's actually inefficient.
Try these prompts in your AI coding assistant!