What Sort of Tests?

Both BDD and TDD ask us to write examples before we write the code to help us drive out just the functionality that our customers want, and no more. When we write these scenarios and tests, they guide our emerging design. Once the functionality has been implemented, their purpose is to give us confidence when we refactor or add new behavior to protect us from regressions.

Many people assume that when using a tool like Cucumber—where the test is a business-readable acceptance test—we must exercise all layers of the solution. That’s not the case! The choice between using a natural language tool or a more technical tool, such as JUnit, to run the tests depends on who is interested in reading the specification. How much of ...

Get The Cucumber for Java Book now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.