📞 0339-0387701 (WhatsApp) Contact

« Back to Software Engineering (NCCIA)

In TDD, what is the red-green-refactor cycle?

A. Refactor first, then test
B. Write code, delete tests, release
C. Write a failing test, make it pass, then improve the code ✅
D. Fix bugs without tests

Correct Answer: C. Write a failing test, make it pass, then improve the code

Explanation

  • Red is a failing test
  • Green is passing code
  • Refactor improves design without changing behaviour.