Towards a Taxonomy of Unit Tests

Markus Gaelli, Michele Lanza, Oscar Nierstrasz · Bern Open Repository and Information System (University of Bern) · 2005

Not all unit tests are alike. Some tests are simple one-liners, while others contain a battery of assertions. Certain tests focus on a single method, while others test interactions between methods. There are even tests that do not contain assertions at all. This can make it difficult for a developer to understand which methods are tested by which tests, to what degree they are tested, and what to take into account while refactoring. We have manually analyzed the test base of a large existing object-oriented system in order to derive a first taxonomy of unit tests. We have then developed some simple tools to semi-automatically categorize tests according to this taxonomy, and applied it to two case studies. Beside explaining our taxonomy, we report on our initial results using it, namely that a majority of unit tests focus on single methods and that our lightweight automatic categorization could already classify more than 50% of these single method commands.

Read the paper · More papers on PaperTik