In test-driven development, what are two of the green bar patterns? (Choose two.)
Correct Answer: C,E
In test-driven development (TDD), the "green bar" refers to the visual indication that all tests have passed, typically seen in a testing framework. Two of the patterns that developers use to reach the green bar in TDD are "triangulate" and "fake it." A: another test - This is not a green bar pattern; it's a step in the TDD cycle but not a pattern for passing tests.
B: break - This is not a TDD pattern. C. triangulate - Correct. Triangulation involves adding another test to force the implementation to be more generic and robust. D. starter test - This is not a TDD pattern. E. fake it - Correct. Faking it means to return a simple, hard-coded value to make the test pass.
References:
* Test-Driven Development (TDD) Patterns
* Growing Object-Oriented Software, Guided by Tests