## Test-Driven Development

### The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.

### Red-Green-Refactor

1. **RED**: Write ONE minimal failing test
2. **Verify RED**: Confirm it fails for the RIGHT reason
3. **GREEN**: Simplest code to pass  -  nothing more
4. **Verify GREEN**: Confirm pass AND other tests still pass
5. **REFACTOR**: Remove duplication, improve names

### Bug Fix Protocol

Bug found -> Write failing test -> TDD cycle -> Test proves fix & prevents regression.

### iOS Testing Pyramid

```
           [UI Tests / XCUITest] (minimize)
        [Integration / Snapshot Tests]
     [Unit Tests / ViewInspector / XCTest] (maximize)
```
