skip to main content
10.1145/3377811.3380343acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article
Public Access
Artifacts Available / v1.1

Tailoring programs for static analysis via program transformation

Published:01 October 2020Publication History

ABSTRACT

Static analysis is a proven technique for catching bugs during software development. However, analysis tooling must approximate, both theoretically and in the interest of practicality. False positives are a pervading manifestation of such approximations---tool configuration and customization is therefore crucial for usability and directing analysis behavior. To suppress false positives, developers readily disable bug checks or insert comments that suppress spurious bug reports. Existing work shows that these mechanisms fall short of developer needs and present a significant pain point for using or adopting analyses. We draw on the insight that an analysis user always has one notable ability to influence analysis behavior regardless of analyzer options and implementation: modifying their program. We present a new technique for automated, generic, and temporary code changes that tailor to suppress spurious analysis errors. We adopt a rule-based approach where simple, declarative templates describe general syntactic changes for code patterns that are known to be problematic for the analyzer. Our technique promotes program transformation as a general primitive for improving the fidelity of analysis reports (we treat any given analyzer as a black box). We evaluate using five different static analyzers supporting three different languages (C, Java, and PHP) on large, real world programs (up to 800KLOC). We show that our approach is effective in sidestepping long-standing and complex issues in analysis implementations.

