skip to main content
10.1145/3019612.3019735acmconferencesArticle/Chapter ViewAbstractPublication PagessacConference Proceedingsconference-collections
research-article

Detecting spring configurations errors

Published: 03 April 2017 Publication History

Abstract

Dependency injection frameworks such as the Spring framework rely on dynamic language features of Java. Errors arising from the improper usage of these features bypass the compile-time checks of the Java compiler. This paper discusses the application of static code analysis as a means to restore compile-time checking for Spring-related configuration errors. First, possible errors in the configuration of Spring are identified and classified. Attributed grammars are applied in order to formally detect the errors and a prototypical compiler extension is implemented based on Java's pluggable annotation processing API.

References

[1]
A. V. Aho, M. S. Lam, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, & Tools. Addison-Wesley Publishing Company, USA, 2nd edition, 2007.
[2]
N. Ayewah, W. Pugh, J. D. Morgenthaler, J. Penix, and Y. Zhou. Evaluating static analysis defect warnings on production software. In Proceedings of the 7th ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering, pages 1--8. ACM, 2007.
[3]
G. Bracha and D. Ungar. Mirrors: Design Principles for Meta-level Facilities of Object-oriented Programming Languages. SIGPLAN Not., 39(10):331--344, Oct. 2004.
[4]
O. Burn. Checkstyle, checkstyle.sourceforge.net, 2003.
[5]
D. R. Cok and J. R. Kiniry. Esc/java2: Uniting esc/java and jml. In Construction and Analysis of Safe, Secure, and Interoperable Smart Devices, pages 108--128. Springer, 2005.
[6]
J. D. Darcy. jcp.org/en/jsr/detail?id=269, 2006.
[7]
T. Ekman and G. Hedin. The jastadd extensible java compiler. In Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems and applications, OOPSLA '07, pages 1--18, New York, NY, USA, 2007. ACM.
[8]
G. de Montmollin. The Transparent Language Popularity Index, http://lang-index.sourceforge.net, 2013.
[9]
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-oriented Software. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1995.
[10]
D. Greenfieldboyce and J. S. Foster. Type qualifier inference for Java. In ACM SIGPLAN Notices, volume 42, pages 321--336. ACM, 2007.
[11]
R. e. a. Johnson. Spring Framework Reference Documentation. docs.spring.io/spring/docs/3.2.11.RELEASE/spring-framework-reference/htmlsingle/, 2015.
[12]
D. E. Knuth. Semantics of context-free languages. In Mathematical Systems Theory, pages 127--145, 1968.
[13]
J. Ludewig and H. Lichter. Software Engineering: Grundlagen, Menschen, Prozesse, Techniken, dpunkt. verlag, 2012.
[14]
S. Markstrum, D. Marino, M. Esquivel, T. Millstein, C. Andreae, and J. Noble. JavaCOP: Declarative pluggable types for Java. ACM Transactions on Programming Languages and Systems (TOPLAS), 32(2):4, 2010.
[15]
S. S. Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1997.
[16]
Oracle Corporation. OpenJDK Compiler Tree API Specification. docs.oracle.com/javase/8/docs/jdk/api/javac/tree/, 2014.
[17]
Oracle Corporation. Java Reflection API. docs.oracle.com/javase/8/docs/api/java/lang/reflect/package-summary.html, 2015.
[18]
M. M. Papi, M. Ali, T. L. Correa, Jr., J. H. Perkins, and M. D. Ernst. Practical pluggable types for Java. In Proceedings of the 2008 International Symposium on Software Testing and Analysis, ISSTA '08, pages 201--212, New York, NY, USA, 2008. ACM.
[19]
Pivotal Sofware, Inc. Spring Framework, 2015.
[20]
PMD. PMD. pmd.sourceforge.net, 2015.
[21]
D. R. Prasanna. Dependency Injection. Manning Publications Co., Greenwich, CT, USA, 1st edition, 2009.
[22]
K. Slonneger and B. Kurtz. Formal Syntax and Semantics of Programming Languages: A Laboratory Based Approach. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1st edition, 1995.
[23]
SonarSource S.A. SonarQube. www.sonarqube.org, 2015.
[24]
E. Spishak, W. Dietl, and M. D. Ernst. A type system for regular expressions. In Proceedings of the 14th Workshop on Formal Techniques for Java-like Programs, FTfJP '12, pages 20--26, New York, NY, USA, 2012. ACM.
[25]
E. Van Wyk, L. Krishnan, D. Bodin, and E. Johnson. Adding Domain-specific and General Purpose Language Features to Java with the Java Language Extender. In Companion to the 21st ACM SIGPLAN Symposium on Object-oriented Programming Systems, Languages, and Applications, OOPSLA '06, pages 728--729, New York, NY, USA, 2006. ACM.
[26]
H. V. Von, K. Foegen, and H. Kuchen. Compilezeit-Pruefung von Spring-Konfigurationen. In Proceedings of the Workshops of the Conference on Software Engineering, SE-WS 2016, volume 1559 of Workshops of the Conference on Software Engineering, pages 96--108. CEUR-WS, 2016.
[27]
C. Walls. Spring in Action. Manning Publications Co., Greenwich, CT, USA, 4th edition, 2014.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
SAC '17: Proceedings of the Symposium on Applied Computing
April 2017
2004 pages
ISBN:9781450344869
DOI:10.1145/3019612
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].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 03 April 2017

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Java
  2. attribute grammars
  3. dependency injection
  4. pluggable annotation processing
  5. spring
  6. static code analysis

Qualifiers

  • Research-article

Conference

SAC 2017
Sponsor:
SAC 2017: Symposium on Applied Computing
April 3 - 7, 2017
Marrakech, Morocco

Acceptance Rates

Overall Acceptance Rate 1,650 of 6,669 submissions, 25%

Upcoming Conference

SAC '25
The 40th ACM/SIGAPP Symposium on Applied Computing
March 31 - April 4, 2025
Catania , Italy

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 189
    Total Downloads
  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)0
Reflects downloads up to 17 Feb 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media