Background technology
Software test utilizes testing tool according to testing scheme and flow process product to be carried out function and performance test exactly, even writes different testing tools as required, and design and maintenance test system analyze and assess the problem that testing scheme may occur.Test process is undertaken by 4 steps, i.e. unit testing, integration testing, affirmation test and system testing below briefly introduce these four steps:
Unit testing: claiming module testing again, is at the least unit software module of software design, carries out the test job of verifying correctness.Its purpose is the various mistakes of finding that each inside modules may exist.Unit testing need be from the inner structure design test case of software.A plurality of modules can independently be carried out unit testing abreast.
Integration testing: on the basis of unit testing, need all modules are assembled into subsystem or system according to designing requirement.The integration testing of subsystem is called unit test especially, and the work that it is done is to find out inconsistent between subsystem after integrated and the system requirements specification.
Confirm test: claim validity test again.Task is whether the function of verifying software is consistent with user's requirement with performance and other characteristic.Function and performance requirement to software are clearly stipulated in Software Requirements Specification (also called requirements analysis).The information that it comprises is exactly the basis of software validation testing.
System testing: be with the software by confirming to test, as a whole element based on computer system, combine with other system elements such as computer hardware, peripheral hardware, some support software, data and personnel, under the actual motion environment, computer system is carried out a series of assembling test and confirmed test.The purpose of system testing is by making comparisons with the requirement definition of system, and the definition of finding software and system does not meet or the place of contradiction with it.
Wherein, can also be divided into white-box testing and Black-box Testing in the software test, wherein white-box testing also claims structured testing or logical drive test, it is the structured testing software according to software inhouse, whether come the testing product internal actions normally to carry out according to the regulation of design specification book by test, whether every path in the check software can both correctly work by pre-provisioning request.Black-box Testing also claims functional test, and whether it is to detect each function by test can both normally use.In test, software is regarded as the black box that can not open, under the situation that gives no thought to software inhouse structure and bulk properties, test at software interface, it only checks whether software function is normally used according to the regulation of Specification, and whether software can suitably receive the input data and produce correct output information.
In the prior art, when carrying out software test, classic method is to adopt white-box testing, write test script by the software engineer and test by hand, but this method of testing efficient is not high.When portable terminal is tested, mostly be Black-box Testing, manual test complex operation and efficient is very low at various platforms.And need test at multiple test environment when carrying out the deployment of multi-platform test environment in the prior art, namely according to tester's operation software is repeatedly tested in different platform successively, can not carry out multi-platform test automatically, and to take a large amount of time and efforts usually like this, the low problem of testing efficiency that has caused software, as can be seen from the above description, software test efficient of the prior art is low, wastes time and energy concerning the tester.In addition, owing to carry out repeatedly test operation, operating process more complicated, and the probability increase that produces error in the test process, and then can cause the accuracy rating of tests of software lower.
Summary of the invention
The invention provides a kind of code test method and system, in order to solve the inefficient problem of code tester of the prior art.
According to an aspect of the present invention, provide a kind of code test method, having comprised: code is deployed on the multiple operation platform has successively compiled; The result who produces according to compiling judges whether the compiling of described code is passed through; If then described code is deployed on the multiple operation platform successively and tests.
Further, said method also comprises: the runnable interface to described code in the process that described code is tested carries out sectional drawing.
Further, described described code is deployed in successively carried out test pack and drawn together on the multiple operation platform: described code is deployed in successively carries out unit testing on the multiple operation platform; The result who produces according to unit testing judges whether the unit testing of described code is passed through; If then described code is deployed to successively and carries out Black-box Testing on the multiple operation platform.
Further, described method also comprises: described code portions is being deployed in before kinds of platform compiles, is also comprising: the code in the detection of code version control system whether have newly-increased, revise or deletion; If carry out that then code portions is deployed in the step that compiles on the kinds of platform.
Further, described method is used in the enterprising line code test of portable terminal.
According to another aspect of the present invention, provide a kind of code tester system, having comprised: collector is used for code is deployed on the multiple operation platform successively and compiles; Judge module is used for judging according to the result that compiling produces whether the compiling of described code is passed through; Test module, be used for when the judged result of described judge module when being, described code is deployed on the multiple operation platform successively tests.
Further, described system also comprises: the sectional drawing module is used for the process of testing at described code the runnable interface of described code is carried out sectional drawing.
Further, described test module comprises: first test cell, carry out unit testing for described code is deployed in successively on the multiple operation platform; Judging unit is used for judging according to the result that unit testing produces whether the unit testing of described code is passed through; Second test cell, be used for when the judged result of described judging unit when being, described code is deployed to successively carries out Black-box Testing on the multiple operation platform.
Further, described system also comprises: detection module, be used for described code portions being deployed in before kinds of platform compiles in described collector, and that whether the code in the detection of code version control system has is newly-increased, revise or deletion; Execution module, when being used for testing result when described detection module and being described version control system the code that increases newly being arranged, execution is deployed in the step that compiles on the kinds of platform with code portions.
Further, described system is used in the enterprising line code test of portable terminal.
Compared with prior art, the present invention can carry out multi-platform compiling automatically and carry out multi-platform test according to the compiling result, make the test of code more intelligent, improved testing efficiency, in addition, by the automatic detection to newly-increased code, thereby the code that increases newly is carried out the compiling of many automatic platform and the complexity that test has reduced the software test operation, simultaneously, in the test process of code, its runnable interface is carried out sectional drawing, can judge conveniently whether user interface meets Expected Results, thereby improved the degree of accuracy of code tester, guaranteed the true and reliable property of code tester data.
Embodiment
The invention provides the method and system of code tester, can automatically carry out multi-platform compiling and test to code, and can determine whether code carries out multi-platform test, makes the test of code more intelligent, has improved the efficient of code tester according to the result of the multi-platform compiling of code.
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, below in conjunction with the drawings and specific embodiments the embodiment of the invention is described in further detail.
Embodiment 1
Fig. 1 is the process flow diagram according to the code test method of the embodiment of the invention 1.
As shown in Figure 1, the code test method of present embodiment may further comprise the steps:
Step 101: code is deployed on the multiple operation platform successively compiles.
Wherein, code portions is being deployed in before kinds of platform compiles, this method can also comprise: detect in the version control system whether the code that increases newly is arranged; If carry out that then code portions is deployed in the step that compiles on the kinds of platform.Particularly, code can be tested at different operating platforms, for example, be tested in operating systems such as Windows XP, Vista, Linux, Android, Mac, Unix, check it whether can move in various operating system.
Step 102: the result who produces according to compiling judges whether the compiling of code is passed through.
Step 103: if then code is deployed on the multiple operation platform successively and tests.
Particularly, above-mentioned code is deployed in successively tested on the multiple operation platform and can be comprised: code is deployed in successively carries out unit testing on the multiple operation platform; The result who produces according to unit testing judges whether the unit testing of code is passed through; If then code is deployed to successively and carries out Black-box Testing on the multiple operation platform.Wherein, for the code that may operate in the browser, can carry out many browser testings to it, for example, can test at browsers such as IE, Firefox, Chrome and Maxton, check it whether can normally transport.In addition, this method can be used in the enterprising line code test of portable terminal.Particularly, relevant browser page or user interface can be encapsulated in the test case library, thereby in the corresponding browser interface of check or user interface, only need corresponding test case is input in the system, can finish the test on multi-platform many browsers automatically, based on this, also can test at mobile-terminal simulator, improve the efficient of multi-platform particularly mobile terminal software test effectively, ensured the quality of software effectively; Simultaneously, also guarantee the true and reliable property of software test data, improved the comprehensive of multi-platform software test.
Embodiment 2
Fig. 2 is the process flow diagram according to the code test method of the embodiment of the invention 2.
As shown in Figure 2, this method may further comprise the steps:
Step 201: code is deployed on the multiple operation platform successively compiles.
Wherein, code portions is being deployed in before kinds of platform compiles, this method can also comprise: detect in the version control system whether the code that increases newly is arranged; If carry out that then code portions is deployed in the step that compiles on the kinds of platform.
Step 202: the result who produces according to compiling judges whether the compiling of code is passed through.
Step 203: if then code is deployed on the multiple operation platform successively and tests.
Particularly, above-mentioned code is deployed in successively tested on the multiple operation platform and can be comprised: code is deployed in successively carries out unit testing on the multiple operation platform; The result who produces according to unit testing judges whether the unit testing of code is passed through; If, then code is deployed to successively and carries out Black-box Testing on the multiple operation platform, preferably, after said units test, can carry out code coverage rate analysis and generate form, like this can so that the tester test data is analyzed.
Step 204: the runnable interface to code in the process that code is tested carries out sectional drawing.
Carry out sectional drawing by the runnable interface to code and can judge conveniently whether user interface meets Expected Results, after above-mentioned runnable interface to code carries out sectional drawing, can generate form according to sectional drawing, and form returned to user interface, can make tester's more intuitive understanding to test data like this.
Embodiment 3
Fig. 3 is the structural representation according to the code tester system of the embodiment of the invention 3.
As shown in Figure 3, this code tester system 300 comprises with lower module:
Collector 301 compiles for code is deployed on the multiple operation platform successively;
Judge module 302 is used for judging according to the result that compiling produces whether the compiling of code is passed through;
Test module 303, be used for when the judged result of judge module when being, code is deployed on the multiple operation platform successively tests.
Fig. 4 is the structural representation according to the test module of the embodiment of the invention 3.
As shown in Figure 4, above-mentioned test module 303 can comprise: first test cell 401, carry out unit testing for code is deployed in successively on the multiple operation platform; Judging unit 402 is used for judging according to the result that unit testing produces whether the unit testing of code is passed through; Second test cell 403, be used for when the judged result of judging unit when being, code is deployed to successively carries out Black-box Testing on the multiple operation platform.
Fig. 5 is the structural representation according to the another kind of code tester system of the embodiment of the invention 3.
As shown in Figure 5, this code tester system 500 can also comprise each module with lower module in comprising above-mentioned Fig. 3:
Sectional drawing module 501 is used for the process of testing at code the runnable interface of code is carried out sectional drawing, in to the process of code tester the runnable interface of code is carried out sectional drawing by this module and can judge conveniently whether user interface meets Expected Results.
Above-mentioned two kinds of systems all can be used in the enterprising line code test of portable terminal.
Fig. 6 is the structural representation according to another code tester system of the embodiment of the invention 3.
As shown in Figure 6, this code tester system 600 each module, can also comprise with lower module in comprising above-mentioned Fig. 3:
Detection module 601 is used for code portions being deployed in before kinds of platform compiles in collector, detects in the version control system whether the code that increases newly is arranged;
Execution module 602, when being used for testing result when detection module and being version control system the code that increases newly being arranged, execution is deployed in the step that compiles on the kinds of platform with code portions.
Preferably, this system can be used in the enterprising line code test of portable terminal.
Embodiment 4
Code tester system in the present embodiment also can by test and management module, compiling administration module, unit testing administration module, code release control system and as a result generation module constitute.
Fig. 7 is the signaling process figure according to the code tester system of the embodiment of the invention 4.
As shown in Figure 7, the realization of multi-platform code tester can be divided into four-stage: detection of code is upgraded; Carry out multi-platform compiling; Carry out multi-platform unit testing; Carry out the automatic Black-box Testing of multi-platform many browsers.By test and management module start flow according to the following steps:
1, the test and management module regularly detects the code whether renewal is arranged.
2, if any the code that upgrades, dispose code multi-platform, carry out multi-platform compiling, and produce compiling report in detail.
3, after compiling is finished, carry out multi-platform test, and produce the DCO analysis report.
4, carry out multi-platform many browsers Black-box Testing, and carry out the interface sectional drawing, produce corresponding report then and detect for the tester.
Need to prove, in this article, relational terms such as first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint and have the relation of any this reality or in proper order between these entities or the operation.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby make and comprise that process, method, article or the equipment of a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or also be included as the intrinsic key element of this process, method, article or equipment.Do not having under the situation of more restrictions, the key element that is limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
The above is preferred embodiment of the present invention only, is not for limiting protection scope of the present invention.All any modifications of doing within the spirit and principles in the present invention, be equal to replacement, improvement etc., all be included in protection scope of the present invention.