Detecting object usage anomalies

Authors:

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 se- quences 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 auto- matic defect detection approach that learns and checks method call sequences. Our JADET prototype has detected yet undiscovered defects and code smells in five popular open-source programs, in- cluding two new defects in ASPECTJ.

This publication has 30 references indexed in Scilit: