Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

which of the following is a key principle of test - driven development …

Question

which of the following is a key principle of test - driven development (tdd)?
a. write tests before writing production code
b. write tests after completing the implementation
c. only write tests for critical bugs
d. skip tests to speed up development

Explanation:

Brief Explanations

Test-Driven Development (TDD) follows a cycle where tests are created first to define desired functionality, then production code is written to pass those tests. This core principle distinguishes TDD from other testing approaches. Options B, C, and D contradict TDD practices: writing tests after implementation is not TDD, limiting tests to critical bugs ignores proactive validation, and skipping tests undermines TDD's purpose of ensuring code correctness.

Answer:

A. Write tests before writing production code