πŸ“– 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!