CN106897217A - Method of testing and test device - Google Patents

Method of testing and test device Download PDF

Info

Publication number
CN106897217A
CN106897217A CN201710076421.6A CN201710076421A CN106897217A CN 106897217 A CN106897217 A CN 106897217A CN 201710076421 A CN201710076421 A CN 201710076421A CN 106897217 A CN106897217 A CN 106897217A
Authority
CN
China
Prior art keywords
request
code
program
test result
test
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
CN201710076421.6A
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.)
Beijing Qunar Software Technology Co Ltd
Original Assignee
Beijing Qunar Software 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 Beijing Qunar Software Technology Co Ltd filed Critical Beijing Qunar Software Technology Co Ltd
Priority to CN201710076421.6A priority Critical patent/CN106897217A/en
Publication of CN106897217A publication Critical patent/CN106897217A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The invention discloses a kind of method of testing and test device.Wherein, the method includes:At least one request message is obtained, wherein, request message is used to test program;The version to be tested that at least one request message is sent to program obtained into the first test result, and is sent to the stable release of program obtaining the second test result, wherein, the program of stable release is the program that correct result can be fed back to request message;The first test result and the second test result are contrasted, comparing result is obtained, wherein, comparing result is used to determine the functional stabilization of version to be tested.The present invention is solved to be needed to write test case in the prior art when code is tested, so as to increase the technical problem of the cost for safeguarding software.

Description

