B. to demonstrate that the tests fail for expected reasons
In Test-Driven Development (TDD), developers write tests before writing code. The purpose of running the tests before writing code is to demonstrate that the tests fail for expected reasons. This is because the tests are written to test the functionality that the developer is about to add to the codebase, and since that functionality does not yet exist, the tests should fail. This is an important step in the TDD process because it confirms that the tests are correctly identifying the missing functionality and that they are not passing due to an error in the tests themselves.
I agree with B. D would be better suited for after the code is written to show what was accomplished.
Reference Chapter 5 'Working with Data in Python' in DevNet Associate DEVASC 200-901 Official Cert Guide
This is from the Cisco Book 200-901 Page 260
"TDD may see like a waste of time initially. Why write
tests for stuff you know isn’t going to pass? Isn’t all of
this testing just wasted effort? The benefit of this style of
development is that it starts with the end goal in mind,
by defining success right away. The test you create is
laser focused on the application’s purpose and a clear
outcome."
This section is not available anymore. Please use the main Exam Page.200-901 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
r0m
Highly Voted 9Â months, 2Â weeks agonicovl
Most Recent 6Â months, 1Â week agoWoonesuf
8Â months, 1Â week agonospampls
9Â months, 1Â week agonospampls
9Â months, 1Â week agomellohello
9Â months, 3Â weeks agoD0rm9nt
10Â months agooutrageous7
10Â months ago