Assert use and defectiveness in industrial code

Steve Counsell, Tracy Hall, Thomas Shippey, David Bowes, Amjed Tahir, Stephen MacDonell

Research output: Chapter in Book/Report/Conference proceedingConference contribution

1 Citation (Scopus)

Abstract

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.

Original languageEnglish
Title of host publicationProceedings - 2017 IEEE 28th International Symposium on Software Reliability Engineering Workshops, ISSREW 2017
PublisherInstitute of Electrical and Electronics Engineers (IEEE)
Pages20-23
Number of pages4
ISBN (Electronic)9781538623879
DOIs
Publication statusPublished - 14 Nov 2017
Event28th IEEE International Symposium on Software Reliability Engineering Workshops, ISSREW 2017 - Toulouse, France
Duration: 23 Oct 201726 Oct 2017

Conference

Conference28th IEEE International Symposium on Software Reliability Engineering Workshops, ISSREW 2017
Country/TerritoryFrance
CityToulouse
Period23/10/1726/10/17

Keywords

  • Assert
  • Defect
  • Empirical
  • Industry

Fingerprint

Dive into the research topics of 'Assert use and defectiveness in industrial code'. Together they form a unique fingerprint.

Cite this