Extending Project Lombok to improve JUnit tests

More Info
expand_more

Abstract

In this thesis, we look at unit and integration test suites and look for ways to improve the quality of the tests. The first step in this research is the development of the JUnitCategorizer tool to distinguish between unit tests and integration tests. JUnitCategorizer determines the actual class under test using a new heuristic and ultimately decides whether the test method is a unit or integration test. We show that JUnitCategorizer correctly determines the class under test with an accuracy of over 90%. Our analysis also shows an accuracy of 95.8% on correctly distinguishing unit and integration tests. We applied JUnitCategorizer on several open and closed source projects to obtain a classification of the test suites based on their ratio of integration tests. The second part of this research looks at applicable methods to increase the quality of the tests, for example elimination of boiler-plate code and detection (and possibly generation) of missing tests. Using the classification of test suites, we show that the aforementioned test problems occur in both unit as integration tests. We then propose a new tool called Java Test Assistant (JTA), which can generate boiler-plate tests and some hard tests. An experiment was conducted to assess JTA and showed promising results. Code coverage increased and several of our generated tests fail on the current code base because the implementations are not entirely correct.