Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 1.6 KB

test-driven-development-quiz.md

File metadata and controls

53 lines (40 loc) · 1.6 KB

Test Driven Development Quiz

Question 1: Which of the following is the proper sequence of events in TDD?

A — Add a test, run all tests, write the code, run tests, refactor code   
B — Run all tests, write the code, add a test, run tests, refactor code   
C — Write the code, run all tests, add a test, run tests, refactor code   
D — None of the above 
Answer 1

A — Add a test, run all Tests, Write the Code, Run tests, Refactor code


Question 2: Which of the following is not a best practice of TDD?

A — Separate common set-up and tear-down logic from the tests cases   
B — Treat test code with the same respect as production code   
C — Execute test methods in an order that ensures the state left by each test is what the next test requires   
D — None of the above 
Answer 2

C — Execute test methods in an order that ensures the state left by each test is what the next test requires


Question 3: Which of the following is a benefit of TDD?

A — TDD may result in more unit tests   
B — TDD can lead to more modularized code   
C — TDD tends to result in tests that cover every code path   
D — All of the above 
Answer 3

D — All of the above


Question 4: True or False? — Test doubles (such as mocks) are not used in TDD

Answer 4

False