Towards Random Elixir Code Generation

  • Bernardo Beltrame Facchi UFFS
  • Andrei de Almeida Sampaio Braga UFFS
  • André Rauber Du Bois UFPel
  • Samuel da Silva Feitosa UFFS

Resumo


Developers expect compilers to be correct. Unfortunately, these tools are not entirely bug-free. A failure introduced by the compiler could compromise a critical system and consequently have catastrophic consequences, specially in applications of great complexity, affecting both end users and developers. Such failures can lead to significant financial losses, security vulnerabilities, and a loss of trust in the software’s reliability. Therefore, testing and validating all the compiler functionalities to assure its correctness is essential given their importance in software development. In light of the given context, this paper describes a random code generation tool using Haskell that generates well-typed Elixir code by adhering to a specified syntax and typing rules, which serves as input for property-based tests, striving to contribute to the overall quality and dependability of software systems built using Elixir.
Palavras-chave: Code generation, Elixir Compiler, Property-based Testing

Referências

Elton M. Cardoso, Daniel F. Pereira, Regina M. A. De Paula, Leonardo V. S. Reis, and Rodrigo G. Ribeiro. 2022. A Type-Directed Algorithm to Generate Random Well-Formed Parsing Expression Grammars. In Proc. of SBLP’22. ACM, New York, NY, USA, 8–14. DOI: 10.1145/3561320.3561326

Giuseppe Castagna, Guillaume Duboc, and José Valim. 2023. The Design Principles of the Elixir Type System. arXiv:2306.06391 [cs.PL]

Elixir. 2023. Elixir. [link]

Samuel Feitosa, Rodrigo Ribeiro, and Andre Du Bois. 2019. Generating Random Well-Typed Featherweight Java Programs Using QuickCheck. ENTCS (apr 2019), 3–20. DOI: 10.1016/j.entcs.2019.04.002

Samuel Feitosa, Rodrigo Ribeiro, and Andre Du Bois. 2020. A type-directed algorithm to generate random well-typed Java 8 programs. Science of Computer Programming 196 (2020), 102494. DOI: 10.1016/j.scico.2020.102494

Vsevolod Livinskii, Dmitry Babokin, and John Regehr. 2020. Random Testing for C and C++ Compilers with YARPGen. Proc. ACM Program. Lang. 4, OOPSLA, Article 196 (nov 2020), 25 pages. DOI: 10.1145/3428264

Michał H. Pałka, Koen Claessen, Alejandro Russo, and John Hughes. 2011. Testing an Optimising Compiler by Generating Random Lambda Terms (AST ’11). 91–97. DOI: 10.1145/1982595.1982615

PetSI. 2018. ELIXIR: uma linguagem de programação brasileira em sistemas distribuídos do mundo. [link]

Richard L. Sauder. 1962. A general test data generator for COBOL. In Proceedings of the May 1-3, 1962, Spring Joint Computer Conference (San Francisco, California) (AIEE-IRE ’62 (Spring)). 317–323. DOI: 10.1145/1460833.1460869

Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. 2011. Finding and Understanding Bugs in C Compilers. SIGPLAN Not. 46, 6 (jun 2011), 283–294. DOI: 10.1145/1993316.1993532
Publicado
30/09/2024
FACCHI, Bernardo Beltrame; BRAGA, Andrei de Almeida Sampaio; DU BOIS, André Rauber; FEITOSA, Samuel da Silva. Towards Random Elixir Code Generation. In: SIMPÓSIO BRASILEIRO DE LINGUAGENS DE PROGRAMAÇÃO (SBLP), 28. , 2024, Curitiba/PR. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2024 . p. 91-93.