SolTG: A CHC-Based Solidity Test Case Generator
Open Access
- 26 July 2024
- book chapter
- Published by Springer Nature
- p. 466-479
Abstract
Achieving high test coverage is important when developing blockchain smart contracts, but it could be challenging without automated reasoning tools. In this paper, we present SolTG, an automated test case generator for Solidity based on constrained Horn clauses (CHC). SolTG exhaustively enumerates symbolic path constraints from the contract’s CHC representation and makes calls to the Satisfiability Modulo Theories (SMT) solver to find input values under which the contract exhibits the corresponding behavior. Test cases synthesized by SolTG have the form of a sequence of function calls over concrete values of input parameters which lead to a specific execution scenario. The tool supports multiple Solidity-specific features and is capable of exhibiting a high coverage for industrial-grade Solidity code. We present a detailed architecture of SolTG based on the existing translation of smart contracts into a CHC representation. We also present the experimental results for test generation on the regression and industrial benchmarks.Keywords
This publication has 17 references indexed in Scilit:
- SMT-Based Test-Case Generation and Validation for Programs with Complex Specifications2023
- Korn—Software Verification with Horn Clauses (Competition Contribution)2023
- SKLEE: A Dynamic Symbolic Analysis Tool for Ethereum Smart Contracts (Tool Paper)2022
- SolCMC: Solidity Compiler’s Model Checker2022
- Maximizing Branch Coverage with Constrained Horn Clauses2022
- Verifying Solidity Smart Contracts via Communication Abstraction in SmartACE2022
- Symbiotic 8: Parallel and Targeted Test Generation2021
- Accurate Smart Contract Verification Through Direct Modelling2020
- The SeaHorn Verification Framework2015
- Z3: An Efficient SMT Solver2008