Summary of the invention
Given this, the invention provides a kind of method for testing software, device and equipment, solve existing software test and technical matters that is higher and optimization of cannot modifying to the test logic of existing testing tool is required to tester's professional ability.
According to one embodiment of present invention, a kind of method for testing software is provided, comprises: select test item functional module and order and test parameter is set; The virtual script of test logic is generated with the test parameter arranged according to the test item functional module selected and order; Resolve described virtual script obtain test logic test item and order and test parameter; And according to test item and order and test parameter progressively all test items are tested.
Preferably, described method for testing software also comprises: generate and show the virtual icon of test item functional module.
Preferably, described method for testing software also comprises: analyze the test result of test item, and judges whether the test re-starting test item.
Preferably, described test parameter comprises input parameter, output parameter and execution number of times.
Preferably, described virtual script is TXT or XML format.
According to still another embodiment of the invention, a kind of software testing device is provided, comprises: select setting unit, for select test item functional module and order and test parameter is set; Script generation unit, for generating the virtual script of test logic according to the described test item functional module of selection setting unit selection and the test parameter of order and setting; Resolution unit, for resolving virtual script that described script generation unit generates to obtain the test item and sequentially and test parameter of test logic; And test cell, for resolving the test item and order that obtain according to described resolution unit and test parameter is progressively tested all test items.
Preferably, described software testing device also comprises test item icon generation unit and display unit, described test item icon generation unit is for generating the virtual icon of test item functional module, and described display unit is for showing the virtual icon of the test item functional module of described test item icon generation unit generation.
Preferably, described software testing device also comprises test result analysis unit, and the test result for the test item to described test cell is analyzed and judged whether to be re-started by described test cell the test of test item.
Preferably, described test parameter comprises input parameter, output parameter and execution number of times.
According to one embodiment of present invention, provide a kind of electronic equipment, described electronic equipment comprises above-mentioned software testing device.
Method for testing software provided by the invention, device and equipment, according to the actual needs of software test, select select test item functional module and order and test parameter is set, just automatically can generate the virtual script of test logic, common test technician just can carry out writing of test script simply, and can freely modify to test script and optimize, reduce the workload of software test Scripting Edition and the professional requirement of tester, improve the work efficiency of software test.
Embodiment
Below in conjunction with the drawings and specific embodiments, more detailed description is further done to technical scheme of the present invention.Obviously, described embodiment is only a part of embodiment of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under the prerequisite of not making creative work, all should belong to the scope of protection of the invention.
In describing the invention, it is to be appreciated that term " first ", " second " etc. are only for describing object, and instruction or hint relative importance can not be interpreted as.In describing the invention, it should be noted that, unless otherwise clearly defined and limited, term " is connected ", " connection " should be interpreted broadly, such as, can be fixedly connected with, also can be removably connect, or connect integratedly; Can be mechanical connection, also can be electrical connection; Can be directly be connected, also indirectly can be connected by intermediary.For the ordinary skill in the art, above-mentioned term concrete meaning in the present invention can be understood in conjunction with concrete condition.In addition, in describing the invention, except as otherwise noted, the implication of " multiple " is two or more.
Describe and can be understood in process flow diagram or in this any process otherwise described or method, represent and comprise one or more for realizing the module of the code of the executable instruction of the step of specific logical function or process, fragment or part, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can not according to order that is shown or that discuss, comprise according to involved function by the mode while of basic or by contrary order, carry out n-back test, this should understand by embodiments of the invention person of ordinary skill in the field.
Fig. 1 is the schematic flow sheet of method for testing software in one embodiment of the invention.As shown in the figure, described method for testing software, comprising:
Step S101: select test item functional module and order and test parameter is set.
Wherein, described test item is all possible test event of software test, the test item functional module of the test logic virtual script comprising test event can be generated in advance according to the fc-specific test FC requirement of test event and method of testing, when the test virtual script of described test item will be generated can directly Selection and call test item functional module and obtain test logic function script, and without the need to separately for described function items edit script.Such as, in the present embodiment, the functional module A that the test item that can actual needs selected to test in all test item functional modules is corresponding, B, C, D and E, and require to carry out test sequencing A-E-D-C-B to the functional module of described test item according to method of testing, correspondingly test parameter is arranged to each functional module.Wherein, described test parameter comprises input parameter, output parameter and execution number of times.The execution number of times of the test parameter of usual functional module is set to once, but may need to be set to perform repeatedly to test, to obtain stable test effect for the test of some specific functions.
Step S102: generate the virtual script of test logic with the test parameter arranged according to the test item functional module selected and order.
Concrete, obtain the test item functional module and order selected, call the test logic virtual script that selectively test item functional module is corresponding, and the virtual script of the test logic of this test is finally generated according to the order of the test function item functional module of described selection and test parameter, described virtual script can be stored as TXT or XML format.
Step S103: resolve described virtual script obtain test logic test item and order and test parameter.
Concrete, when software test will be carried out, can call and resolve the described virtual script of TXT or XML format, and the test item of read test test logic, testing sequence and test parameter.
Step S104: according to test item and order and test parameter progressively all test items are tested.
In the present embodiment, obtain test item sequence A-E-D-C-B and the test parameter corresponding to each test item of this software test, first carry out presetting the test performing number of times to test item A, input parameter in input test parameter, obtain the output parameter of actual test, and the output parameter that output parameter reality exported and test parameter are preset compares, judge the test success of described test item A when both are consistent, exportable described test item A tests successful result; The test crash of described test item A is judged, the result of exportable described test item A test crash when both are inconsistent.In like manner, progressively can test according to default testing sequence all test items, and obtain test result.
The method for testing software of the present embodiment, according to the actual needs of software test, select select test item functional module and order and test parameter is set, just automatically can generate the virtual script of test logic, common test technician just can carry out writing of test script simply, and can freely modify to test script and optimize, reduce the workload of software test Scripting Edition and the professional requirement of tester, improve the work efficiency of software test.
Fig. 2 is the schematic flow sheet of method for testing software in another embodiment of the present invention.As shown in the figure, described method for testing software, comprising:
Step S201: generate and show the virtual icon of test item functional module.
Wherein, described test item is all possible test event of software test, the test item functional module of the test logic virtual script comprising test event can be generated according to the fc-specific test FC requirement of test event and method of testing in advance, and generate and show standard icon corresponding to described test item functional module.
When carrying out testing the writing of virtual script, can directly drag select the functional module of test item corresponding standard icon to test logic editor, and the sequence of the standard icon of test item is obtained test logic function script according to testing sequence sequence, hit testing item icon arranges the test parameter of test item, without the need to the tester of specialty separately for all test item edit scripts, common test personnel just just can realize writing of test logic by the virtual icon dragging test item functional module with the test parameter arranging icon, a large amount of test script code write work simplification for dragging the work of test item functional block diagram target, reduce difficulty and the workload of test logic script edit, improve the work efficiency of software test.
Step S202: select test item functional module and order and test parameter is set.
Step S203: generate the virtual script of test logic with the test parameter arranged according to the test item functional module selected and order.
Step S204: resolve described virtual script obtain test logic test item and order and test parameter.
Step S205: according to test item and order and test parameter progressively all test items are tested.
Step S206: the test result of test item is analyzed, and judge whether the test re-starting test item.
In the present embodiment, when the actual test output parameter of test item A is inconsistent with the output parameter preset, judge the test crash of described test item A, the result of exportable described test item A test crash, and the reason of the output parameter analytical test failure exported is tested according to reality, if because test environment exception or specific factor cause when finding test crash, the test of described test item A can be re-started by automatic decision, avoid the situation of the test crash caused due to test environment exception or specific factor, improve stability and the reliability of software test.
The method for testing software of the present embodiment, according to the actual needs of software test, drag and select the icon of test item functional module and arrange icon order and test parameter is set, just automatically can generate the virtual script of test logic, common test technician just can carry out writing of test script simply visually, and can freely modify to test script and optimize, a large amount of test script code write work simplification for dragging the work of test item functional block diagram target, reduce the workload of software test Scripting Edition and the professional requirement of tester, improve the work efficiency of software test., test result to be analyzed and judgement retests meanwhile, avoid the situation of the test crash caused due to test environment exception or specific factor, improve stability and the reliability of software test.
Fig. 3 is the structural representation of software testing device in one embodiment of the invention.On the basis of said method embodiment, the software testing device 10 of the present embodiment comprises selects setting unit 101, script generation unit 102, resolution unit 103 and test cell 104.
Described selection setting unit 101, for select test item functional module and order and test parameter is set.Wherein, described test item is all possible test event of software test, the test item functional module of the test logic virtual script comprising test event can be generated in advance according to the fc-specific test FC requirement of test event and method of testing, when the test virtual script of described test item will be generated, described selection setting unit 101 can directly Selection and call test item functional module and obtain test logic function script, and without the need to separately for described function items edit script.Such as, in the present embodiment, the functional module A that described selection setting unit 101 test item that can actual needs be selected to test in all test item functional modules is corresponding, B, C, D and E, and require to carry out test sequencing A-E-D-C-B to the functional module of described test item according to method of testing, correspondingly test parameter is arranged to each functional module.Wherein, described test parameter comprises input parameter, output parameter and execution number of times.The execution number of times of the test parameter of usual functional module is set to once, but may need to be set to perform repeatedly to test, to obtain stable test effect for the test of some specific functions.
Described script generation unit 102, for generating the virtual script of test logic according to the described test item functional module of selection setting unit 101 selection and the test parameter of order and setting.Concrete, described script generation unit 102 obtains the test item functional module and order selected, call the test logic virtual script that selectively test item functional module is corresponding, and the virtual script of the test logic of this test is finally generated according to the order of the test function item functional module of described selection and test parameter, described virtual script can be stored as TXT or XML format.
Described resolution unit 103, for resolving virtual script that described script generation unit 102 generates to obtain the test item and sequentially and test parameter of test logic.When carrying out software test, the described virtual script of TXT or XML format is called and resolved to described resolution unit 103, and the test item of read test test logic, testing sequence and test parameter.
Described test cell 104, for resolving the test item and order that obtain and test parameter is progressively tested all test items according to described resolution unit 103.
In the present embodiment, described test cell 104 obtains test item sequence A-E-D-C-B and the test parameter corresponding to each test item of this software test, first carry out presetting the test performing number of times to test item A, input parameter in input test parameter, obtain the output parameter of actual test, and the output parameter that output parameter reality exported and test parameter are preset compares, judge the test success of described test item A when both are consistent, exportable described test item A tests successful result; The test crash of described test item A is judged, the result of exportable described test item A test crash when both are inconsistent.In like manner, described test cell 104 progressively can be tested according to default testing sequence all test items, and obtains test result.
The software testing device of the present embodiment, according to the actual needs of software test, by select setting unit select select test item functional module and order and test parameter is set, script generation unit just can generate the virtual script of test logic automatically, common test technician just can carry out writing of test script simply, and can freely modify to test script and optimize, reduce the workload of software test Scripting Edition and the professional requirement of tester, improve the work efficiency of software test.
Fig. 4 is the structural representation of software testing device in another embodiment of the present invention.As shown in the figure, the software testing device 10 of the present embodiment comprises selects setting unit 101, script generation unit 102, resolution unit 103, test cell 104, test item icon generation unit 105, display unit 106 and test result analysis unit 107, described display unit 106 is respectively with described test item icon generation unit 105 with select setting unit 101 to be connected, and described test result analysis unit 107 is connected with described test cell 104.
Described test item icon generation unit 105 is for generating the virtual icon of test item functional module, described display unit 106 is for showing the virtual icon of the test item functional module of described test item icon generation unit 105 generation, described test result analysis unit 107, the test result for the test item to described test cell 104 is analyzed and is judged whether to be re-started by described test cell 104 test of test item.
Wherein, described test item is all possible test event of software test, described test item icon generation unit 105 can generate the test item functional module of the test logic virtual script comprising test event in advance according to the fc-specific test FC requirement of test event and method of testing, and generates standard icon corresponding to described test item functional module.Described display unit 106 can be display or touch-screen, is shown by the virtual icon that described test item icon generation unit 105 generates, and carries out dragging select for tester.
When carrying out testing the writing of virtual script, directly can drag standard icon corresponding to the functional module of the test item selecting described display unit 106 to show to test logic editor, the sequence of the standard icon of test item is obtained test logic function script according to testing sequence sequence by described selection setting unit 101, and hit testing item icon arranges the test parameter of test item, without the need to the tester of specialty separately for all test item edit scripts, common test personnel just just can realize writing of test logic by the virtual icon dragging test item functional module with the test parameter arranging icon, a large amount of test script code write work simplification for dragging the work of test item functional block diagram target, reduce difficulty and the workload of test logic script edit, improve the work efficiency of software test.
In the present embodiment, when the actual test output parameter of described test cell 104 test item A is inconsistent with the output parameter preset, judge the test crash of described test item A, the result of exportable described test item A test crash, and by the reason of described test result analysis unit 107 according to the output parameter analytical test failure of reality test output, if because test environment exception or specific factor cause when finding test crash, described test result analysis unit 107 can re-start the test of described test item A by automatic decision, avoid the situation of the test crash caused due to test environment exception or specific factor, improve stability and the reliability of software test.
The software testing device of the present embodiment, according to the actual needs of software test, test item icon generation unit generates the icon of test item functional module in advance, drag by selecting setting unit and select the icon of test item functional module and arrange icon order and test parameter is set, script generation unit just can generate the virtual script of test logic automatically, common test technician just can carry out writing of test script simply visually, and can freely modify to test script and optimize, a large amount of test script code write work simplification for dragging the work of test item functional block diagram target, reduce the workload of software test Scripting Edition and the professional requirement of tester, improve the work efficiency of software test.Meanwhile, test result analysis unit analyzes test result and judgement retests, and avoids the situation of the test crash caused due to test environment exception or specific factor, improves stability and the reliability of software test.
Be understandable that, software testing device provided by the invention can be used alone, and also can realize software test as a part for electronic equipment.
Should be appreciated that each several part of the present invention can realize with hardware, software, firmware or their combination.In the above-described embodiment, multiple step or method can with to store in memory and the software performed by suitable instruction execution system or firmware realize.Such as, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: the discrete logic with the logic gates for realizing logic function to data-signal, there is the special IC of suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
In the description of this instructions, reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. describe the specific features, structure, material or the feature that mean to describe in conjunction with this embodiment or example and are contained at least one embodiment of the present invention or example.In this manual, identical embodiment or example are not necessarily referred to the schematic representation of above-mentioned term.And the specific features of description, structure, material or feature can combine in an appropriate manner in any one or more embodiment or example.
Although illustrate and describe embodiments of the invention, those having ordinary skill in the art will appreciate that: can carry out multiple change, amendment, replacement and modification to these embodiments when not departing from principle of the present invention and aim, scope of the present invention is by claim and equivalents thereof.