Intelligent contract test method based on multi-objective optimization

A multi-objective optimization and smart contract technology, which is applied in the test case generation of Ethereum smart contract and blockchain smart contract testing, can solve unrealistic problems and achieve the goals of reducing burden, increasing quality and reliability, and improving efficiency Effect

Active Publication Date: 2020-12-11
NANJING MUCE INFORMATION TECH
View PDF3 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Clearly, these several goals conflict with each other, which means that it is unrealistic to find a solution that achieves the best results in each

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
  • Intelligent contract test method based on multi-objective optimization
  • Intelligent contract test method based on multi-objective optimization
  • Intelligent contract test method based on multi-objective optimization

Examples

Experimental program
Comparison scheme
Effect test

test Embodiment t

[0072] Step 1: Start state; Step 2: Input SC, Set_FD, test file generation stop criterion tc tf and test file number stop criterion tc tfn ;Step 3: Initialize the test file set set_test_file to be empty; Step 4: Initialize the test case set TS to be empty; Step 5: Randomly obtain an element fd in Set_FD; Step 6: Obtain the parameter type sequence list_arg_type of fd; Step 7: Press Sequentially take out an element arg_type of list_arg_type; step 8: randomly generate a value arg_value for arg_type; step 9: store arg_value to the parameter value sequence list_arg_type; step 10: judge whether list_arg_type has been traversed, if so, execute the next step, otherwise execute step 7 ;Step 11: Generate a test case t according to fd and list_arg_value i ; Step 12: put t i Add to TS; step 13: judge whether Set_FD has been traversed, if so, execute the next step, otherwise execute step 5; step 14: judge whether tc is satisfied tf , if so, go to the next step, otherwise go to step 5; s...

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 relates to an intelligent contract testing method based on multi-objective optimization. The method comprises steps of obtaining an ABI for an Ethereum intelligent contract source program through truffle compiling, and generating a series of random testing suites through a method for obtaining an intelligent contract through the analysis of the ABI; running a test suite on a local chain to obtain a plurality of conflicting targets such as gas consumption, test case number, branch coverage rate and variation score; non-dominated sorting being carried out according to the collectedinformation, and a Pareto optimal solution being found so that balance is achieved among multiple targets. The method is advantaged in that the method aims to automatically generate the intelligent contract test suite which has cost effectiveness and representativeness, help contract testers to improve the test sufficiency and reduce the test cost at the same time, and finally achieve the goals of improving the intelligent contract test effect and guaranteeing the intelligent contract quality.

Description

technical field [0001] The invention belongs to the field of blockchain smart contract testing, and is especially suitable for the field of test case generation of Ethereum smart contracts. Its purpose is to automatically generate high-quality and low-cost smart contract test cases. Reduce testing costs and ensure the quality of smart contracts by automatically generating tests. Background technique [0002] Smart Contract (Smart Contract, SC) can be regarded as a "computer transaction agreement that executes the terms of the contract". It was first proposed by Nick Szabo to enable contracts to be automatically and correctly executed without relying on trusted institutions. The blockchain has the characteristics of decentralization and anonymization, which provides a feasible technology for building a smart contract support platform. A smart contract encapsulates a number of predefined states and transition rules, scenarios that trigger contract execution (such as reaching...

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
IPC IPC(8): G06F11/36G06Q40/04
CPCG06F11/3676G06F11/3684G06F11/3688G06Q40/04
Inventor 王兴亚巫浩然孙伟松赵源段定陈振宇
Owner NANJING MUCE INFORMATION TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products