Abstract

Identifier names account for 70 percent of source code in characters. Meaningful identifier names convey valuable natural language information of the corresponding software entities, and thus they can be exploited to analyse the program and comprehend the semantics of it. However, existing bug detection approaches often ignore such natural language information and semantics encoded in identifier names. To this end, we propose a name-based approach to identify suspicious return statements. The recent study suggests that source code elements are often lexically similar to their corresponding semantic related elements. Based on this assumption, we design a sequence of heuristic rules to determine whether the return statement of a given method matches the signature of it. Evaluations on 100 open-source Java projects suggest that the proposed approach detects 16 out of 60 real return bugs. The precision and recall of the proposed approach are 31% and 27%, respectively.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call