Skip to main content
QUICK 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 Techniques被引用 7
一句话总结

AGSolT 是一种新颖的框架,利用多目标搜索算法(特别是随机搜索和遗传算法)在 Solidity 智能合约中实现自动化测试用例生成。该框架实现了高分支覆盖率,并在流行的开源智能合约中发现了此前未知的漏洞。

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.

研究动机与目标

  • 解决缺乏将先进、多目标搜索算法应用于生成 Solidity 智能合约全面测试套件的框架的问题。
  • 克服智能合约测试中的区块链特定挑战,例如状态依赖性和复杂的执行路径。
  • 评估不同搜索策略(随机搜索与遗传算法)在实现高测试覆盖率方面的有效性。
  • 通过自动化测试生成识别现实世界智能合约中此前未知的漏洞。
  • 为去中心化应用提供可扩展且高效的自动化回归与漏洞测试解决方案。

提出的方法

  • AGSolT 使用符号执行引擎分析 Solidity 智能合约,提取控制流和数据依赖关系。
  • 集成两种搜索算法:随机搜索和遗传算法,以探索输入空间并生成测试用例。
  • 遗传算法基于分支覆盖率设计适应度函数,引导测试生成以实现更高的代码覆盖率。
  • 通过选择、交叉和变异操作演化输入参数,以最大化条件分支的覆盖率。
  • 该框架设计用于处理区块链特有的约束,如事务排序、状态转换和气体限制。
  • AGSolT 通过测量分支覆盖率以及检测运行时错误或回滚条件来评估测试套件。

实验结果

研究问题

  • RQ1多目标搜索算法能否有效生成高覆盖率的 Solidity 智能合约测试套件?
  • RQ2与随机搜索相比,基于遗传算法的测试生成在分支覆盖率和漏洞检测方面的性能如何?
  • RQ3AGSolT 在多大程度上能够发现现实世界智能合约中此前未知的漏洞?
  • RQ4AGSolT 在处理区块链特有的复杂性(如状态行为和事务依赖性)方面表现如何?

主要发现

  • AGSolT 在 36 个真实世界智能合约上,分别采用随机搜索和遗传算法方法,均实现了高分支覆盖率。
  • 在分支覆盖率和探索复杂执行路径的效率方面,遗传算法优于随机搜索。
  • AGSolT 在多个广泛使用的、托管在 GitHub 上的智能合约中成功发现了此前未知的漏洞。
  • 该框架在不同智能合约模式和安全属性方面表现出良好的可扩展性和适应性。
  • 结果证实,与仅使用随机测试相比,先进的搜索算法能显著提升测试套件的质量。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。