Perth, WA (PRWEB) February 27, 2013
Anahata Technologies believes that one of the main factors in creating quality code is developing a comprehensive set of unit tests. Writing unit tests simultaneously with the code assists developers in thinking about making classes unit testable to begin with, and reviewing their design becomes a natural side effect, forcing the developer to think about keeping classes small, cohesive and loosely coupled. These principles drive high quality code that is easy to understand and maintain, and has less errors.
Anahata has chosen JUnit as the primary unit test framework. JUnit has been around for a long time in the Java community, maturing into a flexible and easy to use framework that takes advantages of Java annotations. It’s flexibility allows, for example, CDI injection to be performed into unit tests if required when creating more advanced test projects.
One of the challenges in writing unit tests is the ability to isolate classes to test them independently. Test frameworks Mockito and PowerMock combined with JUnit provide mocking capabilities so that external dependencies of a class can be mocked (or emulated). The frameworks provide the power to control the mocking process, whether partially mocking classes or overriding constructors. Anahata has chosen these frameworks because of the power, flexibility and community support providing confidence in using them for the future.