In Test-Driven Development (TDD), what is the correct sequence of the Red-Green-Refactor cycle?
-
A
Write a failing test, make it pass, then improve the code
-
B
Write passing code, add tests, then refactor
-
C
Refactor existing code, write tests, then run them
-
D
Write tests and code simultaneously, then refactor