CN115617700B - Test case design and generation method and system based on relational analysis - Google Patents

Test case design and generation method and system based on relational analysis Download PDF

Info

Publication number
CN115617700B
CN115617700B CN202211631619.3A CN202211631619A CN115617700B CN 115617700 B CN115617700 B CN 115617700B CN 202211631619 A CN202211631619 A CN 202211631619A CN 115617700 B CN115617700 B CN 115617700B
Authority
CN
China
Prior art keywords
case
relation
parent
cases
elements
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211631619.3A
Other languages
Chinese (zh)
Other versions
CN115617700A (en
Inventor
吕敬钦
严丽平
朱志亮
赵丽萍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
East China Jiaotong University
Original Assignee
East China Jiaotong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by East China Jiaotong University filed Critical East China Jiaotong University
Priority to CN202211631619.3A priority Critical patent/CN115617700B/en
Publication of CN115617700A publication Critical patent/CN115617700A/en
Application granted granted Critical
Publication of CN115617700B publication Critical patent/CN115617700B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Physiology (AREA)
  • Genetics & Genomics (AREA)
  • Quality & Reliability (AREA)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a test case designing and generating method and a system based on relational analysis, wherein the method comprises the following steps: acquiring function requirements and a processing mode of a program to be tested, and performing relation analysis on variables in the program to be tested according to the function requirements and the processing mode to obtain a relation between input variables and a relation between the input variables and output variables; designing a plurality of relation use cases according to the relation between the input variables and the output variables to obtain a relation use case set; and generating a progeny case according to a preset ecological reproduction test case algorithm and the test case set, and performing auxiliary test on the program to be tested according to the progeny case. The method for designing and generating the test cases based on the relational analysis solves the problems that the test cases obtained in the traditional mode are difficult to be suitable for researching and analyzing programs with large input data quantity and complex functions, and meanwhile, a large number of test cases with diversity and corresponding functional requirements can be designed in an auxiliary mode, and the burden of manual design is greatly reduced.

Description

Test case design and generation method and system based on relational analysis
Technical Field
The invention relates to the technical field of software testing, in particular to a method and a system for designing and generating a test case based on relational analysis.
Background
The software tester executes the test case to verify the software function and tests to find out the software defect. Designing an efficient, reasonable and complete test case set is the key work of software function testing.
At present, the test case design has many theoretical methods, such as an equivalence class method, a boundary value method, a causal graph method, a decision table method and the like. The equivalence class method and the boundary value method are the most commonly used methods. However, for many programs with relatively complex input, output and requirements, the equivalence class method is difficult to make equivalence division, and the internal boundary values and special values are also difficult to be fully analyzed, so that an efficient, reasonable and complete test case set is difficult to obtain. For example, for a program for searching for a maximum value, the input is an array with a variable length, and the input cannot be divided into equivalent classes by using an equivalent class method, and all boundary values cannot be derived and analyzed. For another example, for a binary search procedure, it is difficult to perform an equivalent division on a value or an array to be searched by using an equivalence class method, and all boundary values cannot be derived and analyzed. Therefore, for many relatively complex software functions, certain defects exist when an equivalence method and a boundary value method are used for research and analysis, so that a reasonable and complete test case is difficult to design, and a test case design method capable of deeply and comprehensively analyzing complex program functions, inputs and outputs is urgently needed.
On the other hand, for programs with large input data volume and complex functions, such as course arrangement in colleges and universities, production planning, text mining and the like, if all latent defects are to be tested as much as possible, a large number of use case development tests need to be designed. Because the input data volume is large, a certain amount of time is needed for manually designing a small amount of use cases, and it is very difficult to design a large amount of test use cases which have diversity and can correspond to functional requirements.
There are also many methods for automatically generating test cases, however, many of these methods are to randomly select or optimally combine within a limited range or under a limited condition, or to analyze codes and the like to generate test cases. These automatic generation methods do not have the functional requirements of the analysis program and the ability to process the way at all. For example, for the next day program NextDate (y, m, d), the function of calculating and outputting the date (y 2, m2, d 2) of the next day for inputting the date year, month and day (y, m, d) is divided into: three types of treatments for the middle of the month, the end of the month, and the date of absence (e.g., 2 months 30). The equivalence class division can be made for the input (y, m, d) according to the functional requirements and processing mode: the months can be divided into big months (1,3,5,7,8,10,12), small months (4,6,9,11) and february (2); the years can be divided into leap years (2016,2000) and peaceful years (1900,2015); the daily score is (1-27,28,29,30,31). However, the computer does not have human intelligence to understand the functional requirements, and cannot automatically classify the equivalence classes for the dates. This analysis can only be made by the tester or programmer according to the functional requirements and the nature of the input date. Of course, the manually designed year, month and day data can be input into the automatic case generation system, and the system randomly combines or combines the input data according to the manually set requirements to obtain cases, so that some manual burdens are reduced. Therefore, the method is a feasible method for inputting the manually designed key data or use cases meeting the functional requirements and generating a large number of use cases through system assistance.
Disclosure of Invention
Based on the above, the invention aims to provide a test case design and generation method and system based on relational analysis, so as to solve the problem that the traditional design method is difficult to deeply and comprehensively analyze complex programs, and a reasonable, effective and comprehensive test case set can be designed; meanwhile, the system can automatically generate and design a large number of auxiliary test case sets which have diversity and correspond to functional requirements, and the burden of manual design is greatly reduced.
According to the test case design and generation method based on the relational analysis, the method comprises the following steps:
acquiring function requirements and a processing mode of a program to be tested, and performing relation analysis on variables in the program to be tested according to the function requirements and the processing mode to obtain a relation between input variables and a relation between the input variables and output variables;
designing a plurality of relation use cases according to the relation between the input variables and the output variables to obtain a relation use case set;
and inputting the relation case set to generate a subsequent generation case set according to a preset ecological reproduction test case algorithm.
In summary, according to the method for designing and generating test cases based on the relational analysis, through the analysis of the function and input complex program development relations, the relations can comprehensively cover the function requirements and the processing modes, so that the efficient, reasonable and complete test cases can be designed, the latent, difficult-to-find program bugs can be found out, and the capability of testers and programmers in designing the test cases can be improved. For a complex program with large input data amount, after a relation case set is designed, a large number of descendant case sets with relation characteristics and diversity can be obtained through multiple rounds of reproduction, recombination and variation by relying on the proposed ecological reproduction algorithm and taking the relation case set as the basis, and the complex program with large input data amount can be comprehensively and effectively tested in an auxiliary manner.
Further, the step of obtaining the function requirement and the processing mode of the program to be tested, and performing relationship analysis on the variables in the program to be tested according to the function requirement and the processing mode to obtain the relationship between the input variables and the output variables comprises:
acquiring a whole input set corresponding to the program to be tested, and acquiring input variables and effective input conditions for representing the whole input set according to the whole input set;
analyzing the value types of the single variables and various relations among the input variables by taking the input variables and the effective input conditions as analysis objects according to the functional requirements and the processing mode;
and inputting all input variables into the program to be tested respectively to obtain output variables, and corresponding the output variables to the input variables according to the function requirements to obtain the relation between the output variables and the input variables.
Further, the step of inputting the relational case set to generate a descendant case set according to a preset ecological reproduction test case algorithm includes:
setting the value range of the elements in the case as
Figure 658161DEST_PATH_IMAGE001
Selecting a similarity function;
inputting the relational use case set
Figure 317812DEST_PATH_IMAGE002
And initializing the parent set
Figure 948645DEST_PATH_IMAGE003
And for the parent set
Figure 806879DEST_PATH_IMAGE004
To carry out
Figure 763334DEST_PATH_IMAGE005
And repeating the loop again to reproduce the offspring use case set.
Further, the inputting the relational use case set
Figure 707019DEST_PATH_IMAGE002
And initializing the parent set
Figure 203860DEST_PATH_IMAGE003
And for the parent set
Figure 791967DEST_PATH_IMAGE004
To carry out
Figure 43957DEST_PATH_IMAGE005
The step of repeating the loop for the second time to reproduce the offspring case set comprises the following steps:
for the parent set
Figure 869347DEST_PATH_IMAGE004
Performing cross propagation to obtain a primary set, then performing individual recombination on the primary set to obtain a recombined set, and performing individual variation on the recombined set to obtain a variant set;
taking the obtained variation set as a child set in the iterative reproduction, and calculating to obtain the similarity between the child set and a parent set in the reproduction;
and taking the filial generation set in the iterative reproduction as a parent set in the next reproduction to perform cross reproduction, individual recombination and individual variation again, and outputting the filial generation sets in the iterative reproduction and the corresponding similarity.
Further, the pair of the parent set
Figure 169878DEST_PATH_IMAGE004
The step of performing cross breeding to obtain a primary set comprises the following steps:
collecting the parent
Figure 737126DEST_PATH_IMAGE004
Each parent use case in
Figure 769804DEST_PATH_IMAGE006
Randomly matching another parent case
Figure 953661DEST_PATH_IMAGE007
So that two different parent cases can exchange partial elements to obtain two sub cases.
The parent set
Figure 464408DEST_PATH_IMAGE004
Each parent use case in
Figure 355003DEST_PATH_IMAGE006
Randomly matching another parent use case
Figure 948796DEST_PATH_IMAGE008
So that two different parent cases can exchange partial elements, and the step of obtaining two sub cases comprises:
acquiring a random number, and calculating according to the random number and a parameter corresponding to the current cross reproduction to obtain the number of elements exchanged in the current cross reproduction by the two relation cases;
and calculating the number of interchangeable elements of the two relation cases in the current cross reproduction according to the following formula:
Figure 964156DEST_PATH_IMAGE009
wherein,
Figure 668807DEST_PATH_IMAGE010
representing the number of elements that the two relational use cases interchange in the current cross-breeding,
Figure 413909DEST_PATH_IMAGE011
and
Figure 286925DEST_PATH_IMAGE012
respectively represent the lengths of two relational use cases,
Figure 914215DEST_PATH_IMAGE013
denotes the first
Figure 32344DEST_PATH_IMAGE005
The parameters of the secondary cross-breeding are,
Figure 694270DEST_PATH_IMAGE014
represents a random number and
Figure 567548DEST_PATH_IMAGE015
obtaining parameters corresponding to the current cross breeding according to the following formula:
Figure 557500DEST_PATH_IMAGE016
wherein,
Figure 603954DEST_PATH_IMAGE017
the initial cross-breeding parameters are expressed,abcthree constant parameters are represented;
the step of carrying out individual recombination on the primary set to obtain a recombined set comprises the following steps:
and acquiring the length of each nascent case in the nascent set, and interchanging the positions of two elements of each nascent case according to the length and the random number to obtain a recombined set.
The step of performing individual variation on the recombination set to obtain a variation set comprises:
and carrying out variation on the elements in the recombination set according to a preset value range.
Further, the step of mutating the elements in the recombination set according to a preset value range includes:
if the elements in the relation case set are numerical value types, calculating to obtain a current variation value according to the numerical values of the elements to be varied in the recombination set and the control parameters of the current individual variation degree, and carrying out individual variation on the elements to be varied according to the current variation value to obtain a variation-completed numerical value, wherein the variation-completed numerical value range is the same as a preset value range;
if the elements in the relation case set are of non-numerical type, the preset value range is selected
Figure 995752DEST_PATH_IMAGE018
Randomly selecting an element to replace the element to be mutated to complete individual mutation.
Further, if the element in the relationship case set is a numerical value type, calculating a current variation value according to a numerical value of the element to be varied in the recombination set and a control parameter of a current individual variation degree, so as to perform individual variation on the element to be varied according to the current variation value, thereby obtaining a variation-completed numerical value, where a variation-completed numerical range is the same as a preset value range, including:
obtaining the current variance value according to the following formula:
Figure 836669DEST_PATH_IMAGE019
wherein,
Figure 641814DEST_PATH_IMAGE020
which is indicative of the current variance value,
Figure 603210DEST_PATH_IMAGE021
is a control parameter of the current individual variation degree,
Figure 239728DEST_PATH_IMAGE022
the absolute value of the element to be varied is indicated.
Further, the step of taking the obtained variant set as a child set in the current iterative reproduction and calculating to obtain the similarity between the child set and a parent set in the current reproduction includes:
calculating the similarity between the parent set and the child set in the reproduction according to the following formula:
Figure 126912DEST_PATH_IMAGE023
wherein,
Figure 153774DEST_PATH_IMAGE024
denotes the first
Figure 542030DEST_PATH_IMAGE025
The similarity between the parent set and the child set in the sub-iterative multiplication,
Figure 908421DEST_PATH_IMAGE026
denotes the first
Figure 91140DEST_PATH_IMAGE025
The set of parents in the secondary iteration breeding,
Figure 870878DEST_PATH_IMAGE027
is shown as
Figure 672611DEST_PATH_IMAGE025
The set of children in the sub-iterative multiplication,
Figure 18142DEST_PATH_IMAGE028
is shown as
Figure 11244DEST_PATH_IMAGE025
The number of use cases in the child set in the sub-iterative multiplication,
Figure 809435DEST_PATH_IMAGE029
representing the first in a parent set
Figure 477177DEST_PATH_IMAGE030
Individual case
Figure 552581DEST_PATH_IMAGE031
And the warp
Figure 608261DEST_PATH_IMAGE031
The obtained filial generation set is usedExample (B)
Figure 503536DEST_PATH_IMAGE032
The similarity of (c).
Further, the method further comprises:
if the elements in the relation case set are numerical value types, calculating the similarity between the two cases according to the following formula:
Figure 240548DEST_PATH_IMAGE033
wherein,
Figure 295092DEST_PATH_IMAGE034
representing a parent case
Figure 131461DEST_PATH_IMAGE035
And its sub-case x,
Figure 904244DEST_PATH_IMAGE036
representing a parent case
Figure 179368DEST_PATH_IMAGE035
To middle
Figure 459390DEST_PATH_IMAGE030
The number of the elements is one,
Figure 591294DEST_PATH_IMAGE037
number of presentation sub-case x
Figure 726740DEST_PATH_IMAGE030
The number of the elements is one,
Figure 602292DEST_PATH_IMAGE038
the length of the use case is represented,
Figure 834691DEST_PATH_IMAGE039
a parameter representing the degree of initial variation;
if the elements in the relation case set are of non-numerical type, calculating the similarity between the two cases according to the following formula:
Figure 747283DEST_PATH_IMAGE040
wherein,
Figure 760238DEST_PATH_IMAGE041
representing a parent case
Figure 49268DEST_PATH_IMAGE035
And its sub-case x,
Figure 136173DEST_PATH_IMAGE042
the weight parameter is represented by a weight value,
Figure 344300DEST_PATH_IMAGE043
representation for judging parent use case
Figure 952874DEST_PATH_IMAGE035
To middle
Figure 170229DEST_PATH_IMAGE030
An element
Figure 111640DEST_PATH_IMAGE044
And sub-case x
Figure 631614DEST_PATH_IMAGE030
An element
Figure 353582DEST_PATH_IMAGE037
Whether or not the same function is used,
Figure 984415DEST_PATH_IMAGE045
represents an element
Figure 842650DEST_PATH_IMAGE044
Match all elements in the sub-case x if
Figure 861421DEST_PATH_IMAGE046
In presence of elements and use cases
Figure 414893DEST_PATH_IMAGE044
If the two are the same, 1 is returned, otherwise 0 is returned.
According to the embodiment of the invention, the system for designing and generating the test case based on the relational analysis comprises the following components:
the system comprises a relation analysis module, a processing module and a processing module, wherein the relation analysis module is used for acquiring the function requirement and the processing mode of a program to be tested, and carrying out relation analysis on variables in the program to be tested according to the function requirement and the processing mode to obtain the relation between input variables and the relation between the input variables and the output variables;
the case set generating module is used for designing various relation cases according to the relation between the input variables and the output variables to obtain a relation case set;
and the case reproduction module is used for inputting the relational case set so as to generate a offspring case set according to a preset ecological reproduction test case algorithm.
Drawings
Fig. 1 is a flowchart of a test case designing and generating method based on relationship analysis according to a first embodiment of the present invention;
fig. 2 is a flowchart of a test case designing and generating method based on relationship analysis according to a second embodiment of the present invention;
FIG. 3 is a detailed diagram of step S106 in the second embodiment of the present invention;
fig. 4 is a flowchart of a test case designing and generating method based on relationship analysis in the third embodiment of the present invention.
The following detailed description will further illustrate the invention in conjunction with the above-described figures.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Several embodiments of the invention are shown in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
Referring to fig. 1, a flowchart of a test case designing and generating method based on relationship analysis according to a first embodiment of the present invention is shown, where the method includes steps S01 to S03, where:
step S01: acquiring function requirements and a processing mode of a program to be tested, and performing relation analysis on variables in the program to be tested according to the function requirements and the processing mode to obtain a relation between input variables and a relation between the input variables and output variables;
it should be noted that the processing mode refers to various specific processes that the program to be tested should perform to meet the functional requirements. The meaning of the variable in the relation analysis comprises objects related to functional requirements, such as positions, polygons, curriculum schedules, dormitories, teaching buildings and the like, and analyzable relations, such as the inside, the outside and the edges of the polygons, comprise a plurality of objects (such as red chessmen and bus stations), wherein in the process of analyzing various relations in input and output, each relation needs to be completely analyzed, namely various conditions of the relations are analyzed, so that test holes can be avoided, and codes can be covered. For example, when analyzing the relationship between the value k to be examined and the array element ai, i ∈ [1,n ] is considered, the boundary values a1 and an of ai are treated with emphasis, and the relationship between k and a1 and the relationship between k and an are also analyzed.
Step S02: designing a plurality of relation use cases according to the relation between the input variables and the output variables to obtain a relation use case set;
it can be understood that, for a general program to be tested, through reasonably and completely analyzing input and output, a sufficient kind of relation case set can be designed according to the obtained relation. The relation case set can comprehensively embody the function requirements and various processing modes in a data form, and can effectively verify whether the program correctly and comprehensively realizes the function requirements. The code of the program to be tested is usually reasonable on the main body, so that the coverage rate of the relation case set on the general code can achieve complete coverage, namely, the relation between various variables obtained in relation analysis can be completely covered by the relation case set through design.
Step S03: and inputting the relation case set to generate a descendant case set according to a preset ecological reproduction test case algorithm.
However, if the core function of the program to be tested and the code thereof are complicated, whether a Bug exists in the code or not, several bugs are hidden, and where the Bug is hidden respectively, are unknown. To ensure that all the latent bugs are found, more use cases are required to test for core functions and code. If the data volume input by the program to be tested is small, a programmer or a tester can design a batch of extension cases by combining and changing according to various analyzed relationships based on the relationship case set. If the input of the program to be tested is the condition of large data quantity such as a long array, a plurality of arrays or a matrix, the new addition of a large number of use cases is very difficult and time-consuming, based on the condition, the relation use case set is taken as a main part, a large number of later-generation use case sets are obtained through an improved algorithm for auxiliary testing, and the latent Bug is easy to find out.
Example 1: taking the maximum value searching program largest (int [ ] data) as an example; the specific implementation steps are as follows:
functional requirements are as follows: finding out the maximum element in the input array data, and returning.
And step one, reasonably and completely analyzing the relation of the program to be tested according to the functional requirements and the processing mode, and analyzing the relation among input variables and the relation between output and input.
1) The set of valid inputs for the program as a whole is expressed in terms of variables and conditions as: data = (d 1, d2, …, di, …, dn), condition: n > =1.
2) Analyzing relationships between input variables
Kinds of individual variables: the single di has no direct relation with the processing mode, the equivalence class division cannot be carried out, and the boundary value cannot be analyzed. Using the condition n > =1 for n, it can be analyzed that: general case n >1; boundary value n =1 (input an array of one element); special value n =0 (condition for valid input is not satisfied, invalid case can be designed).
Relationship of di and dj: the values di > dj, di < dj and di = dj, and the positions i > j and i < j. These relationships are weakly related to the processing mode of finding the maximum value of the array, have no direct relationship, and cannot be used for designing a case, so are discarded.
The relationship between multiple variables is similar to the relationship between two variables, and analysis is not required to be expanded.
Relationship of the entire input array: too many n elements make analysis difficult to be performed by hands, and analysis is not expanded at all.
3) Analyzing relationships of outputs and inputs
The relationship between the output maximum value m and the input data is as follows: m corresponds to the maximum value dt in the input array, the relationship dt > = di exists, i belongs to [1,n ] and i ≠ t, and di is other elements except dt in the array. The relationship dt is actually the relationship of the entire array in step two.
By analyzing it completely, dt > = di can be classified as: 1) The position t of the maximum value dt is within a range from t epsilon [1,n ], t =1 and t = n are boundary values, and 1-t-n is a general case; 2) dt > di, i.e. dt is the only maximum in the array; 3) dt = dj, some elements dj are equal to the maximum, i.e. there are several equal maximum values (needed if the functional requirement is to find the number of maximum values), where the number of elements dj is in the range of [1,n-1].
And step two, designing a test case according to various relationships obtained by analysis.
Depending on the special value n =0 and the boundary value n =1, use cases { } (null array, invalid use case), and use cases {1} of a single element can be designed. Equivalence classes: and n >1, the array length of the general case is larger than 1.
From the boundary values t =1 and t = n, use cases {9,4,7,3,5,1} and {7,5,8,3,0,6,9} can be designed, the maximum values of which are at the first element and the last element, respectively. The use cases {6,4,9,8,1,7,2} can be designed by general case 1-t-woven fabric with the maximum value in the array.
According to the relationship: dt = dj, some elements dj are equal to the maximum value, the number of dj is in the range of [1,n-1], and use cases {1,5,9,6,9,4}, {9,6,5,9,3,9,1,2} and {9,9,9,9,9,9} can be designed, wherein the number of the elements equal to the maximum value among the three use cases is 1, a plurality of elements, and n-1 elements respectively. The actual code does not necessarily need to select the 3 cases, and certainly, in order to ensure the completeness of the test, the types of the cases are comprehensive and better. Generally, in the relationship analysis, various relationships need to be analyzed to avoid test vulnerabilities.
If the test cases are added to ensure the test result is completely consistent, some cases can be continuously designed according to all the relationships analyzed above. For example, {19,8,4,9, -10,5,11}, {8,19, -3,6,2, -5,1} and {1,5,19, -6,7,3,15,2} may be designed using the relationship of the position t of the maximum, with their maximum 19 at the 1 st, 2 nd and 3 rd positions, respectively. Of course, step three may also be run to generate more use cases.
And step three, generating a progeny use case through an ecological reproduction algorithm to assist in testing.
Step two, designing 8 relation cases, wherein { } and {1} are used for processing the two special cases by a test program; the other 6 kinds of use cases have relationship diversity, are used for testing the main code of the program, and can be used as a relationship use case set. Preliminarily setting (v 1, v 2) = (-9,19), after selecting the numerical similarity, reading the designed relation case set (except { } and {1} in the second step) by the ecological reproduction program, and starting to circulate the reproduction process for 5 times. The read relation case set is sorted as follows:
{9,4,7,3,5,1}
{7,5,8,3,0,6,9}
{6,4,9,8,1,7,2}
{1,5,9,6,9,4}
{9,6,5,9,3,9,1,2}
{9,9,9,9,9,9}
after circular propagation, the number of offspring in each round is (24,48,48,48, 48), and the paternal-child similarity in each round is (0.93,0.91,0.89,0.92,0.91). The first round contained 4 sets of descendant use cases, one of which is shown below.
{9,4,7,3,5,2}
{6,5,8,3,0,6,11}
{9,4,9,10,1,7,2}
{1,5,7,6,9,8}
{9,9,5,9,3,9,2,2}
{8,9,10,9,9,9}
The length of the generated offspring use case is the same as that of the relation use case, wherein the bold elements are changed in numerical value after one round of reproduction, and the other elements are not changed. The third round contains 8 sets of descendant use cases, one of which is shown below.
{9,4,8,3,5,2}
{5,6,8,3,0,6,11}
{9,4,6,10,1,7,2}
{1,5,6,7,9,8}
{9,7,5,10,3,2,4,5}
{10,8,9,9,7,5}
The fifth round contained 8 sets of offspring use cases, one of which is shown below.
{9,4,8,2,5,2}
{5,6,8,2,0,6,11}
{9,4,6,10,1,7,2}
{1,4,6,7,9,8}
{9,7,5,10,2,2,4,5}
{10,9,9,9,7,5}
Comparing the original relation case set with the generated partial descendant case sets, it can be seen that most relation case elements are retained during the first reproduction, and after the third and fifth reproductions, the approximation degree of the descendant sets and the relation sets is reduced, and new diversity is embodied. The offspring use cases of each round of reproduction will gradually increase new changes, and the characteristics from the relationship analysis gradually decrease. Therefore, the descendant cases of each round represent input types with different characteristics, and the cases are used for assisting the expansion test of the relational case set to obtain ideal test performance.
Example 2: two-point search program search (int [ ] array, int k)
Functional requirements are as follows: finding out whether k values to be found are in the elements of the array arranged in the ascending order, and if the elements are found, returning the positions of the elements; if no value of k is found, return to-1.
And step one, reasonably and completely analyzing the relation of the program to be tested according to the functional requirements and the processing mode, and analyzing the relation among input variables and the relation between output and input.
1) The set of valid inputs for the program as a whole is expressed in terms of variables and conditions as: array = (a 1, a2, …, ai, …, an), wherein the condition: if i < j, then ai < aj; n > =1.
2) Analyzing relationships between input variables
Kinds of individual variables: the single ai or k has no direct relation with the processing mode, the equivalence class division cannot be carried out, and the boundary value cannot be analyzed. Using the condition n > =1 for n, it can be analyzed that: general case n >1; boundary value n =1 (input an array of one element); special value n =0 (invalid input).
The relationship of the two variables includes: the relationship of ai and aj; and the relationship of k and ai.
The relationship between ai and aj is already clear in the input condition, if i < j, then ai < aj exists, which is a precondition for inputting an ascending array required by the functional requirement, and no expansion analysis is needed.
In the relationship between k and ai, i belongs to [1,n ], a1 and an are boundary values, and the relationship between k and a1 and an needs to be analyzed. The relation can be completely analyzed by combining the searched functional requirements and processing modes: k = ai found, k ≠ ai not found; k = a1, k < a1 is found to be smaller than the minimum value a 1; k = an is found, k > an is greater than the maximum value an; wherein k < a1 and k > an are special cases in the processing mode of the binary search program, and the value k to be searched is out of the numerical range of the array.
3) Analyzing relationships of outputs and inputs
If the k value is found, the output result is the position i of the found element, and the corresponding relation is as follows: k = ai, including boundary cases k = a1 and k = an. If no k value is found, the output result is-1, and the corresponding complete analysis is: k is not equal to ai; boundary cases k ≠ a1 and k ≠ an are included. In the boundary case, k > a1 and k < an do not correspond to a specific processing mode and should be discarded, so that the relation to be tested is k < a1 and k > an. The relationship analyzed in step three is the same as that of k and ai in step two.
And step two, designing a test case according to various relationships obtained by analysis.
Depending on the special value n =0 and the boundary value n =1, use cases { } (null array, invalid use case), and use cases {5} of a single element can be designed. General conditions are as follows: and n >1, the array length of the general case is larger than 1. The array is arranged in ascending order, and a plurality of use cases can be designed: {1,3,6,7,9},{5,6,8,27,32,46,50,68, 83,99}.
And according to the relation between k and ai in the second step, designing k = -1,5,8 for the array {5}. For the array {1,3,6,7,9}, use cases of k = -1,1,5,6,9,13, etc. may be designed. For the second array, use cases of k =2,5,27,48,99,100, etc. can be designed.
The use case was designed with 3 k values except for {5}, and for two other arrays, each array has 6 k values, for a total of 16 use cases. The experiment sets 5 code versions with different bugs for the binary search code, the test operation relation case can completely cover the code, and the 5 bugs can be found.
If the test case is added, k = -5,2,3,7,8,19 can be added to the array {1,3,6,7,9}, and k = -3,6,7,8,30,32,46,50,55,68,70,83,110 can be added to another array by using the relation between k and (a 1, ai, an). And designing a plurality of well-ordered arrays, and designing a plurality of k values for each array by applying the relation.
And step three, generating a progeny use case through an ecological reproduction algorithm to assist in testing.
The binary search program can manually design a large number of use cases depending on the relation, the use cases can be sufficiently and completely covered by codes of the program, and generally, a multiplication algorithm does not need to be operated to generate the use cases. In addition, the input array of the program is an array which is arranged in an ascending order and is not repeated, so that it is difficult to directly generate a large number of required use cases. If the elements in the ascending array are required to be not repeated, range parameters and the like can be reasonably set, the repeated degree of the elements is reduced, and finally, a small number of repeated elements are manually removed or modified.
Example 3: the program to be tested is a chess cannon walking program.
Functional requirements are as follows: in the process of the chess game, a player selects a cannon at a position A and clicks a certain position B on a chessboard; the program analyzes the results of this step-by-step shot: walking, cannon fighting enemies, cannon fighting commander wins chess, and if cannon A can not walk to position B, the user needs to be prompted.
And step one, reasonably and completely analyzing the relation of the program to be tested according to the functional requirements and the processing mode, and analyzing the relation among input variables and the relation between output and input.
1) The set of valid inputs for the program as a whole is expressed in terms of variables and conditions as: position of a and B (xA, yA, xB, yB) and current piece on the board (q 1, q 2.. Qn) qi = (namei, xi, yi). The position x on the chess game belongs to the field of 0,8, and y belongs to the field of 0,9. The name of the red chess belongs to the field of 1,7 and represents 7 chess pieces (the red cannon is 2, the red soldier is 1, the black chess piece is with a minus sign, the black cannon is-2, and the black pawn is-1).
2) Analyzing relationships between input variables/objects
Kind of individual object: the chess has no requirement on the position A of the cannon and no requirement. Kind of the position B: empty chessman and chessman (the former, the enemy and the enemy will be commander).
Relationship of two objects: the relationship between A and B is A = B and A! = B (A and chess, B and chess have no relationship). And A = B indicates that AB is overlapped and cannot walk, so that an invalid case can be designed. A! = B then AB constitutes the line segment, and the cannon can walk when the AB line segment is horizontal or vertical according to the functional requirement (chess rule), and can not walk when being oblique line, there is the relation: transverse, longitudinal and diagonal.
According to the functional requirements, the relationship between the AB line segment and the chess game: there are 0 (walkable), 1 (fireable) or more chessmen (not walkable) on AB.
3) Analyzing relationships of outputs and inputs
The outputs are four: walking, shooting with a cannon and shooting with a general cannon cannot walk. Relationship of walking to input: AB is transverse or longitudinal, and AB is devoid of subunits, and B is devoid of subunits. Relationship of the cannon to the input: AB is horizontal or vertical, and AB is 1 son, and B is enemy (or enemy general). Too many cases of incapability of walking are caused, and the analysis is complex and inconvenient.
Previously analyzed are 3 types of relationships: the direction of AB, the number of chessmen between AB and the condition of B point. The 3 kinds of relations are completely analyzed, namely complement completion: AB is horizontal, longitudinal and oblique; 0 seed, 1 seed and majority seed between AB; b is blank, the Chinese character 'ji' square, enemy square and general of enemy.
The relationships analyzed in 2) and 3) above are basically consistent, and 2) a special relationship of a = B is analyzed, so that a programmer may ignore the fact to write code and result in Bug, and thus such a use case is required.
And step two, designing a test case according to various relationships obtained by analysis.
An invalid case can be designed according to A = B: cannon 2 is at a = (3,7) and purpose B = (3,7). The chess game is a 9 x 10 matrix, the element value is 0 to indicate null, and the position element value of the chessmen is the name of the chessman. The use case focuses on the value of AB, and some chess piece names are randomly arranged in the chess game. Because the chess game matrix occupies space, only one specific chess game case data is shown below, and the matrix parts of the other cases are omitted.
The variable relationships are as follows: 3 in the AB direction, 3 in the middle of the AB direction and 4 in the B point. Design cases need to cover these cases reasonably completely. Design example of cannon attack enemy a: gun-2 has soldiers 1 in A = (2,2), purpose B = (2,6), AB is longitudinal, and only position C (2,3) has pawns-1 on the AB line segment. The chess game of use case a takes the following 9 x 10 matrix.
Chess game 3 4 5 6 7 50 3
0 0 0 0 0 0 0 0 0
0 2 0 0 0 0 4 2 0
1 0 1 0 1 0 1 0 1
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
-1 0-1 0-1 0-1 0-1
0 0-2 0 0 0 0-2 0
0 0 0 0 0 0 0 0 0
-3-4-5-6-7-6-5-4-3
Cannon enemy case b: the cannon 2 has pawns-1 at A = (1,3), a goal B = (4,3), an AB is transverse, and a pawn-1 is only at a position C (2,3) on an AB line segment. Space-limited, use case b and the following use cases, the board game is partially omitted. The shooting enemy strictly meets 3 small conditions: AB transverse or longitudinal and AB inter 1 and B enemy. Thus this relationship is covered by cases a and b.
When the use cases of the enemy commander are designed by the cannon, 1 longitudinal (or transverse) use case of the enemy commander can be designed manually because the previous use cases a and b already cover the processing mode of judging the transverse direction and the longitudinal direction. Shooting enemy and commander case c: the red cannon 2 has a chessman black elephant-1 at A = (4,3), the purpose B = (4,0) is enem general-7, and only the position C (4,2) on the AB longitudinal line segment.
Example of walking d: black gun-2 has no chess pieces on the horizontal line segment AB with A = (7,2), the purpose B = (4,2) is empty 0, and AB. Walking should strictly meet 3 minor conditions: AB transverse or longitudinal and AB internodal and B infertile. Thus case d can cover this relationship. The horizontal or vertical relationship is covered by the previous use cases a-c.
Case e, unable to walk: red cannon 2 can not move in the oblique direction of AB when A = (4,5) and the purpose B = (6,7) is empty 0. If f, the black gun-2 is in A = (3,5), and the purpose B = (6,5) is that the black pawn-1, AB is transverse but the chessman cannot move at point B. In case g, the red cannon 2 has a red horse 4 at A = (4,3), the purpose B = (4,6) is empty 0, and C = (4,5) on an AB longitudinal line segment, so that the person cannot walk. The 3 cases correspond to factors which cannot be walked in the 3 types of relations: oblique, with chessmen in the middle, with chessmen at point B.
Case h which cannot be fired: black gun-2 is in A = (6,3), purpose B = (5,7) is empty 0, AB cannot be shot obliquely. Use case i: red cannon 2 has two chessmen between A = (0,0), the purpose B = (4,0) is that enem general-1, AB transverse direction position C = (2,0) has black elephant-5 and position D = (3,0) has black dragon-6, AB cannot cannon. Case j: black gun-2 is friend and cannot fire at A = (7,2), purpose B = (2,2) is black horse-4, AB transverse direction position C = (4,2) has black phase-5, AB chessman. The 3 cases correspond to the factors that cannot be shot in the 3 types of relations: oblique, 2 pieces in the middle and friend point B.
The above cases a-j and invalid case can completely cover all relations in the step one: 3 in the AB direction, 3 in the middle of the AB direction and 4 in the B point. The logic complexity of the shot-shooting-running code is not high, 4 code versions with different bugs are set through experiments, the test operation relation case can completely cover the code, and the 4 bugs can be found out. If the time is sufficient, the combination can be arranged according to all the relations to obtain 3 × 3 × 4=36 use cases.
And step three, generating a progeny use case through an ecological reproduction algorithm to assist in testing.
The previously designed cases of a-j are 10, and the analysis is focused on A, B and the chessmen in the middle of AB. However, in the whole chess software, a plurality of small programs such as horse walking, soldier walking, car walking and the like exist, and enough chess game matrix cases need to be obtained through ecological reproduction to develop sufficient tests. Because the number of the chess pieces on the chessboard is limited by rules, the value range is set to be [ -7,7] before the reproduction algorithm is operated, the individual variation parameters are reduced, and the cross reproduction and the individual recombination are mainly used to obtain the offspring use cases. The obtained use case set can obtain a chess game matrix use case which accords with the actual chess playing by simply modifying a small amount of data.
In summary, according to the method for designing and generating test cases based on the relational analysis, through analyzing the function and the input complicated program development relations, the relations can comprehensively cover the function requirements and the processing modes, so that the efficient, reasonable and complete test cases can be designed, latent and difficult-to-find program bugs can be found out beneficially, and testers and programmers can be helped to improve the capability of designing the test cases. For a complex program with large input data amount, after a relation case set is designed, a large number of descendant case sets with relation characteristics and diversity can be obtained through multiple rounds of reproduction, recombination and variation by relying on the proposed ecological reproduction algorithm and taking the relation case set as the basis, and the complex program with large input data amount can be comprehensively and effectively tested in an auxiliary manner.
Referring to fig. 2, a flowchart of a test case designing and generating method based on relationship analysis according to a second embodiment of the present invention is shown, where the method includes steps S101 to S106, where:
step S101: acquiring a whole input set corresponding to the program to be tested, and acquiring input variables and effective input conditions for expressing the whole input set according to the whole input set;
step S102: analyzing the value types of the single variables and various relations among the input variables by taking the input variables and the effective input conditions as analysis objects according to the functional requirements and the processing mode;
step S103: inputting all input variables into the program to be tested respectively to obtain output variables, and corresponding the output variables to the input variables according to the function requirements to obtain the relation between the output variables and the input variables;
it should be noted that the set of input variables and valid input conditions is to correspond exactly to the range of all inputs of the program to be tested.
Furthermore, variables and conditions of the input set are taken as objects, the functions of the software are reasonably analyzed in combination with the requirements and the processing modes of the software, and each analyzed variable relation is corresponding to the function requirements and the processing modes.
In the relational analysis, the category of a single variable in the input is analyzed, then the relation between two input variables is analyzed, and the relation between a plurality of variables and the relation of the whole input are analyzed subsequently, so that all the variable relations related to the function requirements and the processing modes in the input space are analyzed comprehensively.
Step S104: designing a plurality of relation cases according to the relation between the input variables and the output variables to obtain a relation case set;
step S105: setting the value range of elements in the case as
Figure 239630DEST_PATH_IMAGE001
Selecting a similarity function;
step S106: inputting the relational use case set
Figure 329202DEST_PATH_IMAGE002
And initializing the parent set
Figure 518875DEST_PATH_IMAGE003
And for the parent set
Figure 949856DEST_PATH_IMAGE004
To carry out
Figure 922492DEST_PATH_IMAGE005
And repeating the loop for several times to obtain the descendant case set.
Referring to fig. 3, a detailed diagram of step S106 in the present embodiment is shown, where step S106 includes step S1061 to step S1063, where:
step S1061: for the parent set
Figure 755318DEST_PATH_IMAGE004
Performing cross propagation to obtain a primary set, then performing individual recombination on the primary set to obtain a recombined set, and performing individual variation on the recombined set to obtain a variant set;
in the process of cross-breeding the parent set, first, the parent set Z is set d Each relation use case in the relation use cases is randomly matched into another relation use case, so that different relation use cases carry out partial element interchange, and two sub use cases are obtained.
Specifically, firstly, a random number r is obtained, and the number of elements exchanged in the current cross reproduction by the two relation cases is obtained through calculation according to the random number r and parameters corresponding to the current cross reproduction;
and calculating the number of the interchange elements of the two relation cases in the current cross reproduction according to the following formula:
Figure 787996DEST_PATH_IMAGE009
wherein m is 1 Representing the number of elements that the two relational use cases interchange in the current cross-breeding,
Figure 643957DEST_PATH_IMAGE011
and
Figure 544917DEST_PATH_IMAGE012
respectively represent the lengths of two relation use cases,
Figure 107616DEST_PATH_IMAGE013
denotes the parameter of the d-th cross-breeding, r denotes a random number and
Figure 701409DEST_PATH_IMAGE015
obtaining the parameters corresponding to the current cross breeding according to the following formula:
Figure 215304DEST_PATH_IMAGE016
parameter in (1)
Figure 857638DEST_PATH_IMAGE047
Is fixedly arranged as
Figure 399478DEST_PATH_IMAGE048
In general, the first cycle of multiplication is carried out without modification
Figure 39538DEST_PATH_IMAGE049
Figure 666828DEST_PATH_IMAGE017
Is the initial cross-breeding parameter. The position of each exchanged element is also determined by a random number
Figure 112853DEST_PATH_IMAGE050
To be determined. Generally, the number of the primary cases obtained by each multiplication is equal to the number of the parent cases. The number of the first three breeding descendants needs to be considered because the descendants are similar to the relational case setAnd (5) doubling. The parameters of the first three times of reproduction are generally set as
Figure 650145DEST_PATH_IMAGE051
Default setting
Figure 585740DEST_PATH_IMAGE052
Further, in the process of performing individual recombination on the obtained primary sets, firstly, the lengths of the primary sets need to be obtained, and the positions of two elements in each primary set are interchanged according to the lengths of the primary sets and random numbers; individual recombination representation in use cases
Figure 310113DEST_PATH_IMAGE053
Self-selecting two elements to interchange position and interchange times
Figure 356567DEST_PATH_IMAGE054
Interchanging the positions of two elements by random numbers
Figure 76261DEST_PATH_IMAGE055
And (5) determining. Parameters of recombination times
Figure 288150DEST_PATH_IMAGE056
Is calculated by
Figure 624453DEST_PATH_IMAGE013
Like
Figure 84385DEST_PATH_IMAGE057
Parameter in
Figure 720902DEST_PATH_IMAGE058
And
Figure 608087DEST_PATH_IMAGE013
the values set in (1) are the same, when the first reproduction is carried out
Figure 900528DEST_PATH_IMAGE059
Furthermore, in the process of performing individual variation on the obtained recombination set, firstly, an input type of an element in a relationship case set needs to be detected, if the element in the relationship case set is a numerical value type, a current variation value is obtained by calculation according to a numerical value corresponding to an element to be varied in the recombination set and a control parameter of a current individual variation degree, so that the element to be varied is subjected to individual variation according to the current variation value to obtain a variation-completed numerical value, and the variation-completed numerical value range is the same as a preset value range;
obtaining the current variance value according to the following formula:
Figure 288784DEST_PATH_IMAGE019
wherein,
Figure 655174DEST_PATH_IMAGE020
which is indicative of the current value of the variance,
Figure 837894DEST_PATH_IMAGE021
and | x | represents the absolute value of the numerical value corresponding to the element to be mutated, which is the control parameter of the current individual mutation degree. The value of the mutated element is changed to
Figure 352052DEST_PATH_IMAGE060
. If out of range
Figure 652321DEST_PATH_IMAGE061
Then the random number is regenerated
Figure 997852DEST_PATH_IMAGE062
Calculating again the variation value
Figure 226839DEST_PATH_IMAGE063
To ensure
Figure 290610DEST_PATH_IMAGE064
Within the range. If the input type is integer, the right side of the formula needs to be rounded first and then the value of the element needs to be updated, that is, the value is
Figure 896035DEST_PATH_IMAGE065
If the elements in the relation case set are of non-numerical type, the preset value range is selected
Figure 299334DEST_PATH_IMAGE018
Randomly selecting an element to replace the element to be mutated to complete individual mutation.
Step S1062: taking the obtained variation set as a child set in the iterative reproduction, and calculating to obtain the similarity between the child set and a parent set in the reproduction;
specifically, the similarity between the child set and the parent set in the reproduction is calculated according to the following formula:
Figure 823856DEST_PATH_IMAGE023
wherein,
Figure 984711DEST_PATH_IMAGE024
is shown as
Figure 784039DEST_PATH_IMAGE025
The similarity between the parent set and the child set in the sub-iterative multiplication,
Figure 41845DEST_PATH_IMAGE026
is shown as
Figure 114100DEST_PATH_IMAGE025
The parent set in the sub-iterative multiplication,
Figure 152463DEST_PATH_IMAGE027
is shown as
Figure 99690DEST_PATH_IMAGE025
The set of children in the sub-iterative multiplication,
Figure 8741DEST_PATH_IMAGE028
is shown as
Figure 343907DEST_PATH_IMAGE025
The number of use cases in the child set in the sub-iterative multiplication,
Figure 213774DEST_PATH_IMAGE029
representing the first in a parent set
Figure 354905DEST_PATH_IMAGE030
Individual case
Figure 993828DEST_PATH_IMAGE031
And the warp
Figure 499896DEST_PATH_IMAGE031
The propagated filial generation collective case
Figure 981693DEST_PATH_IMAGE032
The similarity of (2);
if the elements in the relation case set are numerical value types, calculating the similarity between the two cases according to the following formula:
Figure 34837DEST_PATH_IMAGE033
wherein,
Figure 121742DEST_PATH_IMAGE034
representing a parent case
Figure 595449DEST_PATH_IMAGE035
And its sub-case x,
Figure 439908DEST_PATH_IMAGE036
representing a parent case
Figure 922842DEST_PATH_IMAGE035
To middle
Figure 536357DEST_PATH_IMAGE030
The number of the elements is one,
Figure 180965DEST_PATH_IMAGE037
the second of the presentation sub-case x
Figure 840616DEST_PATH_IMAGE030
The number of the elements is one,
Figure 471449DEST_PATH_IMAGE038
the length of the use case is represented,
Figure 329683DEST_PATH_IMAGE039
a parameter representing the degree of initial variation;
for example, a parent case of the sorting program is {11, 39, -8, 14, -25,5,9, 26, 53, -19,0, -13}, and the elements therein have the property of numerical magnitude, preferably numerical similarity s v Its length n =12.
If the elements in the use case are non-numerical in nature, it is not appropriate to use the similarity of the two previous numerical values. For example, the text paragraph of a certain use case of the string retrieval program is (Hello | My name's Xiaoming. I like playing football.), and it is looked up whether there is a string (ming) therein, and the number of occurrences is returned. For non-numerical use cases, the element similarity s can be calculated e The method specifically comprises the following steps:
Figure 516164DEST_PATH_IMAGE066
wherein,
Figure 459850DEST_PATH_IMAGE041
representing a parent case
Figure 222269DEST_PATH_IMAGE035
And itThe non-numerical similarity between the sub-cases x,
Figure 810377DEST_PATH_IMAGE042
a weight parameter is represented that is a function of,
Figure 62366DEST_PATH_IMAGE043
representation for judging parent cases
Figure 103135DEST_PATH_IMAGE035
To middle
Figure 403666DEST_PATH_IMAGE030
Each element
Figure 236493DEST_PATH_IMAGE044
And sub-case x
Figure 269171DEST_PATH_IMAGE030
An element
Figure 187448DEST_PATH_IMAGE037
Whether or not the same function is used,
Figure 462310DEST_PATH_IMAGE045
represents an element
Figure 149643DEST_PATH_IMAGE044
Match all elements in the sub-case x if
Figure 681118DEST_PATH_IMAGE046
In presence of elements and use cases
Figure 696479DEST_PATH_IMAGE044
If the two are the same, returning to 1, otherwise, returning to 0, specifically:
Figure 401130DEST_PATH_IMAGE067
Figure 818336DEST_PATH_IMAGE068
the left side of the formula calculates the degree of identity of the elements of the two examples, and the right side calculates
Figure 520712DEST_PATH_IMAGE069
The elements in (1) can be in
Figure 148003DEST_PATH_IMAGE070
To the extent that it matches, once the current element matches it ends, the matching of the next element begins.
Step S1063: and taking the filial generation set in the iterative reproduction as a parent set in the next reproduction to perform cross reproduction, individual recombination and individual variation again, and outputting the filial generation sets in the iterative reproduction and the corresponding similarity.
In the ecological reproduction test case algorithm, the more times the algorithm is reproduced, the larger the difference between the following cases and the relational cases, so that the reproduction times of the first three times can be changed if a large number of cases are needed
Figure 531711DEST_PATH_IMAGE071
And (5) adjusting the height. After expected output is designed for later-generation cases, the test cases are automatically run through a unit test tool or an automatic test tool, and latent bugs which are not found in a program can be effectively found.
In addition, it should be emphasized that, in the preset ecological reproduction test case algorithm provided in the embodiment, cross reproduction is performed to exchange elements between cases, individual recombination is performed to exchange elements between cases, and individual variation appropriately modifies some elements. These three steps bring ecological proliferation diversity to the offspring collection. The offspring set has the excellent characteristics and new diversity of the inherited self-relationship case set, and can make up for short boards with insufficient number of relationship cases. And the offspring use case set is taken as an assistant, so that the offspring use case set has ideal assistant test performance and helps to find out latent Bug.
It should be noted that the random use case obtained by simply and directly generating the use case set by the random number in the conventional manner has no relation with the function requirement and the code to be tested. Although a large number of use cases are easily available, these use cases generally have low coverage rates, and it is necessary to achieve a level close to the exhaustive test to ensure good coverage rates. For a program with large input data quantity, the number scale of cases for exhaustive testing is extremely large, and the method is practically not feasible at all. The parent set in this embodiment is obtained by analyzing the functional requirements and the processing manner, and has the advantages of reasonability, diversity and the like, and the propagated and generated extended use case set is better than the randomly generated use case set.
In summary, according to the method for designing and generating test cases based on the relational analysis, through the analysis of the function and input complex program development relations, the relations can comprehensively cover the function requirements and the processing modes, so that the efficient, reasonable and complete test cases can be designed, the latent, difficult-to-find program bugs can be found out, and the capability of testers and programmers in designing the test cases can be improved. For a complex program with large input data amount, after a relation case set is designed, a large number of descendant case sets with relation characteristics and diversity can be obtained through multiple rounds of reproduction, recombination and variation by relying on the proposed ecological reproduction algorithm and taking the relation case set as the basis, and the complex program with large input data amount can be comprehensively and effectively tested in an auxiliary manner.
Referring to fig. 4, a schematic structural diagram of a test case design and generation system based on relationship analysis in a third embodiment of the present invention is shown, where the system includes:
the relation analysis module 10 is configured to obtain a function requirement and a processing mode of a program to be tested, and perform relation analysis on variables in the program to be tested according to the function requirement and the processing mode to obtain a relation between input variables and output variables;
further, the relationship analysis module 10 further includes:
the system comprises a whole input set analysis unit, a test unit and a test unit, wherein the whole input set analysis unit is used for acquiring a whole input set corresponding to the program to be tested and acquiring input variables and effective input conditions for expressing the whole input set according to the whole input set;
the first relation analysis unit is used for analyzing the value types of the single variables and various relations among the input variables by taking the input variables and the effective input conditions as analysis objects according to the functional requirements and the processing mode;
the second relation analysis unit is used for respectively inputting all input variables into the program to be tested to obtain output variables, and corresponding the output variables to the input variables according to the function requirements to obtain the relation between the output variables and the input variables;
the use case set generating module 20 is configured to design a plurality of relation use cases according to the relation between the input variables and the output variables to obtain a relation use case set;
the use case reproduction module 30 is configured to input the relational use case set to generate a subsequent use case set according to a preset ecological reproduction test use case algorithm.
Further, the use case propagation module 30 further includes:
a parameter setting unit for setting the value range of the elements in the use case as
Figure 928057DEST_PATH_IMAGE001
Selecting a similarity function;
an iteration reproduction unit for inputting the relation case set
Figure 974904DEST_PATH_IMAGE002
And initializing the parent set
Figure 292753DEST_PATH_IMAGE003
And for the parent set
Figure 339206DEST_PATH_IMAGE004
To carry out
Figure 731004DEST_PATH_IMAGE005
Performing iteration of the secondary loop to reproduce to obtain a progeny use case set;
further, the iterative multiplication unit further comprises:
a spawn execution subunit to spawn the parent set
Figure 571921DEST_PATH_IMAGE004
Performing cross propagation to obtain a primary set, then performing individual recombination on the primary set to obtain a recombined set, and performing individual variation on the recombined set to obtain a variant set;
the similarity calculation operator unit is used for taking the obtained variation set as an offspring set in the iterative reproduction and calculating to obtain the similarity between the offspring set and a parent set in the reproduction;
a reproduction cycle subunit, configured to use the offspring set in the previous iterative reproduction as a parent set in the next reproduction, perform cross reproduction, individual recombination, and individual variation again, and output the offspring sets in the previous iterative reproduction and corresponding similarity;
further, the spawning execution subunit is further configured to:
collecting the parent
Figure 377066DEST_PATH_IMAGE004
Each parent use case in
Figure 836998DEST_PATH_IMAGE006
Randomly matching another parent use case
Figure 473515DEST_PATH_IMAGE007
So that two different father cases can exchange partial elements to obtain two sub cases;
acquiring a random number, and calculating according to the random number and a parameter corresponding to the current cross reproduction to obtain the number of elements exchanged in the current cross reproduction by the two relation cases;
and calculating the number of the interchange elements of the two relation cases in the current cross reproduction according to the following formula:
Figure 360700DEST_PATH_IMAGE009
wherein m is 1 Representing the number of elements that the two relational use cases interchange in the current cross-breeding,
Figure 449879DEST_PATH_IMAGE011
and
Figure 775818DEST_PATH_IMAGE012
respectively represent the lengths of two relational use cases,
Figure 375164DEST_PATH_IMAGE013
denotes the parameter of the d-th cross breeding, r denotes a random number and
Figure 89042DEST_PATH_IMAGE015
obtaining the parameters corresponding to the current cross breeding according to the following formula:
Figure 275304DEST_PATH_IMAGE016
wherein,
Figure 404934DEST_PATH_IMAGE017
representing initial cross-breeding parameters, and a, b and c represent three constant parameters;
the system is also used for obtaining the length of each nascent case in the nascent set, and interchanging the positions of two elements of each nascent case according to the length and the random number to obtain a regrouping set;
the method is also used for carrying out variation on the elements in the recombination set according to a preset value range;
if the elements in the relation case set are numerical value types, calculating to obtain a current variation value according to the numerical value of the element to be varied in the recombination set and a control parameter of the current individual variation degree, and carrying out individual variation on the element to be varied according to the current variation value to obtain a variation-completed numerical value, wherein the variation-completed numerical value range is the same as a preset value range;
obtaining the current variance value according to the following formula:
Figure 750465DEST_PATH_IMAGE019
wherein,
Figure 979452DEST_PATH_IMAGE020
which is indicative of the current value of the variance,
Figure 43223DEST_PATH_IMAGE021
the absolute value of the numerical value corresponding to the element to be varied is represented by | x | which is a control parameter of the variation degree of the current individual;
if the elements in the relation case set are of non-numerical type, the preset value range is selected
Figure 648648DEST_PATH_IMAGE018
Randomly selecting one element to replace the element to be mutated to complete individual mutation;
further, the similarity operator unit is further configured to:
calculating the similarity between the child set and the parent set in the reproduction according to the following formula:
Figure 51947DEST_PATH_IMAGE023
wherein,
Figure 576470DEST_PATH_IMAGE024
is shown as
Figure 521946DEST_PATH_IMAGE025
The similarity between the parent set and the child set in the sub-iterative multiplication,
Figure 790116DEST_PATH_IMAGE026
is shown as
Figure 47922DEST_PATH_IMAGE025
The parent set in the sub-iterative multiplication,
Figure 884291DEST_PATH_IMAGE027
is shown as
Figure 657075DEST_PATH_IMAGE025
The set of children in the secondary iteration of multiplication,
Figure 604302DEST_PATH_IMAGE028
is shown as
Figure 778932DEST_PATH_IMAGE025
The number of use cases in the child set in the sub-iterative multiplication,
Figure 848519DEST_PATH_IMAGE029
representing the first in a parent set
Figure 983965DEST_PATH_IMAGE030
Individual case
Figure 859517DEST_PATH_IMAGE031
And the warp
Figure 262555DEST_PATH_IMAGE031
The propagated filial generation collective case
Figure 768622DEST_PATH_IMAGE032
The similarity of (2);
if the elements in the relation case set are numerical types, calculating the similarity between the two cases according to the following formula:
Figure 250419DEST_PATH_IMAGE033
wherein,
Figure 539449DEST_PATH_IMAGE034
representing a parent case
Figure 688671DEST_PATH_IMAGE035
And its sub-case x,
Figure 37744DEST_PATH_IMAGE036
representing a parent case
Figure 6837DEST_PATH_IMAGE035
To middle
Figure 161875DEST_PATH_IMAGE072
The number of the elements is one,
Figure 40969DEST_PATH_IMAGE037
the second of the presentation sub-case x
Figure 951156DEST_PATH_IMAGE030
The number of the elements is one,
Figure 784376DEST_PATH_IMAGE038
the length of the use case is represented,
Figure 743105DEST_PATH_IMAGE039
a parameter representing the degree of initial variation;
if the elements in the relation case set are of non-numerical type, calculating the similarity between the two cases according to the following formula:
Figure 335760DEST_PATH_IMAGE040
wherein,
Figure 292215DEST_PATH_IMAGE041
representing a parent case
Figure 235900DEST_PATH_IMAGE035
And its sub-case x,
Figure 998320DEST_PATH_IMAGE042
the weight parameter is represented by a weight value,
Figure 586427DEST_PATH_IMAGE043
representation for judging parent use case
Figure 572838DEST_PATH_IMAGE035
To middle
Figure 879185DEST_PATH_IMAGE030
An element
Figure 179717DEST_PATH_IMAGE044
And sub-case x
Figure 12543DEST_PATH_IMAGE030
Each element
Figure 543757DEST_PATH_IMAGE037
Whether or not the same function is used,
Figure 462034DEST_PATH_IMAGE045
represents an element
Figure 566256DEST_PATH_IMAGE044
Match with all elements in the sub-case x if
Figure 863377DEST_PATH_IMAGE046
In presence of elements and use cases
Figure 457169DEST_PATH_IMAGE044
If the two are the same, 1 is returned, otherwise 0 is returned.
In summary, according to the method for designing and generating test cases based on the relational analysis, through the analysis of the function and input complex program development relations, the relations can comprehensively cover the function requirements and the processing modes, so that the efficient, reasonable and complete test cases can be designed, the latent, difficult-to-find program bugs can be found out, and the capability of testers and programmers in designing the test cases can be improved. For a complex program with large input data amount, after a relation case set is designed, a large number of descendant case sets with relation characteristics and diversity can be obtained through multiple rounds of reproduction, recombination and variation by relying on the proposed ecological reproduction algorithm and taking the relation case set as the basis, and the complex program with large input data amount can be comprehensively and effectively tested in an auxiliary manner.
Another aspect of the present invention also proposes a storage medium on which one or more programs are stored, the programs, when executed by a processor, implementing the above-described method for people counting based on a multimodal network.
In another aspect, the present invention further provides a computer device, which includes a memory and a processor, wherein the memory is used for storing a computer program, and the processor is used for executing the computer program stored in the memory, so as to implement the above-mentioned people counting method based on the multi-modal network.
Those of skill in the art will understand that the logic and/or steps illustrated in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Further, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above examples are merely illustrative of several embodiments of the present invention, and the description thereof is more specific and detailed, but not to be construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present invention should be subject to the appended claims.

Claims (9)

1. A test case design and generation method based on relational analysis is characterized by comprising the following steps:
acquiring function requirements and a processing mode of a program to be tested, and performing relation analysis on variables in the program to be tested according to the function requirements and the processing mode to obtain a relation between input variables and a relation between the input variables and output variables;
designing a plurality of relation use cases according to the relation between the input variables and the output variables to obtain a relation use case set;
inputting a relation case set to generate a descendant case set according to a preset ecological reproduction test case algorithm, wherein the method specifically comprises the following steps:
setting the value range of the elements in the case as
Figure QLYQS_1
Selecting a similarity function;
inputting the relational use case set
Figure QLYQS_2
And initializes the parent set->
Figure QLYQS_3
And collecting/collecting the parent>
Figure QLYQS_4
Make and/or>
Figure QLYQS_5
And repeating the loop for several times to obtain the descendant case set.
2. The method for designing and generating test cases based on relational analysis according to claim 1, wherein the step of obtaining the functional requirements and the processing modes of the program to be tested, and performing relational analysis on the variables in the program to be tested according to the functional requirements and the processing modes to obtain the relationships between the input variables and the output variables comprises:
acquiring a whole input set corresponding to the program to be tested, and acquiring input variables and effective input conditions for expressing the whole input set according to the whole input set;
analyzing the value types of the single variables and various relations among the input variables by taking the input variables and the effective input conditions as analysis objects according to the functional requirements and the processing mode;
and inputting all input variables into the program to be tested respectively to obtain output variables, and corresponding the output variables to the input variables according to the function requirements to obtain the relation between the output variables and the input variables.
3. The method according to claim 2, wherein the input of the relational case set is
Figure QLYQS_6
And initializing a parent set>
Figure QLYQS_7
And collecting/collecting the parent>
Figure QLYQS_8
Make and/or>
Figure QLYQS_9
The step of repeating the loop for the second time to reproduce the offspring case set comprises the following steps:
for the parent set
Figure QLYQS_10
Performing cross propagation to obtain a primary set, then performing individual recombination on the primary set to obtain a recombined set, and performing individual variation on the recombined set to obtain a variant set;
taking the obtained variation set as a child set in the iterative reproduction, and calculating to obtain the similarity between the child set and a parent set in the iterative reproduction;
and taking the filial generation set in the iterative reproduction as a parent set in the next reproduction to perform cross reproduction, individual recombination and individual variation again, and outputting the filial generation sets in the iterative reproduction and the corresponding similarity.
4. The method according to claim 3, wherein the parent set is a set of test cases
Figure QLYQS_11
The step of performing cross breeding to obtain a primary set comprises the following steps:
collecting the parent
Figure QLYQS_12
Is greater than or equal to>
Figure QLYQS_13
Randomly matching another parent use case>
Figure QLYQS_14
So that two different parent cases can exchange partial elements to obtain two sub cases;
the parent set
Figure QLYQS_15
In each parent use case &>
Figure QLYQS_16
Randomly matching another parent use case>
Figure QLYQS_17
So that two different parent cases can exchange partial elements, and the step of obtaining two sub-cases comprises: />
Acquiring a random number, and calculating according to the random number and a parameter corresponding to the current cross reproduction to obtain the number of elements exchanged in the current cross reproduction by the two relation cases;
and calculating the number of the interchange elements of the two relation cases in the current cross reproduction according to the following formula:
Figure QLYQS_18
wherein,
Figure QLYQS_19
represents the number of elements exchanged by the two relational use cases in the current cross breeding, and>
Figure QLYQS_20
and &>
Figure QLYQS_21
Respectively represents the length of two relation examples>
Figure QLYQS_22
Indicates the fifth->
Figure QLYQS_23
A parameter of minor cross breeding>
Figure QLYQS_24
Represents a random number and->
Figure QLYQS_25
Obtaining parameters corresponding to the current cross breeding according to the following formula:
Figure QLYQS_26
wherein,
Figure QLYQS_27
representing initial cross-breeding parameters, and a, b and c represent three constant parameters;
the step of performing individual recombination on the primary set to obtain a recombined set comprises the following steps:
acquiring the length of each nascent case in the nascent set, and interchanging the positions of two elements of each nascent case according to the length and a random number to obtain a recombined set;
the step of performing individual variation on the recombination set to obtain a variation set comprises:
and carrying out variation on the elements in the recombination set according to a preset value range.
5. The method for designing and generating test cases based on relational analysis according to claim 4, wherein the step of mutating the elements in the reorganization set according to a preset value range comprises:
if the elements in the relation case set are numerical value types, calculating to obtain a current variation value according to the numerical value of the element to be varied in the recombination set and a control parameter of the current individual variation degree, and carrying out individual variation on the element to be varied according to the current variation value to obtain a variation-completed numerical value, wherein the variation-completed numerical value range is the same as a preset value range;
if the elements in the relation case set are of non-numerical type, the preset value range is selected
Figure QLYQS_28
Randomly selecting one element to replace the element to be mutated to complete individual mutation.
6. The method for designing and generating test cases based on relational analysis according to claim 5, wherein if the elements in the relational case set are numerical types, a current variation value is calculated according to the numerical values of the elements to be varied in the recombination set and the control parameters of the current individual variation degree, so as to perform individual variation on the elements to be varied according to the current variation value, thereby obtaining a variation-completed numerical value, and the step of completing the variation with the preset numerical range includes:
obtaining the current variance value according to the following formula:
Figure QLYQS_29
wherein,
Figure QLYQS_30
represents the current variance value, is asserted>
Figure QLYQS_31
For a control parameter of the current individual degree of variation>
Figure QLYQS_32
The absolute value of the element to be varied is indicated.
7. The method according to claim 3, wherein the step of calculating the similarity between the child set and the parent set in the current iteration breeding by using the obtained variant set as the child set in the current iteration breeding comprises:
calculating the similarity between the parent set and the child set in the reproduction according to the following formula:
Figure QLYQS_33
wherein,
Figure QLYQS_36
indicates the fifth->
Figure QLYQS_39
The similarity between the parent set and the child set in the sub-iterative multiplication, device for combining or screening>
Figure QLYQS_43
Indicates the fifth->
Figure QLYQS_37
The parent set in the sub-iterative multiplication, and/or>
Figure QLYQS_41
Indicates the fifth->
Figure QLYQS_44
The set of children in the sub-iterative multiplication->
Figure QLYQS_46
Represents a fifth or fifth party>
Figure QLYQS_34
Number of use cases in the child set in the sub-iteration multiplication, < > >>
Figure QLYQS_38
Indicates the fifth or fifth in the parent set>
Figure QLYQS_42
Case for each case>
Figure QLYQS_45
And longitude>
Figure QLYQS_35
The resulting offspring collection cases>
Figure QLYQS_40
The similarity of (c).
8. The method for designing and generating test cases based on relational analysis according to claim 7, wherein the method further comprises:
if the elements in the relation case set are numerical types, calculating the similarity between the two cases according to the following formula:
Figure QLYQS_47
wherein,
Figure QLYQS_49
representing a parent case>
Figure QLYQS_53
And its sub-case x, based on the numerical similarity->
Figure QLYQS_55
Representing a parent case>
Figure QLYQS_50
Middle and fifth>
Figure QLYQS_52
Element(s) is/are present>
Figure QLYQS_54
Indicates the ^ th of sub-case x>
Figure QLYQS_56
Element(s) is/are present>
Figure QLYQS_48
Indicates the length of the use case, and->
Figure QLYQS_51
A parameter representing the degree of initial variation;
if the elements in the relation case set are of non-numerical type, calculating the similarity between the two cases according to the following formula:
Figure QLYQS_57
wherein,
Figure QLYQS_59
representing a parent case>
Figure QLYQS_64
And its sub-case x, a non-numeric similarity->
Figure QLYQS_68
A weight parameter is represented that is a function of,
Figure QLYQS_61
representing a decision for parent use case>
Figure QLYQS_62
In a fifth or fifth sun>
Figure QLYQS_66
Multiple elements>
Figure QLYQS_69
And { (v) } of sub-case x>
Figure QLYQS_58
Element/element->
Figure QLYQS_63
Whether or not the same function is used,
Figure QLYQS_67
indicates that the element is to be->
Figure QLYQS_70
Match all elements in the sub-case x if @>
Figure QLYQS_60
Presence of an element and case->
Figure QLYQS_65
If the two are the same, 1 is returned, otherwise 0 is returned.
9. A test case design and generation system based on relational analysis is characterized by comprising:
the system comprises a relation analysis module, a processing module and a processing module, wherein the relation analysis module is used for acquiring the function requirement and the processing mode of a program to be tested, and carrying out relation analysis on variables in the program to be tested according to the function requirement and the processing mode to obtain the relation between input variables and the relation between the input variables and the output variables;
the case set generating module is used for designing various relation cases according to the relation between the input variables and the output variables to obtain a relation case set;
the case reproduction module is used for inputting the relational case collection so as to generate a descendant case collection according to a preset ecological reproduction test case algorithm, and specifically comprises the following steps:
setting the value range of the elements in the case as
Figure QLYQS_71
Selecting a similarity function;
inputting the relational use case set
Figure QLYQS_72
And initializes the parent set->
Figure QLYQS_73
And collecting/combining said parent>
Figure QLYQS_74
Make a->
Figure QLYQS_75
And repeating the loop for several times to obtain the descendant case set. />
CN202211631619.3A 2022-12-19 2022-12-19 Test case design and generation method and system based on relational analysis Active CN115617700B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211631619.3A CN115617700B (en) 2022-12-19 2022-12-19 Test case design and generation method and system based on relational analysis

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211631619.3A CN115617700B (en) 2022-12-19 2022-12-19 Test case design and generation method and system based on relational analysis

Publications (2)

Publication Number Publication Date
CN115617700A CN115617700A (en) 2023-01-17
CN115617700B true CN115617700B (en) 2023-04-07

Family

ID=84880329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211631619.3A Active CN115617700B (en) 2022-12-19 2022-12-19 Test case design and generation method and system based on relational analysis

Country Status (1)

Country Link
CN (1) CN115617700B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6625760B1 (en) * 1999-08-03 2003-09-23 Hewlett-Packard Development Company, L.P. Apparatus and method for generating random tests for program validation using genetic evolution
CN114595152A (en) * 2022-03-08 2022-06-07 南京航空航天大学 NuXMV-oriented safety key system state transition diagram test case generation method
CN115248781A (en) * 2022-09-22 2022-10-28 西南科技大学 Combined test case generation method, device and equipment and readable storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101859274B (en) * 2009-04-07 2013-06-05 西门子(中国)有限公司 Method and system for fuzz testing
JP2012103791A (en) * 2010-11-08 2012-05-31 Mitsubishi Electric Corp Program testing device, program testing method and program testing program
CN102323906B (en) * 2011-09-08 2014-01-08 哈尔滨工程大学 MC/DC test data automatic generation method based on genetic algorithm
KR101334806B1 (en) * 2013-04-04 2013-11-29 비티에스테크놀로지스(주) Method of proudcing input sets of test case in test case generating system
CN108763055B (en) * 2018-04-19 2020-08-25 北京航空航天大学 Construction method of test case constraint control technology based on epigenetic inheritance
CN111611152B (en) * 2019-02-25 2023-08-04 北京嘀嘀无限科技发展有限公司 Test case generation method and device, electronic equipment and readable storage medium
CN113297059B (en) * 2020-05-10 2024-08-30 浙江天猫技术有限公司 Test case generation method, test method and device of tested software
CN112699053B (en) * 2020-08-03 2022-02-22 徐州工程学院 Software testing method integrated with fuzzy clustering
CN112052166B (en) * 2020-08-26 2021-05-18 河海大学 Test case generation method and device based on domination relationship
CN114492259A (en) * 2022-01-25 2022-05-13 杭州云合智网技术有限公司 Random constraint method for interdependent member variables

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6625760B1 (en) * 1999-08-03 2003-09-23 Hewlett-Packard Development Company, L.P. Apparatus and method for generating random tests for program validation using genetic evolution
CN114595152A (en) * 2022-03-08 2022-06-07 南京航空航天大学 NuXMV-oriented safety key system state transition diagram test case generation method
CN115248781A (en) * 2022-09-22 2022-10-28 西南科技大学 Combined test case generation method, device and equipment and readable storage medium

Also Published As

Publication number Publication date
CN115617700A (en) 2023-01-17

Similar Documents

Publication Publication Date Title
Boas Machine models and simulations
Thomas On the synthesis of strategies in infinite games
Skinner et al. A method for using player tracking data in basketball to learn player skills and predict team performance
CN113687821A (en) Intelligent code splicing method based on graphic visualization
Gamba et al. Efficiently explaining CSPs with unsatisfiable subset optimization
CN115617700B (en) Test case design and generation method and system based on relational analysis
Abdallah et al. Exhaustive analysis of dynamical properties of biological regulatory networks with answer set programming
Ismail et al. Game Theory Using Genetic Algorithms.
US7360184B1 (en) Method and apparatus for scenario search based random generation of functional test suites
Zingaro Algorithmic thinking: a problem-based introduction
CN118502924B (en) Task generation method and system
Lagerkvist State Representation and Polyomino Placement for the Game Patchwork
CN113268574B (en) Graph volume network knowledge base question-answering method and system based on dependency structure
Chu Semantics-based selection and code bloat reduction techniques for genetic programming
Sedano et al. Towards generating essence kernels using genetic algorithms
Frier Genetic Algorithms as a Viable Method of Obtaining Branch Coverage
CN114254260B (en) Method, device, equipment and storage medium for mining unbalanced data group in game
CN109966744A (en) A kind of dynamic is formed a team matched method and system
KR102355806B1 (en) Machine Learning Inverse Prediction Method Using Genetic Algorithm
Juranko Implementace současného použití několika náhradních modelů pro evoluční optimalizaci
Mai et al. A Comprehensive Review of Association Rule Mining Based on Evolutionary
Dessanti et al. Ultra-High Dimensional Optimization and Interactive Requirements Negotiation for New Acquisition Programs.
de Mendonça et al. A framework for genetic algorithms in games
Chagas et al. Assessing Multi-Objective Search Engines for GE: A Case Study in CNN Generation
Moroz Software tool for solving inductive modelling tasks based on self-organizing combinatorial-genetic method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant