Nothing Special   »   [go: up one dir, main page]

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

Detecting object usage anomalies

Published: 07 September 2007 Publication 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.
[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.
[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.
[4]
S. Antoy and D. Hamlet. Automatically checking an implementation against its formal specification. IEEE Transactions on Software Engineering, 26(1):55--69, 2000.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[14]
M. Fowler. Refactoring. Improving the design of existing code. Addison-Wesley, 1999.
[15]
J. Han and M. Kamber. Data mining: concepts and techniques. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, second edition, 2006.
[16]
T. A. Henzinger, R. Jhala, and R. Majumdar. Permissive interfaces. In Wermelinger and Gall {32}, pages 31--40.
[17]
D. Hovemeyer and W. Pugh. Finding bugs is easy. SIGPLAN Notices, 39(12):92--106, 2004.
[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.
[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.
[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/.
[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.
[22]
B. Livshits and T. Zimmermann. DynaMine: finding common error patterns by mining software revision histories. In Wermelinger and Gall {32}, pages 296--305.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.

Cited By

View all
  • (2024)An Empirical Study of API Misuses of Data-Centric LibrariesProceedings of the 18th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement10.1145/3674805.3686685(245-256)Online publication date: 24-Oct-2024
  • (2024)API Misuse Detection via Probabilistic Graphical ModelProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3652112(88-99)Online publication date: 11-Sep-2024
  • (2024)Boosting API Misuse Detection via Integrating API Constraints from Multiple SourcesProceedings of the 21st International Conference on Mining Software Repositories10.1145/3643991.3644904(14-26)Online publication date: 15-Apr-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ESEC-FSE '07: Proceedings of the the 6th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering
September 2007
638 pages
ISBN:9781595938114
DOI:10.1145/1287624
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: 07 September 2007

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. automated defect detection
  2. automated specification generation
  3. data mining for software engineering
  4. object usage anomalies
  5. pattern recognition
  6. programming rules
  7. static analysis

Qualifiers

  • Article

Conference

ESEC/FSE07
Sponsor:

Acceptance Rates

Overall Acceptance Rate 112 of 543 submissions, 21%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)19
  • Downloads (Last 6 weeks)2
Reflects downloads up to 18 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)An Empirical Study of API Misuses of Data-Centric LibrariesProceedings of the 18th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement10.1145/3674805.3686685(245-256)Online publication date: 24-Oct-2024
  • (2024)API Misuse Detection via Probabilistic Graphical ModelProceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3650212.3652112(88-99)Online publication date: 11-Sep-2024
  • (2024)Boosting API Misuse Detection via Integrating API Constraints from Multiple SourcesProceedings of the 21st International Conference on Mining Software Repositories10.1145/3643991.3644904(14-26)Online publication date: 15-Apr-2024
  • (2024)Data-Driven Evidence-Based Syntactic Sugar DesignProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639580(1-12)Online publication date: 20-May-2024
  • (2024)Scaling Code Pattern Inference with Interactive What-If AnalysisProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639193(1-12)Online publication date: 20-May-2024
  • (2024)API usage templates via structural generalizationJournal of Systems and Software10.1016/j.jss.2024.111974210:COnline publication date: 1-Apr-2024
  • (2023)Natural Language Generation and Understanding of Big Code for AI-Assisted Programming: A ReviewEntropy10.3390/e2506088825:6(888)Online publication date: 1-Jun-2023
  • (2023)Detecting Condition-Related Bugs with Control Flow Graph Neural NetworkProceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3597926.3598142(1370-1382)Online publication date: 12-Jul-2023
  • (2023)Code-line-level Bugginess Identification: How Far have We Come, and How Far have We Yet to Go?ACM Transactions on Software Engineering and Methodology10.1145/358257232:4(1-55)Online publication date: 27-May-2023
  • (2023)Client-Specific Upgrade Compatibility Checking via Knowledge-Guided DiscoveryACM Transactions on Software Engineering and Methodology10.1145/358256932:4(1-31)Online publication date: 26-May-2023
  • Show More Cited By

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