skip to main content
10.1145/3439961.3439985acmotherconferencesArticle/Chapter ViewAbstractPublication PagessbqsConference Proceedingsconference-collections
research-article

Towards Practical Reuse of Custom Static Analysis Rules for Defect Localization

Authors Info & Claims
Published:06 March 2021Publication History

ABSTRACT

[Context] Several static analysis tools allow the development of custom rules for locating application-specific defects. Although this feature is powerful and commonly available, it is not well explored in practice. Custom static analysis rules can check design and policies that are shared between applications, allowing the reuse of rules. However, the benefits, scope, and concerns that software engineers should have on reusing custom static analysis rules are unknown. [Goal] In this preliminary study, we investigate the reuse of custom static analysis rules produced by applying Pattern-Driven Maintenance (PDM). PDM is a method to locate defect patterns in web applications that produces custom static analysis rules as output. [Method] We selected a set of rules produced by a previous usage of the PDM method and applied them to other three applications in two contexts, within the same company where the rules were produced, and in other companies. [Results] We successfully reused some rules in both scenarios with minor adjustments, finding new defects to be fixed. The reuse of rules could discard from 58-90% of source code locations found by a naive search for the defects, reducing verification effort. However, the reused rules need adjustments to improve precision for defect localization, as precision ranged from 40-75%. Finally, we identified factors that have an impact on reusing custom rules. [Conclusions] We put forward that reusing customized static analysis rules can be beneficial, in particular when similarities in the architecture and programming style are observed. However, adjustment of the rules might be needed to enable effective reuse. We shared our insights and methodology on how to reuse custom static analysis rules properly.

References

  1. N Ayewah, D Hovemeyer, J D Morgenthaler, J Penix, and W Pugh. 2008. Using Static Analysis to Find Bugs. IEEE Software 25, 5 (2008), 22–29. https://doi.org/10.1109/MS.2008.130Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M Beller, R Bholanath, S McIntosh, and A Zaidman. 2016. Analyzing the State of Static Analysis: A Large-Scale Evaluation in Open Source Software. In 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), Vol. 1. 470–481. https://doi.org/10.1109/SANER.2016.105Google ScholarGoogle Scholar
  3. Al Bessey, Ken Block, Ben Chelf, Andy Chou, Bryan Fulton, Seth Hallem, Charles Henri-Gros, Asya Kamsky, Scott McPeak, and Dawson Engler. 2010. A few billion lines of code later: Using static analysis to find bugs in the real world. Commun. ACM (2010). https://doi.org/10.1145/1646353.1646374Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Maria Christakis and Christian Bird. 2016. What developers want and need from program analysis: An empirical study. In ASE 2016 - Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering. https://doi.org/10.1145/2970276.297Google ScholarGoogle ScholarCross RefCross Ref
  5. David Darais, Matthew Might, and David Van Horn. 2015. Galois transformers and modular abstract interpreters reusable metatheory for program analysis. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA. https://doi.org/10.1145/2814270.2814308Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Alessandro Gurgel, Isela Macia, Alessandro Garcia, Arndt von Staa, Mira Mezini, Michael Eichberg, and Ralf Mitschke. 2014. Blending and reusing rules for architectural degradation prevention. In Proceedings of the 13th international conference on Modularity - MODULARITY ’14. https://doi.org/10.1145/2577080.2577087Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Sarah Heckman and Laurie Williams. 2011. A systematic literature review of actionable alert identification techniques for automated static code analysis. Information and Software Technology 53, 4 (2011), 363–387.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. InfoEther Inc. [n.d.]. PMD. http://pmd.github.io/Google ScholarGoogle Scholar
  9. Diogo S Mendonça, Tarcila G Da Silva, Daniel Ferreira De Oliveira, Julliany Sales Brandão, Helio Lopes, Simone D J Barbosa, Marcos Kalinowski, and Arndt Von Staa. 2018. Applying Pattern-Driven Maintenance: A Method to Prevent Latent Unhandled Exceptions in Web Applications ACM Reference format. In Proceedings of 12th International Symposium on Empirical Software Engineering and Measurement, Oulu, Finland, October 2018 (ESEM’18). Oulu, Finland, 10.Google ScholarGoogle Scholar
  10. Johannes Mey, Thomas Kühn, René Schöne, and Uwe Assmann. 2020. Reusing Static Analysis across Different Domain-Specific Languages using Reference Attribute Grammars. The Art, Science, and Engineering of Programming 4, 3 (feb 2020). https://doi.org/10.22152/programming-journal.org/2020/4/15Google ScholarGoogle ScholarCross RefCross Ref
  11. Tukaram Muske and Alexander Serebrenik. 2016. Survey of approaches for handling static analysis alarms. In Source Code Analysis and Manipulation (SCAM), 2016 IEEE 16th International Working Conference on. IEEE, 157–166.Google ScholarGoogle ScholarCross RefCross Ref
  12. Vladimir A. Shekhovtsov, Yuriy Tomilko, and Mikhail D. Godlevskiy. 2009. Facilitating Reuse of Code Checking Rules in Static Code Analysis. In Lecture Notes in Business Information Processing. 91–102. https://doi.org/10.1007/978-3-642-01112-2_10Google ScholarGoogle Scholar
  13. SonarSource. 2008. SonarQube. https://www.sonarqube.org/Google ScholarGoogle Scholar
  14. The University of Maryland. [n.d.]. FindBugs. http://findbugs.sourceforge.net/Google ScholarGoogle Scholar
  15. Yuriy Tymchuk, Mohammad Ghafari, and Oscar Nierstrasz. 2018. JIT feedback: What experienced developers like about static analysis. In Proceedings - International Conference on Software Engineering. https://doi.org/10.1145/3196321.3196327Google ScholarGoogle ScholarDigital LibraryDigital Library

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

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format .

View HTML Format