CN101876939B - System test method and device - Google Patents

System test method and device Download PDF

Info

Publication number
CN101876939B
CN101876939B CN2009102387041A CN200910238704A CN101876939B CN 101876939 B CN101876939 B CN 101876939B CN 2009102387041 A CN2009102387041 A CN 2009102387041A CN 200910238704 A CN200910238704 A CN 200910238704A CN 101876939 B CN101876939 B CN 101876939B
Authority
CN
China
Prior art keywords
test
sut
static
system under
under test
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.)
Expired - Fee Related
Application number
CN2009102387041A
Other languages
Chinese (zh)
Other versions
CN101876939A (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.)
Beijing Information Science and Technology University
Original Assignee
Beijing Information Science and Technology 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 Beijing Information Science and Technology University filed Critical Beijing Information Science and Technology University
Priority to CN2009102387041A priority Critical patent/CN101876939B/en
Publication of CN101876939A publication Critical patent/CN101876939A/en
Application granted granted Critical
Publication of CN101876939B publication Critical patent/CN101876939B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention relates to a system test method and a system test device. The method comprises the steps of obtaining all static paths in a tested system; tracking execution paths in all static paths; obtaining a sample set for the minimum test according to the execution paths; according to the sample set for the minimum test, carrying out the static path test on a tested system. The system test method and the device provided by the embodiment of the invention are characterized in that the sample set for the minimum test is obtained by tracking the execution paths in all static paths in the tested system when the tested system meets the problem that the variation point of the execution paths or the static paths changes, so that static path test is carried out on the tested system according to the sample set for the minimum test; the variation point of the invoking path of all tested systems and the static path which varies are intuitively and accurately determined so as to provide the basis for optimizing and choosing the sample for a regression test.

Description

