An empirical study into the relationship between class features and test smells

03/27/2021
by   Amjed Tahir, et al.
0

While a substantial body of prior research has investigated the form and nature of production code, comparatively little attention has examined characteristics of test code, and, in particular, test smells in that code. In this paper, we explore the relationship between production code properties (at the class level) and a set of test smells, in five open source systems. Specifically, we examine whether complexity properties of a production class can be used as predictors of the presence of test smells in the associated unit test. Our results, derived from the analysis of 975 production class-unit test pairs, show that the Cyclomatic Complexity (CC) and Weighted Methods per Class (WMC) of production classes are strong indicators of the presence of smells in their associated unit tests. The Lack of Cohesion of Methods in a production class (LCOM) also appears to be a good indicator of the presence of test smells. Perhaps more importantly, all three metrics appear to be good indicators of particular test smells, especially Eager Test and Duplicated Code. The Depth of the Inheritance Tree (DIT), on the other hand, was not found to be significantly related to the incidence of test smells. The results have important implications for large-scale software development, particularly in a context where organizations are increasingly using, adopting or adapting open source code as part of their development strategy and need to ensure that classes and methods are kept as simple as possible.

READ FULL TEXT
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

03/12/2021

Combining Dynamic Analysis and Visualization to Explore the Distribution of Unit Test Suites

As software systems have grown in scale and complexity the test suites b...
07/20/2021

On the Interplay of Smells Large Class, Complex Class and Duplicate Code

Bad smells have been defined to describe potential problems in code, pos...
04/04/2021

Assert Use and Defectiveness in Industrial Code

The use of asserts in code has received increasing attention in the soft...
12/23/2021

Flakify: A Black-Box, Language Model-based Predictor for Flaky Tests

Software testing assures that code changes do not adversely affect exist...
12/02/2017

The impact of software complexity on cost and quality - A comparative analysis between Open source and proprietary software

Early prediction of software quality is important for better software pl...
08/28/2018

Does the Testing Level affect the Prevalence of Coincidental Correctness?

Researchers have previously shown that Coincidental Correctness (CC) is ...
11/03/2021

Smells in System User Interactive Tests

Test smells are known as bad development practices that reflect poor des...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.