Affiliation:
1. Key Laboratory of Water Big Data Technology of Ministry of Water Resources Hohai University Nanjing China
2. College of Computer Science and Software Engineering Hohai University Nanjing China
3. School of Computing Technologies RMIT University Melbourne Australia
Abstract
AbstractWith the widespread application of smart contracts, there is a growing concern over the quality assurance of smart contracts. The data flow testing is an important technology to ensure the correctness of smart contracts. We propose an approach named IABC‐TCG (Improved Artificial Bee Colony‐Test Case Generation) to generate test cases for the data flow testing of smart contracts. With a dominance relations‐based fitness function, an improved artificial bee colony algorithm is used to generate test cases, in which the bee colony search coefficient is adaptively adjusted to improve the effectiveness and efficiency of the search. In addition, an improved test case selection and updation strategy is used to avoid unnecessary test cases. The experimental results show that IABC‐TCG achieves 100% coverage for all the test requirements on a dataset of 30 smart contracts and outperforms the baseline approaches in terms of the number of test cases and the execution time. Performing tests with the generated test cases, IABC‐TCG can find more errors with less test cost.
Funder
National Natural Science Foundation of China