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.
翻译:虽然现有的工具可以通过随机搜索或象征性地执行来识别和发现已知的弱点及其在Eceenum区块链上的相互作用,但这些工具通常不会产生适合人手的测试套件。在本文中,我们介绍AGSOLT(团结测试套件的自动生成器),通过实施两种搜索算法来自动生成独立固态智能合同的测试套件以显示其效率,同时考虑到某些特定链条的挑战。测试AGSOLT,我们比较了36个现实世界智能合同的随机搜索算法和遗传算法。我们发现,AGSOLT能够以两种方法实现高分支覆盖,甚至发现一些在Github最受欢迎的固态智能合同中出现错误。