skip to main content
research-article

Enabling static analysis for partial java programs

Published:19 October 2008Publication History
Skip Abstract Section

Abstract

Software engineering tools often deal with the source code of programs retrieved from the web or source code repositories. Typically, these tools only have access to a subset of a program's source code (one file or a subset of files) which makes it difficult to build a complete and typed intermediate representation (IR). Indeed, for incomplete object-oriented programs, it is not always possible to completely disambiguate the syntactic constructs and to recover the declared type of certain expressions because the declaration of many types and class members are not accessible.

We present a framework that performs partial type inference and uses heuristics to recover the declared type of expressions and resolve ambiguities in partial Java programs. Our framework produces a complete and typed IR suitable for further static analysis. We have implemented this framework and used it in an empirical study on four large open source systems which shows that our system recovers most declared types with a low error rate, even when only one class is accessible.

References

  1. JFreeChart. http://www.object-refinery.com/jfreechart/.Google ScholarGoogle Scholar
  2. Jython. http://www.jython.org.Google ScholarGoogle Scholar
  3. Lucene. http://lucene.apache.org.Google ScholarGoogle Scholar
  4. Spring Framework. http://www.springframework.org.Google ScholarGoogle Scholar
  5. Nathaniel Ayewah, William Pugh, J. David Morgenthaler, John Penix, and YuQian Zhou. Using findbugs on production software. In OOPSLA '07: Companion to the 22nd ACM SIGPLAN conference on Object oriented programming systems and applications companion, pages 805--806, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Rolf Bahlke and Gregor Snelting. The PSG system: from formal language definitions to interactive programming environments. ACM Trans. Program. Lang. Syst., 8(4):547--576, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Nicolas Bettenburg, Rahul Premraj, and Thomas Zimmermann. Extracting structural information from bug reports. In MSR '08: Proceedings of the 2008 international workshop on Mining software repositories, pages 27--30, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Barthelemy Dagenais and Martin P. Robillard. Recommending adaptive changes for framework evolution. In ICSE '08: Proceedings of the 30th International Conference on Software Engineering, pages 481--490, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Evelyn Duesterwald, Rajiv Gupta, and Mary Lou Soffa. A practical framework for demand-driven interprocedural data flow analysis. ACM Trans. Program. Lang. Syst., 19(6):992--1030, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Etienne Gagnon, Laurie J. Hendren, and Guillaume Marceau. Efficient inference of static types for java bytecode. In Static Analysis Symposium, pages 199--219, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Rajiv Gupta and Mary Lou Soffa. A framework for partial data flow analysis. In ICSM '94: Proceedings of the International Conference on Software Maintenance, pages 4--13, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Gregory Knapen, Bruno Lague, Michel Dagenais, and Ettore Merlo. Parsing C++ Despite Missing Declarations. In IWPC '99: Proceedings of the 7th International Workshop on Program Comprehension, page 114, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Rainer Koppler. A systematic approach to fuzzy parsing. Softw. Pract. Exper., 27(6):637--649, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Leon Moonen. Generating robust parsers using island grammars. In WCRE '01: Proceedings of the Eighth Working Conference on Reverse Engineering, page 13, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Nathaniel Nystrom, Michael R. Clarkson, and Andrew C. Myers. Polyglot: An extensible compiler framework for java. In Proc. of the 12th International Conference on Compiler Construction, pages 138--152, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Atanas Rountev, Ana Milanova, and Barbara G. Ryder. Fragment class analysis for testing of polymorphism in java software. IEEE Transactions on Software Engineering, 30(6):372--387, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Atanas Rountev, Barbara G. Ryder, and William Landi. Dataflow analysis of program fragments. In ESEC/FSE-7: Proceedings of the 7th European Software Engineering Conference held jointly with the 7th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pages 235--252, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Stephen M. Blackburn et al. The dacapo benchmarks: java benchmarking development and analysis. In OOPSLA '06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, pages 169--190, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Suresh Thummalapenta and Tao Xie. Parseweb: a programmer assistant for reusing open source code on the web. In ASE '07: Proceedings of the twenty-second IEEE/ACM international conference on Automated software engineering, pages 204--213, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Raja Vallee-Rai, Phong Co, Etienne Gagnon, Laurie Hendren, Patrick Lam, and Vijay Sundaresan. Soot -- a Java bytecode optimization framework. In CASCON '99: Proceedings of the 1999 conference of the Centre for Advanced Studies on Collaborative research, page 13. IBM Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Wei Zhao, Lu Zhang, Yin Liu, Jiasu Sun, and Fuqing Yang. Sniafl: Towards a static noninteractive approach to feature location. ACM Trans. Softw. Eng. Methodol., 15(2):195--226, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Thomas Zimmermann, PeterWeissgerber, Stephan Diehl, and Andreas Zeller. Mining version histories to guide software changes. IEEE Transactions on Software Engineering, 31(6):429--445, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Enabling static analysis for partial java programs

    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

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 43, Issue 10
      September 2008
      613 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1449955
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications
        October 2008
        654 pages
        ISBN:9781605582153
        DOI:10.1145/1449764

      Copyright © 2008 ACM

      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]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 19 October 2008

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader