Skip to main content

Testing Languages with a Languages-as-Databases Approach

  • Conference paper
  • First Online:
Tests and Proofs (TAP 2023)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 14066))

Included in the following conference series:

  • 171 Accesses

Abstract

Language testing is an important element in the cycle of a programming language development. A part of these tests aim at determining features such as what type of binders the language has, whether evaluation takes place underneath a binder, as well as other features.

In prior work, we have proposed languages-as-databases, an approach that is based on storing languages as databases, which then can be interrogated with declarative queries.

This paper illustrates a number of language tests on various aspects of programming languages. We also formulate tests that establish whether the language at hand conforms to the GSOS rule format.

Our tests show that languages-as-databases provides a lightweight approach to language testing.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    http://www.jetbrains.com/mps/.

References

  1. Aceto, L., Bloom, B., Vaandrager, F.: Turning SOS rules into equations. Inf. Comput. 111(1), 1–52 (1994). https://doi.org/10.1006/inco.1994.1040

    Article  Google Scholar 

  2. Aceto, L., Caltais, G., Goriac, E.-I., Ingolfsdottir, A.: PREG axiomatizer – a ground bisimilarity checker for GSOS with predicates. In: Corradini, A., Klin, B., Cîrstea, C. (eds.) CALCO 2011. LNCS, vol. 6859, pp. 378–385. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-22944-2_27

    Chapter  Google Scholar 

  3. Aceto, L., Cimini, M., Ingólfsdóttir, A., Mousavi, M.R., Reniers, M.A.: SOS rule formats for zero and unit elements. Theoret. Comput. Sci. 412(28), 3045–3071 (2011). https://doi.org/10.1016/j.tcs.2011.01.024

    Article  Google Scholar 

  4. Aceto, L., Cimini, M., Ingolfsdottir, A., Mousavi, M., Reniers, M.A.: Rule formats for distributivity. Theoret. Comput. Sci. 458, 1–28 (2012). https://doi.org/10.1016/j.tcs.2012.07.036

    Article  Google Scholar 

  5. Bach Poulsen, C., Rouvoet, A., Tolmach, A., Krebbers, R., Visser, E.: Intrinsically-typed definitional interpreters for imperative languages. Proc. ACM Program. Lang. (PACMPL) 2(POPL), 1–34 (2017). https://doi.org/10.1145/3158104

  6. Baeten, J.C.M., Bergstra, J.A.: Process algebra with signals and conditions. In: Broy, M. (ed.) Programming and Mathematical Method, pp. 273–323. Springer, Heidelberg (1992). https://doi.org/10.1007/978-3-642-77572-7_13

  7. Baeten, J.C.M., Bergstra, J.A., Klop, J.W.: Syntax and defining equations for an interrupt mechanism in process algebra. Fund. Inform. 9(2), 127–167 (1986). https://doi.org/10.3233/FI-1986-9202

    Article  Google Scholar 

  8. Berghofer, S., Nipkow, T.: Random testing in Isabelle/HOL. In: Proceedings of the 2nd International Conference on Software Engineering and Formal Methods, pp. 230–239, SEFM 2004. IEEE Computer Society, USA (2004). https://doi.org/10.1109/SEFM.2004.10049

  9. Bergstra, J., Klop, J.: Process algebra for synchronous communication. Inf. Control 60(1), 109–137 (1984). https://doi.org/10.1016/S0019-9958(84)80025-X

    Article  Google Scholar 

  10. Bloom, B., Istrail, S., Meyer, A.R.: Bisimulation can’t be traced. J. ACM 42(1), 232–268 (1995). https://doi.org/10.1145/200836.200876

  11. Cheney, J.: Toward a general theory of names: binding and scope. In: Proceedings of the 3rd ACM SIGPLAN Workshop on Mechanized Reasoning about Languages with Variable Binding, MERLIN 2005, pp. 33–40. Association for Computing Machinery, New York, NY, USA (2005). https://doi.org/10.1145/1088454.1088459

  12. Cimini, M.: Lang-SQL (2022). https://github.com/mcimini/lang-sql

  13. Cimini, M.: A query language for language analysis. In: Schlingloff, B.H., Chai, M. (eds.) Software Engineering and Formal Methods - 20th International Conference, SEFM 2022, Berlin, Germany, 26–30 September 2022, Proceedings, vol. 13550, pp. 57–73. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-17108-6_4

  14. Cimini, M.: A declarative validator for GSOS languages. In: Proceedings of the 14th International Workshop on Programming Language Approaches to Concurrency- and Communication-cEntric Software (PLACES 2023), vol. 378, pp. 14–25. Open Publishing Association (2023). https://doi.org/10.4204/EPTCS.378.2

  15. Cimini, M., Miller, D., Siek, J.G.: Extrinsically typed operational semantics for functional languages. In: Proceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2020, Virtual Event, USA, 16–17 November 2020, pp. 108–125 (2020). https://doi.org/10.1145/3426425.3426936

  16. Cranen, S., Mousavi, M., Reniers, M.A.: A rule format for associativity. In: van Breugel, F., Chechik, M. (eds.) CONCUR 2008 - Concurrency Theory, pp. 447–461. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-85361-9_35

  17. Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex, 1st edn. The MIT Press (2009)

    Google Scholar 

  18. Fetscher, B., Claessen, K., Pałka, M., Hughes, J., Findler, R.B.: Making random judgments: automatically generating well-typed terms from the definition of a type-system. In: Vitek, J. (ed.) European Symposium on Programming Languages and Systems (ESOP 2015), pp. 383–405. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-46669-8_16

  19. Grewe, S., Erdweg, S., Wittmann, P., Mezini, M.: Type systems for the masses: deriving soundness proofs and efficient checkers. In: 2015 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software (Onward!), pp. 137–150. Onward! 2015. ACM, New York, NY, USA (2015). https://doi.org/10.1145/2814228.2814239

  20. Groote, J.F., Vaandrager, F.: Structured operational semantics and bisimulation as a congruence. Inf. Comput. 100(2), 202–260 (1992). https://doi.org/10.1016/0890-5401(92)90013-6

    Article  Google Scholar 

  21. Hoare, C.A.R.: Communicating sequential processes. Commun. ACM 21(8), 666–677 (1978). https://doi.org/10.1145/359576.359585

  22. Kats, L.C., Vermaas, R., Visser, E.: Integrated language definition testing: enabling test-driven language development. In: Proceedings of the 2011 ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA 2011, pp. 139–154. Association for Computing Machinery, New York, NY, USA (2011). https://doi.org/10.1145/2048066.2048080

  23. Klein, C., et al.: Run your research: on the effectiveness of lightweight mechanization. In: Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2012, pp. 285–296. Association for Computing Machinery, New York, NY, USA (2012). https://doi.org/10.1145/2103656.2103691

  24. Milner, R. (ed.): A Calculus of Communicating Systems. LNCS, vol. 92. Springer, Heidelberg (1980). https://doi.org/10.1007/3-540-10235-3

  25. Mourad, B., Cimini, M.: A calculus for language transformations. In: Chatzigeorgiou, A., et al. (eds.) SOFSEM 2020. LNCS, vol. 12011, pp. 547–555. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-38919-2_44

    Chapter  Google Scholar 

  26. Mourad, B., Cimini, M.: System description: Lang-n-Change - a tool for transforming languages. In: Nakano, K., Sagonas, K. (eds.) FLOPS 2020. LNCS, vol. 12073, pp. 198–214. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-59025-3_12

    Chapter  Google Scholar 

  27. Mousavi, M.R., Reniers, M.A.: Prototyping SOS meta-theory in Maude. Electron. Notes Theoret. Comput. Sci. 156(1), 135–150 (2006). https://doi.org/10.1016/j.entcs.2005.09.030, Proceedings of the Second Workshop on Structural Operational Semantics (SOS 2005)

  28. Mousavi, M.R., Reniers, M.A., Groote, J.F.: SOS formats and meta-theory: 20 years after. Theoret. Comput. Sci. 373(3), 238–272 (2007). https://doi.org/10.1016/j.tcs.2006.12.019

    Article  Google Scholar 

  29. Mousavi, M., Reniers, M., Groote, J.F.: A syntactic commutativity format for SOS. Inf. Process. Lett. 93(5), 217–223 (2005). https://doi.org/10.1016/j.ipl.2004.11.007

    Article  Google Scholar 

  30. Pfenning, F., Schürmann, C.: System description: Twelf — a meta-logical framework for deductive systems. In: CADE 1999. LNCS (LNAI), vol. 1632, pp. 202–206. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48660-7_14

    Chapter  Google Scholar 

  31. Pierce, B.C.: Types and Programming Languages. MIT Press (2002)

    Google Scholar 

  32. Ratiu, D., Voelter, M.: Automated testing of DSL implementations: experiences from building mbeddr. In: Proceedings of the 11th International Workshop on Automation of Software Test, AST 2016, pp. 15–21. Association for Computing Machinery, New York, NY, USA (2016). https://doi.org/10.1145/2896921.2896922

  33. van der Rest, C., Poulsen, C.B., Rouvoet, A., Visser, E., Mosses, P.: Intrinsically-typed definitional interpreters à la carte. Proc. ACM Program. Lang. 6(OOPSLA2), 1903–1932 (2022). https://doi.org/10.1145/3563355

  34. Roberson, M., Harries, M., Darga, P.T., Boyapati, C.: Efficient software model checking of soundness of type systems. In: Harris, G.E. (ed.) Proceedings of the 23rd ACM SIGPLAN Conference on Object-Oriented Programming Systems Languages and Applications, OOPSLA 2008, pp. 493–504. Association for Computing Machinery, New York, NY, USA (2008). https://doi.org/10.1145/1449764.1449803

  35. Rosu, G., Şerbănuţă, T.F.: An overview of the K semantic framework. J. Logic Algebraic Program. 79(6), 397–434 (2010). https://doi.org/10.1016/j.jlap.2010.03.012

    Article  Google Scholar 

  36. Sewell, P.: Ott: effective tool support for the working semanticist. J. Funct. Program. 20(1), 71–122 (2010). https://doi.org/10.1017/S0956796809990293

    Article  Google Scholar 

  37. Verhoef, C.: A congruence theorem for structured operational semantics with predicates and negative premises. In: Jonsson, B., Parrow, J. (eds.) CONCUR 1994. LNCS, vol. 836, pp. 433–448. Springer, Heidelberg (1994). https://doi.org/10.1007/978-3-540-48654-1_32

    Chapter  Google Scholar 

  38. Wu, H.: Grammar-driven generation of domain-specific language tools. In: Companion to the 21st ACM SIGPLAN Symposium on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA 2006, pp. 772–773. Association for Computing Machinery, New York, NY, USA (2006). https://doi.org/10.1145/1176617.1176718

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Matteo Cimini .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Cimini, M. (2023). Testing Languages with a Languages-as-Databases Approach. In: Prevosto, V., Seceleanu, C. (eds) Tests and Proofs. TAP 2023. Lecture Notes in Computer Science, vol 14066. Springer, Cham. https://doi.org/10.1007/978-3-031-38828-6_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-38828-6_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-38827-9

  • Online ISBN: 978-3-031-38828-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics