Embodiment
Because when treating testing software and test, operational order of the every input of user, the status information of this software to be tested all can change, also promptly jump to another state from a state, therefore the embodiment of the invention writes down each status information of software to be tested, and write down redirect condition between each status information, the redirect condition of record is imported software to be tested as operational order, to realize treating the automatic test of testing software.
Below in conjunction with Figure of description, the embodiment of the invention is described in detail.
Fig. 1 is the process that software is tested that the embodiment of the invention provides, and specifically may further comprise the steps:
S101: the status information current according to software to be tested, in the model bank of preserving, extract the state path that comprises the current status information of this software to be tested at software to be tested.
In embodiments of the present invention, preserved model bank, comprised some bar states path in this model bank, as shown in Figure 2 at this software to be tested.The state path synoptic diagram that Fig. 2 provides for the embodiment of the invention, in Fig. 2, this state path comprises status information A, status information B, status information C and status information D, in state path shown in Figure 2, software to be tested is under status information A, and input redirect condition 1 then jumps to status information B, under status information B, input redirect condition 2 then jumps to status information C, under status information C, input redirect condition 3 then jumps to status information D.
Therefore, the status information current according to software to be tested extracted the state path that comprises this current status information in model bank.For example, the current status information of software to be tested is status information B, then extracts state path as shown in Figure 2.
S102:, determine to connect the next status information of this current status information according to the annexation of each status information that comprises in the state path of extracting.
Continue to continue to use example, extracted state path as shown in Figure 2 after because current status information is status information B, therefore according to the annexation of each status information in this state path, the next status information of determining this status information B is status information C.
S103: this current status information according to record jumps to the redirect condition of this definite next one status information, this redirect condition is imported this software to be tested as operational order test.
Continue to continue to use example, the current status information of this software to be tested is status information B, the next status information of this status information B that determines is status information C, this software to be tested is redirect condition 2 by the redirect condition that status information B jumps to status information C, therefore with the operational order of this redirect condition 2, be input to this software to be tested and test as input.
In follow-up step, if this software to be tested receives this redirect condition 2 of input, and jump to status information C, then with status information C as current status information, determine that next status information is status information D, and determine that software to be tested is redirect condition 3 by the redirect condition that status information C jumps to status information D, continue that redirect condition 3 is imported software to be tested as operational order and test, same basically with said process, just give unnecessary details no longer one by one here.
In said process, the status information current according to software to be tested, extraction comprises the state path of this current status information, annexation according to each status information that comprises in the state path of extracting, determine the next status information of the status information that this is current, this current status information according to record jumps to the redirect condition of this next one status information, this redirect condition is imported this software to be tested as operational order test.Because the redirect condition that in the embodiment of the invention each status information in the state path of preserving is jumped to next status information is as the operational order of importing, treating testing software tests, thereby realized automatic test to software, need not manually-operated in the process of test, therefore improved the efficient that software is tested.
And, in above-mentioned steps S101, the state path of extracting that comprises this current status information may be many bar states path, if the state path of extracting that comprises this current status information is many bar states path, then can all carry out the step of follow-up S102 and S103 at every bar state path, to realize automatic test to this software to be tested.
Wherein, when the state path of extracting that comprises this current status information is many bar states path, if last status information in this many bar states path is all identical, in order further to improve the efficient that software is tested, then can in this many bar states path, select a state path the shortest, and carry out the step of follow-up S102 and S103, treat testing software and test; Accordingly,, then also can carry out the step of follow-up S102 and S103 respectively at this many bar states path, software is tested in order to improve the accuracy that software is tested.Further, when the state path of extracting that comprises this current status information is many bar states path, if last status information in this many bar states path is all identical, also can be as required, in this mulitpath, select one or several state path flexibly, treat testing software and test.
In embodiments of the present invention, the method of preserving model bank at this software to be tested is specially, each status information at this software to be tested, write down this software to be tested under this status information, each operational order of user's input, each operational order at user's input, determine that this software to be tested is under this status information, after receiving this operational order of user's input, the next status information that jumps to, this status information is connected with this next one status information that jumps to, and this operational order of user input is jumped to the redirect condition of this next one status information as this status information, annexation according to each status information is determined state path, and the state path of determining is kept in the model bank at this software to be tested.
Wherein, carry out when test treating testing software, may import a lot of operational orders, because operational order of every input, the status information of this software to be tested will change, therefore respectively at each status information of carrying out this software to be tested, write down each operational order of importing when carrying out this test, and the redirect situation of recording status information.
Each status information that Fig. 3 provides for the embodiment of the invention according to software to be tested, and each operational order of user's input, determine the annexation of each status information, and the process synoptic diagram of definite state path, as shown in Figure 3, the status information of software to be tested comprises status information A, status information B, status information C and status information D, this software to be tested is in status information A following time, the operational order of user's input of record is operational order 1 and operational order 2, wherein, if receive the operational order 1 of user's input, the next status information that then jumps to is status information B, if receive the operational order 2 of user's input, the next status information that then jumps to is status information C.This software to be tested is in status information C following time, and the operational order of the user of record input is an operational order 3, and wherein, if receive the operational order 3 of user's input, the next status information that then jumps to is status information D.Therefore, at status information A, this status information A is connected with status information B, and this operational order 1 is jumped to the redirect condition of status information B by status information A as this software to be tested, simultaneously, this status information A is connected with status information C, this operational order 2 is jumped to the redirect condition of status information C as this software to be tested by status information A.At status information C, this status information C is connected with status information D, and with this operational order 3 as the redirect condition that jumps to status information D as this software to be tested by status information C.
In follow-up step, annexation according to status information A, status information B, status information C and status information D, determine that jumping to status information B by status information A is first state path, determine to jump to status information C by status information A, jumping to status information D by status information C again is second state path, and this two bar states path of determining is kept in the model bank at this software to be tested.
In embodiments of the present invention, in order to improve the efficient in preservation state path, with further raising testing efficiency, the state path of determining is kept at the method in the model bank of this software to be tested is specially, annexation according to each status information in the state path of determining, with each status information corresponding codes in the state path according to the order of connection, be kept at this state path corresponding codes successively and concentrate, this state path corresponding codes collection is kept in the model bank at this software to be tested as definite state path.Wherein, for each status information of this software to be tested is set the unique encoding of a correspondence, as the identification information of each status information.
Continuation is that example describes with Fig. 3, in Fig. 3, suppose that status information A corresponding codes is 01, status information B corresponding codes is 02, status information C corresponding codes is 03, status information D corresponding codes is 04, then according to the annexation of status information A and status information B in first state path of determining, the order of connection according to these two status informations, these two status information corresponding codes are kept in first coded set of this first state path correspondence successively, then first coded set be 01,02}.Same, annexation according to status information A, status information C and status information D in second state path of determining, the order of connection according to these three status informations, the coding of these three status informations is kept in second coded set of this second state path correspondence successively, then second coded set is { 01,03,04}.First coded set is kept in the model bank as first state path, second coded set is kept in the model bank as second state path.
When adopting said method in model bank during the preservation state path, the process of step S101 in the process shown in Figure 1 is specially, the status information corresponding codes current according to software to be tested, in the model bank that software to be tested is preserved at this, extraction comprises the coded set of this current status information corresponding codes, as the state path of extracting that comprises this current status information.
Continue to continue to use example and describe, suppose that the current status information of software to be tested is status information C,, therefore extract the coded set that comprises this coding 03 because status information C corresponding codes is 03, also promptly extract second coded set 01,03,04}.
And, the process of step S102 in the process shown in Figure 1 is specially, according to this current status information corresponding codes, in the coded set that extracts as state path, search and come this current status information corresponding codes next one coding afterwards, with the corresponding status information of next one coding that finds, be defined as connecting the next status information of this current status information.
Continue to continue to use example and describe, extract second coded set { 01,03, behind the 04}, search and come coding 03 next one coding afterwards, promptly encode 04, with the status information of coding 04 correspondence that finds, promptly status information D is defined as connecting the next status information of this current status information C.
In subsequent step, then can jump to the redirect condition of next status information by this current status information according to this software to be tested of record, this redirect condition is imported this software to be tested as operational order test.
In embodiments of the present invention, the annexation of each status information that comprises in according to the state path of extracting when determining not exist the next status information that connects this current status information, outputs test result.When also promptly in determining this state path that current status information is being extracted, being last status information,, output test result at the end of test (EOT) of this state path of extracting to this software to be tested.
In embodiments of the present invention, in order to improve the accuracy of test, after step S103 shown in Figure 1, also be, after this redirect condition is tested as this software to be tested of operational order input, after will judging that also this software to be tested is carried out this operational order, whether the status information that jumps to is this next one status information of determining, if judged result is for being, then continue this software to be tested is tested, otherwise will this current status information, this next one status information of determining, this software to be tested is carried out the status information that jumps to behind this operational order, and exports in error reporting as the redirect condition of operational order, and outputs test result.
Continuing to continue to use example describes, the current status information of this software to be tested is status information C, the next status information of determining is status information D, the redirect condition that is jumped to status information D by status information C is a redirect condition 3, then after redirect condition 3 is imported this software to be tested as operational order, after judging that this software to be tested is carried out this operational order, whether jumped to status information D, if, then declare record to jump to the redirect condition 3 of status information D by status information C errorless, can proceed test, otherwise, declare record to jump to the redirect condition 3 of status information D by status information C wrong, then will this current status information C, definite next status information D, this software to be tested carry out the actual status information that jumps to behind this operational order, and be recorded in the error reporting as the redirect condition 3 of this operational order and export, so that the redirect condition of record is revised.
Fig. 4 is the detailed process that software is tested that the embodiment of the invention provides, and specifically comprises:
S401: the status information corresponding codes current according to software to be tested, in the model bank that software to be tested is preserved at this, extraction comprises the coded set of this current status information corresponding codes, as the state path of extracting that comprises this current status information.
S402: according to this current status information corresponding codes, in the coded set that extracts as state path, search and come this current status information corresponding codes next one coding afterwards, with the corresponding status information of next one coding that finds, be defined as connecting the next status information of this current status information.
S403: this current status information according to record jumps to the redirect condition of this definite next one status information, this redirect condition is imported this software to be tested as operational order test.
S404: after judging that this software to be tested is carried out this operational order, whether the status information that jumps to is this next one status information of determining, if then carry out step S405, otherwise carry out step S406.
S405: should next one status information as the current status information of this software to be tested, and return step S401, proceed to test.
S406: will this current status information, definite this next one status information, this software to be tested is carried out the actual status information that jumps to behind this operational order, and is recorded in the error reporting as the redirect condition of operational order and exports.
In said process, the status information current according to software to be tested, extraction comprises the state path of this current status information, annexation according to each status information that comprises in the state path of extracting, determine the next status information of the status information that this is current, this current status information according to record jumps to the redirect condition of this next one status information, this redirect condition is imported this software to be tested as operational order test.Because the redirect condition that in the embodiment of the invention each status information in the state path of preserving is jumped to next status information is as the operational order of importing, treating testing software tests, thereby realized automatic test to software, need not manually-operated in the process of test, therefore improved the efficient that software is tested.
And, among the step S402 in said process,, do not find and come this current status information corresponding codes next one coding afterwards if in the coded set that extracts as state path, then end of test (EOT) is exported test result.In addition, when the judged result of step S404 for not the time, also status information that can this is current, definite this next one status information, this software to be tested is carried out the actual status information that jumps to behind this operational order, and be recorded in the error reporting as the redirect condition of operational order, continue then this software to be tested is tested, after end of test (EOT), with error reporting output, just give unnecessary details no longer one by one here.
Fig. 5 is the proving installation structural representation that the embodiment of the invention provides, and specifically comprises:
Extraction module 501 is used for the status information current according to software to be tested, in the model bank of preserving at described software to be tested, extracts the state path that comprises the current status information of described software to be tested;
Determination module 502 is used for the annexation of each status information of comprising according to the described state path of extracting, determines to connect the next status information of described current status information;
Test module 503 is used for jumping to the redirect condition of definite described next status information according to the described current status information of record, described redirect condition is imported described software to be tested as operational order test.
Described device also comprises:
Path memory module 504, be used for each status information at described software to be tested, write down described software to be tested under this status information, each operational order of user's input, each operational order at user's input, determine that described software to be tested is under this status information, after receiving this operational order of user's input, the next status information that jumps to, this status information is connected with this next one status information that jumps to, and this operational order of user input is jumped to the redirect condition of this next one status information as this status information, annexation according to each status information is determined state path, and the state path of determining is kept in the model bank at described software to be tested.
Described path memory module 504 specifically is used for, annexation according to each status information in the state path of determining, with each status information corresponding codes in the state path according to the order of connection, be kept at this state path corresponding codes successively and concentrate, this state path corresponding codes collection is kept in the model bank at described software to be tested as definite state path.
Described extraction module 501 specifically is used for, according to described current status information corresponding codes, in the model bank of preserving at described software to be tested, extraction comprises the coded set of described current status information corresponding codes, as the state path of comprising of extracting of described current status information.
Described determination module 502 specifically is used for, according to described current status information corresponding codes, in the coded set of the described state path of extracting of conduct, search and come described current status information corresponding codes next one coding afterwards, with the corresponding status information of the next one that finds coding, be defined as connecting the next status information of described current status information.
Described device also comprises:
Error reporting logging modle 505, be used for described redirect condition is imported after described software to be tested tests as operational order, after judging that described software to be tested is carried out described operational order, whether the status information that jumps to is the described next status information of determining, if judged result is for being, then continue described software to be tested is tested, otherwise, with described current status information, the described next status information of determining, described software to be tested is carried out the status information that jumps to behind the described operational order, and is recorded in the error reporting as the redirect condition of operational order and exports.
Described device also comprises:
Output module 506 as a result, are used for the annexation when each status information that comprise according to the described state path of extracting, and when determining not exist the next status information that connects described current status information, output test result.
The embodiment of the invention provides a kind of method of testing and device, the status information that this method is current according to software to be tested, extraction comprises the state path of this current status information, annexation according to each status information that comprises in the state path of extracting, determine the next status information of the status information that this is current, this current status information according to record jumps to the redirect condition of this next one status information, this redirect condition is imported this software to be tested as operational order test.Because the redirect condition that in the embodiment of the invention each status information in the state path of preserving is jumped to next status information is as the operational order of importing, treating testing software tests, thereby realized automatic test to software, need not manually-operated in the process of test, therefore improved the efficient that software is tested.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.