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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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.
...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com