AGTS: Novel automated generation of smart contract test suites for Hyperledger Fabric
Authors:
Open Access
- 13 August 2025
- journal article
- Published by Springer Nature in Scientific Reports
- Vol. 15 (1) , 29675
Abstract
The robustness and reliability of blockchain applications, critically depend on thorough testing. This study introduces AGTS, an automated framework for generating smart contract test suites on Hyperledger Fabric, significantly reducing manual effort while improving test coverage and security. The framework integrates static and dynamic analysis, leveraging symbolic execution and fuzz testing to detect vulnerabilities. The project is implemented in C#, and uses three test cases: CoCoME, LibraryMS and LoanPS, with their requirements as input, and generates their closely related test cases. We generated 34 test cases for CoCoME, 32 for LibraryMS, and 28 for LoanPS. Combining the test cases, their executable scripts were generated. Finally, we tested all the targeted smart contracts rigorously against the predefined criteria. The generated scripts undergo the quality assurance using ShellCheck, deploying on the continuous integration system, that further enhances the reliability and maintainability of these tests. AGTS automates the entire process of test script creation and verification, drastically reducing the manual effort involved in preparing test cases. It facilitates rapid and thorough testing cycles by generating dedicated scripts that execute specific test scenarios on smart contracts, verifying their behavior and performance. By automating the tedious and error-prone task of writing test cases, AGTS accelerates the development process and fortifies the security framework of blockchain applications. Comprehensive evaluation of AGTS across diverse real world smart contracts demonstrated the effectiveness in defect detection, significantly outperforming existing methods. The contribution of AGTS extends beyond providing a practical testing tool, by offering developers a robust framework for ensuring the reliability and security of their smart contracts. AGTS not only expedites test preparation but also ensures comprehensive test coverage, thus improving the overall quality of blockchain applications.Keywords
Funding Information
- the Science and Technology Development Fund, Macau SAR (0015/2023/RIA1, 0015/2023/RIA1, 0015/2023/RIA1)
This publication has 34 references indexed in Scilit:
- Blockchain-enabled infrastructural security solution for serverless consortium fog and edge computing2024
- Typing Requirement Model as CoroutinesIEEE Access, 2024
- On the Use of GitHub Actions in Software Development Repositories2022
- DevOps for Ethereum Blockchain Smart Contracts2021
- Hyperledger Fabric Blockchain for Securing the Edge Internet of ThingsSensors, 2021
- Static analysis for discovering IoT vulnerabilitiesInternational Journal on Software Tools for Technology Transfer, 2020
- Basis Path Coverage Criteria for Smart Contract Application Testing2019
- An extended access control model for permissioned blockchain frameworksWireless Networks, 2019
- Automatic Test Data Generation for Data Flow Testing Using Particle Swarm OptimizationCommunications in Computer and Information Science, 2010
- Combined Static and Dynamic AnalysisElectronic Notes in Theoretical Computer Science, 2005