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.
翻译:屏障链和智能合同技术是数据和代码管理的新办法,通过分散和分散的方式允许发展,便利了可信任的计算。测试智能合同带来了其自身的一系列挑战,但尚未充分确定和探索。虽然现有工具可以通过随机搜索或象征性执行来识别和发现已知的脆弱性及其在Etheyum街区链上的相互作用,但在应用先进、多客观的算法为这种智能合同创建测试套件方面没有框架。在本文中,我们介绍了AGSolT(固体测试套件的自动生成器),我们通过实施两种搜索算法来显示其效率,以自动生成独立固态智能合同的测试套件,同时考虑到某些特定链条的挑战。测试AGSolT时,我们比较了一套36个真实世界智能合同的随机搜索算法和遗传算法。我们发现,AGSolT能够用两种方法实现高分机,甚至发现一些在Githhub最受欢迎的“固态”智能合同中的错误。