Skip to content
← All CTFL glossary terms

Test-driven development (TDD)

A test-first approach in which a failing test is written before the code, followed by minimal implementation and refactoring.

Syllabus chapters: 2

Sources: ISTQB® Certified Tester Foundation Level syllabus 4.0.1 and the official ISTQB® Glossary. Glossary content © International Software Testing Qualifications Board; source: glossary.istqb.org.

Related terms

Test-driven development (TDD) in a practice question

Question 1

Which approach expresses the desired behavior of an application with test cases written in a simple form of natural language, usually using the Given/When/Then format?

  1. Test-driven development (TDD)
  2. Acceptance test-driven development (ATDD)
  3. Behavior-driven development (BDD)
  4. Domain-driven design (DDD)
Show answer
  • Test-driven development (TDD)TDD directs the coding through test cases rather than through natural-language behavior descriptions.
  • Acceptance test-driven development (ATDD)ATDD derives tests from acceptance criteria as part of the system design process.
  • Correct answer: Behavior-driven development (BDD)Natural-language test cases in Given/When/Then format characterize BDD.
  • Domain-driven design (DDD)DDD is named among the development methods and Agile practices, not as a test-first approach.

Behavior-driven development expresses the desired behavior of an application with test cases written in a simple form of natural language, which is easy for stakeholders to understand, usually using the Given/When/Then format. Those test cases should then be automatically translated into executable tests.

Syllabus section 2.1.3

Question 2

Which statement characterizes test-driven development (TDD)?

  1. Tests are derived from acceptance criteria as part of the system design process
  2. The desired behavior is expressed in natural language that stakeholders understand easily
  3. Coding is directed through test cases, instead of through extensive software design
  4. Tests are written after the code, to document the behavior that was implemented
Show answer
  • Tests are derived from acceptance criteria as part of the system design processDeriving tests from acceptance criteria during system design characterizes ATDD.
  • The desired behavior is expressed in natural language that stakeholders understand easilyExpressing behavior in natural language for stakeholders characterizes BDD.
  • Correct answer: Coding is directed through test cases, instead of through extensive software designTDD directs coding through test cases rather than extensive software design.
  • Tests are written after the code, to document the behavior that was implementedWriting tests after the code would contradict the test-first basis all three approaches share.

TDD directs the coding through test cases instead of extensive software design: tests are written first, then the code is written to satisfy the tests, and then the tests and code are refactored. Like ATDD and BDD, it implements the principle of early testing and follows shift left, because the tests are defined before the code is written.

Syllabus section 2.1.3

Original PrepBench practice material, not official exam questions or exam dumps. PrepBench is independent and is not affiliated with or endorsed by ISTQB®.