arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2102.08864cs.SE
收藏

Solidity智能合约测试用例自动生成:AGSolT方法及其评估

Automated Test-Case Generation for Solidity Smart Contracts: the AGSolT Approach and its Evaluation

Stefan Driessen, Dario Di Nucci, Geert Monsieur, Damian A. Tamburri, Willem-Jan van den Heuvel

摘要:

区块链和智能合约技术是数据和代码管理的新方法,通过允许以分布式和去中心化的方式进行开发来促进可信计算。测试智能合约带来了一系列挑战,这些挑战尚未完全确定和探索。虽然现有的工具可以通过随机搜索或符号执行来识别和发现以太坊区块链上的已知漏洞及其交互,但这些工具通常不会产生适合人类预言机的测试套件。在本文中,我们提出了AGSOLT(自动生成器的Solidity测试套件)。我们通过实现两种搜索算法来自动生成独立Solidity智能合约的测试套件,并考虑到一些区块链特有的挑战,来证明其效率。为了测试AGSOLT,我们在一组36个真实世界的智能合约上比较了随机搜索算法和遗传算法。我们发现AGSOLT能够通过这两种方法实现高分支覆盖率,甚至在Github上最流行的Solidity智能合约中发现了一些错误。

英文摘要:

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, these tools generally do not produce test suites suitable for human oracles. 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 coverage with both approaches and even discovered some errors in some of the most popular Solidity smart contracts on Github.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