ADF-GA: Data Flow Criterion Based Test Case Generation for Ethereum Smart Contracts

02/29/2020
by   Pengcheng Zhang, et al.
0

Testing is an important technique to improve the quality of Ethereum smart contract programs. However, current work on testing smart contract only focus on static problems of smart contract programs. A data flow oriented test case generation approach for dynamic testing of smart contract programs is still missing. To address this problem, this paper proposes a novel test case generation approach, called ADF-GA (All-uses Data Flow criterion based test case generation using Genetic Algorithm), for Solidity based Ethereum smart contract programs. ADF-GA aims to efficiently generate a valid set of test cases via three stages. First, the corresponding program control flow graph is constructed from the source codes. Second, the generated control flow graph is analyzed to obtain the variable information in the Solidity programs, locate the require statements, and also get the definition-use pairs to be tested. Finally, a genetic algorithm is used to generate test cases, in which an improved fitness function is proposed to calculate the definition-use pairs coverage of each test case with program instrumentation. Experimental studies are performed on several representative Solidity programs. The results show that ADF-GA can effectively generate test cases, achieve better coverage, and reduce the number of iterations in genetic algorithm.

READ FULL TEXT
research
11/24/2019

Basis Path Coverage Criteria for Smart Contract Application Testing

The widespread recognition of the smart contracts has established their ...
research
12/28/2016

Optimization of Test Case Generation using Genetic Algorithm (GA)

Testing provides means pertaining to assuring software performance. The ...
research
11/21/2019

SolidityCheck : Quickly Detecting Smart Contract Problems Through Regular Expressions

As a blockchain platform that has developed vigorously in recent years, ...
research
04/18/2022

QuSBT: Search-Based Testing of Quantum Programs

Generating a test suite for a quantum program such that it has the maxim...
research
09/24/2021

Test Scenario Generation for Context-Oriented Programs

Their highly adaptive nature and the combinatorial explosion of possible...
research
01/15/2021

A Data Flow Analysis Framework for Data Flow Subsumption

Data flow testing creates test requirements as definition-use (DU) assoc...
research
11/26/2021

Testability-Aware Low Power Controller Design with Evolutionary Learning

XORNet-based low power controller is a popular technique to reduce circu...

Please sign up or login with your details

Forgot password? Click here to reset