Detecting object usage anomalies

  • Authors:
  • Andrzej Wasylkowski;Andreas Zeller;Christian Lindig

  • Affiliations:
  • Saarland University, Saarbruecken, Germany;Saarland University, Saarbruecken, Germany;Saarland University, Saarbruecken, Germany

  • Venue:
  • Proceedings of the the 6th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

Interacting with objects often requires following a protocol---for instance, a specific sequence of method calls. These protocols are not always documented, and violations can lead to subtle problems. Our approach takes code examples to automatically infer legal sequences of method calls. The resulting patterns can then be used to detect anomalies such as "Before calling next, one normally calls hasNext". To our knowledge, this is the first fully automatic defect detection approach that learns and checks methodcall sequences. Our JADET prototype has detected yet undiscovered defects and code smells in five popular open-source programs, including two new defects in AspectJ.