🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Unit Testing and TDD: all 10 questions

Quiz: Unit Testing and TDD · Question 3 of 10

In TDD, what must happen in the "red" step?

In TDD, what must happen in the "red" step?

  1. A.A new test is written and it fails, because the feature does not exist yet
  2. B.The code is refactored
  3. C.All tests are deleted and rewritten
  4. D.The code is deployed to production
Answer & explanation

Correct answer: A new test is written and it fails, because the feature does not exist yet

A failing test proves the test can detect the missing behaviour.

Can you get the rest right without peeking?

Take the timed Quiz: Unit Testing and TDD quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →