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 11. Unit-testing database applications

This chapter covers

  • Unit-testing in isolation from the database with mock objects

  • Performing integration tests with Cactus and DbUnit

  • Improving integration tests’ performances

 

Dependency is the key problem in software development at all scales.... [E]liminating duplication in programs eliminates dependency.

 
 --Kent Beck, Test-Driven Development: By Example

For the combined 22 years that we have been writing business applications, we can’t recall a single project that did not use a database of some sort! How do people unit-test code that calls a database? Most of them don’t. Many developers deem the database problem to be too complex and rely solely on functional tests.

Our goal in this chapter is to show ...

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