200-901 · Question #601
What is a characteristic of test-driven development?
The correct answer is A. It enables code refactoring. Test-Driven Development (TDD) is a software development approach where tests are written before writing the actual code. TDD enables and encourages code refactoring because it ensures that tests are already in place to verify the correctness of the code after changes…
Question
What is a characteristic of test-driven development?
Options
- AIt enables code refactoring.
- BUser tests are created after deployment.
- CInfrastructure testing is done at every stage.
- DLarge updates are applied infrequently.
How the community answered
(39 responses)- A87% (34)
- B3% (1)
- C3% (1)
- D8% (3)
Explanation
Test-Driven Development (TDD) is a software development approach where tests are written before writing the actual code. TDD enables and encourages code refactoring because it ensures that tests are already in place to verify the correctness of the code after changes. Red-Green-Refactor Cycle: TDD follows a cycle of writing a test (Red), writing code to pass the test (Green), and then refactoring the code while ensuring the test still passes (Refactor). Refactoring Support: Because tests are written first, developers can confidently refactor code knowing that any changes that break functionality will be caught by the existing tests.
Topics
Community Discussion
No community discussion yet for this question.