exam questions

Exam 200-901 All Questions

View all questions & answers for the 200-901 exam

Exam 200-901 topic 1 question 319 discussion

Actual exam question from Cisco's 200-901
Question #: 319
Topic #: 1
[All 200-901 Questions]

What is the purpose of running tests before writing code in test-driven development?

  • A. to find unexpected failures in the tests
  • B. to demonstrate that the tests fail for expected reasons
  • C. to ensure that the tests pass
  • D. to provide proof of the work carried out
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
r0m
Highly Voted 9 months, 2 weeks ago
Selected Answer: B
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.
upvoted 7 times
...
nicovl
Most Recent 6 months, 1 week ago
Selected Answer: B
Definitely answer B
upvoted 2 times
...
Woonesuf
8 months, 1 week ago
Selected Answer: B
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
upvoted 3 times
...
nospampls
9 months, 1 week ago
Selected Answer: D
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."
upvoted 1 times
nospampls
9 months, 1 week ago
i asked a programmer friend and she told me to choose B
upvoted 1 times
...
...
mellohello
9 months, 3 weeks ago
Selected Answer: B
The correct answer is B
upvoted 2 times
...
D0rm9nt
10 months ago
A. to find unexpected failures in the tests
upvoted 1 times
...
outrageous7
10 months ago
Selected Answer: B
i would say B
upvoted 2 times
...
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago