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.
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- S. Antoy and D. Hamlet. Automatically checking an implementation against its formal specification. IEEE Transactions on Software Engineering, 26(1):55--69, 2000. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- M. Fowler. Refactoring. Improving the design of existing code. Addison-Wesley, 1999. Google ScholarDigital Library
- J. Han and M. Kamber. Data mining: concepts and techniques. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, second edition, 2006. Google ScholarDigital Library
- T. A. Henzinger, R. Jhala, and R. Majumdar. Permissive interfaces. In Wermelinger and Gall {32}, pages 31--40. Google ScholarDigital Library
- D. Hovemeyer and W. Pugh. Finding bugs is easy. SIGPLAN Notices, 39(12):92--106, 2004. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- B. Livshits and T. Zimmermann. DynaMine: finding common error patterns by mining software revision histories. In Wermelinger and Gall {32}, pages 296--305. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
Index Terms
- Detecting object usage anomalies
Recommendations
PR-Miner: automatically extracting implicit programming rules and detecting violations in large software code
Programs usually follow many implicit programming rules, most of which are too tedious to be documented by programmers. When these rules are violated by programmers who are unaware of or forget about them, defects can be easily introduced. Therefore, it ...
PR-Miner: automatically extracting implicit programming rules and detecting violations in large software code
ESEC/FSE-13: Proceedings of the 10th European software engineering conference held jointly with 13th ACM SIGSOFT international symposium on Foundations of software engineeringPrograms usually follow many implicit programming rules, most of which are too tedious to be documented by programmers. When these rules are violated by programmers who are unaware of or forget about them, defects can be easily introduced. Therefore, it ...
Automatically detecting architecturally-relevant code anomalies
RSSE '12: Proceedings of the Third International Workshop on Recommendation Systems for Software EngineeringSoftware architecture degradation is a long-standing problem in software engineering. Previous studies have shown that certain code anomalies - or patterns of code anomalies - are likely to be harmful to architecture design, although their ...
Comments