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.

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

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.