CS FundamentalsHardProduct-company placement

In TDD, a developer has one failing test, assertEqual(add(2, 3), 5), and makes it pass with `return 5`. What is the next step according to the TDD technique called triangulation?

  1. A. Delete the test since it passes
  2. B. Write another test such as add(4, 6) == 10 that forces a general implementation
  3. C. Refactor the test to remove the assertion
  4. D. Add 100% coverage before continuing

Correct answer: B. Write another test such as add(4, 6) == 10 that forces a general implementation

Faking it is allowed to get to green quickly; a second example that the fake cannot satisfy drives the general code (return a + b). This keeps each step small and test-driven.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic