Test-Driven Development (TDD) is a software development approach where tests are written before writing the actual code. The steps involved in TDD are:
Write a test for the new functionality.
Run the test and see it fail (because the functionality is not yet implemented).
Write the minimum code necessary to make the test pass.
Refactor the code while keeping the test passing.
Option B is the correct answer because refactoring code while it is covered by existing tests is a key aspect of TDD. The existing tests ensure that the functionality remains correct even after refactoring.
References:
Cisco DevNet Associate Exam Topics: Software Development and Design (understanding TDD methodology)
"Test-Driven Development by Example" by Kent Beck (standard reference on TDD)
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit