64.1k views
3 votes
When are the tests written in a Test-driven Development environment?

A) While creating the Product Requirements document
B) Just before deployment (Just in Time)
C) While the code is being written
D) Before the code is written

User Jdcantrell
by
8.4k points

1 Answer

4 votes

Final answer:

In Test-driven Development, tests are written before the code itself to guide the development process and ensure that all new features are tested as soon as they are developed.

Step-by-step explanation:

Tests in a Test-driven Development (TDD) environment are written before the actual code is written. This methodology prioritizes the creation of tests that define and validate what the code will do before the functionality itself is developed. It means, when a requirement is specified, a test is created which initially fails, because the corresponding feature has not yet been implemented. The goal is to then write the minimum amount of code to pass that test, which incorporates an iterative process of designing, prototyping, refining, and re-testing.

User Dansarmo
by
7.4k points