Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A smart contract testing method based on path coverage sufficiency criterion

A path coverage test and smart contract technology, applied in the computer field, can solve the problems that tools cannot detect and can only detect a limited number of known vulnerabilities, so as to improve the effect of vulnerability detection and reduce labor costs

Active Publication Date: 2022-05-17
SOUTH CHINA NORMAL UNIVERSITY +1
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] Existing smart contract testing tools are designed to detect specific patterns of known vulnerabilities. The disadvantage is that they can only detect a limited number of known vulnerabilities. Oyente can only detect 4 specific vulnerabilities, and contractFuzzer can only detect 7 specific vulnerability
However, other vulnerabilities or errors other than these vulnerabilities may exist in the smart contracts written by programmers
These tools cannot detect logic errors that do not have a specific pattern

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A smart contract testing method based on path coverage sufficiency criterion
  • A smart contract testing method based on path coverage sufficiency criterion
  • A smart contract testing method based on path coverage sufficiency criterion

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0046] as Figure 1 As shown, a smart contract test method of the present invention based on the path coverage adequacy criterion, comprising the following steps:

[0047] The first step is to enter the bytecode that requires the smart contract and the ABI of the smart contract.

[0048] The second step is to generate a control flowchart based on bytecode.

[0049] The third step is to use the EPP algorithm to analyze the control flowchart, find out the blocks that need to be piled, and insert the pile.

[0050] The fourth step is to deploy the smart contract after the stake on the truffle.

[0051] In the fifth step, generate a collection of test cases that meet the requirements based on the path coverage test adequacy guidelines.

[0052] The specific description of each of the above steps is as follows:

[0053] The first step is to enter the bytecode of the smart contract, which can be obtained through sol-bin-runtimefilePath.

[0054] The second step is to generate a control fl...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a smart contract testing method based on path coverage sufficiency criteria, comprising the following steps: step 1, inputting the byte code of the smart contract and the ABI of the smart contract; step 2, generating a control flow chart according to the byte code; Step 3, use the EPP algorithm to analyze the control flow chart, find out the blocks that need to be staked, and perform stakes; Step 4, deploy the smart contract after the stakes on the truffle; Step 5, generate according to the path coverage test adequacy criterion to meet the requirements set of test cases. Compared with the analysis of source code by other technologies, the present invention analyzes the byte code of the smart contract, which is more efficient. The present invention automatically generates test cases for smart contracts, and uses the sufficiency criterion of path coverage to judge whether a sufficient set of test cases is generated, fully exposes possible errors in smart contract codes as much as possible, and improves the effect of loophole detection. Reduced labor costs.

Description

Technical field [0001] The present invention relates to the field of computer technology, in particular to a smart contract testing method based on the path coverage adequacy criterion. Background [0002] Smart contracts are programs that run on top of a blockchain consensus protocol with the aim of allowing people to reach agreements while minimizing trust. Once deployed, smart contracts have the characteristics of open, transparent, immutable, and automatic execution of contract content. But it is precisely because of the immutability of smart contracts, if the smart contract is not found in time or logical errors before deployment, it may be wrong or maliciously exploited by bad actors, resulting in property damage to people, such as: The DAO contract vulnerability caused a loss of $60 million. In order to avoid errors or vulnerabilities in the deployed smart contracts and to protect people's property, it is very important to test smart contracts. [0003] The existing smart...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F11/36G06Q40/04
CPCG06F11/3684G06F11/3688G06Q40/04
Inventor 赵淦森王欣明周东宜谢智健何嘉浩周子衡莫泽枫
Owner SOUTH CHINA NORMAL UNIVERSITY
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products