CN109271308A - Class based on search integrates the generation method of initial population in cycle tests problem - Google Patents

Class based on search integrates the generation method of initial population in cycle tests problem Download PDF

Info

Publication number
CN109271308A
CN109271308A CN201710578788.8A CN201710578788A CN109271308A CN 109271308 A CN109271308 A CN 109271308A CN 201710578788 A CN201710578788 A CN 201710578788A CN 109271308 A CN109271308 A CN 109271308A
Authority
CN
China
Prior art keywords
class
tree
initial population
cycle tests
sequence
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.)
Pending
Application number
CN201710578788.8A
Other languages
Chinese (zh)
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.)
China University of Mining and Technology CUMT
Original Assignee
China University of Mining and Technology CUMT
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 China University of Mining and Technology CUMT filed Critical China University of Mining and Technology CUMT
Priority to CN201710578788.8A priority Critical patent/CN109271308A/en
Publication of CN109271308A publication Critical patent/CN109271308A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Class based on search integrates the generation method of initial population in cycle tests problem.It has been firstly introduced into a constraint condition, that is, when testing the class of certain sequence, has not allowed to break the strong dependence between class.Then propose a kind of generation method in this constraint condition lower class cycle tests, including analysis system obtain relying on by force matrix, by matrix transposition and traverse to construct multiway tree or multiway tree forest, the tree that can merge merged, the class that completion does not traverse so obtain complete forest, by every one tree in random sequence level traversal forest to obtain class testing sequence;The present invention solves to a certain extent when solving class using intelligent algorithm (such as genetic algorithm and particle swarm algorithm) and integrating cycle tests, due to initial population ideal adaptation angle value is lower, total quality is poor and the problem of influence algorithm the convergence speed and optimizing result.The class testing sequence generated by this method is not lost into randomness as initial population, while total quality increases, strengthens the optimizing ability of simple generic algorithm and simple particle swarm algorithm.

Description

