Designing method of high-efficiency high-coverage-rate function test case[technical field]
The invention relates to a kind of method of software Black-box Testing, be meant a kind of designing method of high-efficiency high-coverage-rate function test case especially.
[background technology]
The test case design is an important skill of software test, and the quality of use-case design is directly connected to the height of testing level.
Use-case design theory method is a lot of at present, like equivalence class division, boundary value analysis, cause-and-effect diagram, judgement table driven parsing, scene design etc.These methods have bigger help in the use-case design of certain function point or module.These methods do not have versatility, and concrete a certain function point or module will be selected one or more concrete methods for use.The use-case that designs like this can better be verified the software quality of each module, and the guidance of individual bulking property can not be arranged software system test.
A judgment criteria of software test level is exactly coverage and accuracy, testing efficiency.So the use-case design also will be considered from this two sides.
Two broad theory viewpoints of current software test circle------program be work with program be idle.Before a kind of be the correct realization of judging software function according to demand, the back is a kind of to be that prover is that BUG (mistake) is arranged as far as possible, mainly on the reliability of program, robustness " finding fault ".
Because manual test is more loaded down with trivial details, if software systems are divided into a plurality of little modules, carry out forward and reverse use-case design then, staggered forward and the reverse use-case carried out of test man is easy to wrong report and fails to report BUG like this.
[summary of the invention]
Technical matters to be solved by this invention is to provide a kind of method for designing of high efficiency high coverage rate functional test use-case.
The present invention solves the problems of the technologies described above through following technical scheme: a kind of designing method of high-efficiency high-coverage-rate function test case comprises the following step of carrying out successively:
Step 10: at first carry out tested object and testing requirement analysis;
Step 20: beginning use-case;
Step 30: analyze the expected result of use-case, and whether program receive input variable and handle the corresponding result of feedback, with positive function and reverse unusual two kinds of situation classification, then get intostep 40 andstep 70 based on the use-case numbering simultaneously this moment;
Step 40: program receives input variable and handles, and gets intostep 50 then;
Step 50: the design of positive function test case is carried out in tested object and demand analysis according tostep 10; The function that is used for the verifying software requirement can both realize; Get intostep 60 then; What this use-case design was mainly considered is coverage, the realizing route of software function, the different input values in same path etc.;
Step 60: various use-case methods for designing are used, and get intostep 100 then;
Step 70: program does not receive input variable, then gets intostep 80;
Step 80: reverse abnormal conditions use-case design is carried out in tested object and demand analysis according tostep 10, gets intostep 90 then;
The various use-case methods for designing ofstep 90 are used, and with the viewpoint or the position of opposition, utilization error guessing, judgement/condition combined method are analyzed in reverse abnormal conditions use-case design; Cause unusual input, the off path of software irregular operating; Whether verifying software can well recover under above-mentioned abnormal conditions, then carries out test result and estimates, at this moment; Program has prompting or abnormal conditions to recover, and gets intostep 100 then;
Step 100: accomplish use-case.
In the saidstep 60, in the process of positive function test case design, the method for designing of employing comprises following at least a: boundary value analysis method, Path Coverage Analysis, orthogonal experimental design method.
In the saidstep 90, the method for designing of usefulness comprises following at least a: boundary value analysis method, scene design method.
The advantage of designing method of high-efficiency high-coverage-rate function test case of the present invention is:
1, according to two broad theory viewpoints of current software test circle------program be work with program be idle; Come design test case from forward thinking and opposition thinking two aspects; The forward thinking realizes based on the software function demand, guarantees that software function can both correctly realize; Opposition thinking is based on unusual input, realizations such as abnormal operation, the robustness of verifying software.Two kinds of methods of forward thinking and opposition thinking combine, and guarantee the high coverage rate of testing.Forward thinking and opposition thinking are separated, so more help in the measuring executing process result's judgement is more helped the efficient execution of use-case.
2, based on the use-case of this strategy design, be used for automatic test, also more help result's judgement.
[description of drawings]
Combine embodiment that the present invention is done further description with reference to the accompanying drawings.
Fig. 1 is the process flow diagram of designing method of high-efficiency high-coverage-rate function test case embodiment of the present invention.
[embodiment]
See also Fig. 1, designing method of high-efficiency high-coverage-rate function test case of the present invention comprises the following step of carrying out successively:
Step 10: at first carry out tested object and testing requirement analysis;
Step 20: beginning use-case;
Step 30: analyze the expected result of use-case, and whether program receive input variable and handle the corresponding result of feedback,, with positive function and reverse unusual two kind situation classification like positive function use-case be numbered according to the use-case numbering this moment*A, promptly last position is a, reverse unusual use-case is numbered*B, promptly last position is b, then gets intostep 40 andstep 70 simultaneously;
Step 40: program receives input variable and handles, and gets intostep 50 then;
Step 50: the design of positive function test case is carried out in tested object and demand analysis according tostep 10; The function that is used for the verifying software requirement can both realize; Get intostep 60 then; What this use-case design was mainly considered is coverage, the realizing route of software function, the different input values in same path etc.;
Step 60: various use-case methods for designing are used, and in the process of positive function test case design, the method for designing that can adopt mainly contains: boundary value analysis method, Path Coverage Analysis, orthogonal experimental design method etc. get intostep 100 then;
Step 70: program does not receive input variable, then gets intostep 80;
Step 80: reverse abnormal conditions use-case design is carried out in tested object and demand analysis according tostep 10, gets intostep 90 then;
Step 90: various use-case methods for designing are used; Viewpoint or position to oppose in reverse abnormal conditions use-case design; Utilization error guessing, judgement/methods analysts such as condition combination; Cause unusual input (not meeting input, illegal input that design specification requires), the off path of software irregular operating, whether verifying software can well recover under above-mentioned abnormal conditions.Test result is estimated, and at this moment, program has prompting or abnormal conditions to recover.The method for designing that can adopt mainly contains: boundary value analysis method, scene design method etc. get intostep 100 then;
Step 100: accomplish use-case.
Though more than described embodiment of the present invention; But the technician who is familiar with the present technique field is to be understood that; We described concrete embodiment is illustrative; Rather than being used for qualification to scope of the present invention, those of ordinary skill in the art are in the modification and the variation of the equivalence of doing according to spirit of the present invention, all should be encompassed in the scope that claim of the present invention protects.