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

skip to main content
10.1145/2001420.2001448acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Detecting anomalies in the order of equally-typed method arguments

Published: 17 July 2011 Publication History

Abstract

In statically-typed programming languages, the compiler ensures that method arguments are passed in the expected order by checking the type of each argument. However, calls to methods with multiple equally-typed parameters slip through this check. The uncertainty about the correct argument order of equally-typed arguments can cause various problems, for example, if a programmer accidentally reverses two arguments. We present an automated, static program analysis that detects such problems without any input except for the source code of a program. The analysis leverages the observation that programmer-given identifier names convey information about the semantics of arguments, which can be used to assign equally-typed arguments to their expected position. We evaluate the approach with a large corpus of Java programs and show that our analysis finds relevant anomalies with a precision of 76%.

References

[1]
https://issues.apache.org/jira/browse/HADOOP-4732.
[2]
http://issues.liferay.com/browse/LPS-3890.
[3]
JBoss SVN repository. Revisions 58536, 58764, and 60357.
[4]
JikesRVM SVN repository. Revisions 10263 and 13935.
[5]
G. Ammons, R. Bodík, and J. R. Larus. Mining specifications. In Symposium on Principles of Programming Languages (POPL), pages 4--16. ACM, 2002.
[6]
S. M. Blackburn, R. Garner, C. Hoffmann, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. L. Hosking, M. Jump, H. B. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanovic, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 169--190. ACM, 2006.
[7]
S. Butler, M. Wermelinger, Y. Yu, and H. Sharp. Relating identifier naming flaws and code quality: An empirical study. In Working Conference on Reverse Engineering (WCRE), pages 31--35. IEEE, 2009.
[8]
R.-Y. Chang, A. Podgurski, and J. Yang. Finding what's not there: a new approach to revealing neglected conditions in software. In International Symposium on Software Testing and Analysis (ISSTA), pages 163--173. ACM, 2007.
[9]
W. W. Cohen, P. D. Ravikumar, and S. E. Fienberg. A comparison of string distance metrics for name-matching tasks. In Workshop on Information Integration on the Web (IIWeb), pages 73--78, 2003.
[10]
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 Symposium on Operating Systems Principles (SOSP), pages 57--72. ACM, 2001.
[11]
M. D. Ernst, J. Cockrell, W. G. Griswold, and D. Notkin. Dynamically discovering likely program invariants to support program evolution. IEEE Transactions on Software Engineering, 27(2):213--224, 2001.
[12]
M. Erwig and M. M. Burnett. Adding apples and oranges. In Symposium on Practical Aspects of Declarative Languages (PADL), pages 173--191. Springer, 2002.
[13]
M. Gabel and Z. Su. Javert: Fully automatic mining of general temporal properties from dynamic traces. In Symposium on Foundations of Software Engineering (FSE), pages 339--349. ACM, 2008.
[14]
D. Greenfieldboyce and J. S. Foster. Type qualifier inference for Java. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 321--336. ACM, 2007.
[15]
P. J. Guo, J. H. Perkins, S. McCamant, and M. D. Ernst. Dynamic inference of abstract types. In International Symposium on Software Testing and Analysis (ISSTA), pages 255--265. ACM, 2006.
[16]
S. Hangal and M. S. Lam. Tracking down software bugs using automatic anomaly detection. In International Conference on Software Engineering (ICSE), pages 291--301. ACM, 2002.
[17]
S. Hangal and M. S. Lam. Automatic dimension inference and checking for object-oriented programs. In International Conference on Software Engineering (ICSE), pages 155--165. IEEE, 2009.
[18]
J. Henkel, C. Reichenbach, and A. Diwan. Discovering documentation for Java container classes. IEEE Transactions on Software Engineering, 33(8):526--543, 2007.
[19]
E. W. Høst and B. M. Østvold. Debugging method names. In European Conference on Object-Oriented Programming (ECOOP), pages 294--317. Springer, 2009.
[20]
D. Hovemeyer and W. Pugh. Finding bugs is easy. In Companion to the Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 132--136. ACM, 2004.
[21]
J. L. Lawall and D. Lo. An automated approach for finding variable-constant pairing bugs. In International Conference on Automated Software Engineering (ASE), pages 103--112. ACM, 2010.
[22]
D. Lawrie, C. Morrell, H. Feild, and D. Binkley. What's in a name? A study of identifiers. In International Conference on Program Comprehension (ICPC), pages 3--12. IEEE, 2006.
[23]
Z. Li and Y. Zhou. PR-Miner: Automatically extracting implicit programming rules and detecting violations in large software code. In European Software Engineering Conference and Symposium on Foundations of Software Engineering (ESEC/FSE), pages 306--315. ACM, 2005.
[24]
D. Lo and S.-C. Khoo. SMArTIC: Towards building an accurate, robust and scalable specification miner. In Symposium on Foundations of Software Engineering (FSE), pages 265--275. ACM, 2006.
[25]
S. Lu, S. Park, C. Hu, X. Ma, W. Jiang, Z. Li, R. A. Popa, and Y. Zhou. MUVI: Automatically inferring multi-variable access correlations and detecting related semantic and concurrency bugs. In Symposium on Operating Systems Principles (SOSP), pages 103--116. ACM, 2007.
[26]
M. Monperrus, M. Bruch, and M. Mezini. Detecting missing method calls in object-oriented software. In European Conference on Object-Oriented Programming (ECOOP), pages 2--25. Springer, 2010.
[27]
T. T. Nguyen, H. A. Nguyen, N. H. Pham, J. M. Al-Kofahi, and T. N. Nguyen. Graph-based mining of multiple object usage patterns. In European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE), pages 383--392. ACM, 2009.
[28]
M. Pradel, P. Bichsel, and T. R. Gross. A framework for the evaluation of specification miners based on finite state machines. In International Conference on Software Maintenance (ICSM), pages 1--10. IEEE, 2010.
[29]
M. Pradel and T. R. Gross. Automatic generation of object usage specifications from large method traces. In International Conference on Automated Software Engineering (ASE), pages 371--382. IEEE, 2009.
[30]
S. Shoham, E. Yahav, S. Fink, and M. Pistoia. Static specification mining using automata-based abstractions. In International Symposium on Software Testing and Analysis (ISSTA), pages 174--184. ACM, 2007.
[31]
S. Thummalapenta and T. Xie. Alattin: Mining alternative patterns for detecting neglected conditions. In International Conference on Automated Software Engineering (ASE), pages 283--294. IEEE, 2009.
[32]
S. Thummalapenta and T. Xie. Mining exception-handling rules as sequence association rules. In International Conference on Software Engineering (ICSE), pages 496--506. IEEE, 2009.
[33]
A. Wasylkowski and A. Zeller. Mining temporal specifications from object usage. In International Conference on Automated Software Engineering (ASE), pages 295--306. IEEE, 2009.
[34]
A. Wasylkowski, A. Zeller, and C. Lindig. Detecting object usage anomalies. In European Software Engineering Conference and Symposium on Foundations of Software Engineering (ESEC/FSE), pages 35--44. ACM, 2007.
[35]
J. Whaley, M. C. Martin, and M. S. Lam. Automatic extraction of object-oriented component interfaces. In Symposium on Software Testing and Analysis (ISSTA), pages 218--228. ACM, 2002.