Class based on search integrates the generation method of initial population in cycle tests problem
Technical field
The invention belongs to software testing technology fields, especially integrate cycle tests generation technique in the class based on search In, a kind of generation method of the initial population (class testing sequence) under certain constraint condition.
Background technique
The determination of the integrated cycle tests of class is one of the key difficulties in object-oriented software integration testing.Object-oriented is soft Part has the characteristics that encapsulation, inheritance and polymorphism, so its measuring technology and traditional area procedure-oriented software You Hen great Not.Testing cost caused by time that class testing ordinal relation is found to software defect and design test pile, accordingly, it is determined that class Integration testing sequence become integration testing in an important research problem.
During object-oriented software test, the development cost of test pile is often very high, so determining that class is integrated The top priority of cycle tests is exactly to reduce the development cost of test pile.Based on the method for graph theory due to itself limitation, nothing Method is suitable for large program.And when determining class testing sequence, need to consider to influence the various factors of test pile, therefore, The problem of solving class testing sequence can be converted into optimization problem.Current existing method includes genetic algorithm (Genetic Algorithm, GA) and particle swarm optimization algorithm (Particle Swarm Optimization, PSO) etc., they belong to people Work intelligent algorithm.Such methods in order to indicate construction test pile cost, often using the overall complexity of sequence as fitness Function, by generating a certain number of individual composition initial populations at random, a class testing sequence is as an individual.It is right later Population carries out a series of evolutional operation, after certain algebra of evolving, the final optimal solution obtained under fitness function.
Currently, simple genetic algorithm and particle swarm algorithm are all to generate initial population, initial population by random device The fitness of individual is lower, restricts convergence speed of the algorithm to a certain extent, causes to be unable to get in defined evolutionary generation More preferably solve.Therefore, simple evolution algorithm is not able to satisfy actual needs gradually.
Summary of the invention
It is lower in order to solve existing method initial population individual adaptation degree, lead to the problem that optimizing is ineffective, this hair It is bright to provide a kind of generation method of the class testing sequence (population at individual) under constraint condition.That is, introducing a kind of constraint condition pair Initial population is pre-processed, constraint condition are as follows: when breaking that dependence generates class testing sequence between class, is not allowed to break between class Strong dependence.Firstly, determining the dependence type between class;Then, the developing algorithm for proposing multiway tree, exist by force according to Root node and leaf node of the target class and source class for the relationship of relying respectively as multiway tree;Finally, carrying out level time to multiway tree It goes through, generates with randomness and meet the individual of constraint condition.Method executes a primary generation individual, so, execute number It is identical as population scale.Wherein, population scale is generally twice to three times of class number.Thus individual institute's group that method generates At initial population, do not lose randomness, while total quality increases, simple generic algorithm and simple population can be reinforced The optimizing ability of algorithm.Method the following steps are included:
(1) it indicates for convenience, all classes of examining system is numbered from 1.
(2) strong dependence matrix M, M [i, j]=1 between class are obtained by static analysis indicates that class i relies on by force class j, if M [i, J]=there is no strong dependences for 0 expression, two classes.
(3) it by matrix M transposition and traverses.Transposed matrix M ' is obtained first, and the purpose of transposition is that strong dependence is converted Indicate that class i relies on by force class j at the front-rear position relationship in class testing sequence, such as M [i, j]=1, in order to meet constraint, in the sequence Class j need to be before class i, and the matrix M ' after transposition can more intuitively indicate this context.M [i, j]=1 become M ' [j, I]=1, indicate class j before class i.Then transposed matrix is traversed, M ' [j, i]=1 is worked as, then using class j as root node, class i conduct Leaf node constructs a multiway tree.
(4) tree that can merge is merged, some class is root node in one tree, and such conduct in another one tree Leaf node thinks that two trees can merge at this time.If there is no such class, then original state is kept.
(5) class each not traversed so far is obtained separately as one tree comprising all classes several trees Forest.
(6) it is pressed by each tree in random sequence successively level traversal forest when some node has multiple child nodes Random sequence traversal.
The obtained class testing sequence ensure that great randomness while meeting constraint condition.As Class testing sequence reduces the overall complexity of individual, improves the total quality of population as initial population individual.
Detailed description of the invention
Fig. 1 is flow chart of the invention.
Fig. 2 is strong dependence matrix.
Fig. 3 is transposed matrix.
Fig. 4 is multiway tree.
Fig. 5 is the multiway tree after merging.
Fig. 6 is forest.
Detailed description of the invention
With reference to the accompanying drawings and examples to the detailed description of the invention.
In Fig. 1, the present invention includes that analysis system is relied on by force in the generation method of constraint condition lower class cycle tests Matrix, by matrix transposition and traverse with construct multiway tree, merge the class that multiway tree, completion do not traverse obtain complete forest, By every one tree in random sequence level traversal forest, traversing result is class testing sequence, and its step are as follows:
(1) analysis system obtains relying on matrix by force: an existing system, contains 10 classes, number 1-10 altogether.Fig. 2 is analysis Strong dependence the matrix M, M [i, j]=1 obtained afterwards indicates that class i relies on by force class j, and being worth indicates that strong dependence is not present in two classes for 0. In Fig. 2, M [1,3]=M [2,3]=M [4,9]=M [5,3]=M [6,5]=M [8,5]=1 illustrates class 1,2, and the last 5 relies on class 3, class semi-finals Class 9, class 6 are relied on, the Final 8 relies on class 5.
(2) Fig. 3 is before matrix M ', M ' [i, j]=1 after transposition indicates that class i needs to come class j in the sequence.It is constraining Under the conditions of, before class 3 will come class 1,2,5 in sequence, before class 5 will come class 6,8, before class 9 will come class 4, except this it Relative position is any between outer class, and so there is no need to break strong dependence.Then, transposed matrix M ' is traversed, if M ' [i, j] =1, then using i as root node, j constructs multiway tree as leaf node.Fig. 4 is the multiway tree constructed after Ergodic Matrices.
(3) in Fig. 4, class 5 is not only used as root node on one tree, but also leaf node is used as on another one tree, so Class 5 is the node that can merge, and two trees are merged, and eliminates duplicate node.What Fig. 5 was indicated is the multiway tree after merging.
(4) after having merged multiway tree, if each class is separately as one there is also the class not traversed Tree is just constituted named comprising 10 class 4 entitled trees 3, tree 9, tree 7, tree 10(with root node in this way) tree forest.
(5) finally, traversing 4 trees according to random sequence level, if some node has multiple child nodes, also by random Order traversal.In this way, random sequence can be obtained, such as: 9-4-3-2-5-8-6-1-7-10 or 10-3-1-5-6-8-2-7-9-4 Deng.Verified, the class testing sequence tested does not break the strong dependence between class.

Claims (6)

