Summary of the invention
It is an object of the invention to provide a kind of automated testing method and system, make the test system can unusual circumstance automatically (Bug), and obtain the relevant data of Bug, save the plenty of time, significantly improve test efficiency, and improve the degree of accuracy that Bug judges, avoid and omit Bug or the situation of erroneous judgement Bug due to tester's carelessness.
For solving the problems of the technologies described above, embodiments of the present invention provide a kind of automated testing method, comprise following step:
The tested software prestored is sent at least one Devices to test;
Test data are selected according to tested software; Test data at least comprise the test script of test case;
According to test Data Control Devices to test testing results case, and record test daily record Log;
If test Log comprises the abnormal keyword representing abnormal conditions, then from test Log, obtain the attribute information of abnormal conditions according to abnormal keyword; Wherein, the attribute information of abnormal conditions at least comprises abnormal information, the version number of software and test application module corresponding to case.
Embodiments of the present invention additionally provide a kind of automatization test system, comprise: test subsystems, Log analyzing subsystem and exception manage subsystem;
Test subsystems is for being sent at least one Devices to test by the tested software prestored, and selects test data according to tested software; Test subsystems also for according to test Data Control Devices to test testing results case, and record test Log;
Log analyzing subsystem tests, for judging, the abnormal keyword whether comprising in Log and representing abnormal conditions; If comprising, in test Log, the abnormal keyword representing abnormal conditions, then Log analyzing subsystem obtains the attribute information of abnormal conditions according to abnormal keyword from test Log;
Abnormal management subsystem is for storing the attribute information of abnormal conditions and test Log.
The tested software prestored in terms of existing technologies, is sent at least one Devices to test by embodiment of the present invention; Test data are selected according to tested software; Test data at least comprise the test script of test case; According to test Data Control Devices to test testing results case, and record test daily record Log; If test Log comprises the abnormal keyword representing abnormal conditions, then from test Log, obtain the attribute information of abnormal conditions according to abnormal keyword; Wherein, the attribute information of abnormal conditions at least comprises abnormal information, the version number of software and test application module corresponding to case. That is, the relevant data such as test data are selected by test system automatically according to tested software, and automatically search the Bug in the test daily record Log recorded, the respective modules of acquisition Bug. In this way, test system is made can automatically to help tester to find Bug, and obtain the relevant data of Bug, save the plenty of time, significantly improve test efficiency, and the degree of accuracy making Bug judge is improved, avoid the erroneous judgement manually tested the inadequate or careful degree of the personnel specialty ability caused and cause not.
In addition, from test Log, obtain the step of the attribute information of abnormal conditions according to abnormal keyword, comprise following sub-step: the association character section obtaining abnormal keyword from test Log; The version number of software and application module is extracted from association character section; Wherein, the association character section of abnormal keyword is front M the character of abnormal keyword and/or rear N number of character of abnormal keyword, and M, N are natural number. Like this, by obtaining the mode of association character section, obtain the attribute information of Bug, accelerate the process efficiency of test system, and feasibility is higher.
In addition, the attribute information of abnormal conditions also comprises person liable corresponding to application module; Wherein, according to the default corresponding relation of application module and person liable, obtain the person liable that application module is corresponding, thus reach the object of clear-cut job responsibility, facilitate the management to Bug.
In addition, obtain the step of attribute information of abnormal conditions from test Log according to abnormal keyword after, also comprise following step: the attribute information of abnormal conditions is sent to the director that application module is corresponding such that it is able to notify that director processes timely, avoid the delay process time.
In addition, the attribute information of abnormal conditions also comprises abnormality processing state; When detecting that abnormality processing state occurs to change, send the attribute information director that extremely application module is corresponding of the abnormal conditions after changing; Or when detecting that person liable occurs to change, send the director after the attribute information change that extremely application module is corresponding of abnormal conditions. Which can be applicable to current director and leaves office change, the situation that abnormal conditions are not processed, then in time notice change after director abnormal conditions are processed; Which can also be applied to director and abnormal conditions be processed, and revises the situation of tester as director of downstream simultaneously, so that the director of downstream that makes after notice change in time processes timely. Like this, so that other directors also can understand the process progress of abnormal conditions timely.
In addition, test data also comprise the length of testing speech of test case and the testing time of test case, test daily record Log more accurately to obtain.
Specific embodiment party formula
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, the embodiments of the present invention are explained in detail. But, it will be understood by those skilled in the art that, in each enforcement mode of the present invention, propose many technology details to make reader understand the application better. But, even if there is no these technology details and based on the many variations of following enforcement mode and amendment, it is also possible to realize the technical scheme that each claim of the application is claimed.
The first enforcement mode of the present invention relates to a kind of automated testing method, and the method for testing in present embodiment is implemented on the basis of automatization test system, and idiographic flow is as shown in Figure 1.
Step 101, is sent at least one Devices to test by the tested software prestored.
Wherein, Devices to test can be the mobile terminals such as mobile phone, and tested software can be the software of the various versions of corresponding mobile phone.
Specifically, automatization test system comprises test subsystems, Log analyzing subsystem and extremely manages subsystem. Test subsystems comprises server and PC end, in advance by PC end telnet server, tested software is sent to server, and Devices to test can be connected on the port of server by data line (such as USB line), to realize information transmission. After PC end logon server, select tested software in the server, and by the connectivity port that Devices to test is corresponding, tested software is sent to Devices to test. When practical operation, it is also possible to make each port is mounted with multiple stage Devices to test by connector, to improve the reliability of each tested software test; Further, different port is hung between the load Devices to test of disparity items and each port noiseless, it is to increase test efficiency.
Wherein, Log analyzing subsystem and abnormal management subsystem can also comprise server, store the program segment of corresponding function in advance, to realize corresponding function in server. Or, test subsystems, Log analyzing subsystem and abnormal management subsystem can also be the program segments of the not congenerous relying on same server.
Step 102, selects test data according to tested software; Test data at least comprise the test script of test case.
Wherein, PC end sets up test case in advance on the server by remote controlled manner; That is, the function point in tested software is converted into system, function and checks and accepts test case, based on automation frameworks such as UIAutomator or Robotium, test case is split into automatic test script, and under the upper corresponding case path that uploads onto the server. Meanwhile, tested software is also uploaded onto the server by PC end, can set up the corresponding relation of test case and tested software on the server, and this corresponding relation can exist in table form.
In present embodiment, the way selection that PC end logon server is tabled look-up goes out and corresponding test data, and downloads test data, by communication link, test data is sent to Devices to test. Wherein, the link that communicates can be wired communication.
Step 103, according to test Data Control Devices to test testing results case, and records test daily record Log.
Specifically, test subsystems control Devices to test testing results case, and control Devices to test and upload test daily record Log (such as Systemlog, Modemlog, Networklog etc.).
Step 104, judges to test whether Log comprises the abnormal keyword representing abnormal conditions. If then performing step 105, otherwise terminating.
Wherein, abnormal keyword can be pre-set by tester and be kept in automatization test system.
Specifically, Log analyzing subsystem obtains test daily record Log from test subsystems, and test Log is carried out filter analysis, judges whether to there is the abnormal keyword such as Javacrash, ANR. If existing, then it is determined that the presence of abnormal conditions (Bug), otherwise, judge there are not abnormal conditions.
Step 105, obtains the attribute information of abnormal conditions according to abnormal keyword from test Log. Wherein, the attribute information of abnormal conditions at least comprises abnormal information, the version number of software and test application module corresponding to case. In present embodiment, the attribute information of abnormal conditions comprises person liable corresponding to abnormal information, the version number of software, test application module corresponding to case and application module.
Step 105 comprises sub-step 1051 and sub-step 1052.
Sub-step 1051, Log analyzing subsystem obtains the association character section of abnormal keyword from test Log.
Wherein, the association character section of abnormal keyword is front M the character of abnormal keyword and/or rear N number of character of abnormal keyword, and M, N are natural number.
Specifically, owing to the abnormal keyword in test Log is front/rear general all with the description of association character section (package title) and abnormal conditions, and packets of information title comprises the title of application module, therefore Log analyzing subsystem obtains the mode of the association character section of abnormal keyword by this kind, and feasibility is higher.
Sub-step 1052, Log analyzing subsystem extracts the version number of tested software and application module from association character section.
Specifically, Log analyzing subsystem is according to the version number extracting tested software, and is judged by package name analysis to test application module corresponding to case.
Wherein, Log analyzing subsystem also stores the corresponding relation of application module and person liable in advance, this corresponding relation can exist in table form, as applied module in charge people's comparison table, so that after Log analyzing subsystem extracts application module, corresponding director can be obtained timely, and director is added in the attribute information of abnormal conditions.
It should be noted that, the corresponding relation of application module and person liable can also be stored in abnormal management subsystem, searches director corresponding to this application module by extremely managing subsystem.
It is worth mentioning that, in present embodiment, Log analyzing subsystem can also generate a document of the attribute information comprising abnormal conditions according to the Bug attribute templates prestored in PC end, namely according to template generation Buglist, so that director checks and document management. In present embodiment, the test Log recorded also is sent to and extremely manages subsystem, carries out contrast for director according to the Buglist generated and checks.
Step 106, is sent to the director that application module is corresponding by the attribute information of abnormal conditions.
Specifically, abnormal management subsystem is according to the attribute information of the abnormal conditions obtained, the attribute information of abnormal conditions is sent to the director belonging to these abnormal conditions (i.e. the corresponding director of application module in the attribute information of abnormal conditions) by the form of mail, thus reach the object of clear-cut job responsibility, facilitate the management of Bug. And, it is possible to notify the object that abnormal conditions are processed by director timely, avoid the delay process time.
In present embodiment, test data are selected by test system according to tested software, perform automation tests the Bug automatically searching in the test daily record Log recorded, and obtains the relevant data such as application module corresponding to the abnormal information of Bug, the version number of software and test case. In this way, make the test system can unusual circumstance automatically (Bug), and obtain the relevant data of Bug, save the plenty of time, significantly improve test efficiency, and improve the degree of accuracy that Bug judges, avoid and omit Bug or the situation of erroneous judgement Bug due to tester's carelessness.
It should be noted that in present embodiment, test data can also comprise the length of testing speech of test case and the testing time of test case. Namely, PC telnet server selects the case (script) needing test, the time that automation test needs to perform and the number of repetition performing test case are set, test, to control, total time and the number of times that case performs, test daily record Log more accurately to obtain. Test subsystems, Log analyzing subsystem and abnormal management subsystem can be three sub-modules of a server, store the program segment of its corresponding function in advance, to realize the function of its correspondence in three sub-modules in server.
The 2nd enforcement mode of the present invention relates to a kind of automated testing method. 2nd enforcement mode is improved on the basis of the first enforcement mode, main improvements are: in second embodiment of the invention, the attribute information of abnormal conditions also comprises abnormality processing state, this enforcement mode can be applicable to current director and leaves office change, the situation that abnormal conditions are not processed, then notify that abnormal conditions are processed by the director after changing in time; This enforcement mode can also be applied to director and abnormal conditions be processed, and revises the situation of tester as director of downstream simultaneously, so that the director of downstream that makes after notice change in time processes timely. Like this, so that other directors also can understand the process progress of abnormal conditions timely.
Step 201 in present embodiment is roughly the same to step 106 with the step 101 in the first enforcement mode to step 206, for avoiding repetition, does not repeat them here. Hereinafter difference part is described:
Step 207, judges: whether detect that abnormality processing state changes, or whether detect that director changes. If then performing step 208, otherwise performing step 207.
Specifically, when director is untreated or during untreated complete abnormal conditions, the state of abnormal conditions is masked as untreated state; After abnormal conditions are processed by person liable, can be then processed state by the Status Change of these abnormal conditions, and likely change corresponding director (the i.e. director of downstream, such as retest personnel), extremely whether management subsystem is by occurring change to judge abnormality processing state, to judge that whether abnormal conditions are processed. Or, current director leaves office change, when abnormal conditions are not processed, then the attribute information amendment of abnormal conditions corresponds to other director.
Step 208, the attribute information sending the abnormal conditions after changing is to applying director corresponding to module; Or, send the director after the attribute information change that extremely application module is corresponding of abnormal conditions.
Specifically, the attribute information of the abnormal conditions after change is sent to the director of downstream by abnormal management subsystem, such as, retest personnel. Or, when the attribute information of abnormal conditions is sent to new director, so that abnormal conditions are processed.
The step of various method divides above, just in order to be described clearly, it is achieved time can be merged into a step or some step be split, and is decomposed into multiple step, as long as comprising identical logic relation, all in the protection domain of this patent; To adding unimportant amendment in algorithm or in flow process or introduce unimportant design, but the core design not changing its algorithm and flow process is all in the protection domain of this patent.
Third embodiment of the invention relates to a kind of automatization test system, as shown in Figure 3, comprises: test subsystems, Log analyzing subsystem and exception manage subsystem;
Test subsystems is for being sent at least one Devices to test by the tested software prestored, and selects test data according to tested software; Test subsystems also for according to test Data Control Devices to test testing results case, and record test Log;
Log analyzing subsystem tests, for judging, the abnormal keyword whether comprising in Log and representing abnormal conditions; If comprising, in test Log, the abnormal keyword representing abnormal conditions, then Log analyzing subsystem obtains the attribute information of abnormal conditions according to abnormal keyword from test Log;
The attribute information of abnormal conditions with testing Log and is sent to director corresponding to this application module for storing the attribute information of abnormal conditions by abnormal management subsystem. Wherein, the attribute information of abnormal conditions at least comprises abnormal information, the version number of software and test application module corresponding to case.
It should be noted that in present embodiment, the attribute information of abnormal conditions also comprises person liable corresponding to application module; Log analyzing subsystem, also for the default corresponding relation according to application module and person liable, obtains the person liable that application module is corresponding.
Being not difficult to find, present embodiment is the system embodiment corresponding with the first enforcement mode, and present embodiment can be worked in coordination enforcement with the first enforcement mode. The relevant technical details mentioned in first enforcement mode is still effective in the present embodiment, in order to reduce repetition, repeats no more here. Correspondingly, the relevant technical details mentioned in present embodiment also can be applicable in the first enforcement mode.
It should be noted that each module involved in present embodiment is logic module, in actual applications, a logic unit can be a physics unit, it is also possible to be a part for a physics unit, it is also possible to realize with the combination of multiple physics unit. In addition, in order to the innovation part of the outstanding present invention, the unit not too close with solving technical problem relation proposed by the invention is not introduced by present embodiment, but this does not show not exist in present embodiment other unit.
Four embodiment of the invention relates to a kind of automatization test system. 4th enforcement mode is improved on the basis of the 3rd enforcement mode, and main improvements are: in four embodiment of the invention, and the attribute information of abnormal conditions also comprises abnormality processing state;
Abnormal management subsystem also person liable for detecting abnormality processing state corresponding with applying module whether all change; Director if abnormality processing state changes per capita with application responsibility corresponding to module, then after the attribute information that abnormal management subsystem sends abnormal conditions to change corresponding to application module.
Owing to the 2nd enforcement mode is mutually corresponding with present embodiment, therefore present embodiment can be worked in coordination enforcement with the 2nd enforcement mode. The relevant technical details mentioned in 2nd enforcement mode is still effective in the present embodiment, and the technique effect that can reach in this second embodiment can realize in the present embodiment too, in order to reduce repetition, repeats no more here. Correspondingly, the relevant technical details mentioned in present embodiment also can be applicable in the 2nd enforcement mode.
It will be understood by those skilled in the art that, the respective embodiments described above realize specific embodiments of the invention, and in actual applications, it is possible in the form and details it is done various change, and without departing from the spirit and scope of the present invention.