skip to main content
10.1145/2491411.2491422acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Inferring project-specific bug patterns for detecting sibling bugs

Published: 18 August 2013 Publication History

Abstract

Lightweight static bug-detection tools such as FindBugs, PMD, Jlint, and Lint4j detect bugs with the knowledge of generic bug patterns (e.g., objects of java.io.InputStream are not closed in time after used). Besides generic bug patterns, different projects under analysis may have some project-specific bug patterns. For example, in a revision of the Xerces project, the class field "fDTDHandler" is dereferenced without proper null-checks, while it could actually be null at runtime. We name such bug patterns directly related to objects instantiated in specific projects as Project-Specific Bug Patterns (PSBPs). Due to lack of such PSBP knowledge, existing tools usually fail in effectively detecting most of this kind of bugs. We name bugs belonging to the same project and sharing the same PSBP as sibling bugs. If some sibling bugs are fixed in a fix revision but some others remain, we treat such fix as an incomplete fix. To address such incomplete fixes, we propose a PSBP-based approach for detecting sibling bugs and implement a tool called Sibling-Bug Detector (SBD). Given a fix revision, SBD first infers the PSBPs implied by the fix revision. Then, based on the inferred PSBPs, SBD detects their related sibling bugs in the same project. To evaluate SBD, we apply it to seven popular open-source projects. Among the 108 warnings reported by SBD, 63 of them have been confirmed as real bugs by the project developers, while two existing popular static detectors (FindBugs and PMD) cannot report most of them.

References

