Towards a Unified Metrics Suite for JUnit Test Cases.
Fadel Touré, Mourad Badri, Luc Lamontagne · Software Engineering and Knowledge Engineering · 2014
This paper aims at proposing a unified metrics suite that can be used to quantify different perspectives related to the code of JUnit test cases. We extended existing JUnit test case metrics by introducing two new metrics. We analyzed the code of JUnit test cases of two open source Java software systems (ANT and JFREECHART). We used in total five metrics. We used the Principal Component Analysis (PCA) method in order: (1) to better understand the underlying orthogonal dimensions captured by the suite of unit test case metrics, and (2) to find whether the metrics are independent or are measuring similar structural aspects of the JUnit test code. Overall, results show that: (1) the new introduced unit test case metrics are relevant, (2) the studied unit test case metrics are not independent, and (3) the best subset (a couple) of unit test case metrics that maximizes the variance varies from one system to the other. The new introduced metrics are, however, each in the best subset of unit test case metrics that provide the best independent information that maximizes the variance for each system.