Assert Use and Defectiveness in Industrial Code

04/04/2021
by   Steve Counsell, et al.
0

The use of asserts in code has received increasing attention in the software engineering community in the past few years, even though it has been a recognized programming construct for many decades. A previous empirical study by Casalnuovo showed that methods containing asserts had fewer defects than those that did not. In this paper, we analyze the test classes of two industrial telecom Java systems to lend support to, or refute that finding. We also analyze the physical position of asserts in methods to determine if there is a relationship between assert placement and method defect-proneness. Finally, we explore the role of test method size and the relationship it has with asserts. In terms of the previous study by Casalnuovo, we found only limited evidence to support the earlier results. We did however find that defective methods with one assert tended to be located at significantly lower levels of the class position-wise than non-defective methods. Finally, method size seemed to correlate strongly with asserts, but surprisingly less so when we excluded methods with just one assert. The work described highlights the need for more studies into this aspect of code, one which has strong links with code comprehension.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/27/2021

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

While a substantial body of prior research has investigated the form and...
research
04/11/2019

Empirical Study of Phased Model of Software Change

Software change is the basic task of software evolution and maintenance....
research
06/08/2021

Does class size matter? An in-depth assessment of the effect of class size in software defect prediction

In the past 20 years, defect prediction studies have generally acknowled...
research
03/01/2021

Rethinking complexity for software code structures: A pioneering study on Linux kernel code repository

The recent progress of artificial intelligence(AI) has shown great poten...
research
07/18/2022

Software Artifact Mining in Software Engineering Conferences: A Meta-Analysis

Background: Software development results in the production of various ty...
research
05/04/2022

An Empirical Study on Maintainable Method Size in Java

Code metrics have been widely used to estimate software maintenance effo...

Please sign up or login with your details

Forgot password? Click here to reset