Cited By

View all
  • (2023)Automatic Static Vulnerability Detection for Machine Learning Libraries: Are We There Yet?2023 IEEE 34th International Symposium on Software Reliability Engineering (ISSRE)10.1109/ISSRE59848.2023.00042(795-806)Online publication date: 9-Oct-2023
  • (2023)Rete: Learning Namespace Representation for Program Repair2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)10.1109/ICSE48619.2023.00112(1264-1276)Online publication date: May-2023
  • (2022)VarCLRProceedings of the 44th International Conference on Software Engineering10.1145/3510003.3510162(2327-2339)Online publication date: 21-May-2022
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ISSTA '11: Proceedings of the 2011 International Symposium on Software Testing and Analysis
July 2011
394 pages
ISBN:9781450305624
DOI:10.1145/2001420
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

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 17 July 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. anomaly detection
  2. automated program analysis
  3. maintenance
  4. method arguments
  5. static analysis

Qualifiers

  • Research-article

Funding Sources

Conference

ISSTA '11
Sponsor:

Acceptance Rates

Overall Acceptance Rate 58 of 213 submissions, 27%

Upcoming Conference

ISSTA '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

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

Other Metrics

Citations

Cited By

View all
  • (2023)Automatic Static Vulnerability Detection for Machine Learning Libraries: Are We There Yet?2023 IEEE 34th International Symposium on Software Reliability Engineering (ISSRE)10.1109/ISSRE59848.2023.00042(795-806)Online publication date: 9-Oct-2023
  • (2023)Rete: Learning Namespace Representation for Program Repair2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)10.1109/ICSE48619.2023.00112(1264-1276)Online publication date: May-2023
  • (2022)VarCLRProceedings of the 44th International Conference on Software Engineering10.1145/3510003.3510162(2327-2339)Online publication date: 21-May-2022
  • (2022)Heuristic and Neural Network Based Prediction of Project-Specific API Member AccessIEEE Transactions on Software Engineering10.1109/TSE.2020.301779448:4(1249-1267)Online publication date: 1-Apr-2022
  • (2022)A controlled experiment of different code representations for learning-based program repairEmpirical Software Engineering10.1007/s10664-022-10223-527:7Online publication date: 1-Dec-2022
  • (2021)Learning to find naming issues with big code and small supervisionProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454045(296-311)Online publication date: 19-Jun-2021
  • (2021)IdBenchProceedings of the 43rd International Conference on Software Engineering10.1109/ICSE43902.2021.00059(562-573)Online publication date: 22-May-2021
  • (2021)Practical heuristics to improve precision for erroneous function argument swapping detection in C and C++Journal of Systems and Software10.1016/j.jss.2021.111048181:COnline publication date: 1-Nov-2021
  • (2021)Identifying change patterns of API misuses from code changesScience China Information Sciences10.1007/s11432-019-2745-564:3Online publication date: 7-Feb-2021
  • (2020)The Role of Implicit Conversions in Erroneous Function Argument Swapping in C++2020 IEEE 20th International Working Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM51674.2020.00028(203-214)Online publication date: Sep-2020
  • 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