Cisco 200-901 Question Answer
What is a tenet of test-driven development?
write documentation for tests
write tests after adding new blocks of code
write and run tests before writing new code
run tests after writing new code
Test-Driven Development (TDD) is a software development approach where tests are written before the code that needs to be tested.
TDD Process:
Write a Test: Start by writing a test for a new feature or functionality.
Run the Test: Run the test, which should fail initially since the code hasn’t been written yet.
Write Code: Write the minimum amount of code required to pass the test.
Run Tests Again: Run the tests again to ensure they pass.
Refactor: Refactor the code while ensuring the tests still pass.
Advantages:
Early Bug Detection: Bugs are detected early in the development cycle.
Better Design: Promotes writing cleaner, more modular code.
Documentation: The tests themselves serve as documentation for the code.
Writing and running tests before writing the actual code ensures that the code meets the specified requirements and functions correctly.
References:
TDD Overview: Test-Driven Development
TESTED 17 Aug 2025
Copyright © 2014-2025 ACE4Sure. All Rights Reserved