Domain-Specific Program Checking

  • Lukas Renggli
  • Stéphane Ducasse
  • Tudor Gîrba
  • Oscar Nierstrasz
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6141)

Abstract

Lint-like program checkers are popular tools that ensure code quality by verifying compliance with best practices for a particular programming language. The proliferation of internal domain-specific languages and models, however, poses new challenges for such tools. Traditional program checkers produce many false positives and fail to accurately check constraints, best practices, common errors, possible optimizations and portability issues particular to domain-specific languages. We advocate the use of dedicated rules to check domain-specific practices. We demonstrate the implementation of domain-specific rules, the automatic repair of violations, and their application to two case-studies: (1) Seaside defines several internal DSLs through a creative use of the syntax of the host language; and (2) Magritte adds meta-descriptions to existing code by means of special methods. Our empirical validation demonstrates that domain-specific program checking significantly improves code quality when compared with general purpose program checking.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [ACN02]
    Aldrich, J., Chambers, C., Notkin, D.: Architectural reasoning in ArchJava. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 334–367. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  2. [ANMM06]
    Andreae, C., Noble, J., Markstrum, S., Millstein, T.: A framework for implementing pluggable type systems. In: OOPSLA ’06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, pp. 57–74. ACM Press, New York (2006)CrossRefGoogle Scholar
  3. [BFJR98]
    Brant, J., Foote, B., Johnson, R., Roberts, D.: Wrappers to the rescue. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 396–417. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  4. [DGN07]
    Denker, M., Greevy, O., Nierstrasz, O.: Supporting feature analysis with runtime annotations. In: Proceedings of the 3rd International Workshop on Program Comprehension through Dynamic Analysis (PCODA 2007), pp. 29–33, Technische Universiteit Delft (2007)Google Scholar
  5. [DK97]
    van Deursen, A., Klint, P.: Little languages: Little maintenance? In: Kamin, S. (ed.) First ACM-SIGPLAN Workshop on Domain-Specific Languages; DSL’97, January 1997, pp. 109–127 (1997)Google Scholar
  6. [DLR07]
    Ducasse, S., Lienhard, A., Renggli, L.: Seaside: A flexible environment for building dynamic web applications. IEEE Software 24(5), 56–63 (2007)CrossRefGoogle Scholar
  7. [Fow99]
    Fowler, M.: Refactoring: improving the design of existing code. Addison-Wesley Professional, Reading (1999)Google Scholar
  8. [Fow08]
    Fowler, M.: Domain specific languages (Work in progress) (June 2008), http://martinfowler.com/dslwip/
  9. [HP00]
    Havelund, K., Pressburger, T.: Model checking Java programs using Java PathFinder. International Journal on Software Tools for Technology Transfer (STTT) 2(4), 366–381 (2000)MATHCrossRefGoogle Scholar
  10. [HP04]
    Hovemeyer, D., Pugh, W.: Finding bugs is easy. ACM SIGPLAN Notices 39(12), 92–106 (2004)CrossRefGoogle Scholar
  11. [Joh83]
    Johnson, S.C.: Lint, a C program checker. UNIX time-sharing system: UNIX programmer’s manual, p. 278 (1983)Google Scholar
  12. [KS03]
    Koschke, R., Simon, D.: Hierarchical reflexion models. In: Proceedings of the 10th Working Conference on Reverse Engineering (WCRE 2003), p. 36. IEEE Computer Society, Los Alamitos (2003)CrossRefGoogle Scholar
  13. [KV08]
    Kuhn, A., Verwaest, T.: FAME, a polyglot library for metamodeling at runtime. In: Workshop on Models at Runtime, pp. 57–66 (2008)Google Scholar
  14. [Lie89]
    Lieberherr, K.J.: Formulations and benefits of the Law of Demeter. ACM SIGPLAN Notices 24(3), 67–78 (1989)CrossRefGoogle Scholar
  15. [MKPW06]
    Mens, K., Kellens, A., Pluquet, F., Wuyts, R.: Co-evolving code and design with intensional views — a case study. Journal of Computer Languages, Systems and Structures 32(2), 140–156 (2006)MATHCrossRefGoogle Scholar
  16. [MNS95]
    Murphy, G., Notkin, D., Sullivan, K.: Software reflexion models: Bridging the gap between source and high-level models. In: Proceedings of SIGSOFT ’95, Third ACM SIGSOFT Symposium on the Foundations of Software Engineering, pp. 18–28. ACM Press, New York (1995)CrossRefGoogle Scholar
  17. [PMW09]
    Pluquet, F., Marot, A., Wuyts, R.: Fast type reconstruction for dynamically typed programming languages. In: DLS ’09: Proceedings of the 5th symposium on Dynamic languages, pp. 69–78. ACM, New York (2009)CrossRefGoogle Scholar
  18. [RAF04]
    Rutar, N., Almazan, C.B., Foster, J.S.: A comparison of bug finding tools for Java. In: 15th International Symposium on Software Reliability Engineering, ISSRE 2004, pp. 245–256 (2004)Google Scholar
  19. [RBJ97]
    Roberts, D., Brant, J., Johnson, R.E.: A refactoring tool for Smalltalk. Theory and Practice of Object Systems (TAPOS) 3(4), 253–263 (1997)CrossRefGoogle Scholar
  20. [RDK07]
    Renggli, L., Ducasse, S., Kuhn, A.: Magritte — a meta-driven approach to empower developers and end users. In: Engels, G., Opdyke, B., Schmidt, D.C., Weil, F. (eds.) MODELS 2007. LNCS, vol. 4735, pp. 106–120. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  21. [RGN10]
    Renggli, L., Gîrba, T., Nierstrasz, O.: Embedding languages without breaking tools. In: ECOOP 2010: Proceedings of the 24th European Conference on Object-Oriented Programming, Maribor, Slovenia. LNCS. Springer, Heidelberg (to appear, 2010)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Lukas Renggli
    • 1
  • Stéphane Ducasse
    • 2
  • Tudor Gîrba
    • 3
  • Oscar Nierstrasz
    • 1
  1. 1.Software Composition GroupUniversity of BernSwitzerland
  2. 2.RMoDINRIA-Lille Nord EuropeFrance
  3. 3.Sw-eng. Software Engineering GmbHSwitzerland

Personalised recommendations