CN104298600A - Software testing method and device - Google Patents

Software testing method and device Download PDF

Info

Publication number
CN104298600A
CN104298600A CN201410572668.3A CN201410572668A CN104298600A CN 104298600 A CN104298600 A CN 104298600A CN 201410572668 A CN201410572668 A CN 201410572668A CN 104298600 A CN104298600 A CN 104298600A
Authority
CN
China
Prior art keywords
statement
circulation
program element
test procedure
called
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
CN201410572668.3A
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.)
Guangzhou Huaduo Network Technology Co Ltd
Original Assignee
Guangzhou Huaduo Network Technology Co Ltd
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 Guangzhou Huaduo Network Technology Co Ltd filed Critical Guangzhou Huaduo Network Technology Co Ltd
Priority to CN201410572668.3A priority Critical patent/CN104298600A/en
Publication of CN104298600A publication Critical patent/CN104298600A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a software testing method and device and belongs to the technical field of computers. The software testing method includes: receiving software testing requests of target software; acquiring a testing program used in the software testing requests; extracting loop statements to form to-be-called program units from each loop in the testing program if the testing program includes multilayer loops; setting calling executing statements corresponding to the to-be-called program units at the position where the loop statements are extracted; replacing the extracted loop statements, running the modified testing program and testing the target software. By the software testing method and device, flexibility in software testing can be improved.

Description