1. the class based on search integrates the generation method of initial population in cycle tests problem it is characterized in that, being firstly introduced into one Kind constraint condition: when testing the class of a certain sequence, do not allow to break the strong dependence between class.Then, the structure of multiway tree is proposed Build algorithm.Finally traversal multiway tree obtains class sequence.This method mainly include the following steps include: 1) analysis system obtain by force according to Rely matrix;2) by matrix transposition and traverse to construct multiway tree;3) merge multiway tree;4) using each class not traversed as One tree and multiway tree form forest;5) class testing sequence is obtained by every one tree in random sequence level traversal forest.
2. the class according to claim 1 based on search integrates the generation method of initial population in cycle tests problem, It is characterized in that, in step 1), analysis system obtains relying on matrix by force, if matrix is M, M [i, j]=1 indicates that class i relies on by force class J, being worth indicates that strong dependence is not present in two classes for 0.
3. the class according to claim 1 based on search integrates the generation method of initial population in cycle tests problem, It is characterized in that, in step 2, by matrix transposition and traverses to construct multiway tree, if the matrix after transposition is M ', M ' [i, j]=1 Before indicating that class i needs to come class j in the sequence.Ergodic Matrices M ' later, when working as M ' [i, j]=1, using i as root node, j makees For leaf node, multiway tree is constructed.
4. the class according to claim 1 based on search integrates the generation method of initial population in cycle tests problem, It is characterized in that, in step 3), when merging multiway tree, if some class is in two trees respectively as root node and leaf section Point then merges identical node in this two trees, that is, realizes the merging of multiway tree.
5. the class according to claim 1 based on search integrates the generation method of initial population in cycle tests problem, It is characterized in that, in step 4), if, using each class as one tree, obtained with step 2 there is also the class not traversed The tree composition forest arrived.
6. the class according to claim 1 based on search integrates the generation method of initial population in cycle tests problem, It is characterized in that, in step 5), by random sequence, level traversal successively is carried out to every one tree in forest, if certain node has Multiple child nodes are also traversed by random sequence.The node traversed is sequentially output and obtains class testing sequence, is obtained in this way The existing randomness of class testing sequence, and meet constraint condition.
CN201710578788.8A 2017-07-17 2017-07-17 Class based on search integrates the generation method of initial population in cycle tests problem Pending CN109271308A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710578788.8A CN109271308A (en) 2017-07-17 2017-07-17 Class based on search integrates the generation method of initial population in cycle tests problem

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710578788.8A CN109271308A (en) 2017-07-17 2017-07-17 Class based on search integrates the generation method of initial population in cycle tests problem

Publications (1)

Publication Number Publication Date
CN109271308A true CN109271308A (en) 2019-01-25

Family

ID=65147663

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710578788.8A Pending CN109271308A (en) 2017-07-17 2017-07-17 Class based on search integrates the generation method of initial population in cycle tests problem

Country Status (1)

Country Link
CN (1) CN109271308A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111880795A (en) * 2020-07-29 2020-11-03 中国银联股份有限公司 Front-end interface generation method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070162894A1 (en) * 2006-01-11 2007-07-12 Archivas, Inc. Method of and system for dynamic automated test case generation and execution
CN102937933A (en) * 2012-11-14 2013-02-20 中国矿业大学 Class test sequence determining method based on testing level

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070162894A1 (en) * 2006-01-11 2007-07-12 Archivas, Inc. Method of and system for dynamic automated test case generation and execution
CN102937933A (en) * 2012-11-14 2013-02-20 中国矿业大学 Class test sequence determining method based on testing level

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张艳梅: "一种基于动态依赖关系的类集成测试方法", 《计算机学报》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111880795A (en) * 2020-07-29 2020-11-03 中国银联股份有限公司 Front-end interface generation method and device
CN111880795B (en) * 2020-07-29 2024-03-12 中国银联股份有限公司 Front-end interface generation method and device

Similar Documents

Publication Publication Date Title
CN103257921B (en) Improved random forest algorithm based system and method for software fault prediction
CN105095491B (en) Process model restorative procedure based on Petri network basic structure
CN103870260B (en) The method and system of business interface exploitation
CN103559129B (en) Statistical regression test data generating method based on genetic algorithm
CN109407654A (en) A kind of non-linear causality analysis method of industrial data based on sparse depth neural network
CN107423217B (en) Black box fuzzy test method and system based on variation tree
CN103605605B (en) Based on the be dominant high-order mutation testing method of relation and two-stage genetic algorithm of statement
CN105718368A (en) Software testing data amplification method
CN110825615A (en) Software defect prediction method and system based on network embedding
CN104360947B (en) Multi-process deadlock detection method based on petri network
CN110175085A (en) A kind of Hadoop system abnormal cause diagnostic method and device using map analysis
CN110942098A (en) Power supply service quality analysis method based on Bayesian pruning decision tree
CN109271308A (en) Class based on search integrates the generation method of initial population in cycle tests problem
CN103678123A (en) Method applied to recognizing vulnerabilities of single-event soft errors in processor systems
Tomašević et al. Ergodic behaviour of a multi-type growth-fragmentation process modelling the mycelial network of a filamentous fungus
CN104750610B (en) Message-passing parallel program variant reduction method based on degree of being dominant
CN105528296B (en) A kind of class cluster test method of object-oriented software
CN109783361A (en) The method and apparatus for determining code quality
CN104615679A (en) Multi-agent data mining method based on artificial immunity network
CN103729297A (en) Test case generation method based on hierarchic genetic algorithm
Fell et al. An algebra of unbounded operators
CN104461861B (en) Path test data generation method based on EFSM models
CN104199649B (en) The path method for decomposing of interactive information between a kind of process for father and son
CN104731695B (en) A kind of unit test system and method for supporting the input of table driving bottom
CN109190204A (en) A kind of complex mechanical product module partition method based on complex network

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190125