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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
References
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
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
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
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
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
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
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
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
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
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
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
Cimini, M.: Lang-SQL (2022). https://github.com/mcimini/lang-sql
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
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
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
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
Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex, 1st edn. The MIT Press (2009)
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
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
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
Hoare, C.A.R.: Communicating sequential processes. Commun. ACM 21(8), 666–677 (1978). https://doi.org/10.1145/359576.359585
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
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
Milner, R. (ed.): A Calculus of Communicating Systems. LNCS, vol. 92. Springer, Heidelberg (1980). https://doi.org/10.1007/3-540-10235-3
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
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
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)
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
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
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
Pierce, B.C.: Types and Programming Languages. MIT Press (2002)
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
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
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
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
Sewell, P.: Ott: effective tool support for the working semanticist. J. Funct. Program. 20(1), 71–122 (2010). https://doi.org/10.1017/S0956796809990293
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
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
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
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)