The method and apparatus of software test
Technical field
The present invention relates to field of computer technology, the method and apparatus of particularly a kind of software test.
Background technology
Along with the development of computer technology, the kind of software is more and more abundanter, and the quality of software quality becomes more and more important, like this, before software comes into operation, just needs to test software.
When testing software, usually test procedure (also protos test suite PROTOS can be called) is write by programming language, tested by the correlation function of test procedure to software, such as, test procedure is write, to test software, wherein based on Robot Framework (robotization framework), generally include key word and execution parameter etc. in test statement in test procedure, therefore above-mentioned test mode is also referred to as key word and drives test.
Realizing in process of the present invention, inventor finds that prior art at least exists following problem:
Because the test procedure write by automated test frame only supports individual layer cycling, if comprise multilayer circulation in test procedure, then cannot run this test procedure, thus, make the dirigibility tested software poor.
Summary of the invention
In order to solve the problem of prior art, embodiments provide a kind of method and apparatus of software test.Described technical scheme is as follows:
First aspect, provides a kind of method of software test, and described method comprises:
The software test request of receiving target software, obtains the test procedure that described software test request uses;
If comprise multilayer circulation in described test procedure, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted;
Run amended test procedure, described target software is tested.
Alternatively, if comprise multilayer circulation in described test procedure, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted, comprising:
If do not comprise circulation end statement between the first circulation initial statement in described test procedure and the second circulation initial statement, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, if comprise multilayer circulation in described test procedure, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted, comprising:
If comprise multilayer circulation in described test procedure, then successively outside from innermost loop, for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, described for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted, comprising:
For each circulation in described test procedure except outermost loop, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, described for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted, comprising:
For each circulation in described test procedure, extract loop statement and form program element to be called, the call parameters of the corresponding program element to be called formed is set, and the situ of loop statement extracted, arrange carry described call parameters call perform statement, substitute the loop statement extracted.
Second aspect, provides a kind of device of software test, and described device comprises:
Acquisition module, for the software test request of receiving target software, obtains the test procedure that described software test request uses;
Processing module, if for comprising multilayer circulation in described test procedure, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted;
Test module, for running amended test procedure, tests described target software.
Alternatively, described processing module, for:
If do not comprise circulation end statement between the first circulation initial statement in described test procedure and the second circulation initial statement, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, described processing module, for:
If comprise multilayer circulation in described test procedure, then successively outside from innermost loop, for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, described processing module, for:
For each circulation in described test procedure except outermost loop, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, described processing module, for:
For each circulation in described test procedure, extract loop statement and form program element to be called, the call parameters of the corresponding program element to be called formed is set, and the situ of loop statement extracted, arrange carry described call parameters call perform statement, substitute the loop statement extracted.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
In the embodiment of the present invention, the software test request of receiving target software, obtain the test procedure that software test request uses, if comprise multilayer circulation in test procedure, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitute the loop statement extracted, run amended test procedure, target software is tested, like this, each circulation is extracted as independently program element respectively, each program element performs individual layer circulation, avoid the nested problem that cannot perform of multilayer circulation, thus, the dirigibility to software test can be improved.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the method flow diagram of a kind of software test that the embodiment of the present invention provides;
Fig. 2 is the examples of interfaces figure of the application program of a kind of software test that the embodiment of the present invention provides;
Fig. 3 is the apparatus structure schematic diagram of a kind of software test that the embodiment of the present invention provides;
Fig. 4 is the structural representation of a kind of terminal that the embodiment of the present invention provides.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Embodiment one
Embodiments provide a kind of method of software test, as shown in Figure 1, the treatment scheme of the method can comprise following step:
Step 101, the software test request of receiving target software, obtains the test procedure that software test request uses.
Step 102, if comprise multilayer circulation in test procedure, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Step 103, runs amended test procedure, tests target software.
In the embodiment of the present invention, the software test request of receiving target software, obtain the test procedure that software test request uses, if comprise multilayer circulation in test procedure, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitute the loop statement extracted, run amended test procedure, target software is tested, like this, each circulation is extracted as independently program element respectively, each program element performs individual layer circulation, avoid the nested problem that cannot perform of multilayer circulation, thus, the dirigibility to software test can be improved.
Embodiment two
Embodiments provide a kind of method of software test, the method can be realized by terminal.Terminal wherein can be arbitrary terminal, such as notebook computer, panel computer etc.
Below in conjunction with embodiment, be described in detail the treatment scheme shown in Fig. 1, content can be as follows:
Step 101, the software test request of receiving target software, obtains the test procedure that software test request uses.
Wherein, target software can be any software, such as browser, instant messaging application program, web page code etc.Can be comprise one or more test statement in test procedure, key word and execution parameter etc. can be comprised in test statement, key word is for representing the character of the test statement of correspondence, key word can comprise circulation and start key word, circulation end key word etc., ForRange such as can be used to represent, and circulation starts key word, and ForEnd represents that circulation terminates key word etc.
In force, technician can write test procedure by various programming language, and can comprise multilayer circulation and/or individual layer circulation in the test procedure write, the number of individual layer circulation or multilayer circulation can be one, also can be multiple.In the software testing system of reality, test procedure can be called protos test suite PROTOS, and usually, protos test suite PROTOS comprises test case, and test case comprises test statement, and the test statement in test procedure can be thought in this test statement.After technician completes test procedure, can be this test procedure setting program mark, such as external member A etc., can store program identification in the terminal with corresponding test procedure.Application program for carrying out software test can be installed in terminal, as shown in Figure 2, when technician needs to test a certain function of certain software (i.e. target software), technician can start this application program of installing in terminal, and the software identification of select target software in the software catalog provided in this application program, thus determine test target, then, corresponding test procedure can be selected for the difference in functionality of software, the program identification of this test procedure can be selected in this application program, when technician's click starts to test button, terminal can generate software test request by the program identification selected, terminal can the software test request of receiving target software, and the program identification by carrying in software test request, determine the test procedure corresponding with this program identification, this test procedure can be retrieved as the test procedure that software test request uses.
Step 102, if comprise multilayer circulation in test procedure, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Wherein, perform statement is called for calling corresponding program element to be called, to perform the loop statement in program element to be called.If there is not the circulation end statement matched with some circulation initial statements in test procedure, then can by this circulation initial statement to test procedure last test statement between all test statements, as the loop statement of the circulation belonging to this circulation initial statement.
In force, terminal can detect the loop statement in test procedure, can determine in several ways to comprise multilayer circulation in test procedure, such as can search the circulation initial statement in test procedure and circulation end statement, and mate, between certain circulation initial statement and circulation end statement corresponding thereto, also comprise one or more circulation initial statement, then can determine to comprise multilayer circulation in test procedure.For any one circulation in test procedure, terminal can extract the loop statement of this circulation, form program element to be called, simultaneously, can in test procedure the situ at above-mentioned loop statement place, what arrange an above-mentioned program element to be called of correspondence calls perform statement, replaces above-mentioned loop statement.
Such as, if only include one three layers circulation in test procedure, from innermost layer to outermost layer, three layers of circulation can be called the first circulation successively, second circulation and the 3rd circulation, the loop statement extracting the first circulation forms the first program element to be called, corresponding call perform statement and can be called that first calls perform statement, the loop statement extracting the second circulation forms the second program element to be called, corresponding call perform statement and can be called that second calls perform statement, extract loop statement composition the 3rd program element to be called of the 3rd circulation, corresponding call perform statement and can be called that the 3rd calls perform statement, then by after the process of above-mentioned steps 102, only comprise the 3rd in this test procedure and call perform statement, like this, application program due to software test cannot perform multilayer circulation operation, after above-mentioned process, multilayer circulation is there is not in test procedure, therefore, this application program can testing results program.Wherein, the 3rd program element to be called comprises second and calls perform statement, and the second program element to be called comprises first and calls perform statement, and the first program element to be called comprises the loop statement of the first circulation.
Alternatively, above-mentionedly determine that the processing mode comprising multilayer circulation in test procedure can be varied, a kind of feasible processing mode is below provided, the processing procedure of corresponding above-mentioned steps 102 can comprise following content: if do not comprise circulation end statement between the first circulation initial statement in test procedure and the second circulation initial statement, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitute the loop statement extracted.
Wherein, first circulation initial statement can be the arbitrary circulation initial statement in test procedure, second circulation initial statement can be the arbitrary circulation initial statement in test procedure except the first circulation initial statement, circulation initial statement can be comprise the statement that circulation starts keyword, such as comprise the statement of ForRange, circulation end statement can be comprise the statement that circulation terminates keyword, such as, comprise the statement of ForEnd.
In force, terminal can search circulation initial statement in test procedure and circulation end statement, if find between some circulation initial statements (i.e. the first circulation initial statement) and another circulation initial statement (i.e. the second circulation initial statement) and do not comprise circulation end statement, then can determine that test procedure comprises multilayer circulation.Then, terminal can for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitute the loop statement extracted, concrete processing procedure see above-mentioned related content, can not repeat them here.
Alternatively, processing mode for the loop statement extracted in test procedure can be varied, a kind of optional processing mode is below provided, the processing procedure of corresponding above-mentioned steps 102 can comprise following content: if comprise multilayer circulation in test procedure, then successively outside from innermost loop, for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
In force, if comprise multilayer circulation in terminal determination test procedure, then in order to reduce the error rate of loop statement in the process extracted, for this multilayer circulation, terminal can be successively outside from innermost loop, extracts the every one deck circulation composition program element to be called in multilayer circulation successively, and in the situ of the loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, in order to simplify the processing procedure of multilayer circulation, and consider in existing software test mechanism that being merely able to process individual layer circulates, therefore any process can not be carried out to the outermost loop in multilayer circulation, the processing procedure of corresponding above-mentioned steps 102 can comprise following content: for each circulation in test procedure except outermost loop, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
In force, terminal can obtain the loop statement of any layer circulation in multilayer circulation, and will judge whether this layer of circulation is outermost loop, if not, the loop statement that then can extract this layer of circulation forms program element to be called, and in the situ of above-mentioned loop statement, what arrange corresponding above-mentioned program element to be called calls perform statement, substitute above-mentioned loop statement, if, terminal can not process outermost loop, by that analogy, until processed every one deck circulation in multilayer circulation.
Alternatively, in order to the convenient loop statement treated in calling program unit carries out calling execution, call parameters can be set for program element to be called, the processing procedure of corresponding above-mentioned steps 102 can comprise following content: for each circulation in described test procedure, extract loop statement and form program element to be called, the call parameters of the corresponding program element to be called formed is set, and the situ of loop statement extracted, arrange carry described call parameters call perform statement, substitute the loop statement extracted.
In force, if comprise multilayer circulation in terminal determination test procedure, for any one circulation in multilayer circulation, terminal can extract the loop statement of this circulation, form program element to be called, a call parameters can be set for this program element to be called, and in the situ of above-mentioned loop statement, arrange one carry this call parameters call perform statement, substitute above-mentioned loop statement.Wherein, call in perform statement to comprise and call key word and call parameters, call key word and call parameters can be arranged in advance by technician in above-mentioned application program, such as calling key word can for also can ForRangeFold, ForRangeSuite etc., and call parameters can be A, 1 etc.
Such as, test procedure can store in table form, as shown in table 1.
Table 1
Line number Key word Execution parameter
1 SubString ["abc","1"]
2 ForRange ["varA","0","3","1"]
3 ForRange ["varB","0","5","1"]
4 SubString ["abcdefghi","${varB}"]
5 ForEnd []
6 SubString ["abcdefghi","${varA}"]
The test procedure of table 1 comprises multilayer circulation, namely line number is the first circulation that the test statement in 3,4 and 5 is formed, line number is the second circulation that the test statement in 2,3,4,5 and 6 is formed, after above-mentioned processing procedure, the test procedure as table 1 can be expressed as the amended test procedure as table 2.
Table 2
Line number Key word Execution parameter Call parameters
1 SubString ["abc","1"]
2 ForRange ["varA","0","3","1"]
3 ForRangeFold ["varB","0","5","1"] 1
6 SubString ["abcdefghi","${varA}"]
As table 2, the key word of the first circulation is ForRangeFold (also can be described as and call key word), and call parameters is 1.
Step 103, runs amended test procedure, tests target software.
In force, above-mentioned application program order performs the test statement in test procedure, when execution is to when calling perform statement, call corresponding program element to be called, and the loop statement performed in this program element to be called, and use the result of this program element to be called, continue to perform other test statement in test procedure, until this test procedure has run, thus complete the test to target software.
In the embodiment of the present invention, the software test request of receiving target software, obtain, the test procedure that software test request uses, if comprise multilayer circulation in test procedure, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitute the loop statement extracted, run amended test procedure, target software is tested, like this, each circulation is extracted as independently program element respectively, each program element performs individual layer circulation, avoid the nested problem that cannot perform of multilayer circulation, thus, the dirigibility to software test can be improved.
Embodiment three
Based on identical technical conceive, the embodiment of the present invention additionally provides a kind of device of software test, and as shown in Figure 3, this device comprises:
Acquisition module 310, for the software test request of receiving target software, obtains the test procedure that software test request uses;
Processing module 320, if for comprising multilayer circulation in test procedure, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted;
Test module 330, for running amended test procedure, tests target software.
Alternatively, processing module 320, for:
If do not comprise circulation end statement between the first circulation initial statement in test procedure and the second circulation initial statement, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, processing module 320, for:
If comprise multilayer circulation in test procedure, then successively outside from innermost loop, for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, processing module 320, for:
For each circulation in test procedure except outermost loop, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, processing module 320, for:
For each circulation in test procedure, extract loop statement and form program element to be called, the call parameters of the corresponding program element to be called formed is set, and the situ of loop statement extracted, arrange carry call parameters call perform statement, substitute the loop statement extracted.
In the embodiment of the present invention, the software test request of receiving target software, obtain, the test procedure that software test request uses, if comprise multilayer circulation in test procedure, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitute the loop statement extracted, run amended test procedure, target software is tested, like this, each circulation is extracted as independently program element respectively, each program element performs individual layer circulation, avoid the nested problem that cannot perform of multilayer circulation, thus, the dirigibility to software test can be improved.
It should be noted that: the device of the software test that above-described embodiment provides is when carrying out software test, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by terminal is divided into different functional modules, to complete all or part of function described above.In addition, the device of the software test that above-described embodiment provides and the embodiment of the method for software test belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
Embodiment four
Please refer to Fig. 4, it illustrates the structural representation of the terminal involved by the embodiment of the present invention, this terminal may be used for the method implementing a kind of software test provided in above-described embodiment.Specifically:
Terminal 700 can comprise communication unit 110, includes the storer 120 of one or more computer-readable recording mediums, input block 130, display unit 140, sensor 150, voicefrequency circuit 160, WIFI (Wireless Fidelity, Wireless Fidelity) module 170, include the parts such as processor 180 and power supply 190 that more than or processes core.It will be understood by those skilled in the art that the restriction of the not structure paired terminal of the terminal structure shown in figure, the parts more more or less than diagram can be comprised, or combine some parts, or different parts are arranged.Wherein:
Communication unit 110 can be used for receiving and sending messages or in communication process, the reception of signal and transmission, this communication unit 110 can be RF (Radio Frequency, radio frequency) circuit, router, modulator-demodular unit, etc. network communication equipment.Especially, when communication unit 110 is RF circuit, after being received by the downlink information of base station, more than one or one processor 180 is transferred to process; In addition, base station is sent to by relating to up data.Usually, RF circuit as communication unit includes but not limited to antenna, at least one amplifier, tuner, one or more oscillator, subscriber identity module (SIM) card, transceiver, coupling mechanism, LNA (Low Noise Amplifier, low noise amplifier), diplexer etc.In addition, communication unit 110 can also by radio communication and network and other devices communicatings.Described radio communication can use arbitrary communication standard or agreement, include but not limited to GSM (Global System of Mobile communication, global system for mobile communications), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, Wideband Code Division Multiple Access (WCDMA)), LTE (Long Term Evolution, Long Term Evolution), Email, SMS (Short Messaging Service, Short Message Service) etc.Storer 120 can be used for storing software program and module, and processor 180 is stored in software program and the module of storer 120 by running, thus performs the application of various function and data processing.Storer 120 mainly can comprise storage program district and store data field, and wherein, storage program district can store operating system, application program (such as sound-playing function, image player function etc.) etc. needed at least one function; Store data field and can store the data (such as voice data, phone directory etc.) etc. created according to the use of terminal 700.In addition, storer 120 can comprise high-speed random access memory, can also comprise nonvolatile memory, such as at least one disk memory, flush memory device or other volatile solid-state parts.Correspondingly, storer 120 can also comprise Memory Controller, to provide the access of processor 180 and input block 130 pairs of storeies 120.
Input block 130 can be used for the numeral or the character information that receive input, and produces and to arrange with user and function controls relevant keyboard, mouse, control lever, optics or trace ball signal and inputs.Preferably, input block 130 can comprise Touch sensitive surface 131 and other input equipments 132.Touch sensitive surface 131, also referred to as touch display screen or Trackpad, user can be collected or neighbouring touch operation (such as user uses any applicable object or the operations of annex on Touch sensitive surface 131 or near Touch sensitive surface 131 such as finger, stylus) thereon, and drive corresponding coupling arrangement according to the formula preset.Optionally, Touch sensitive surface 131 can comprise touch detecting apparatus and touch controller two parts.Wherein, touch detecting apparatus detects the touch orientation of user, and detects the signal that touch operation brings, and sends signal to touch controller; Touch controller receives touch information from touch detecting apparatus, and converts it to contact coordinate, then gives processor 180, and the order that energy receiving processor 180 is sent also is performed.In addition, the polytypes such as resistance-type, condenser type, infrared ray and surface acoustic wave can be adopted to realize Touch sensitive surface 131.Except Touch sensitive surface 131, input block 130 can also comprise other input equipments 132.Preferably, other input equipments 132 can include but not limited to one or more in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, control lever etc.
Display unit 140 can be used for the various graphical user interface showing information or the information being supplied to user and the terminal 700 inputted by user, and these graphical user interface can be made up of figure, text, icon, video and its combination in any.Display unit 140 can comprise display panel 141, optionally, the form such as LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) can be adopted to configure display panel 141.Further, Touch sensitive surface 131 can cover display panel 141, when Touch sensitive surface 131 detects thereon or after neighbouring touch operation, send processor 180 to determine the type of touch event, on display panel 141, provide corresponding vision to export with preprocessor 180 according to the type of touch event.Although in the drawings, Touch sensitive surface 131 and display panel 141 be as two independently parts realize input and input function, in certain embodiments, can by Touch sensitive surface 131 and display panel 141 integrated and realize input and output function.
Terminal 700 also can comprise at least one sensor 150, such as optical sensor, motion sensor and other sensors.Optical sensor can comprise ambient light sensor and proximity transducer, wherein, ambient light sensor the light and shade of environmentally light can regulate the brightness of display panel 141, and proximity transducer when terminal 700 moves in one's ear, can cut out display panel 141 and/or backlight.As the one of motion sensor, Gravity accelerometer can detect the size of all directions (are generally three axles) acceleration, size and the direction of gravity can be detected time static, can be used for identifying the application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating) of mobile phone attitude, Vibration identification correlation function (such as passometer, knock) etc.; As for terminal 700 also other sensors such as configurable gyroscope, barometer, hygrometer, thermometer, infrared ray sensor, do not repeat them here.
Voicefrequency circuit 160, loudspeaker 161, microphone 162 can provide the audio interface between user and terminal 700.Voicefrequency circuit 160 can by receive voice data conversion after electric signal, be transferred to loudspeaker 161, by loudspeaker 161 be converted to voice signal export; On the other hand, the voice signal of collection is converted to electric signal by microphone 162, voice data is converted to after being received by voicefrequency circuit 160, after again voice data output processor 180 being processed, through RF circuit 110 to send to such as another terminal, or export voice data to storer 120 to process further.Voicefrequency circuit 160 also may comprise earphone jack, to provide the communication of peripheral hardware earphone and terminal 700.
In order to realize radio communication, this terminal can be configured with wireless communication unit 170, this wireless communication unit 170 can be WIFI module.WIFI belongs to short range wireless transmission technology, and terminal 700 can help user to send and receive e-mail by wireless communication unit 170, browse webpage and access streaming video etc., and its broadband internet wireless for user provides is accessed.Although there is shown wireless communication unit 170, be understandable that, it does not belong to must forming of terminal 700, can omit in the scope not changing disclosed essence as required completely.
Processor 180 is control centers of terminal 700, utilize the various piece of various interface and the whole mobile phone of connection, software program in storer 120 and/or module is stored in by running or performing, and call the data be stored in storer 120, perform various function and the process data of terminal 700, thus integral monitoring is carried out to mobile phone.Optionally, processor 180 can comprise one or more process core; Preferably, processor 180 accessible site application processor and modem processor, wherein, application processor mainly processes operating system, user interface and application program etc., and modem processor mainly processes radio communication.Be understandable that, above-mentioned modem processor also can not be integrated in processor 180.
Terminal 700 also comprises the power supply 190 (such as battery) of powering to all parts, preferably, power supply can be connected with processor 180 logic by power-supply management system, thus realizes the functions such as management charging, electric discharge and power managed by power-supply management system.Power supply 190 can also comprise one or more direct current or AC power, recharging system, power failure detection circuit, power supply changeover device or the random component such as inverter, power supply status indicator.
Although not shown, terminal 700 can also comprise camera, bluetooth module etc., does not repeat them here.In the present embodiment, terminal also includes storer, and one or more than one program, one of them or more than one program are stored in storer, and be configured to be performed by more than one or one processor, described more than one or one routine package is containing the instruction for carrying out following method:
The software test request of receiving target software, obtains the test procedure that software test request uses;
If comprise multilayer circulation in test procedure, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted;
Run amended test procedure, target software is tested.
Alternatively, if comprise multilayer circulation in test procedure, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted, comprising:
If do not comprise circulation end statement between the first circulation initial statement in test procedure and the second circulation initial statement, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, if comprise multilayer circulation in test procedure, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted, comprising:
If comprise multilayer circulation in test procedure, then successively outside from innermost loop, for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted, comprising:
For each circulation in test procedure except outermost loop, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
Alternatively, for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted, comprising:
For each circulation in test procedure, extract loop statement and form program element to be called, the call parameters of the corresponding program element to be called formed is set, and the situ of loop statement extracted, arrange carry call parameters call perform statement, substitute the loop statement extracted.
In the embodiment of the present invention, the software test request of receiving target software, obtain, the test procedure that software test request uses, if comprise multilayer circulation in test procedure, then for each circulation in test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitute the loop statement extracted, run amended test procedure, target software is tested, like this, each circulation is extracted as independently program element respectively, each program element performs individual layer circulation, avoid the nested problem that cannot perform of multilayer circulation, thus, the dirigibility to software test can be improved.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. a method for software test, is characterized in that, described method comprises:
The software test request of receiving target software, obtains the test procedure that described software test request uses;
If comprise multilayer circulation in described test procedure, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted;
Run amended test procedure, described target software is tested.
2. method according to claim 1, it is characterized in that, if comprise multilayer circulation in described test procedure, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitute the loop statement extracted, comprising:
If do not comprise circulation end statement between the first circulation initial statement in described test procedure and the second circulation initial statement, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
3. method according to claim 1, it is characterized in that, if comprise multilayer circulation in described test procedure, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitute the loop statement extracted, comprising:
If comprise multilayer circulation in described test procedure, then successively outside from innermost loop, for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
4. method according to claim 1, it is characterized in that, described for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted, comprising:
For each circulation in described test procedure except outermost loop, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
5. method according to claim 1, it is characterized in that, for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted, comprising:
For each circulation in described test procedure, extract loop statement and form program element to be called, the call parameters of the corresponding program element to be called formed is set, and the situ of loop statement extracted, arrange carry described call parameters call perform statement, substitute the loop statement extracted.
6. a device for software test, is characterized in that, described device comprises:
Acquisition module, for the software test request of receiving target software, obtains the test procedure that described software test request uses;
Processing module, if for comprising multilayer circulation in described test procedure, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted;
Test module, for running amended test procedure, tests described target software.
7. device according to claim 6, is characterized in that, described processing module, for:
If do not comprise circulation end statement between the first circulation initial statement in described test procedure and the second circulation initial statement, then for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
8. device according to claim 6, is characterized in that, described processing module, for:
If comprise multilayer circulation in described test procedure, then successively outside from innermost loop, for each circulation in described test procedure, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
9. device according to claim 6, is characterized in that, described processing module, for:
For each circulation in described test procedure except outermost loop, extract loop statement and form program element to be called, and the situ of loop statement extracted, what arrange the corresponding program element to be called formed calls perform statement, substitutes the loop statement extracted.
10. device according to claim 6, is characterized in that, described processing module, for:
For each circulation in described test procedure, extract loop statement and form program element to be called, the call parameters of the corresponding program element to be called formed is set, and the situ of loop statement extracted, arrange carry described call parameters call perform statement, substitute the loop statement extracted.
CN201410572668.3A 2014-10-23 2014-10-23 Software testing method and device Pending CN104298600A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410572668.3A CN104298600A (en) 2014-10-23 2014-10-23 Software testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410572668.3A CN104298600A (en) 2014-10-23 2014-10-23 Software testing method and device

