Assert Use and Defectiveness in Industrial Code

by   Steve Counsell, et al.

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.



There are no comments yet.


page 1

page 2

page 3

page 4


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

While a substantial body of prior research has investigated the form and...

Empirical Study of Phased Model of Software Change

Software change is the basic task of software evolution and maintenance....

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...

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...

Better Code, Better Sharing:On the Need of Analyzing Jupyter Notebooks

By bringing together code, text, and examples, Jupyter notebooks have be...

Empirical Analysis on Effectiveness of NLP Methods for Predicting Code Smell

A code smell is a surface indicator of an inherent problem in the system...
This week in AI

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