Method for generating metamorphic test case based on adaptive random strategy

A test case and random strategy technology, applied in the field of metamorphic test case generation and metamorphic test case generation based on adaptive random strategy, can solve the problems of lack of test coverage and insufficient effectiveness, and achieve improved effectiveness and coverage, Simple generation method and improved dispersion effect

Active Publication Date: 2015-04-29
PLA UNIV OF SCI & TECH
View PDF4 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Although this universal random value testing technique is simple, it does not provide useful information for test coverage in the process of test case generation, and has a certain degree of blindness, so its effectiveness is generally considered not high enough compared with other testing techniques

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
  • Method for generating metamorphic test case based on adaptive random strategy
  • Method for generating metamorphic test case based on adaptive random strategy
  • Method for generating metamorphic test case based on adaptive random strategy

Examples

Experimental program
Comparison scheme
Effect test

Embodiment approach

[0038] A kind of transformation test case generation method based on self-adaptive random strategy of the present invention, such as figure 1 shown, including the following steps:

test Embodiment OTC, test Embodiment test Embodiment F

[0039] Step 1 For the software under test, a group of original test cases OTC is randomly generated by random value strategy, and the corresponding additional test cases FTC are generated by the original test cases according to the input relationship of the metamorphic relationship; the original test case OTC and the additional test case FTC constitute a set of Select test cases OTC and FTC, the number of selected test cases OTC and FTC is |OTC|+|FTC|, where |OTC| represents the number of original test cases, and |FTC| represents the number of additional test cases.

[0040] Step 2 is based on a group of selected test cases OTC and FTC generated in step 1, and adopts an adaptive random strategy to generate the next group of test cases, including the following sub-steps:

[0041]Sub-step 1 divides the input domain of the software under test into |OTC|+|FTC|+1 subdomains; The number of (|OTC|+|FTC|) is 1 more, so it can be ensured that there is at least one subdomain that does n...

Embodiment

[0056] In order to illustrate the test case generation and selection process of the present invention in detail and clearly, this example takes a software program P that realizes the [P(x)]=sin(x) function as an example to describe in detail. The software program P is used to calculate y=sin(x). For this procedure, it is easy to obtain its metamorphic relationship MR sin1 :

[0057] MR sin1 : sin 2 (x)=sin(x+y)*sin(x-y)+sin 2 (y), namely:

[0058]

[0059] Among them, {x 1 , x 2} is the transformation relation MR sin1 The original test case to the metamorphic relation MR sin1 Based on the input relationship of , generate additional test cases {x 3 , x 4}.

[0060] Step 1: For the software P under test, a group of original test cases OTC is randomly generated using a random value strategy, and the corresponding additional test cases FTC are generated by the original test cases according to the input relationship of the above-mentioned metamorphic relationship.

...

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 method for generating a metamorphic test case based on an adaptive random strategy, and aims at randomly automatically generating a test case based on an adaptive strategy. The method comprises the steps of randomly generating a first group of original test cases; generating additional test cases according to metamorphic relation; forming a selected test case through the two cases; dividing an input field to obtain a subfield without being covered with the selected test case; generating a plurality of test cases randomly in the subfield; selecting one group of test cases as the candidate original test cases; generating the additional test cases according to the metamorphic relation; then selecting the test cases with the maximum distance as the next group of text cases according to the distance from the candidate test cases to the selected test cases and the distance from the candidate original test cases to the additional test cases. The test case generation method is simple and clear; the dispersion, effectiveness and coverage rate of the test cases in the input field are greatly improved.

Description

technical field [0001] The invention relates to a method for generating a metamorphosis test case, in particular to a method for generating a metamorphosis test case based on an adaptive random strategy, and belongs to the technical field of software metamorphosis testing. Background technique [0002] Metamorphic Testing (Metamorphic Testing) is an effective and practical means to solve the problem of software testing judgment. The original intention of this testing technology is to generate additional test cases based on the existing test cases through the metamorphic relationship, and then check whether the two test cases satisfy the metamorphic relationship through the corresponding metamorphic relationship. The former test case is called the original test case of metamorphosis test, referred to as the original test case (Original Test Cases: OTC). The latter test case is the additional test case of the transformation test, referred to as the additional test case (Follo...

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 Applications(China)
IPC IPC(8): G06F11/36
Inventor 惠战伟黄松李辉饶莉萍王梅娟吕学伟
Owner PLA UNIV OF SCI & 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