,
José Nuno Macedo
,
João Saraiva
Creative Commons Attribution 4.0 International license
Software testing is essential to ensure software reliability and functionality. Numerous testing techniques have been proposed, and most programming languages provide built-in support for testing. However, these techniques have yet to be integrated into the powerful attribute grammar formalism. This paper introduces a method to incorporate property-based testing into attribute grammars. We achieve this by embedding attribute grammars in Python which is combined with its powerful Hypothesis property-based testing framework. To validate our approach, we express properties of scope rules in a (nested) block-structured language, commonly found in many (functional) languages.
@InProceedings{rodrigues_et_al:OASIcs.Programming.2025.19,
author = {Rodrigues, Emanuel and Macedo, Jos\'{e} Nuno and Saraiva, Jo\~{a}o},
title = {{Is There Hypothesis for Attribute Grammars?}},
booktitle = {Companion Proceedings of the 9th International Conference on the Art, Science, and Engineering of Programming (Programming 2025)},
pages = {19:1--19:15},
series = {Open Access Series in Informatics (OASIcs)},
ISBN = {978-3-95977-382-9},
ISSN = {2190-6807},
year = {2025},
volume = {134},
editor = {Edwards, Jonathan and Perera, Roly and Petricek, Tomas},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/OASIcs.Programming.2025.19},
URN = {urn:nbn:de:0030-drops-243036},
doi = {10.4230/OASIcs.Programming.2025.19},
annote = {Keywords: Property-based Testing, Attribute Grammars, Strategic Term Rewriting}
}