19 Testing database applications

This chapter covers

  • Examining the challenges of database testing
  • Implementing tests for JDBC, Spring JDBC, Hibernate, and Spring Hibernate applications
  • Comparing the different approaches to building and testing database applications

Dependency is the key problem in software development at all scales. . . . Eliminating duplication in programs eliminates dependency.

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

The persistence layer (or, roughly speaking, database access code) is undoubtedly one of the most important parts of any enterprise project. Despite its importance, the persistence layer is hard to unit test, mainly due to the following three issues:

  • Unit tests must exercise code in isolation; the ...

Get JUnit in Action, Third Edition 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.