What is Test-driven development (TDD)?

A way of developing software in a short repeated cycle: first write a test for the feature to be built, then write the minimum code to make the test pass, then refactor while keeping the tests passing. It spread as a practice of Extreme Programming (XP).

Japanese name: テスト駆動開発(TDD)

Test-driven development (TDD) appears in 1 practice question across 1 topic, including Software Development and Project Management.

Field: Software Development and Project Management

Try it: questions about Test-driven development (TDD)

Which describes how test-driven development (TDD) proceeds?

  1. AWrite a test that does not yet pass, write the minimum code to make it pass, and then refactor while keeping the tests passing
  2. BFinish writing all the code for a feature, then create test cases by following the branches in that code
  3. CDedicated testers write the tests, and developers do not run any tests until the integration testing stage
Show answer and explanation

Answer: A. Write a test that does not yet pass, write the minimum code to make it pass, and then refactor while keeping the tests passing

In test-driven development, a small piece of the specification of the feature to be built is first written as a test, which is run to confirm that it fails (red). Next, the minimum code needed to pass that test is written (green), and then duplication and other problems are cleaned up while the tests keep passing (refactor). Through this short cycle, features are added little by little while a full set of tests is maintained. In embedded firmware too, the hardware-dependent parts are made replaceable so that unit tests can be run repeatedly on a development PC.

Test-driven development (TDD) in the explanations

Questions that mention Test-driven development (TDD) (1)

  1. Which describes how test-driven development (TDD) proceeds?

Books on Software Development and Project Management Ad

As an Amazon Associate I earn from qualifying purchases.

Related terms

Agile development Black-box testing Boundary value analysis Branch coverage CI/CD (continuous integration and continuous delivery) Critical path method (CPM) Earned value management (EVM) Equivalence partitioning Scrum SLA (service level agreement)

Back to the glossary