Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do.
-- Steve Jobs
Showing posts with label JUnit. Show all posts
Showing posts with label JUnit. Show all posts

Wednesday, September 7, 2011

Testing Databases with JUnit and Hibernate Part 1: One to Rule them | Schauderhaft

Schauderhaft » Testing Databases with JUnit and Hibernate Part 1: One to Rule them
Databases are an extremely important part of almost every enterprise application. Yet there is very little support for testing your database, which results in very little tests coverage of database related code out in the wild. In a desperate attempt to change that at least a little the article series starting with this article will describe some of the problems and possible partial solutions based on Hibernate and JUnit.

Tuesday, July 19, 2011

Parameterized unit tests with JUnit 4 (Locke's Socks)

Parameterized unit tests with JUnit 4 (Locke's Socks)
If you've ever found yourself writing a series of tests which differ only in their inputs and expected results, you've probably realized that the sensible thing to do would be to abstract your tests into a single test that can be run against a varying set of data. JUnit 4 allows you to do this with either theories or parameterized tests; here, I'll discuss the latter.

JUnit theories (Locke's Socks)

JUnit theories (Locke's Socks)
So, theories. Whereas parameterized tests are generally built around a known set of inputs and expected outputs, a theories-based test focuses on the generalized relationship between inputs and outputs. It might help you to understand the difference if you try to recall learning about mathematical functions for the first time in junior high or high school.