Method of testing and test device
Technical field
The present invention relates to software test field, in particular to a kind of method of testing and test device.
Background technology
During software test, the modification to software code is often pulled one hair and move the whole body, and is especially quickly being changed During generation, not only need to test the correctness of New function, also to ensure not influence original function.But at present to soft When part is tested, it is required for writing test case, and pre-set the result of return.Existing this method needs to write big The test case of amount, it is necessary to consume substantial amounts of human resources, and if the result for pre-setting there occurs change, then need and Test case before Shi Xiugai, therefore, increase the cost for safeguarding software.
Need to write test case in the prior art when code is tested for above-mentioned, safeguard soft so as to increase The problem of the cost of part, not yet proposes effective solution at present.
The content of the invention
A kind of method of testing and test device are the embodiment of the invention provides, at least to solve in the prior art due to test Code needs to write test case and cause the big technical problem of software maintenance cost.
A kind of one side according to embodiments of the present invention, there is provided method of testing, including:At least one request is obtained to disappear Breath, wherein, request message is used to test program;The version to be tested that at least one request message is sent to program is obtained To the first test result, and it is sent to the stable release of program and obtains the second test result, wherein, the program of stable release is The program of correct result can be fed back to request message;The first test result and the second test result are contrasted, comparing result is obtained, Wherein, comparing result is used to determine the functional stabilization of version to be tested.
Another aspect according to embodiments of the present invention, additionally provides a kind of test device, including:Acquisition module, for obtaining At least one request message is taken, wherein, request message is used to test program;Sending module, at least one to be asked Ask message to send to the version to be tested of program and obtain the first test result, and be sent to the stable release of program and obtain second Test result, wherein, the program of stable release is the program that correct result can be fed back to request message;Contrast module, is used for The first test result and the second test result are contrasted, comparing result is obtained, wherein, comparing result is used to determine version to be tested Functional stabilization.
In embodiments of the present invention, by the way of contrast test result, by obtaining at least one request message, and will At least one request message sends to the version to be tested of program and obtains the first test result, and the stable version for being sent to program Originally the second test result is obtained, comparing result is obtained finally by the first test result of contrast and the second test result, reached The purpose that test case just can obtain software test result need not be write, it is achieved thereby that saving the manpower money of software test Source, reduce software maintenance cost technique effect, and then to solve need when code is tested in the prior art and compile Test case is write, so as to increase the technical problem of the cost for safeguarding software.
Brief description of the drawings
Accompanying drawing described herein is used for providing a further understanding of the present invention, constitutes the part of the application, this hair Bright schematic description and description does not constitute inappropriate limitation of the present invention for explaining the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of method of testing according to embodiments of the present invention;
Fig. 2 is the flow chart of a kind of optional method of testing according to embodiments of the present invention;
Fig. 3 is the flow chart of a kind of optional method of testing according to embodiments of the present invention;
Fig. 4 is the flow chart of a kind of optional method of testing according to embodiments of the present invention;
Fig. 5 is the flow chart of a kind of preferred method of testing according to embodiments of the present invention;
Fig. 6 is the flow chart of a kind of optional method of testing according to embodiments of the present invention;
Fig. 7 is the flow chart of a kind of optional method of testing according to embodiments of the present invention;
Fig. 8 is the flow chart of a kind of optional method of testing according to embodiments of the present invention;And
Fig. 9 is a kind of structural representation of test device according to embodiments of the present invention.
Wherein, above-mentioned accompanying drawing is marked including the following drawings:
901st, acquisition module;903rd, sending module;905th, contrast module.
Specific embodiment
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention Accompanying drawing, is clearly and completely described to the technical scheme in the embodiment of the present invention, it is clear that described embodiment is only The embodiment of a part of the invention, rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people The every other embodiment that member is obtained under the premise of creative work is not made, should all belong to the model of present invention protection Enclose.
It should be noted that term " first ", " in description and claims of this specification and above-mentioned accompanying drawing Two " it is etc. for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that so using Data can exchange in the appropriate case, so as to embodiments of the invention described herein can with except illustrating herein or Order beyond those of description is implemented.Additionally, term " comprising " and " having " and their any deformation, it is intended that cover Lid is non-exclusive to be included, for example, the process, method, system, product or the equipment that contain series of steps or unit are not necessarily limited to Those steps or unit clearly listed, but may include not list clearly or for these processes, method, product Or other intrinsic steps of equipment or unit.
Embodiment 1
According to embodiments of the present invention, there is provided a kind of embodiment of method of testing.
Fig. 1 is method of testing flow chart according to embodiments of the present invention, as shown in figure 1, the method comprises the following steps:
Step S102, obtains at least one request message, wherein, request message is used to test program.
In the scheme that above-mentioned steps S102 is limited, said procedure include program to be tested and with the program phase to be tested The program of the corresponding stable release crossed after tested, above-mentioned request message can be obtained by agreement request, for example, can led to The agreement request for crossing HTTP constructs request message.Specifically, the task scheduling platform for performing test software task can be from every Request is obtained in it system journal, and request message is obtained according to the request for obtaining.
Request message during to software test can be obtained by above-mentioned steps S102, and according to the request message to program Tested, message is input into without the programming again to testing, such that it is able to further reduce the work of tester Amount.
Step S104, the first test result is obtained by the version to be tested that at least one request message is sent to program, with And be sent to the stable release of program and obtain the second test result, wherein, the program of stable release is can be anti-to request message Present the program of correct result.
In the scheme that above-mentioned steps S104 is limited, said procedure includes two programs of version, i.e., version to be tested And stable release, wherein, version to be tested is the version after being modified to stable release.In a kind of optional embodiment In, the modification in performance only has been carried out to stable release, for example, in the application software of a reserving hotel, developer couple The program of the application software is modified, but the function that the application software is realized does not change, it is contemplated that effect be The internal memory that is more stable or taking less mobile device of application software operation.
It should be noted that above-mentioned first test result and the second test result are obtained by same request message , additionally, the first test result and the second test result can be picture format, comparing service by image can obtain first The difference of test result and the second test result.
By above-mentioned steps S104, and come to program as benchmark using performing the second test result of the program of stable release Version to be tested be estimated the time that can save tester, improve testing efficiency.
Step S106, contrasts the first test result and the second test result, obtains comparing result, wherein, comparing result is used In it is determined that the functional stabilization of version to be tested.
In the scheme that above-mentioned steps S106 is limited, test report, tester can be generated according to above-mentioned comparing result Member can at least obtain following information by the test report:With the presence or absence of poor between first test result and the second test result The different tested service corresponding with the first test program with the presence or absence of abnormal log and the code coverage of tested service whether Within the scope of default etc..
In a kind of optional embodiment, if had differences between the first test result and the second test result, say The functional lability of the version to be tested of bright program, conversely, then the function of the version to be tested of read-me is more stable.
In an alternative embodiment, the task scheduling platform for performing test software task can be to different requests Message assigns different weights, then the method by performing step S102 to step S104, obtains each request message correspondence The first test result and the second test result, and contrast the first test result and the second test result, obtain comparing result, so The success and failure of request message are determined further according to comparing result afterwards, finally according to the weights of each request message and each please The success for seeking message and the overall condition for unsuccessfully determining version to be tested.Wherein, if the first test result and the second test knot Had differences between fruit, then illustrate request message failure;Otherwise, request message success is illustrated.
It should be noted that the frequency that can be used under request message according to program to be tested determines request message Weights, for example, the frequency using the program in request message A is more than the frequency used in request message B, then can be please Message A is asked to assign the weights bigger than request message B.The weights characterize the frequency of use of the request message, i.e. the request disappears Cease the importance for the program.If in the case where request message is request message A, the first test result is tested with second Do not exist difference between result, and in the case where request message is request message B, the first test result and the second test result Between have differences, then illustrate under request message A test program than under request message B test program stabilization, this is treated Test program is more stable.
Based on the scheme disclosed in above-mentioned steps S102 to step S106, can know disappeared by obtaining at least one request Breath, and the version to be tested that at least one request message is sent to program obtains the first test result, and it is sent to program Stable release obtain the second test result, finally by contrast the first test result and the second test result obtain contrast knot Really, it is easily noted that, because the version to be tested and stable release of program are performed under same request message, and And determine the stability of the version to be tested of program on the basis of the second test result of stable release, therefore, tester Without writing test case again, test result is guessed, having reached need not write test case and just can obtain software survey The purpose of test result, it is achieved thereby that saving the human resources of software test, the technique effect of the cost of reduction software maintenance, enters And solve needs to write test case in the prior art when code is tested, the cost of software is safeguarded so as to increase Technical problem.
Fig. 2 shows a kind of flow chart of optional method of testing, as shown in Fig. 2 specifically, can be with by the flow chart At least one request message is obtained, the method comprises the following steps:
Step S202, obtains multiple requests;
Step S204, the code coverage situation according to multiple requests filters out at least one request from multiple request;
Step S206, according at least one request at least one request message of construction.
In the scheme that above-mentioned steps S202 is limited to step S206, the task scheduling platform of test software task is performed Daily request is obtained from daily record on line, and obtains these code coverages asked, please from multiple according to code coverage At least one request is filtered out in asking, for example, request of the code coverage more than predetermined threshold value is selected from these requests, most Request message is constructed according to request afterwards, for example, parse obtaining request message by request.
It should be noted that above-mentioned code coverage is used for source code in description program is test for ratio and degree, can For as the index for weighing test quality.Above-mentioned request can be the request of agreement, such as HTTP, DUBBO etc..
Fig. 3 shows a kind of flow chart of optional method of testing, as shown in figure 3, specifically including following steps:
Step S302, obtains the code of each the request covering in multiple requests;
Step S304, the code according to each request covering filters out at least one request from multiple request.
In the scheme that above-mentioned steps S302 is limited to step S304, can be by the path covering side in software test Method obtains the code of each the request covering in multiple requests, and calculates the ratio of all of code in the code and program of covering Example, that is, obtain the code coverage under the request.For example, multiple as shown in table 1 asks corresponding code coverage.
Table 1
Request B A C E D
Code coverage 78% 80% 86% 86% 90%
Fig. 4 shows a kind of flow chart of optional method of testing, as shown in figure 4, the code in the case where each request is obtained After coverage rate, at least one request is filtered out from multiple request and also needs to perform following steps:
Step S402, obtains the size of code of current request covering;
Step S404, judges whether the size of code of current request covering asks the size of code of covering more than upper one;
Step S406, in the case of the size of code of the size of code more than upper one request covering of current request covering, preserves Current request.
In a kind of optional embodiment, all requests are located in request queue, and obtaining each by step S302 asks Code coverage after, the code coverage of all requests is arranged in the form of being incremented by queue, wherein, positioned at team's head Ask to be current request (for example, in table 1, request B is current request).A kind of preferred method of testing as shown in Figure 5 Flow chart, the code coverage of program to be tested is initialized as 0, and current request B does not send request, position as in request queue In team's head of request queue.When in detecting request queue in the presence of request is not sent, the request is sent, and obtain current request Code coverage 78%.Because 78% > 0%, therefore request B are screened out, and preserve;After request B has been sent, please A is sought as current request, its code coverage is 80%, more than 78%, therefore, request A will also be screened out, and preserve.Together Sample, asks the > 80% of code coverage 86% of C, asks the > 86% of code coverage 90% of D, therefore, request C and request D It is screened out, and preserves;And ask the code coverage 86% of E to be not more than the code coverage 86% for asking C, therefore, ask E Will not be screened out.
Fig. 6 shows a kind of flow chart of optional method of testing, as shown in fig. 6, the code in the case where each request is obtained After coverage rate, at least one request is filtered out from multiple request and also needs to perform following steps:
Step S602, filters out the first request, and obtain the size of code of the first request covering from multiple request;
Step S604, according to the first code for not covering of request, filtered out from multiple request can cover first please Ask the request of the code not covered.
In a kind of optional embodiment, by step S302 obtain each ask code coverage after, choose generation The maximum request of code coverage rate in table 1, chooses request D as the first request as the first request.If request A is covered Code in cover the code of request D remaining 10%, and covered code coverage request D residue codes of other requests Percentage is respectively less than 10%, then request A and request D is filtered out from above-mentioned 5 requests.If in the code that request A is covered The code of request D remaining 2% is cover only, and asks to cover request D and request A remaining 8% in the code that B covered Code, and ask C and request E cover only request D remaining 1% code, then ask A, request B and request E sieved Select.
If it should be noted that the code coverage of at least two requests is identical, and the code coverage is maximum , now, one request of any selection is used as the first request from these requests.
Fig. 7 shows a kind of flow chart of optional method of testing, as shown in fig. 7, the code in the case where each request is obtained After coverage rate, at least one request is filtered out from multiple request needs the step of performing also to comprise the following steps:
Step S702, the code of each the request covering in multiple request judges that one group of request in multiple requests is covered The code of lid whether whole codes of overlay program;
Step S704, in the case of one group of whole code of the code coverage program of request covering, at least two requests It is screened out.
In a kind of optional embodiment, all of request is combined, if the request after combination can cover journey All codes of sequence, the then request after combining will be screened out.It should be noted that can cover journey if there is multiple combination All codes of sequence, then be screened out in selection combination comprising the minimum request of number of requests.For example, request A in table 1 and please Seeking B with all codes in overlay program, and can ask all codes that A, request C and request D can also be in overlay program, then Request A and request B are screened out.By the above method, the minimum request of number of requests can be selected to combine, can effectively saved The testing time is saved, testing efficiency is improved.
Fig. 8 show by contrast the first test result and the second test result, obtain the method flow diagram of comparing result, As shown in figure 8, the method specifically includes following steps:
Step S802, deletes the test result that the first test result is led to the failure due to predetermined reason;
Step S804, by deletion after the first test result and the second test result compare, obtain comparing result.
In the scheme that above-mentioned steps S802 is limited to step S804, when to the first test result and the second test result When comparing, due to the fields such as timestamp or random digit may be included in the first test result so that the first test knot Had differences between fruit and the second test result, comparing result is that the program of version to be tested is unstable.In a kind of optional reality Apply in example, timestamp is included in the first test result and the second test result, because two beta versions may not be same Time synchronized is carried out, so the timestamp in two test results is differed, for example, the timestamp in the first test result may It is " 4634637715 ", and the timestamp in the second test result may be " 4635501715 ", due in two test results Timestamp differ so that treating the test crash of the program of beta version.
It should be noted that above-mentioned predetermined reason is included as follows at least:Due to failing caused by timestamp, due to random number Caused failure.
Additionally, performing step S202, that is, during obtaining multiple requests, pre- timing can be obtained from journal file Between request in section asked as multiple, multiple request can be for example obtained from daily record on daily line.Obtaining above-mentioned many Intelligent screening is being carried out to it after individual request, is being obtained to the contributive request of code coverage.
Embodiment 2
According to embodiments of the present invention, there is provided a kind of embodiment of test device, wherein, the method in above-described embodiment 1 Run in the device that can be provided in the present embodiment.
Fig. 9 is test device according to embodiments of the present invention, as shown in figure 9, the device includes:Acquisition module 901, transmission Module 903 and contrast module 905.
Acquisition module 901, for obtaining at least one request message, wherein, request message is used to test program.
In above-mentioned acquisition module 901, said procedure includes program to be tested and corresponding with the program to be tested The program of the stable release crossed after tested, above-mentioned request message can be obtained by agreement request, for example can be by HTTP's Agreement request constructs request message.Specifically, the task scheduling platform for performing test software task can be from daily system Request is obtained in daily record, and request message is obtained according to the request for obtaining.
Request message during to software test can be obtained by above-mentioned acquisition module 901, and according to the request message pair Program is tested, and message is input into without the programming again to testing, such that it is able to further reduce tester's Workload.
Sending module 903, the version to be tested at least one request message to be sent to program obtains the first test As a result, and it is sent to the stable release of program and obtains the second test result, wherein, the program of stable release is to request message The program of correct result can be fed back.
In above-mentioned sending module 903, said procedure includes the programs of two versions, i.e., version to be tested and stablize version This, wherein, version to be tested is the version after being modified to stable release.In a kind of optional embodiment, only to steady The modification that version has been carried out in performance is determined, for example, in the application software of a reserving hotel, developer is to the application software Program be modified, but the function that the application software is realized does not change, it is contemplated that effect be the application software The internal memory that is more stable or taking less mobile device of operation.
It should be noted that above-mentioned first test result and the second test result are obtained by same request message , additionally, the first test result and the second test result can be picture format, comparing service by image can obtain first The difference of test result and the second test result.
By performing the step S104 in embodiment 1 in the sending module 903, and to perform the of the program of stable release Two test results are estimated the time that can save tester as benchmark come the version to be tested to program, improve test Efficiency.
Contrast module 905, for contrasting the first test result and the second test result, obtains comparing result, wherein, contrast Result is used to determine the functional stabilization of version to be tested.
In above-mentioned contrast module 905, test report can be generated according to above-mentioned comparing result, tester is by the survey Examination report can at least obtain following information:Whether there is difference and first between first test result and the second test result Whether the corresponding tested service of test program is with the presence or absence of abnormal log and the code coverage of tested service default Within the scope of etc..
In a kind of optional embodiment, if had differences between the first test result and the second test result, say The functional lability of the version to be tested of bright program, conversely, then the function of the version to be tested of read-me is more stable.
In an alternative embodiment, the task scheduling platform for performing test software task can be to different requests Message assigns different weights, then the method by performing step S102 to step S104 in embodiment 1, obtains each request Corresponding first test result of message and the second test result, and the first test result and the second test result are contrasted, obtain right Than result, the success and failure of request message are then determined further according to comparing result, finally according to the weights of each request message And the success of each request message and the overall condition for unsuccessfully determining version to be tested.Wherein, if the first test result and Had differences between second test result, then illustrate request message failure;Otherwise, request message success is illustrated.
It should be noted that the frequency that can be used under request message according to program to be tested determines request message Weights, for example, the frequency using the program in request message A is more than the frequency used in request message B, then can be please Message A is asked to assign the weights bigger than request message B.The weights characterize the frequency of use of the request message, i.e. the request disappears Cease the importance for the program.If in the case where request message is request message A, the first test result is tested with second Do not exist difference between result, and in the case where request message is request message B, the first test result and the second test result Between have differences, then illustrate under request message A test program than under request message B test program stabilization, this is treated Test program is more stable.
From the foregoing, it will be observed that by obtaining at least one request message, and at least one request message is sent into treating to program Beta version obtains the first test result, and is sent to the stable release of program and obtains the second test result, finally by right Comparing result is obtained than the first test result and the second test result, is easily noted that, due to the version to be tested of program With stable release performed under same request message, and determined on the basis of the second test result of stable release The stability of the version to be tested of program, therefore, tester is guessed test result without writing test case again, Having reached need not write the purpose that test case just can obtain software test result, it is achieved thereby that saving the people of software test The technique effect of power resource, the cost of reduction software maintenance, and then solve the need when testing code in the prior art Test case is write, so as to increase the technical problem of the cost for safeguarding software.
Herein it should be noted that above-mentioned acquisition module 901, sending module 903 and contrast module 905 correspond to embodiment Step S102 to step S106 in 1, three modules are identical with example and application scenarios that the step of correspondence is realized, but do not limit In the disclosure of that of above-described embodiment 1.
Optionally, acquisition module 901 includes:First acquisition module, screening module and constructing module.Wherein, first obtain Module, for obtaining multiple requests;Screening module, screens for the code coverage situation according to multiple requests from multiple request Go out at least one request;Constructing module, for according at least one request at least one request message of construction.
Used as a kind of optional embodiment, the task scheduling platform for performing test software task is obtained often from daily record on line It request, and the code coverage of these requests is obtained, filter out at least one from multiple request according to code coverage Request, for example, selecting request of the code coverage more than predetermined threshold value from these requests, being constructed finally according to request please Message is sought, for example, parse obtaining request message by request.
It should be noted that above-mentioned code coverage is used for source code in description program is test for ratio and degree, can For as the index for weighing test quality.Above-mentioned request can be the request of agreement, such as HTTP, DUBBO etc..
Herein also, it should be noted that above-mentioned first acquisition module, screening module and constructing module are corresponding in embodiment 1 The step of S202 to step S206, three modules are identical with the example realized of step and application scenarios of correspondence, but are not limited to The disclosure of that of above-described embodiment 1.
Optionally, screening module includes:Second acquisition module and the first screening module.Wherein, the second acquisition module, is used for Obtain the code of each the request covering in multiple requests;First screening module, for according to each request covering code from At least one request is filtered out in multiple request.
As a kind of optional embodiment, during multiple requests can be obtained by the path covering method in software test The code of each request covering, and calculate the ratio of all of code in the code and program of covering, that is, obtain under the request Code coverage.For example, multiple as shown in table 3 asks corresponding code coverage.
Table 2
Request B A C E D
Code coverage 78% 80% 86% 86% 90%
Herein it should be noted that above-mentioned second acquisition module and the first screening module correspond to the step in embodiment 1 S302 to step S304, two modules are identical with example and application scenarios that the step of correspondence is realized, but are not limited to above-mentioned reality Apply the disclosure of that of example 1.
Optionally, the first screening module includes the 3rd acquisition module, judging submodule and memory module.Wherein, the 3rd Acquisition module is used to obtain the size of code of current request covering;Judging submodule is used to judge that the size of code of current request covering to be The no size of code more than upper one request covering;Memory module is used for the size of code in current request covering more than upper one request covering Size of code in the case of, preserve current request.
In a kind of optional embodiment, all requests are located in request queue, are obtaining the code coverage of each request After rate, the code coverage of all requests is arranged in the form of being incremented by queue, wherein, the request positioned at team's head is current Request (for example, in table 1, request B is current request).The flow chart of a kind of preferred method of testing as shown in Figure 5, it is to be measured The code coverage of examination program is initialized as 0, and current request B does not send request as in request queue, positioned at request queue Team's head.When in detecting request queue in the presence of request is not sent, the request is sent, and obtain the code coverage of current request Rate 78%.Because 78% > 0%, therefore request B are screened out, and preserve;After request B has been sent, A is used as current for request Request, its code coverage is 80%, more than 78%, therefore, request A will also be screened out, and preserve.Equally, the generation of C is asked The code > 80% of coverage rate 86%, asks the > 86% of code coverage 90% of D, therefore, request C and request D are screened out, and protect Deposit;And ask the code coverage 86% of E to be not more than the code coverage 86% for asking C, therefore, request E will not be screened out.
Herein also, it should be noted that above-mentioned 3rd acquisition module, judging submodule and memory module correspond to implementation Step S402 to step S406 in example 1, three modules are identical with example and application scenarios that the step of correspondence is realized, but not It is limited to the disclosure of that of above-described embodiment 1.
Optionally, the first screening module includes size of code acquisition module and the second screening module.Wherein, size of code is obtained Module, for filtering out the first request from multiple request, and obtains the size of code of the first request covering;Second screening module, For the code not covered according to the first request, being filtered out from multiple request can cover the generation that the first request is not covered The request of code.
In a kind of optional embodiment, after the code coverage for obtaining each request, code coverage is chosen most Big request in table 2, chooses request D as the first request as the first request.If covered in the code that request A is covered The code of request D remaining 10% has been covered, and the percentage of the covered code coverage request D residue codes of other requests is small In 10%, then request A and request D is filtered out from above-mentioned 5 requests.Please if be cover only in the code that request A is covered The code of D remaining 2% is sought, and asks to cover the code of request D and request A remaining 8% in the code that B covered, and Request C and request E cover only the code of request D remaining 1%, then ask A, request B and request E to be screened out.
If it should be noted that the code coverage of at least two requests is identical, and the code coverage is maximum , now, one request of any selection is used as the first request from these requests.
Herein also, it should be noted that above-mentioned size of code acquisition module and the second screening module are corresponding in embodiment 1 The step of S602 to step S604, two modules are identical with the example realized of step and application scenarios of correspondence, but are not limited to The disclosure of that of above-described embodiment 1.
Optionally, the first screening module includes judge module and the 3rd screening module.Wherein, judge module, according to many The code of each the request covering in individual request judges whether the code of at least two request coverings in multiple requests covers journey Whole codes of sequence;3rd screening module, in the case of whole codes of the code coverage program of at least two request coverings, At least two requests are screened out.
In a kind of optional embodiment, all of request is combined, if the request after combination can cover journey All codes of sequence, the then request after combining will be screened out.It should be noted that can cover journey if there is multiple combination All codes of sequence, then be screened out in selection combination comprising the minimum request of number of requests.For example, request A in table 2 and please Seeking B with all codes in overlay program, and can ask all codes that A, request C and request D can also be in overlay program, then Request A and request B are screened out.By the above method, the minimum request of number of requests can be selected to combine, can effectively saved The testing time is saved, testing efficiency is improved.
Herein it should be noted that above-mentioned judge module and the 3rd screening module correspond to the step in embodiment 1 S702 to step S704, two modules are identical with example and application scenarios that the step of correspondence is realized, but are not limited to above-mentioned reality Apply the disclosure of that of example 1.
Optionally, contrast module 905 includes:Removing module and the first contrast module.Wherein, removing module, for deleting The test result that first test result is led to the failure due to predetermined reason;First contrast module, for the first survey after by deletion Test result and the second test result are compared, and obtain comparing result.
In above-mentioned contrast module, when comparing to the first test result and the second test result, due to the first survey May be comprising fields such as timestamp or random digits in test result so that deposited between the first test result and the second test result In difference, comparing result is that the program of version to be tested is unstable.In a kind of optional embodiment, the first test result and Timestamp is included in two test results, because two beta versions may not be carried out in same time synchronized, so two surveys Timestamp in test result is differed, for example, the timestamp in the first test result may be " 4634637715 ", and second surveys Timestamp in test result may be " 4635501715 ", because the timestamp in two test results is differed, so that Treat the test crash of the program of beta version.
It should be noted that above-mentioned predetermined reason is included as follows at least:Due to failing caused by timestamp, due to random number Caused failure.
Herein also, it should be noted that above-mentioned removing module and the first contrast module correspond to the step in embodiment 1 S802 to step S804, two modules are identical with example and application scenarios that the step of correspondence is realized, but are not limited to above-mentioned reality Apply the disclosure of that of example 1.
Additionally, the method for the step S202 in can performing embodiment 1 in the first acquisition module, obtains from journal file The request taken in predetermined amount of time is asked as multiple, for example, multiple requests can be obtained from daily record on daily line. Intelligent screening is being carried out to it after to above-mentioned multiple requests, is being obtained to the contributive request of code coverage.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
In the above embodiment of the present invention, the description to each embodiment all emphasizes particularly on different fields, and does not have in certain embodiment The part of detailed description, may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed technology contents, can be by other Mode is realized.Wherein, device embodiment described above is only schematical, such as division of described unit, Ke Yiwei A kind of division of logic function, can there is other dividing mode when actually realizing, such as multiple units or component can combine or Person is desirably integrated into another system, or some features can be ignored, or does not perform.Another, shown or discussed is mutual Between coupling or direct-coupling or communication connection can be the INDIRECT COUPLING or communication link of unit or module by some interfaces Connect, can be electrical or other forms.
The unit that is illustrated as separating component can be or may not be it is physically separate, it is aobvious as unit The part for showing can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On unit.Some or all of unit therein can be according to the actual needs selected to realize the purpose of this embodiment scheme.
In addition, during each functional unit in each embodiment of the invention can be integrated in a processing unit, it is also possible to It is that unit is individually physically present, it is also possible to which two or more units are integrated in a unit.Above-mentioned integrated list Unit can both be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.
If the integrated unit is to realize in the form of SFU software functional unit and as independent production marketing or use When, can store in a computer read/write memory medium.Based on such understanding, technical scheme is substantially The part for being contributed to prior art in other words or all or part of the technical scheme can be in the form of software products Embody, the computer software product is stored in a storage medium, including some instructions are used to so that a computer Equipment (can be personal computer, server or network equipment etc.) perform each embodiment methods described of the invention whole or Part steps.And foregoing storage medium includes:USB flash disk, read-only storage (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various can be with store program codes Medium.
The above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (10)

1. a kind of method of testing, it is characterised in that including:
At least one request message is obtained, wherein, the request message is used to test program;
The version to be tested that at least one request message is sent to described program is obtained into the first test result, and is sent Stable release to described program obtains the second test result, wherein, the program of the stable release is to the request message The program of correct result can be fed back;
First test result and second test result are contrasted, comparing result is obtained, wherein, the comparing result is used for Determine the functional stabilization of the version to be tested.
2. method according to claim 1, it is characterised in that obtaining at least one request message includes:
Obtain multiple requests;
Code coverage situation according to the multiple request filters out at least one request from the multiple request;
According to described at least one request construction at least one request message.
3. method according to claim 2, it is characterised in that code coverage situation according to the multiple request is from described Filtering out at least one request in multiple request includes:
Obtain the code of each the request covering in the multiple request;
Code according to each request covering filters out at least one request from the multiple request.
4. method according to claim 3, it is characterised in that code according to each request covering is from the multiple At least one request is filtered out in request to be included:
Obtain the size of code of current request covering;
Judge whether the size of code of the current request covering asks the size of code of covering more than upper one;
It is more than on described in the case of the size of code of a request covering in the size of code of current request covering, preservation is described ought Preceding request.
5. method according to claim 3, it is characterised in that code according to each request covering is from the multiple At least one request is filtered out in request to be included:
The first request is filtered out from the multiple request, and obtains the size of code of the first request covering;
According to the code that the described first request is not covered, being filtered out from the multiple request can cover first request The request of the code not covered.
6. method according to claim 3, it is characterised in that code according to each request covering is from the multiple At least one request is filtered out in request to be included:
The code of each the request covering in the multiple request judges the one group of request covering in the multiple request Whether code covers whole codes of described program;
In the case of whole codes of the code coverage described program of one group of request covering, quilt is asked described at least two Filter out.
7. method according to claim 1, it is characterised in that contrast first test result and the second test knot Really, obtaining comparing result includes:
Delete the test result that first test result is led to the failure due to predetermined reason;
The first test result and second test result after by deletion are compared, and obtain the comparing result.
8. method according to claim 7, it is characterised in that the predetermined reason includes at least one of:Due to when Between stamp caused by failure, due to caused by random number fail.
9. the method according to any one of claim 2 to 6, it is characterised in that obtaining the multiple request includes:
The request in predetermined amount of time is obtained from journal file as the multiple request.
10. a kind of test device, it is characterised in that including:
Acquisition module, for obtaining at least one request message, wherein, the request message is used to test program;
Sending module, the version to be tested at least one request message to be sent to described program obtains the first test As a result, and it is sent to the stable release of described program and obtains the second test result, wherein, the program of the stable release is right The request message can feed back the program of correct result;
Contrast module, for contrasting first test result and second test result, obtains comparing result, wherein, institute Comparing result is stated for determining the functional stabilization of the version to be tested.
CN201710076421.6A 2017-02-13 2017-02-13 Method of testing and test device Pending CN106897217A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710076421.6A CN106897217A (en) 2017-02-13 2017-02-13 Method of testing and test device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710076421.6A CN106897217A (en) 2017-02-13 2017-02-13 Method of testing and test device

Publications (1)

Publication Number Publication Date
CN106897217A true CN106897217A (en) 2017-06-27

Family

ID=59199014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710076421.6A Pending CN106897217A (en) 2017-02-13 2017-02-13 Method of testing and test device

Country Status (1)

Country Link
CN (1) CN106897217A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107423222A (en) * 2017-08-08 2017-12-01 腾讯科技(深圳)有限公司 A kind of method and apparatus for determining test coverage
CN107992389A (en) * 2017-12-22 2018-05-04 无线生活(杭州)信息科技有限公司 A kind of test method and device
CN109815145A (en) * 2019-01-18 2019-05-28 中国农业银行股份有限公司 A kind of batch program test method and device
CN110471829A (en) * 2018-05-09 2019-11-19 阿里巴巴集团控股有限公司 The inspection method and device of software code test coverage
CN111124909A (en) * 2019-12-20 2020-05-08 网易(杭州)网络有限公司 Test method and device
CN111694734A (en) * 2020-05-26 2020-09-22 五八有限公司 Software interface checking method and device and computer equipment
CN113722201A (en) * 2020-05-25 2021-11-30 中移(苏州)软件技术有限公司 API consistency detection method and PaaS platform
RU2774659C1 (en) * 2021-05-13 2022-06-21 Общество с ограниченной ответственностью "Тест АйТи" System for controlling software testing
WO2022240310A1 (en) * 2021-05-13 2022-11-17 Евгений Уралович ХАФИЗОВ Software test management system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178687A (en) * 2007-11-26 2008-05-14 中兴通讯股份有限公司 Software regression testing method
CN102902619A (en) * 2011-07-29 2013-01-30 阿里巴巴集团控股有限公司 Method and device for regression testing of Web application programs
CN103246600A (en) * 2012-02-10 2013-08-14 广州博纳信息技术有限公司 Fast verification method for software testing and evaluation
CN103885876A (en) * 2012-12-21 2014-06-25 百度在线网络技术(北京)有限公司 Testing method and testing equipment
CN105446885A (en) * 2015-12-28 2016-03-30 西南大学 Regression testing case priority ranking technology based on needs
CN106326120A (en) * 2016-08-22 2017-01-11 北京金山安全软件有限公司 Regression testing method and device for application software and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178687A (en) * 2007-11-26 2008-05-14 中兴通讯股份有限公司 Software regression testing method
CN102902619A (en) * 2011-07-29 2013-01-30 阿里巴巴集团控股有限公司 Method and device for regression testing of Web application programs
CN103246600A (en) * 2012-02-10 2013-08-14 广州博纳信息技术有限公司 Fast verification method for software testing and evaluation
CN103885876A (en) * 2012-12-21 2014-06-25 百度在线网络技术(北京)有限公司 Testing method and testing equipment
CN105446885A (en) * 2015-12-28 2016-03-30 西南大学 Regression testing case priority ranking technology based on needs
CN106326120A (en) * 2016-08-22 2017-01-11 北京金山安全软件有限公司 Regression testing method and device for application software and electronic equipment

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107423222A (en) * 2017-08-08 2017-12-01 腾讯科技(深圳)有限公司 A kind of method and apparatus for determining test coverage
CN107992389A (en) * 2017-12-22 2018-05-04 无线生活(杭州)信息科技有限公司 A kind of test method and device
CN110471829A (en) * 2018-05-09 2019-11-19 阿里巴巴集团控股有限公司 The inspection method and device of software code test coverage
CN109815145A (en) * 2019-01-18 2019-05-28 中国农业银行股份有限公司 A kind of batch program test method and device
CN111124909A (en) * 2019-12-20 2020-05-08 网易(杭州)网络有限公司 Test method and device
CN111124909B (en) * 2019-12-20 2024-02-23 网易(杭州)网络有限公司 Test method and device
CN113722201A (en) * 2020-05-25 2021-11-30 中移(苏州)软件技术有限公司 API consistency detection method and PaaS platform
CN111694734A (en) * 2020-05-26 2020-09-22 五八有限公司 Software interface checking method and device and computer equipment
RU2774659C1 (en) * 2021-05-13 2022-06-21 Общество с ограниченной ответственностью "Тест АйТи" System for controlling software testing
WO2022240310A1 (en) * 2021-05-13 2022-11-17 Евгений Уралович ХАФИЗОВ Software test management system

Similar Documents

Publication Publication Date Title
CN106897217A (en) Method of testing and test device
CN104915296B (en) Buried point testing method, data query method and device
CN108268372B (en) Mock test processing method and device, storage medium and computer equipment
CN106886492A (en) Method of testing and test device based on data readback
US20060200373A1 (en) Facilitating Root Cause Analysis for Abnormal Behavior of Systems in a Networked Environment
CN105787364B (en) Automatic testing method, device and system for tasks
CN107645562A (en) Data transmission processing method, device, equipment and system
CN111124850A (en) MQTT server performance testing method, system, computer equipment and storage medium
CN106897216A (en) The method and apparatus of test software
CN100512274C (en) Device and method for simulating communication system capable of easily controlling protocol message
CN104320325B (en) A kind of information push method and device
CN106815141A (en) A kind of method for testing software and device
CN108762917A (en) Access request processing method, device, system, computer equipment and storage medium
CN110276199B (en) Dynamic security detection method for Kubernetes cloud native application
CN107179995A (en) A kind of performance test methods of application program of computer network
CN105303112A (en) Component calling bug detection method and apparatus
CN107943697A (en) Problem distribution method, device, system, server and computer-readable storage medium
CN106202083A (en) Resource packaging system, method and device for web page
CN105978938A (en) Service processing equipment service status determining method and scheduling equipment
CN107249182A (en) A kind of note transmission method and its device, terminal device
CN109743286A (en) A kind of IP type mark method and apparatus based on figure convolutional neural networks
CN113672934A (en) Security vulnerability scanning system and method, terminal and storage medium
CN106650399A (en) Processing method and device for user access permissions
CN110365673B (en) Method, server and system for isolating network attack plane
CN107305529A (en) The method and apparatus for detecting target software

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
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: 20170627