Developing Applications and Automating Workflows Using Cisco Platforms (DEVASC) — Question 275
What is the purpose of running tests before writing code in test-driven development?
Answer options
- A. to find unexpected failures in the tests
- B. to demonstrate that the tests fail for expected reasons
- C. to ensure that the tests pass
- D. to provide proof of the work carried out
Correct answer: B
Explanation
The correct answer is B because the fundamental principle of test-driven development is to write tests that initially fail, which confirms that the tests are correctly identifying the intended functionality. Options A and C are incorrect as they do not align with the primary goal of demonstrating test failures for expected reasons. Option D, while related to documentation, does not pertain directly to the testing process in TDD.