skip to main content
10.1145/1287624.1287632acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
Article

Detecting object usage anomalies

Published:07 September 2007Publication History

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 sequences 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 automatic defect detection approach that learns and checks methodcall sequences. Our JADET prototype has detected yet undiscovered defects and code smells in five popular open-source programs, including two new defects in AspectJ.

References

  1. L. de Alfaro and T. A. Henzinger. Interface automata. In ESEC/FSE-9: Proc. of the 8th European Software Engineering Conference held jointly with 9th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pages 109--120. ACM Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. Alur, P. Cerny, P. Madhusudan, and W. Nam. Synthesis of interface specifications for Java classes. In POPL '05: Proc. of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 98--109. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. G. Ammons, R. Bodik, and J. R. Larus. Mining specifications. In POPL '02: Proc. of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 4--16. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Antoy and D. Hamlet. Automatically checking an implementation against its formal specification. IEEE Transactions on Software Engineering, 26(1):55--69, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. T. Ball and S. K. Rajamani. Automatically validating temporal safety properties of interfaces. In SPIN '01: Proc. of the 8th International SPIN Workshop on Model Checking of Software, pages 103--122. Springer-Verlag New York, Inc., 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. E. Cook and A. L. Wolf. Discovering models of software processes from event-based data. ACM Transactions on Software Engineering and Methodology, 7(3):215--249, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. V. Dallmeier, C. Lindig, A. Wasylkowski, and A. Zeller. Mining object behavior with ADABU. In WODA '06: Proc. of the Fourth International Workshop on Dynamic Analysis, pages 17--24. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. V. Dallmeier, C. Lindig, and A. Zeller. Lightweight defect localization for Java. In A. Black, editor, ECOOP '05: European Conference on Object-Oriented Programming, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. DeLine and M. Fahndrich. Typestates for objects. In M. Odersky, editor, ECOOP '04: European Conference on Object-Oriented Programming, volume 3086 of Lecture Notes in Computer Science. Springer, 2004.Google ScholarGoogle Scholar
  10. W. Dickinson, D. Leon, and A. Podgurski. Finding failures by cluster analysis of execution profiles. In ICSE '01: Proc. of the 23rd International Conference on Software Engineering, pages 339--348. IEEE Computer Society, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. T. Eisenbarth, R. Koschke, and G. Vogel. Static object trace extraction for programs with pointers. Journal of Systems and Software, 77(3):263--284, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. Engler, D. Y. Chen, S. Hallem, A. Chou, and B. Chelf. Bugs as deviant behavior: a general approach to inferring errors in systems code. In SOSP '01: Proc. of the 18th ACM Symposium on Operating Systems Principles, pages 57--72. ACM Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. Fink, E. Yahav, N. Dor, G. Ramalingam, and E. Geay. Effective typestate verification in the presence of aliasing. In ISSTA '06: Proc. of the International Symposium on Software Testing and Analysis, pages 133--144. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Fowler. Refactoring. Improving the design of existing code. Addison-Wesley, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J. Han and M. Kamber. Data mining: concepts and techniques. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, second edition, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. T. A. Henzinger, R. Jhala, and R. Majumdar. Permissive interfaces. In Wermelinger and Gall {32}, pages 31--40. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. Hovemeyer and W. Pugh. Finding bugs is easy. SIGPLAN Notices, 39(12):92--106, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. S. Kim, K. Pan, and J. E. E. James Whitehead. Memories of bug fixes. In FSE-14: Proc. of the 14th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pages 35--45. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Z. Li and Y. Zhou. PR-Miner: automatically extracting implicit programming rules and detecting violations in large software code. In Wermelinger and Gall {32}, pages 306--315. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. Lindig. Mining patterns and violations using concept analysis. Technical report, Saarland University, Software Engineering Chair, Germany, June 2007. Avaliable from http://www.st.cs.uni-sb.de/publications/; the software is available from http://code.google.com/p/colibri-ml/.Google ScholarGoogle Scholar
  21. C. Liu, E. Ye, and D. J. Richardson. LtRules: an automated software library usage rule extraction tool. In ICSE '06: Proc. of the 28th International Conference on Software Engineering (tool demonstrations), pages 823--826. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. B. Livshits and T. Zimmermann. DynaMine: finding common error patterns by mining software revision histories. In Wermelinger and Gall {32}, pages 296--305. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. Lorenzoli, L. Mariani, and M. Pezze. Inferring state-based behavior models. In WODA '06: Proc. of the Fourth International Workshop on Dynamic Analysis, pages 25--32. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. D. Mandelin, L. Xu, R. Bodík, and D. Kimelman. Jungloid mining: helping to navigate the API jungle. In PLDI '05: Proc. of the ACM SIGPLAN 2005 Conference on Programming Language Design and Implementation, pages 48--61. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. O. Nierstrasz. Regular types for active objects. In OOPSLA '93: Proc. of the 8th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 1--15. ACM Press, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J. Quante and R. Koschke. Dynamic object process graphs. In CSMR '06: Proc. of the 10th European Conference on Software Maintenance and Reengineering, pages 81--90. IEEE Computer Society, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. K. Ramanathan, A. Grama, and S. Jagannathan. Path-sensitive inference of function precedence protocols. In ICSE '07: Proc. of the 29th International Conference on Software Engineering, pages 240--250. IEEE Computer Society, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. S. P. Reiss. Specifying and checking component usage. In AADEBUG '05: Proc. of the Sixth International Symposium on Automated and Analysis-Driven Debugging, pages 13--22. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. N. Sahavechaphan and K. Claypool. XSnippet: mining for sample code. In OOPSLA '06: Proc. of the 21st Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 413--430. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. R. E. Strom and S. Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Transactions on Software Engineering, 12(1):157--171, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. W. Weimer and G. C. Necula. Mining temporal specifications for error detection. In N. Halbwachs and L. D. Zuck, editors, TACAS '05: Proc. of the 12th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pages 461--476, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. Wermelinger and H. Gall, editors. Proc. of the 10th European Software Engineering Conference held jointly with 13th ACM SIGSOFT International Symposium on Foundations of Software Engineering, 2005, Lisbon, Portugal, September 5-9, 2005. ACM Press, 2005. Google ScholarGoogle Scholar
  33. C. C. Williams and J. K. Hollingsworth. Recovering system specific rules from software repositories. In MSR '05: Proc. of the 2005 International Workshop on Mining Software Repositories, pages 1--5. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. T. Xie, E. Martin, and H. Yuan. Automatic extraction of abstract-object-state machines from unit-test executions. In ICSE '06: Proc. of the 28th International Conference on Software Engineering, pages 835--838. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. T. Xie and J. Pei. MAPO: mining API usages from open source repositories. In MSR '06: Proc. of the 2006 International Workshop on Mining Software Repositories, pages 54--57. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. J. Yang, D. Evans, D. Bhardwaj, T. Bhat, and M. Das. Perracotta: mining temporal API rules from imperfect traces. In ICSE '06: Proc. the 28th International Conference on Software Engineering, pages 282--291. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. D. M. Yellin and R. E. Strom. Protocol specifications and component adaptors. ACM Transactions on Programming Languages and Systems, 19(2):292--333, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Detecting object usage anomalies

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader