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?
- A. Delete the test since it passes
- B. Write another test such as add(4, 6) == 10 that forces a general implementation
- C. Refactor the test to remove the assertion
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A legacy COBOL system with no documentation is analysed to recover its design (step 1), restructured and migrated to Java with the same…
- In software configuration management, the approved requirements specification is frozen and further changes need formal approval by a…
- A team records, in short version-controlled documents, why it chose PostgreSQL over MongoDB, the context, the options considered and the…
- A request passes through 6 microservices and is sometimes slow. Logs and per-service CPU metrics look normal. Which observability tool…
- A team deliberately terminates random instances and injects latency in production during business hours, with monitoring and a way to stop…
- After a major outage, a team writes a postmortem focusing on what in the system and process allowed the mistake, rather than on who made…