References

  1. 2019. Clang Static Analyzer. https://clang-analyzer.llvm.org/.Google ScholarGoogle Scholar
  2. 2019. CodeSonar. https://www.grammatech.com/products/codesonar.Google ScholarGoogle Scholar
  3. 2019. Coverity: suppressing asserts. https://community.synopsys.com/s/question/0D534000046YuzbCAC.Google ScholarGoogle Scholar
  4. 2019. Error Prone: Patching. https://errorprone.info/docs/patching.Google ScholarGoogle Scholar
  5. 2019. Infer. https://github.com/facebook/infer.Google ScholarGoogle Scholar
  6. 2019. NullAway: auto-suppressing. https://github.com/uber/NullAway/wiki/Suppressing-Warnings#auto-suppressing.Google ScholarGoogle Scholar
  7. 2019. PHPStan. https://github.com/phpstan/phpstan.Google ScholarGoogle Scholar
  8. 2019. Spotbugs. https://github.com/spotbugs/spotbugs.Google ScholarGoogle Scholar
  9. Cristiano Calcagno, Dino Distefano, Jérémy Dubreil, Dominik Gabi, Pieter Hooimeijer, Martino Luca, Peter W. O'Hearn, Irene Papakonstantinou, Jim Purbrick, and Dulma Rodriguez. 2015. Moving Fast with Software Verification. In NASA Formal Methods (NFM '15). 3--11.Google ScholarGoogle Scholar
  10. Maria Christakis and Christian Bird. 2016. What Developers Want and Need from Program Analysis: An Empirical Study. In International Conference on Automated Software Engineering (ASE '16). 332--343.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Maria Christakis, Peter Müller, and Valentin Wüstholz. 2015. An Experimental Evaluation of Deliberate Unsoundness in a Static Program Analyzer. In Verification, Model Checking, and Abstract Interpretation (VMCAI '15). 336--354.Google ScholarGoogle Scholar
  12. J. Robert M. Cornish, Graeme Gange, Jorge A. Navas, Peter Schachte, Harald Søndergaard, and Peter J. Stuckey. 2014. Analyzing Array Manipulating Programs by Program Transformation. In Logic-Based Program Synthesis and Transformation (LOPSTR '14). 3--20.Google ScholarGoogle Scholar
  13. Patrick Cousot and Radhia Cousot. 2002. Systematic Design of Program Transformation Frameworks by Abstract Interpretation. In Symposium on Principles of Programming Languages (POPL '02). 178--190.Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Pascal Cuoq, Benjamin Monate, Anne Pacalet, Virgile Prevosto, John Regehr, Boris Yakobowski, and Xuejun Yang. 2012. Testing Static Analyzers with Randomly Generated Programs. In NASA Formal Methods (NFM '12). 120--125.Google ScholarGoogle Scholar
  15. Alastair F. Donaldson, Hugues Evrard, Andrei Lascu, and Paul Thomson. 2017. Automated testing of graphics shader compilers. PACMPL 1, OOPSLA (2017), 93:1--93:29.Google ScholarGoogle Scholar
  16. Pär Emanuelsson and Ulf Nilsson. 2008. A Comparative Study of Industrial Static Analysis Tools. Electr. Notes Theor. Comput. Sci. 217 (2008), 5--21.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Nikos Gorogiannis, Peter W. O'Hearn, and Ilya Sergey. 2019. A true positives theorem for a static race detector. PACMPL 3, POPL (2019), 57:1--57:29.Google ScholarGoogle Scholar
  18. Mark Harman. 2018. We Need a Testability Transformation Semantics. In Software Engineering and Formal Methods (SEFM '18). 3--17.Google ScholarGoogle ScholarCross RefCross Ref
  19. Mark Harman, Lin Hu, Robert M. Hierons, Joachim Wegener, Harmen Sthamer, André Baresel, and Marc Roper. 2004. Testability Transformation. IEEE Trans. Software Eng. 30, 1 (2004), 3--16.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Ciera Jaspan, I-Chin Chen, and Anoop Sharma. 2007. Understanding the Value of Program Analysis Tools. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '07). 963--970.Google ScholarGoogle Scholar
  21. Brittany Johnson, Yoonki Song, Emerson R. Murphy-Hill, and Robert W. Bowdidge. 2013. Why Don't Software Developers use Static Analysis Tools to Find Bugs?. In International Conference on Software Engineering, 2013 ('13). 672--681.Google ScholarGoogle Scholar
  22. William Landi. 1992. Undecidability of Static Analysis. ACM Letters on Programming Languages and Systems 1, 4 (dec 1992), 323--337.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Chris Lattner and Vikram S. Adve. 2004. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In Code Generation and Optimization (CGO '04). 75--88.Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Julia Lawall and Gilles Muller. 2018. Coccinelle: 10 Years of Automated Evolution in the Linux Kernel. In USENIX Annual Technical Conference. 601--614.Google ScholarGoogle Scholar
  25. Benjamin Livshits, Manu Sridharan, Yannis Smaragdakis, Ondrej Lhoták, José Nelson Amaral, Bor-Yuh Evan Chang, Samuel Z. Guyer, Uday P. Khedker, Anders Møller, and Dimitrios Vardoulakis. 2015. In Defense of Soundiness: A Manifesto. Commun. ACM 58, 2 (2015), 44--46.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Francesco Logozzo and Manuel Fähndrich. 2008. On the Relative Completeness of Bytecode Analysis Versus Source Code Analysis. In Compiler Construction (CC '08). 197--212.Google ScholarGoogle Scholar
  27. Eduardus A. T. Merks, J. Michael Dyck, and Robert D. Cameron. 1992. Language Design For Program Manipulation. IEEE Trans. Software Eng. 18, 1 (1992), 19--32.Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Kedar S. Namjoshi and Zvonimir Pavlinovic. 2018. The Impact of Program Transformations on Static Program Analysis. In International Symposium on Static Analysis (SAS '18). 306--325.Google ScholarGoogle Scholar
  29. Hui Peng, Yan Shoshitaishvili, and Mathias Payer. 2018. T-Fuzz: Fuzzing by Program Transformation. In IEEE Symposium on Security and Privacy.Google ScholarGoogle ScholarCross RefCross Ref
  30. Martin C Rinard, Cristian Cadar, Daniel Dumitran, Daniel M Roy, Tudor Leu, and William S Beebee. 2004. Enhancing Server Availability and Security Through Failure-Oblivious Computing.. In OSDI, Vol. 4. 21--21.Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Caitlin Sadowski, Edward Aftandilian, Alex Eagle, Liam Miller-Cushon, and Ciera Jaspan. 2018. Lessons from Building Static Analysis Tools at Google. Commun. ACM 61, 4 (2018), 58--66.Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Rijnard van Tonder, John Kotheimer, and Claire Le Goues. 2018. Semantic Crash Bucketing. In International Conference on Automated Software Engineering (ASE '18). 612--622.Google ScholarGoogle Scholar
  33. Rijnard van Tonder and Claire Le Goues. 2018. Static Automated Program Repair for Heap Properties. In International Conference on Software Engineerinng (ICSE '18). 151--162.Google ScholarGoogle Scholar
  34. Rijnard van Tonder and Claire Le Goues. 2019. Lightweight Multi-Language Syntax Transformation with Parser Parser Combinators. In Conference on Programming language Design and Implementation (PLDI '19).Google ScholarGoogle Scholar
  35. Louis Wasserman. 2013. Scalable, Example-based Refactorings with Refaster. In Workshop on Refactoring Tools (WRT@SPLASH '13). 25--28.Google ScholarGoogle Scholar
  36. Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. 2011. Finding and Understanding Bugs in C Compilers. In Conference on Programming Language Design and Implementation (PLDI '11). 283--294.Google ScholarGoogle Scholar
  1. Tailoring programs for static analysis via program transformation

    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
    • Published in

      cover image ACM Conferences
      ICSE '20: Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering
      June 2020
      1640 pages
      ISBN:9781450371216
      DOI:10.1145/3377811

      Copyright © 2020 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 the author(s) 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: 1 October 2020

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate276of1,856submissions,15%

      Upcoming Conference

      ICSE 2025

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader