

The client: Vertical search company
This company is one of the Internet’s fastest growing publisher of school directories, matching millions of highly qualified prospective students with the schools that best meet their education needs. More than 5,000 featured schools already use them to meet their recruiting objectives.
The challenge:
The website’s data tier had 150 database tables and each table was represented by a different domain object written in Java. Each domain object required unit tests to be written to evaluate CRUD functionality and to evaluate validation rules. This required a large number of test cases that needed to be written. Each test case would have very similar functionality which implies duplication of code which would make unit test code hard to maintain.
The solution:
In order to implement the unit test cases quickly for the large number of domain objects, a testing API was developed using Java Reflection. The API allowed the unit tests to be implemented in a generic way since the functionality of each of the 150 domain objects was very similar. Unit tests were created with a couple lines of code rather than 15 to 20 lines of code, which made the test cases more maintainable.
The result:
The time required to implement the unit test cases for the 150 domains was reduced by fifty percent. The testing API created using Java Reflection allowed creating more maintainable code and expandable test cases for future changing requirements.