O'Reilly logo

JUnit in Action by Ted Husted, Vincent Massol

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Sampling JUnit

This chapter covers

  • Testing larger components

  • Project infrastructure

 

Tests are the Programmer’s Stone, transmuting fear into boredom.

 
 --Kent Beck, Test First Development

Now that you’ve had an introduction to JUnit, you’re ready to see how it works on a practical application. Let’s walk through a case study of testing a single, significant component, like one your team leader might assign to you. We should choose a component that is both useful and easy to understand, common to many applications, large enough to give us something to play with, but small enough that we can cover it here. How about a controller?

In this chapter, we’ll first introduce the case-study code, identify what code to test, and then show how to test ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required