Easy and maintainable enterprise testing with Unitils
ad5c44c4-ada5-463a-8d8c-1206c875e9e5
|
Presentation |
Unit testing has become a mainstream task. Most developers do it. Most project leaders and architects expect their team to write tests. However, practice has taught us that a lot of teams write few tests, or spend too much time writing and maintaining them. Different development teams make common mistakes, run into similar issues and find their own solutions for them. This costs a lot of valuable time.
Unitils started in 2005, when a group of developers and architects joined in a task force to share their testing experience. These discussions resulted in a set of testing guidelines. The leaders of this task force started writing code to help implementing these guidelines. Unitils has emerged from concrete experience and lessons learned, with the ultimate goal of making unit testing easy, effective and maintainable.
Unitils offers a lot of support in testing the database layer: automatic maintenance of test databases, automatic post-processing of the database to make it more test-friendly, loading test data using DbUnit and verifying the contents of the database after execution of a test. Unitils provides specific support for testing with JPA or hibernate, and offers integration with spring. It makes abstraction of the testing framework that is used for executing the tests, making it useable with JUnit3, JUnit4 or TestNG.
But Unitils is not limited to persistence layer testing only: The reflection assert utility is a very useful alternative to the classic assertEquals method with a range of leniency options. Unitils also provides superior support for dynamic mock objects, offering a simple syntax for specifying method behavior and verifying expectations.
During this talk, I will present the different features of Unitils using simple, concrete examples. I will talk about problems from real projects and demonstrate how Unitils helps solving these problems.
Outline:
- Introduction
- Feature overview: Using examples, I’ll demonstrate the features of Unitils: assertion using reflection, test data management, test database maintenance, JPA / hibernate and spring integration, testing with mock objects.
- Demo: demonstration of the database maintainer, JPA / hibernate entity-database mapping test
- Architecture: Provide some insight into how Unitils works.
- Summary and roadmap: What are our plans for the future
- Q & A
Required experience:
Basic experience with unit testing. Knowledge of hibernate and spring is useful but not required.
Expected audience:
Developers, technical project leaders and architects, who are into unit testing and want to improve testing on their projects.
-
Filip NevenFilip is an architect at Ordina Belgium. He's been involved in enterprise java development since 2001, spending most of his time developing web based applications for large companies. Filip is always striving for better quality and productivity, and he has a particular interest for test automation, continuous integration and code quality. He's co-founder and lead developer of the Unitils framework, and has previously spoken at the Javapolis and SpringOne conferences.



Intermediate
Core Java