Abstract
Many techniques have been developed over the years to automatically find bugs in software. Often, these techniques rely on formal methods and sophisticated program analysis. While these techniques are valuable, they can be difficult to apply, and they aren't always effective in finding real bugs.Bug patterns are code idioms that are often errors. We have implemented automatic detectors for a variety of bug patterns found in Java programs. In this paper, we describe how we have used bug pattern detectors to find serious bugs in several widely used Java applications and libraries. We have found that the effort required to implement a bug pattern detector tends to be low, and that even extremely simple detectors find bugs in real applications.From our experience applying bug pattern detectors to real programs, we have drawn several interesting conclusions. First, we have found that even well tested code written by experts contains a surprising number of obvious bugs. Second, Java (and similar languages) have many language features and APIs which are prone to misuse. Finally, that simple automatic techniques can be effective at countering the impact of both ordinary mistakes and misunderstood language features.
- E. Allen. Bug Patterns In Java. APress, 2002. Google ScholarDigital Library
- Apache Ant, http://ant.apache.org/, 2004.Google Scholar
- C. Artho and A. Biere. Applying static analysis to large-scale, multi-threaded Java. In Proceedings of the 13th Australian Software Engineering Conference, pages 68--75, August 2001. Google ScholarDigital Library
- K. Ashcraft and D. Engler. Using programmer-written compiler extensions to catch security holes. In IEEE Symposium on Security and Privacy, Oakland, California, May 2002. Google ScholarDigital Library
- G. Back and D. Engler. MJ: A system for constructing bug-finding analyses for Java. http://www.stanford.edu/~gback/gback-icse2004.pdf, 2003.Google Scholar
- T. Ball and S. K. Rajamani. The SLAM project: Debugging system software via static analysis. In Proceedings of the 29th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 1--3, Portland, Oregon, Jan. 2002. Google ScholarDigital Library
- The Byte Code Engineering Library, http://jakarta.apache.org/bcel/, 2004.Google Scholar
- J. Bloch. Effective Java Programming Language Guide. Addison-Wesley, 2002. Google ScholarDigital Library
- W. R. Bush, J. D. Pincus, and D. J. Sielaff. A static analyzer for finding dynamic programming errors. Software---Practice & Experience, 30:775--802, 2000. Google ScholarDigital Library
- CheckStyle, http://checkstyle.sourceforge.net, 2004.Google Scholar
- J.-D. Choi, K. Lee, A. Loginov, R. O'Callahan, V. Sarkar, and M. Sridharan. Efficient and precise datarace detection for multithreaded object-oriented programs. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, July 2002. Google ScholarDigital Library
- A. Chou, J. Yang, B. Chelf, S. Hallem, and D. R. Engler. An empirical study of operating system errors. In Symposium on Operating Systems Principles, pages 73--88, 2001. Google ScholarDigital Library
- R. F. Crew. ASTLOG: A language for examining abstract syntax trees. In USENIX Conference on Domain Specific Languages, pages 229--241, Santa Barbara, 1997. Google ScholarDigital Library
- M. C. Daconta, E. Monk, J. P. Keller, and K. Bohnenberger. Java Pitfalls. John Wiley & Sons, Inc., 2000.Google Scholar
- M. Das, S. Lerner, and M. Seigle. ESP: path-sensitive program verification in polynomial time. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 57--68, 2002. Google ScholarDigital Library
- DrJava, http://www.drjava.org/, 2004.Google Scholar
- A. Druin, B. Bederson, A. Weeks, A. Farber, J. Grosjean, M. Guha, J. Hourcade, J. Lee, S. Liao, K. Reuter, A. Rose, Y. Takayama, L., and L. Zhang. The international children's digital library: Description and analysis of first use. Technical Report HCIL-2003-02, Human-Computer Interaction Lab, Univ. of Maryland, January 2003.Google ScholarCross Ref
- Eclipse, http://www.eclipse.org/, 2004.Google Scholar
- D. Engler and K. Ashcraft. Racerx: Effective, static detection of race conditions and deadlocks. In Proceedings of the Nineteenth ACM Symposium on Operating Systems Principles, pages 237--252. ACM Press, 2003. Google ScholarDigital Library
- D. Engler, B. Chelf, A. Chou, and S. Hallem. Checking system rules using system-specific, programmer-written compiler extensions. In Proceedings of the Fourth Symposium on Operating Systems Design and Implementation, San Diego, CA, Oct. 2000. Google ScholarDigital Library
- M. D. Ernst, J. Cockrell, W. G. Griswold, and D. Notkin. Dynamically discovering likely program invariants to support program evolution. IEEE Transactions in Software Engineering, 27(2):1--25, Feb. 2001. Google ScholarDigital Library
- D. Evans. Static detection of dynamic memory errors. In Proceedings of the 1996 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 44--53, Philadelphia, Pennsylvania, May 1996. Google ScholarDigital Library
- D. Evans, J. Guttag, J. Horning, and Y. M. Tan. LCLint: A tool for using specifications to check code. In Proceedings of the ACM SIGSOFT '94 Symposium on the Foundations of Software Engineering, pages 87--96, 1994. Google ScholarDigital Library
- C. Flanagan, K. R. M. Leino, M. Lillibridge, G. Nelson, J. B. Saxe, and R. Stata. Extended static checking for Java. In Proceedings of the 2002 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 234--245, Berlin, Germany, June 2002. Google ScholarDigital Library
- J. S. Foster, M. Fähndrich, and A. Aiken. A theory of type qualifiers. In Proceedings of the 1999 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 192--203, Atlanta, Georgia, May 1999. Google ScholarDigital Library
- J. S. Foster, T. Terauchi, and A. Aiken. Flow-sensitive type qualifiers. In Proceedings of the 2002 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 1--12, Berlin, Germany, June 2002. Google ScholarDigital Library
- GNU Classpath, http://www.gnu.org/software/classpath/, 2004.Google Scholar
- S. Hallem, B. Chelf, Y. Xie, and D. Engler. A system and language for building system-specific, static analyses. In Proceedings of the 2002 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 69--82, Berlin, Germany, June 2002. Google ScholarDigital Library
- S. Hangal and M. S. Lam. Tracking down software bugs using automatic anomaly detection. In Proceedings of the International Conference on Software Engineering, pages 291--301, May 2002. Google ScholarDigital Library
- D. Hovemeyer and W. Pugh. Finding concurrency bugs in Java. In Proceedings of the PODC Workshop on Concurrency and Synchronization in Java Programs, St. John's, Newfoundland, Canada, July 2004.Google Scholar
- Java(tm) 2 Platform, Standard Edition, http://java.sun.com/j2se/, 2004.Google Scholar
- Collected java practices. http://www.javapractices.com.Google Scholar
- JBoss, http://www.jboss.org/, 2004.Google Scholar
- jEdit, http://www.jedit.org/, 2004.Google Scholar
- S. Johnson, Lint, a C program checker. In UNIX Programmer's Supplementary Documents Volume 1 (PS1), April 1986.Google Scholar
- T. Kremenek and D. R. Engler. Z-ranking: Using statistical analysis to counter the impact of static analysis approximations. In Proceedings of Static Analysis, 10th International Symposium, SAS 2003, San Diego, CA, USA, pages 295--315, June 2003. Google ScholarDigital Library
- Y. A. Liu, T. Rothamel, F. Yu, S. Stoller, and N. Hu. Parametric regular path queries. In Proceedings of the 2004 ACM SIGPLAN Conference on Programming Language Design and Implementation, Washington, D.C., USA, June 2004. Google ScholarDigital Library
- PMD, http://pmd.sourceforge.net, 2004.Google Scholar
- W. Pugh. The double checked locking is broken declaration. http://www.cs.umd.edu/users/pugh/java/memory-Model/DoubleCheckedLocking.html, July 2000.Google Scholar
- N. Rutar, C. Almazan, and J. S. Foster. A comparison of bug finding tools for Java. In Proceedings of the 15th IEEE International Symposium on Software Reliability Engineering, Saint-Malo, France, November 2004. Google ScholarDigital Library
- S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: A dynamic data race detector for multithreaded programs. ACM Transactions on Computer Systems, 15(4):391--411, 1997. Google ScholarDigital Library
- D. Schmidt and T. Harrison. Double-checked locking: An Optimization pattern for efficiently initializing and accessing thread-safe objects. In 3rd Annual Pattern Languages of Program Design Conference, 1996. Google ScholarDigital Library
- U. Shankar, K. Talwar, J. S. Foster, and D. Wagner. Detecting format string vulnerabilities with type qualifiers. In Proceedings of the 10th Usenix Security Symposium, Washington, D.C., Aug. 2001. Google ScholarDigital Library
- N. Sterling. WARLOCK --- a static data race analysis tool. In Proceedings of the USENIX Annual Technical Conference, pages 97--106, Winter 1993.Google Scholar
- B. Tate. Bitter Java. Manning Publications, 2002. Google ScholarDigital Library
- Y. Xie and D. Engler. Using redundancies to find errors. In Proceedings of the ACM SIGSOFT International Symposium on the Foundations of Software Engineering, November 2002. Google ScholarDigital Library
Index Terms
Finding bugs is easy
Recommendations
Finding bugs is easy
OOPSLA '04: Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applicationsMany techniques have been developed over the years to automatically find bugs in software. Often, these techniques rely on formal methods and sophisticated program analysis. While these techniques are valuable, they can be difficult to apply, and they ...
Finding Atomicity-Violation Bugs through Unserializable Interleaving Testing
Multicore hardware is making concurrent programs pervasive. Unfortunately, concurrent programs are prone to bugs. Among different types of concurrency bugs, atomicity violations are common and important. How to test the interleaving space and expose ...
Comments