Publications (1)

Publication Number Publication Date
CN104298600A true CN104298600A (en) 2015-01-21

Family

ID=52318335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410572668.3A Pending CN104298600A (en) 2014-10-23 2014-10-23 Software testing method and device

Country Status (1)

Country Link
CN (1) CN104298600A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106407120A (en) * 2016-10-08 2017-02-15 河南理工大学 Automated testing system and method for computer software
CN108959079A (en) * 2018-06-27 2018-12-07 郑州云海信息技术有限公司 A kind of with automatic test is leading software agile development method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271397A (en) * 2007-03-23 2008-09-24 北京大学 Recognition method of nested loop structure
CN101401075A (en) * 2006-11-17 2009-04-01 深圳市领测科技有限公司 Mapping method in the program testing system and program testing system
CN101944014A (en) * 2010-09-15 2011-01-12 复旦大学 Method for realizing automatic pipeline parallelism

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101401075A (en) * 2006-11-17 2009-04-01 深圳市领测科技有限公司 Mapping method in the program testing system and program testing system
CN101271397A (en) * 2007-03-23 2008-09-24 北京大学 Recognition method of nested loop structure
CN101944014A (en) * 2010-09-15 2011-01-12 复旦大学 Method for realizing automatic pipeline parallelism

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
齐涛-道长: "RFS的web自动化验收测试——第13讲 分支与循环的用法", 《博客》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106407120A (en) * 2016-10-08 2017-02-15 河南理工大学 Automated testing system and method for computer software
CN106407120B (en) * 2016-10-08 2019-07-30 河南理工大学 A kind of automatization test system and test method of computer software
CN108959079A (en) * 2018-06-27 2018-12-07 郑州云海信息技术有限公司 A kind of with automatic test is leading software agile development method and system
CN108959079B (en) * 2018-06-27 2021-08-20 郑州云海信息技术有限公司 Software agile development method and system taking automatic test as leading factor

