Bugs in Solidity smart contracts caused millions of dollars in losses in the past year alone. Mutation testing can expose weaknesses in test suites that simpler coverage metrics often miss, but the effort required to generate test cases for live mutants remains a major barrier to adoption. To address this, we present Alchemist, a framework that generates test cases from Solidity mutants via LLMs. Alchemist incorporates the scientific method into its test generation process, enabling the systematic refinement of test cases through hypotheses. Evaluation on Solidity projects demonstrates that this method improves test quality over direct prompting while reducing developer effort.
Mutant-Driven Test Generation for Ethereum Smart Contracts via LLMs
Barboni, Morena;Lampa, Filippo;Morichetta, Andrea;Polini, Andrea;
2025-01-01
Abstract
Bugs in Solidity smart contracts caused millions of dollars in losses in the past year alone. Mutation testing can expose weaknesses in test suites that simpler coverage metrics often miss, but the effort required to generate test cases for live mutants remains a major barrier to adoption. To address this, we present Alchemist, a framework that generates test cases from Solidity mutants via LLMs. Alchemist incorporates the scientific method into its test generation process, enabling the systematic refinement of test cases through hypotheses. Evaluation on Solidity projects demonstrates that this method improves test quality over direct prompting while reducing developer effort.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.


