TDD Workflow Write tests first, code second. --- 1. The TDD Cycle --- 2. The Three Laws of TDD 1. Write production code only to make a failing test pass 2. Write only enough test to demonstrate failure 3. Write only enough code to make the test pass --- 3. RED Phase Principles What to Write | Focus | Example | |-------|---------| | Behavior | "should add two numbers" | | Edge cases | "should handle empty input" | | Error states | "should throw for invalid data" | RED Phase Rules - Test must fail first - Test name describes expected behavior - One assertion per test (ideally) --- 4. GREEN Phas…