Similar Documents

Publication Publication Date Title
CN105320598A (en) Software testing method and device
CN105005909A (en) Method and device for predicting lost users
CN104780164A (en) Method and device for operating game client
CN105528297A (en) Method and device for testing web page
CN104639672A (en) Method and device for domain name resolution (DNS)
CN104462119A (en) Data migration method and device
CN104636047A (en) Method and device for operating objects in list and touch screen terminal
CN104572430A (en) Method, device and system for testing terminal application interface
CN105278937A (en) Method and device for displaying pop-up box messages
CN104135728B (en) Method for connecting network and device
CN104850406A (en) Page switching method and device
CN104717341A (en) Message prompting method and terminal
CN103310009A (en) Method, device and terminal for updating webpage data
CN104281600A (en) Method and device for intelligent selecting words
CN105389259A (en) Method, apparatus and system for performing application testing
CN104699501A (en) Method and device for running application program
CN104965722A (en) Method and apparatus for displaying information
CN104077211A (en) Test method and test system for mobile terminal software
CN103631592B (en) A kind of configuration, call method, device and equipment that shows resource
CN105278925A (en) Method and device for refuse cleaning of uninstalled software
CN104123210A (en) Method, device and system for testing performance of browser
CN104391588B (en) A kind of method of input prompt and device
CN104102560A (en) Method and device for testing system performance
CN103336677B (en) A kind of methods, devices and systems to display device output image
CN105302589A (en) Method and apparatus for acquiring uninstallation information

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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: 20150121