Which of the following correctly represents a test first approach?
A.
First the tests fail then the code is written to pass the tests and this is iterated
B.
Tests are derived from acceptance criteria and run to check that the code passes these tests
C.
Application behaviour is written in Given/When/Then format and tests are then written and run
D.
Code is refactored first then tests are written and run
The Answer Is:
A
This question includes an explanation.
Explanation:
A test-first approach involves writing tests before writing the code. In this approach, initially, the tests fail because the corresponding functionality is not yet implemented. Afterward, the code is written or modified to make the tests pass. This cycle is repeated iteratively. This method ensures that the code is developed based on predefined tests and helps in identifying issues early in the development process​​.
CTFL_Syll_4.0 PDF/Engine
Printable Format
Value of Money
100% Pass Assurance
Verified Answers
Researched by Industry Experts
Based on Real Exams Scenarios
100% Real Questions
Get 65% Discount on All Products,
Use Coupon: "ac4s65"