• DocumentCode
    555289
  • Title

    Taming reflection: Aiding static analysis in the presence of reflection and custom class loaders

  • Author

    Bodden, Eric ; Sewe, Andreas ; Sinschek, Jan ; Oueslati, Hela ; Mezini, Mira

  • Author_Institution
    Software Technol. Group, Tech. Univ. Darmstadt, Darmstadt, Germany
  • fYear
    2011
  • fDate
    21-28 May 2011
  • Firstpage
    241
  • Lastpage
    250
  • Abstract
    Static program analyses and transformations for Java face many problems when analyzing programs that use reflection or custom class loaders: How can a static analysis know which reflective calls the program will execute? How can it get hold of classes that the program loads from remote locations or even generates on the fly? And if the analysis transforms classes, how can these classes be re-inserted into a program that uses custom class loaders? In this paper, we present TamiFlex, a tool chain that offers a partial but often effective solution to these problems. With TamiFlex, programmers can use existing static-analysis tools to produce results that are sound at least with respect to a set of recorded program runs. TamiFlex inserts runtime checks into the program that warn the user in case the program executes reflective calls that the analysis did not take into account. TamiFlex further allows programmers to re-insert offline-transformed classes into a program. We evaluate TamiFlex in two scenarios: benchmarking with the DaCapo benchmark suite and analysing large-scale interactive applications. For the latter, TamiFlex significantly improves code coverage of the static analyses, while for the former our approach even appears complete: the inserted runtime checks issue no warning. Hence, for the first time, TamiFlex enables sound static whole-program analyses on DaCapo. During this process, TamiFlex usually incurs less than 10% runtime overhead.
  • Keywords
    Java; program diagnostics; software tools; DaCapo benchmark suite; Java; TamiFlex; code coverage; custom class loaders; large-scale interactive application analysis; offline-transformed classes; reflective calls; runtime check; static program analysis; static-analysis tool; taming reflection; tool chain; Benchmark testing; Heuristic algorithms; Instruments; Java; Runtime; Transforms; Virtual machining; dynamic class loaders; dynamic class loading; native code; reflection; static analysis; tracing;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Software Engineering (ICSE), 2011 33rd International Conference on
  • Conference_Location
    Honolulu, HI
  • ISSN
    0270-5257
  • Print_ISBN
    978-1-4503-0445-0
  • Electronic_ISBN
    0270-5257
  • Type

    conf

  • DOI
    10.1145/1985793.1985827
  • Filename
    6032463