[1]
S. Cherem and R. Rugina. Region analysis and transformation for Java programs. In Proc. of the 4th Int. Symposium on Memory Management, ISMM '04, pages 85- 96, New York, NY, USA, 2004. ACM.
[2]
I. Dillig, T. Dillig, E. Yahav, and S. Chandra. The CLOSER: automating resource management in Java. In Proc. of the 7th Int. Symposium on Memory Management, ISMM ’08, pages 1-10, New York, NY, USA, 2008. ACM.
[3]
ESC/Java. http://en.wikipedia.org/wiki/ESC/Java.
[4]
FindBugs. http://findbugs.sourceforge.net/.
[5]
Z. Gu, E. T. Barr, D. J. Hamilton, and Z. Su. Has the bug really been fixed? In Proc. of the 32nd ACM/IEEE Int. Conf. on Software Engineering - Volume 1, ICSE’10, pages 55-64, New York, NY, USA, 2010. ACM.
[6]
D. Hovemeyer, J. Spacco, and W. Pugh. Evaluating and tuning a static analysis to find null pointer bugs. In Proc. of the 6th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, PASTE’05, pages 13-19, New York, NY, USA, 2005. ACM.
[7]
Jlint. http://jlint.sourceforge.net/.
[8]
S. Kim and M. D. Ernst. Which warnings should I fix first? In Proc. of the 6th joint meeting of the European Software Engineering Conf. and the ACM SIGSOFT Symposium on Foundations of Software Engineering, ESEC/FSE’07, pages 45-54, New York, NY, USA, 2007. ACM.
[9]
M. Kim, S. Sinha, C. Görg, H. Shah, M. J. Harrold, and M. G. Nanda. Automated bug neighborhood analysis for identifying incomplete bug fixes. In Proc. of the 3rd Int. Conf. on Software Testing, Verification and Validation, ICST ’10, pages 383-392, Washington, DC, USA, 2010. IEEE Computer Society.
[10]
G. Liang, L. Wu, Q. Wu, Q. Wang, T. Xie, and H. Mei. Automatic construction of an effective training set for prioritizing static analysis warnings. In Proc. of the 25th IEEE/ACM Int. Conf. on Automated Software Engineering, ASE’10, pages 93-102, New York, NY, USA, 2010. ACM.
[11]
G. Liang, Q. Wu, Q. Wang, and H. Mei. An effective defect detection and warning prioritization approach for resource leaks. In Proc. of the 36th Annual IEEE Computer Software and Applications Conference (COMPSAC 2012), pages 119- 128, Izmir, Turkey, July 16-20, 2012.
[12]
Lint4j. http://www.jutils.com/.
[13]
N. A. Naeem and O. Lhotak. Typestate-like analysis of multiple interacting objects. In Proc. of the 23rd ACM SIGPLAN Conf. on Object-Oriented Programming Systems Languages and Applications, OOPSLA’08, pages 347-366, New York, NY, USA, 2008.
[14]
F. Nielson, H. R. Nielson, and C. Hankin. Principles of Program Analysis. Springer Publishing Company, Incorporated, 2010.
[15]
A. Orso, N. Shi, and M. J. Harrold. Scaling regression testing to large software systems. SIGSOFT Software Eng. Notes, 29(6), pages 241-251, Oct. 2004.
[16]
K. Pan, S. Kim, and E. J. Whitehead, Jr. Toward an understanding of bug fix patterns. Empirical Software Engineering. 14(3), pages 286-315, June 2009.
[17]
PMD. http://pmd.sourceforge.net/.
[18]
R. Purushothaman and D. E. Perry. Toward understanding the rhetoric of small source code changes. IEEE Trans. Softw. Eng., 31(6):511-526, June 2005.
[19]
N. Rutar, C. B. Almazan, and J. S. Foster. A comparison of bug finding tools for Java. In Proc. of the 15th Int. Symposium on Software Reliability Engineering, ISSRE’04, pages 245-256, Washington, DC, USA, 2004. IEEE Computer Society.
[20]
R. Shaham, E. Yahav, E. K. Kolodner, and M. Sagiv. Establishing local temporal heap safety properties with applications to compile-time memory management. In Proc. of the 10th Int. Conf. on Static Analysis, SAS’03, pages 483- 503, Berlin, Heidelberg, 2003. Springer-Verlag.
[21]
J. Sliwerski, T. Zimmermann, and A. Zeller. HATARI: raising risk awareness. SIGSOFT Softw. Eng. Notes, 30(5):107-110, Sept. 2005.
[22]
J. Sliwerski, T. Zimmermann, and A. Zeller. When do changes induce fixes? SIGSOFT Softw. Eng. Notes, 30(4):1- 5, May 2005.
[23]
F. Spoto. Precise null-pointer analysis. Softw. Syst. Model., 10(2):219-252, May 2011.
[24]
L. Tan, D. Yuan, G. Krishna, Y. Zhou. /*iComment: Bugs or bad comments?*/. In Proc. of the 21st Symposium on Operating Systems Principles, pp.145-158, Stevenson, USA, Oct. 14-17, 2007.
[25]
E. Torlak and S. Chandra. Effective interprocedural resource leak detection. In Proc. of the 32nd ACM/IEEE Int. Conf. on Software Engineering - Volume 1, ICSE’10, pages 535-544, New York, NY, USA, 2010. ACM.
[26]
J. Tucek, W. Xiong, and Y. Zhou. Efficient online validation with delta execution. SIGPLAN Not., 44(3):193-204, Mar. 2009.
[27]
W. Weimer and G. C. Necula. Mining temporal specifications for error detection. In Proc. of the 11th Int. Conf. on Tools and Algorithms for the Construction and Analysis of Systems, pp.461-476, Edinburgh, UK, Apr. 4-8, 2005.
[28]
W. Weimer and G. C. Necula. Finding and preventing runtime error handling mistakes. In Proc. of the 19th Annual ACM SIGPLAN Conf. on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA’04, pages 419-431, New York, NY, USA, 2004. ACM.
[29]
Q. Wu, G. Liang, Q. Wang, T. Xie, and H. Mei. Iterative mining of resource-releasing specifications. In Proc. of the 26th IEEE/ACM Int. Conf. on Automated Software Engineering, ASE’2011, pages 233-242, 2011.
[30]
Z. Yin, D. Yuan, Y. Zhou, S. Pasupathy, and L. Bairavasundaram. How do fixes become bugs? In Proc. of the 19th ACM SIGSOFT Symposium and the 13th European Conf. on Foundations of Software Engineering, ESEC/FSE’11, pages 26-36, New York, NY, USA, 2011.
[31]
H. Zhong, L. Zhang, T. Xie, and H. Mei. Inferring resource specifications from natural language API documentation. In Proc. of the 24th Int. Conf. on Automated Software Engineering, pp.307-318, Auckland, New Zealand, Nov. 16- 20, 2009.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ESEC/FSE 2013: Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering
August 2013
738 pages
ISBN:9781450322379
DOI:10.1145/2491411
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 18 August 2013

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Project-specific bug patterns
  2. incomplete fixes
  3. sibling-bug detection

Qualifiers

  • Research-article

Conference

ESEC/FSE'13
Sponsor:

Acceptance Rates

Overall Acceptance Rate 112 of 543 submissions, 21%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)8
  • Downloads (Last 6 weeks)0
Reflects downloads up to 05 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media