System detection method and device
Technical field
The embodiment of the invention relates to computer technology, especially a kind of system detection method and device.
Background technology
Along with developing rapidly of computer software technology, software size is increasing, has brought challenge therefore for the test and the maintenance of system under test (SUT).Software section at system under test (SUT) carries out in the regression tested process, need test systemic-function and in the system under test (SUT) all be called the path test by selecting best test case, yet for the system under test (SUT) of a reality, though the software test personnel can report according to the actual requirements the function of system under test (SUT) is tested, but because to call path number huge, the software test personnel can not be to all call the path and test in the system under test (SUT).The path produces new variation point or the static path in the system under test (SUT) changes if system under test (SUT) calls owing to software upgrading makes, after system runs to renewal and not after tested call the path time, can produce the tester is unpredictable consequence, causes the tester to carry out follow-up debugging and application to system under test (SUT).
Summary of the invention
The purpose of the embodiment of the invention is to provide a kind of system detection method and device, realizes determining intuitively and accurately the variation point that calls the path of whole system under test (SUT) and the static path that change takes place, for optimizing and selecting regression test case that foundation is provided.
The embodiment of the invention provides a kind of system detection method, comprising:
Obtain all static paths of system under test (SUT);
Execution route in described all static paths is followed the tracks of;
Obtain minimum test use cases according to described execution route;
Carry out the static path test according to the described system under test (SUT) of described minimum test case set pair.
The embodiment of the invention also provides a kind of system testing device, comprising:
First acquisition module is used to obtain all static paths of system under test (SUT);
Tracking module is used for the execution route of described all static paths is followed the tracks of;
Second acquisition module is used for obtaining minimum test use cases according to described execution route;
First test module is used for carrying out the static path test according to the described system under test (SUT) of described minimum test case set pair.
System detection method that the embodiment of the invention provides and device, when system under test (SUT) being tested the variation point that runs into execution route or static path change takes place, after being followed the tracks of, the execution route in all static paths in the system under test (SUT) gets access to minimum test use cases, make and carry out the static path test according to minimum test case set pair system under test (SUT), the variation point that calls the path of whole system under test (SUT) and the static path that change takes place have been realized determining intuitively and accurately, for optimizing and selecting regression test case that foundation is provided.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of an embodiment of system detection method of the present invention;
Fig. 2 is the schematic flow sheet of another embodiment of system detection method of the present invention;
Fig. 3 is the structural representation of an embodiment of system testing device of the present invention;
Fig. 4 is the structural representation of another embodiment of system testing device of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
Fig. 1 is the schematic flow sheet of an embodiment of system detection method of the present invention, and as shown in Figure 1, the embodiment of the invention comprises the steps:
Step 101, obtain all static paths of system under test (SUT);
Step 102, the execution route in all static paths is followed the tracks of;
Step 103, obtain minimum test use cases according to execution route;
Step 104, carry out static path test according to minimum test case set pair system under test (SUT).
The system detection method that the embodiment of the invention provides, when system under test (SUT) being tested the variation point that runs into execution route or static path change takes place, after being followed the tracks of, the execution route in all static paths in the system under test (SUT) gets access to minimum test use cases, make and carry out the static path test according to minimum test case set pair system under test (SUT), the variation point that calls the path of whole system under test (SUT) and the static path that change takes place have been realized determining intuitively and accurately, for optimizing and selecting regression test case that foundation is provided.
Fig. 2 is the schematic flow sheet of another embodiment of system detection method of the present invention, and as shown in Figure 2, the embodiment of the invention comprises the steps:
Step 201, the source code of system under test (SUT) is carried out pre-service;
Wherein, when the source code of system under test (SUT) is carried out pre-service, need to import the source code of the software section of system under test (SUT), obtain the sentence structure form of source code, the sentence structure form is specifically as follows order, circulation, selects; In addition, source code for the ease of the identification system under test (SUT), needs at the system under test (SUT) design, also be provided with the sentence structure form of mixed type in the source code of the application program in the present embodiment, in proper order, circulation, select the sentence structure form of three kinds of sentence structure forms by the described mixed type of the use formation embodiment of the invention nested against one another; The sentence structure form of the source code of system under test (SUT) is carried out pre-service and is provided with decorateeing (being also referred to as a point).
Step 202, source code analysis obtained the logic branch of source code;
Wherein, according to the function calling relationship structure, the hierarchical structure of the source code of system under test (SUT) is divided into function body, function call, statement block, statement, variable, function pointer, operational symbol, key word, by above-mentioned hierarchical structure is analyzed, further obtain the logic branch of source code, for example:
if(a1>6)
{f1();}
else
{f2();}
In above-mentioned source code, logic branch is specially the if...else... statement, certainly, the embodiment of the invention is that example is carried out exemplary illustration with the if...else... statement only, but be not limited to the if...else... statement, logic branch also can be the switch statement, gets final product so long as have the statement of logical relation in the source code.
Step 203, obtain all static paths of system under test (SUT) according to logic branch;
Wherein, when system under test (SUT) moves, the execution route in all static paths in the system under test (SUT) is followed the tracks of, for example, carry out in the process of if statement and have node a, node b, node c, if satisfy condition a1>6 o'clock, call function f1 then, if satisfy condition a1<6 o'clock, call function f2 then; When system under test (SUT) moves, adopt test case a1=7 that following logic branch is carried out tracking and testing, the execution route that then gets access to is specially a → b → d; If adopt test case a1=5 that following statement is carried out tracking and testing, the execution route that then gets access to is specially a → c → d.
Node a
if(a1>6)
{ f1 (); Node b
else
{ f2 (); Node c
Node d
Step 204, the execution route in all static paths is followed the tracks of;
Wherein, if have following 7 test target: x=-1, x=-7, x=-9, x=1, x=3, x=9, x=17, then statement described in the above-mentioned steps 203 is followed the tracks of, the execution route that exists in all static paths has: execution route is a → b during x=-1; Execution route is a → b → d during x=-7; Execution route is a → b → d during x=-9; Execution route is a → c during x=1; Execution route is a → c → d during x=3; Execution route is a → c → d during x=9; Execution route is a → c → d during x=17; Then in the above-mentioned execution route that obtains according to test target, the execution route of x=-7, x=-9 is identical, and the execution route of x=3, x=9, x=17 is identical; And execution route a → b of x=-1 is included among execution route a → b → d of x=-7, x=-9, the execution route of x=1 is included among execution route a → c → d of x=3, x=9, x=17, hence one can see that, in the implementation of all static paths, there be the relation of inclusion and the redundancy relationship of static path.
Step 205, the static path that has relation of inclusion in all static paths is optimized to handle obtains first test use cases, the static path that has redundancy relationship in all static paths is optimized to handle obtains second test use cases;
Wherein, tracking according to the execution route in 204 pairs of all static paths of above-mentioned steps, obtained the static path that has relation of inclusion and redundancy relationship in all static paths, static path with relation of inclusion and redundancy relationship is optimized, is formed for testing first test use cases and is used to test second test use cases with redundancy relationship with relation of inclusion; Particularly, in test target x=-1, x=-7, x=-9, first test use cases with static path formation of relation of inclusion is { x=-7}, wherein, x=-7 is the test case that first test case is concentrated, and the embodiment of the invention is only concentrated in first test case for convenience of description and only had a test case x=-7, when having the static path of a plurality of relation of inclusion, then first test case is concentrated and promptly can be had a plurality of test cases, correspondingly, a plurality of test targets is just arranged also; In test target x=1, x=3, x=9, x=17, second test use cases is { x=3}, wherein, x=3 is the test case that second test case is concentrated, the embodiment of the invention is only concentrated in second test case for convenience of description and is only had a test case x=3, and when having the static path of a plurality of redundancy relationship, then second test case is concentrated and promptly can be had a plurality of test cases, correspondingly, a plurality of test targets are also just arranged.
Step 206, obtain minimum test use cases according to first test use cases and second test use cases of all static paths after the optimization process;
Wherein, by above-mentioned steps 205 as can be known, first test use cases { x=-7} and second test use cases { minimum test use cases { x=-7, x=3} when x=3} is formed for tested static path a → b → d and a → c → d; Further, all carry out identical operations, can obtain and be used for minimum test use cases that system under test (SUT) is tested for all static paths in the system under test (SUT).
Step 207, the minimum test case of extraction are concentrated and the corresponding test case of system under test (SUT);
Step 208, basis are tested the static path of system under test (SUT) with the corresponding test case of system under test (SUT);
In step 207 and step 208, for example, if need the static path a → b → d in the system under test (SUT) be tested, then { extraction is tested static path a → b → d with the corresponding test case x=-7 of static path a → b → d and is got final product x=-7, the x=3} from minimum test use cases.
Step 209, if the source program of system under test (SUT) changes, then the corresponding test case of extraction is tested the static path that influenced by variation point from minimum set of uses case.
Wherein, if change has taken place in function f 2 in the system under test (SUT), then static path a → c → d changes, therefore take place after changing when getting access to this static path a → c → d, the test case that the minimum test case that gets access to from above-mentioned steps 206 is concentrated is tested the static path that influenced by variation point and get final product, so has saved the time that system under test (SUT) is tested.
The system detection method that the embodiment of the invention provides, when system under test (SUT) being tested the variation point that runs into execution route or static path change takes place, after being followed the tracks of, the execution route in all static paths in the system under test (SUT) gets access to minimum test use cases, make and carry out the static path test according to minimum test case set pair system under test (SUT), the variation point that calls the path of whole system under test (SUT) and the static path that change takes place have been realized determining intuitively and accurately, for optimizing and selecting regression test case that foundation is provided.
Fig. 3 is the structural representation of an embodiment of system testing device of the present invention, the embodiment of the invention can realize the flow process of above-mentioned Fig. 1, method embodiment shown in Figure 2, as shown in Figure 3, the embodiment of the invention comprises: first acquisition module 31, tracking module 32, second acquisition module 33, first test module 34;
Wherein, first acquisition module 31 obtains all static paths of system under test (SUT); Execution route in 32 pairs of described all static paths of tracking module is followed the tracks of; Second acquisition module 33 obtains minimum test use cases according to described execution route; First test module 34 carries out the static path test according to the described system under test (SUT) of described minimum test case set pair.
The system testing device that the embodiment of the invention provides, when system under test (SUT) being tested the variation point that runs into execution route or static path change takes place, get access to minimum test use cases after following the tracks of by the execution route in all static paths in 33 pairs of systems under test (SUT) of second acquisition module, make and carry out the static path test according to minimum test case set pair system under test (SUT), the variation point that calls the path of whole system under test (SUT) and the static path that change takes place have been realized determining intuitively and accurately, for optimizing and selecting regression test case that foundation is provided.
Fig. 4 is the structural representation of another embodiment of system testing device of the present invention, the embodiment of the invention can realize the flow process of above-mentioned Fig. 1, method embodiment shown in Figure 2, as shown in Figure 4, the embodiment of the invention comprises: first acquisition module 41, tracking module 42, second acquisition module 43, first test module 44, second test module 45;
Wherein, first acquisition module 41 obtains all static paths of system under test (SUT); Execution route in 42 pairs of described all static paths of tracking module is followed the tracks of; Second acquisition module 43 obtains minimum test use cases according to described execution route; First test module 44 carries out the static path test according to the described system under test (SUT) of described minimum test case set pair; If the source program of described system under test (SUT) changes, then second test module 45 extracts corresponding test case the static path that influenced by variation point is tested from described minimum set of uses case.
Further, first acquisition module 41 can also comprise: pretreatment unit 411, analytic unit 412, first acquiring unit 413; Wherein, the source code of 411 pairs of systems under test (SUT) of pretreatment unit carries out pre-service; 412 pairs of pretreatment units of analytic unit, 411 pretreated source code analyses obtain the logic branch of described source code; The logic branch that first acquiring unit 413 obtains according to analytic unit 412 obtains all static paths of described system under test (SUT).
Further, second acquisition module 43 can also comprise: first processing unit 431, second processing unit 432, second acquisition unit 433; Wherein, the static path that has relation of inclusion in 431 pairs of described all static paths of first processing unit is optimized to handle and obtains first test case; The static path that has redundancy relationship in 432 pairs of described all static paths of second processing unit is optimized to handle and obtains second test case; Second acquisition unit 433 obtains minimum test use cases according to described first test case and described second test case of described all static paths after the optimization process.
Further, first test module 44 can also comprise: extraction unit, test cell; Wherein, extraction unit extracts the concentrated and corresponding test case of described system under test (SUT) of described minimum test case; Test cell is according to the corresponding test case of described system under test (SUT) the static path of described system under test (SUT) being tested.
The system testing device that the embodiment of the invention provides, when system under test (SUT) being tested the variation point that runs into execution route or static path change takes place, get access to minimum test use cases after following the tracks of by the execution route in all static paths in 43 pairs of systems under test (SUT) of second acquisition module, make and carry out the static path test according to minimum test case set pair system under test (SUT), the variation point that calls the path of whole system under test (SUT) and the static path that change takes place have been realized determining intuitively and accurately, for optimizing and selecting regression test case that foundation is provided.
System under test (SUT) described in the invention described above embodiment is specifically as follows: the computer software system under test (SUT), and also can be for comprising the computing machine system under test (SUT) of software and hardware one.
One of ordinary skill in the art will appreciate that: all or part of step that realizes the foregoing description can be finished by the relevant hardware of programmed instruction, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (2)

1. a system detection method is characterized in that, comprising:
Obtain all static paths of system under test (SUT);
Execution route in described all static paths is followed the tracks of;
Obtain minimum test use cases according to described execution route;
Carry out the static path test according to the described system under test (SUT) of described minimum test case set pair;
Described all static paths that obtain system under test (SUT) comprise:
Source code to system under test (SUT) carries out pre-service;
Described source code analysis is obtained the logic branch of described source code;
Obtain all static paths of described system under test (SUT) according to described logic branch;
Describedly obtain minimum test use cases according to described execution route and comprise:
The static path that has relation of inclusion in described all static paths is optimized processing obtains first test use cases;
The static path that has redundancy relationship in described all static paths is optimized processing obtains second test use cases;
Described first test use cases and described second test use cases according to described all static paths after the optimization process obtain minimum test use cases;
Describedly carry out static path test according to the described system under test (SUT) of described minimum test case set pair and comprise:
Extracting described minimum test case concentrates and the corresponding test case of described system under test (SUT);
According to the static path of described system under test (SUT) being tested with the corresponding test case of described system under test (SUT);
This system detection method also comprises:
If the source program of described system under test (SUT) changes, then from described minimum set of uses case, extract corresponding test case the static path that influenced by variation point is tested.
2. a system testing device is characterized in that, comprising:
First acquisition module is used to obtain all static paths of system under test (SUT);
Tracking module is used for the execution route of described all static paths is followed the tracks of;
Second acquisition module is used for obtaining minimum test use cases according to described execution route;
First test module is used for carrying out the static path test according to the described system under test (SUT) of described minimum test case set pair;
Described first acquisition module comprises:
Pretreatment unit is used for the source code of system under test (SUT) is carried out pre-service;
Analytic unit is used for described source code analysis is obtained the logic branch of described source code;
First acquiring unit is used for obtaining according to described logic branch all static paths of described system under test (SUT);
Described second acquisition module comprises:
First processing unit is used for that the static path that described all static paths have relation of inclusion is optimized processing and obtains first test use cases;
Second processing unit is used for that the static path that described all static paths have redundancy relationship is optimized processing and obtains second test use cases;
Second acquisition unit is used for obtaining minimum test use cases according to described first test use cases and described second test use cases of described all static paths after the optimization process;
Described first test module comprises:
Extraction unit is used to extract described minimum test case and concentrates and the corresponding test case of described system under test (SUT);
Test cell is used for according to the corresponding test case of described system under test (SUT) the static path of described system under test (SUT) being tested;
This system testing device also comprises:
Second test module is used for if the source program of described system under test (SUT) changes, and then extracts corresponding test case from described minimum set of uses case the static path that influenced by variation point is tested.
CN2009102387041A 2009-11-20 2009-11-20 System test method and device Expired - Fee Related CN101876939B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009102387041A CN101876939B (en) 2009-11-20 2009-11-20 System test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009102387041A CN101876939B (en) 2009-11-20 2009-11-20 System test method and device

Publications (2)

Publication Number Publication Date
CN101876939A CN101876939A (en) 2010-11-03
CN101876939B true CN101876939B (en) 2011-12-21

Family

ID=43019498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009102387041A Expired - Fee Related CN101876939B (en) 2009-11-20 2009-11-20 System test method and device

Country Status (1)

Country Link
CN (1) CN101876939B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8788239B2 (en) * 2011-02-11 2014-07-22 Fisher-Rosemount Systems, Inc. Methods, apparatus and articles of manufacture to test batch configurations
CN102364449B (en) * 2011-10-24 2017-04-12 中兴通讯股份有限公司 Generation method and system for minimum test case set
CN102902623B (en) * 2012-09-27 2015-01-07 华北电力大学 Implementation method for test optimization of complex system
CN103336760B (en) * 2013-07-11 2016-12-28 北京信息科技大学 A kind of method and device based on reverse-engineering automatic generating software document
US9218169B2 (en) * 2013-11-19 2015-12-22 Google Inc. Callpath finder
CN107786869B (en) * 2017-12-11 2020-03-17 深圳Tcl数字技术有限公司 Method, device and storage medium for generating menu path of television equipment
CN109388568B (en) * 2018-09-29 2020-05-15 百度在线网络技术(北京)有限公司 Code testing method and device
CN109828909A (en) * 2018-12-21 2019-05-31 北京城市网邻信息技术有限公司 Regression test case determines method, apparatus, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1776643A (en) * 2004-11-15 2006-05-24 华为技术有限公司 Method and device for testing software product robustness

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1776643A (en) * 2004-11-15 2006-05-24 华为技术有限公司 Method and device for testing software product robustness

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
万松松等.最小测试用例集生成方法改进及应用.《计算机技术与发展》.2008,第18卷(第10期),第2页,第3页. *

Also Published As

Publication number Publication date
CN101876939A (en) 2010-11-03

Similar Documents

Publication Publication Date Title
CN101876939B (en) System test method and device
CN107423278B (en) Evaluation element identification method, device and system
CN102402479B (en) For the intermediate representation structure of static analysis
CN109871319A (en) Item code scan method, device, computer equipment and storage medium
CN102360334A (en) Dynamic and static combined software security test method
CN103488482A (en) Method and device for generating test cases
CN103886092A (en) Method and device for providing terminal failure problem solutions
CN111079408A (en) Language identification method, device, equipment and storage medium
KR102013657B1 (en) Apparatus for statically analyzing assembly code including assoxiated multi files
CN115686631B (en) Random instruction generation method and device based on knowledge base and storage medium
Gürdür et al. Visual analytics for cyber-physical systems development: Blending design thinking and systems thinking
CN104809063A (en) Test method and device of distributed system
CN106775906A (en) Business flow processing method and device
CN104536897A (en) Automatic testing method and system based on keyword
CN117707948A (en) Training method and device for test case generation model
CN114721926A (en) Method, device, equipment and storage medium for detecting code coverage rate
CN102279795B (en) Test method and test device
CN116560631A (en) Method and device for generating machine learning model code
CN104063308A (en) Data verification method and device
CN102693150A (en) Processing method and apparatus based on virtual machine of charging special field
CN1459719A (en) System of pattern development program and method
CN109558580A (en) A kind of text analyzing method and device
Lami et al. QuARS: A pioneer tool for NL requirement analysis
CN103235745A (en) Address conflict detection method and device
Fangquan et al. Binary-oriented hybrid fuzz testing

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20111221

Termination date: 20151120

EXPY Termination of patent right or utility model