Skip to main content
QUICK REVIEW

[Paper Review] AGSolT: a Tool for Automated Test-Case Generation for Solidity Smart Contracts.

Stefan Driessen, Dario Di Nucci|arXiv (Cornell University)|Feb 17, 2021
Software Testing and Debugging TechniquesComputer Science7 citations
TL;DR

AGSolT is a novel framework for automated test-case generation in Solidity smart contracts using multi-objective search algorithms, specifically random search and genetic algorithms. It achieves high branch coverage and uncovers previously unknown bugs in popular open-source smart contracts.

ABSTRACT

Blockchain and smart contract technology are novel approaches to data and code management, that facilitate trusted computing by allowing for development in a distributed and decentralized manner. Testing smart contracts comes with its own set of challenges which have not yet been fully identified and explored. Although existing tools can identify and discover known vulnerabilities and their interactions on the Ethereum blockchain through random search or symbolic execution, no framework exists for applying advanced, multi-objective algorithms to create test suites for such smart contracts. In this paper, we present AGSolT (Automated Generator of Solidity Test Suites). We demonstrate its efficiency by implementing two search algorithms to automatically generate test suites for stand-alone Solidity smart contracts, taking into account some of the blockchain-specific challenges. To test AGSolT, we compared a random search algorithm and a genetic algorithm on a set of 36 real-world smart contracts. We found that AGSolT is capable of achieving high branch overage with both approaches and even discovered some errors in some of the most popular Solidity smart contracts on Github.

Motivation & Objective

  • To address the lack of frameworks that apply advanced, multi-objective search algorithms to generate comprehensive test suites for Solidity smart contracts.
  • To overcome blockchain-specific challenges in smart contract testing, such as state dependencies and complex execution paths.
  • To evaluate the effectiveness of different search strategies—random search and genetic algorithms—in achieving high test coverage.
  • To identify previously unknown bugs in real-world smart contracts through automated test generation.
  • To provide a scalable and efficient solution for automated regression and vulnerability testing in decentralized applications.

Proposed method

  • AGSolT employs a symbolic execution engine to analyze Solidity smart contracts and extract control flow and data dependencies.
  • It integrates two search algorithms: random search and a genetic algorithm, to explore the input space and generate test cases.
  • The genetic algorithm uses fitness functions based on branch coverage to guide test generation toward higher code coverage.
  • Test cases are generated by evolving input parameters through selection, crossover, and mutation operations to maximize coverage of conditional branches.
  • The framework is designed to handle blockchain-specific constraints such as transaction ordering, state transitions, and gas limits.
  • AGSolT evaluates test suites by measuring branch coverage and detecting runtime errors or revert conditions.

Experimental results

Research questions

  • RQ1Can multi-objective search algorithms effectively generate high-coverage test suites for Solidity smart contracts?
  • RQ2How does the performance of genetic algorithm-based test generation compare to random search in terms of branch coverage and bug detection?
  • RQ3To what extent can AGSolT uncover previously unknown vulnerabilities in real-world smart contracts?
  • RQ4How well does AGSolT handle blockchain-specific complexities such as stateful behavior and transaction dependencies?

Key findings

  • AGSolT achieved high branch coverage using both random search and genetic algorithm approaches on a set of 36 real-world smart contracts.
  • The genetic algorithm outperformed random search in terms of branch coverage and efficiency in exploring complex execution paths.
  • AGSolT successfully discovered previously unknown bugs in several widely used smart contracts hosted on GitHub.
  • The framework demonstrated scalability and adaptability to diverse smart contract patterns and security properties.
  • The results confirm that advanced search algorithms significantly improve test suite quality compared to random testing alone.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.