Istqb Certified Tester Foundation Level CTFL · Free Practice Question Easy

Question 58

Which of the following best describes the cycle in Test-Driven Development (TDD)?

  • A

    Write code, write test, refactor

  • B

    Write test, write code, refactor

  • C

    Write test, refactor, write code

  • D

    Refactor, write code, write test

Reveal correct answer

Correct answer: B

A.

Incorrect. This is not the correct sequence for TDD.

B.

Correct. In TDD, the cycle is to write a test first, then write code to pass the test, and finally refactor the code.

C.

Incorrect. Refactoring occurs after writing the code, not before.

D.

Incorrect. This sequence does not follow the TDD principles.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need