Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application
In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is
Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art
Every other embodiment obtained without making creative work, shall fall in the protection scope of this application.
To be further explained below in conjunction with attached drawing with specific embodiment convenient for the understanding to the embodiment of the present application
Bright, embodiment does not constitute the restriction to the embodiment of the present application.
The test method and device of application system provided by the embodiments of the present application, suitable for being to the application that blocking is disposed
The scene that system is tested is particularly suitable for carrying out to based on global (city region global, the CRG) framework of city zoning
The scene that the application system of blocking deployment is tested.Shown in Figure 1 carries out answering for blocking deployment based on CRG framework
With the schematic diagram of system, CRG framework is a kind of implementation of data center unit, so-called data center unit, be by
Complicated business is split according to business feature and data characteristic, and deployment is in a different unit, relatively independent between unit, can be expanded
Exhibition, to realize the requirement of the dilatation of business, disaster tolerance etc..
In Fig. 1, functional unit corresponding with application system (tested application system) includes three types: global logic computer room
Unit (global zone, Gzone) type, zoned logic computer room unit (region zone, Rzone) type, urban logic
Computer room unit (city zone, Czone) type, wherein the functional unit of Gzone type is at only one group of the overall situation, and e.g., G is mono-
Member disposes the data that can not be split, and the functional unit of Rzone type is self-contained unit, e.g., R1Unit and R2Unit,
It can be used as independent unit and service be externally provided, and do not depend on other functional units.The functional unit of Czone type is city
The unit of city-level, e.g., C1Unit and C2The functional unit of unit, functional unit and Gzone type to Rzone type provides
Service, to reduce intercity calling.In addition, the functional unit of above-mentioned Rzone type and Czone type can have it is multiple,
Each functional unit may include multiple and different tested interfaces, and a tested interface uniquely corresponds to a functional unit.
When carrying out blocking deployment based on CRG framework, the dependence between unit is relatively high, and will do it phase intermodulation between unit
With, and often there is certain delay in the calling between unit, thus will lead to the speed decline of test.And the test side of the application
Method uses the strategy of blocking test, so as to realize the decoupling for executing logical AND blocking framework.
Fig. 2 is a kind of test method flow chart for the application system that embodiment provides of the application.The execution master of the method
Body can be the equipment with processing capacity: server or system or device, for example, it may be test device, referring to Fig. 3
Shown in test device schematic diagram, which includes: command processor (CommandProcessor), logic computer room unit
Processor (ZoneProcessor), logic computer room detector (ZoneChecker), polymerizer (Aggregator) and test
Base class monitor (TestBaseListenser), wherein command processor is mainly responsible for the enabled instruction of processing application system,
The information of this tested functional unit is carried in the instruction, and this information for being tested functional unit is sent to logic computer room list
First processor starts corresponding functional unit according to above- mentioned information by logic computer room Cell processor;Startup function unit it
Afterwards, logic computer room detector is responsible for screening and executing test case corresponding with functional unit is had been turned on;Polymerizer is mainly responsible for
The test result of all functional units is polymerize, to show test result to tester.As shown in Fig. 2, the method
It specifically includes:
Step 210, receive the step of instruction: receiving the instruction for starting the application system, described instruction carry with it is described
The first kind information of the corresponding functional unit of application system.
Herein, the instruction for starting the application system can be by operation automatic test script triggering.It needs to illustrate
It is that the type of functional unit corresponding with application system may include with one or more of Types Below: global logic machine
Room unit Gzone type, urban logic computer room unit Czone type and zoned logic computer room unit R zone type.
In one implementation, above-mentioned first kind information can be with are as follows: Gzone type, Czone type or Rzone
Type.
Step 220, the step of startup function unit: starting the first functional unit corresponding with the first kind information,
And execute test case corresponding with first functional unit.
For example, in fig. 1, it is assumed that the first kind information carried in instruction is Rzone type, then start Rzone
The functional unit of type: R1Unit and R2Unit.
Optionally, before execution test case corresponding with the functional unit of the first kind, the method
Further include:
Step 2201, preset multiple test cases are read.
Preset multiple test cases herein are write in advance by tester, and it is right under simulation of real scenes to be used for
In functional unit be tested interface calling, by by call result with the desired value pre-set compared with, it is possible to determine that survey
Test result be by or failure, to verify the correctness that tested interface calls.
After reading above-mentioned multiple test cases, the method can also include the step for determining the type of test case
Suddenly, comprising:
Determine the corresponding first tested interface of each test case.
According to the type of functional unit belonging to the described first tested interface, the type of each test case is obtained.
To preset multiple test cases, according to the annotation information of the test case, alternatively, passing through preset analysis tool
After test case analysis, the corresponding first tested interface of test case can be obtained, wherein the first tested interface can be
Any tested interface for including in functional unit corresponding with application system, e.g., when testing the application system in Fig. 1, the
One tested interface can be any tested interface of the interface 1 into interface 10.As an example it is assumed that preset multiple test cases
In the corresponding first tested interface of the first test case be interface 1 because functional unit belonging to interface 1 be G unit, then may be used
With the type of the first test case of acquisition for Gzone type, and so on, it can obtain each in preset multiple test cases
The type of test case.
Step 2202, identification information, the mark successively are added to each test case in the multiple test case
Information is used to identify the type of each test case.
In one implementation, preset multiple test cases are saved in the form of a file, then can pass through two
Kind mode adds identification information: first way is that mark is added directly in the title of file corresponding with each test case
Know information;The second way is added in the beginning of the body matter of file corresponding with each test case or latter end
Add identification information.
Wherein, the identification information of above-mentioned addition can be the information of any type that can identify test case, e.g., Ke Yiwei
" Rzone type ".
As an example it is assumed that preset test case includes 10, specifically: test case 1 to test case 10, and should
10 test cases are corresponding to interface 10 with the interface 1 in Fig. 1 respectively, then after adding identification information to each test case,
It can be as shown in table 1:
Table 1
Test case |
Identification information |
Test case 1 |
Gzone type |
Test case 2 |
Gzone type |
… |
|
Test case 10 |
Czone type |
It returns in step 220, after starting the first functional unit corresponding with the first kind information, execution and institute
State the corresponding test case of the first functional unit, wherein executing test case corresponding with first functional unit can wrap
It includes:
According to the identification information, it is that the first kind information is corresponding that type is read from the multiple test case
The test case of the first kind;
Execute the test case with type for the corresponding first kind of the first kind information.
As an example it is assumed that first kind information are as follows: Rzone type, then successively each test case in scan table 1,
The test case that identification information is " Rzone type ", i.e. test case 3 to test case 6 are read, then executing identification information is
The test case 3 of " Rzone type " is to test case 6.
It should be noted that the process of above-mentioned implementation of test cases 3 to test case 6 is to Rzone type of functionality list
Member: R1Unit and R2The process that unit is tested.
Step 230, if the type of the functional unit be it is a variety of, repeat receptions instruct the step of and open
The step of dynamic functional unit;Test case corresponding with a plurality of types of functional units is completed until executing.
As an example it is assumed that tested application system is that core system applies (CIF app), it is deployed in Gzone respectively
In the functional unit of type, Czone type and Rzone type, then completed first according to step 210 and step 220 to a type
The test of the functional unit of type e.g. completes the test to the functional unit of Gzone type, later, because of above-mentioned core system first
System application is deployed in the functional unit of three types, so repeating step 210 and step 220 to complete to remaining two types
Functional unit test.
Wherein, the test of each type of functional unit in core system application can be found in shown in Fig. 4, Fig. 5 and Fig. 6.
Fig. 4 is the test schematic diagram of Gzone type of functionality unit, and in Fig. 4, it is single that service interface tests (Service Test)
Member sends inquiry request to tested business packet, carries any tested interface in the inquiry request, is tested business packet on receiving
After stating inquiry request, any of the above-described tested interface is tested, business packet is tested in tested interface test process to writing
Data are written in database (Writing Data Base, wDB), test is returned to service interface test cell after terminating and tested
As a result, the result of return is compared by service interface test cell with desired value, to judge the correctness of test result.
Fig. 5 is the test schematic diagram of Rzone type of functionality unit, and Fig. 6 is that the test of Czone type of functionality unit is illustrated
The test process class of Gzone type of functionality unit in the test process and Fig. 4 of figure, Rzone type and Czone type of functionality unit
Seemingly, therefore not to repeat here.
Step 240, test result and the output to the functional unit are collected.
Assuming that tested application system is the application system in Fig. 1, then after the completion of testing each functional unit, test
As a result reference can be made to content shown in table 2.
Table 2
According to the test result of table 2, tester, which can facilitate, is tracked BUG present in application system.
To sum up, by the test method of the application, following several major functions may be implemented:
1) it tests just for the tested interface (servicing) in this functional unit;
2) comprehensive verification calls link in the entrance and exit of this functional unit, does not consider other function unit;
3) divide functional unit to execute test, then polymerize test, coverage rate result to form Final Report.
To sum up, the test method of the application system of the application, when testing application system, every time only to application
The corresponding a type of functional unit of system is tested, i.e., the tested interface for only including to a type of functional unit into
Row test;When there are many functional unit of type, the process of above-mentioned test is repeated.Thus, it is possible to the efficiency of test is promoted, into
And computer resource can be saved.
Although the embodiment of the present application by based on CRG framework carry out blocking deployment application system test for into
Row explanation, but it is not limited to this, and those skilled in the art can carry out according to the present processes to based on other deployment schemes
The application system of blocking deployment is tested, and test method is similar, and therefore not to repeat here.
Accordingly with the test method of above-mentioned application system, the test for a kind of application system that the embodiment of the present application also provides
Device, as shown in fig. 7, the device includes: receiving unit 701, start unit 702, execution unit 703 and collector unit 704.
Receiving unit 701, for receiving the instruction for starting the application system, described instruction is carried and the application system
The first kind information of corresponding functional unit.
Wherein, the type of the functional unit includes with one or more of Types Below: global logic computer room unit
Gzone type, urban logic computer room unit Czone type and zoned logic computer room unit R zone type.
Start unit 702, for starting corresponding with the first kind information the first functional unit, and execution with it is described
The corresponding test case of first functional unit.
Start unit 702 is specifically used for:
According to the identification information, it is that the first kind information is corresponding that type is read from the multiple test case
The test case of the first kind;
Execute the test case with type for the corresponding first kind of the first kind information.
Execution unit 703, if for the functional unit type be it is a variety of, repeat receiving unit 701 and
The step of start unit 702 executes;Test case corresponding with a plurality of types of functional units is completed until executing.
Collector unit 704, for collecting test result and output to the functional unit.
Optionally, described device further include: reading unit 705 and adding unit 706;
Reading unit 705, for reading preset multiple test cases;
Adding unit 706, each test in the multiple test case for successively reading to reading unit 705 are used
Example addition identification information, the identification information are used to identify the type of each test case.
Optionally, the application system includes at least one tested interface, at least one described tested interface is included in institute
It states in functional unit;Described device further include: determination unit 707 and acquiring unit 708;
Determination unit 707, for determining the corresponding first tested interface of each test case;
Acquiring unit 708, for the functional unit according to belonging to the described first determining tested interface of determination unit 707
Type obtains the type of each test case.
The function of each functional module of the embodiment of the present application device, can be by each step of above method embodiment come real
Existing, therefore, the specific work process of device provided by the present application does not repeat again herein.
To sum up, the test device of application system provided by the present application, receiving unit 701, which receives, starts the application system
Instruction, described instruction carry the first kind information of functional unit corresponding with the application system;Start unit 702 starting with
Corresponding first functional unit of the first kind information, and execute test case corresponding with first functional unit;It holds
If the type of the functional unit of row unit 703 be it is a variety of, repeat receiving unit 701 and start unit 702 and execute
The step of;Test case corresponding with a plurality of types of functional units is completed until executing;Collector unit 704 is collected to the function
Can unit test result and output.Thus, it is possible to promote the efficiency of test, and then computer resource can be saved.
The test device of the application system of the application may finally be encapsulated as a jar packet (being referred to as plug-in unit),
After quoting the jar packet in other tested application systems, when running automatic test script, so that it may to other tested application systems
System is tested, wherein other tested application systems can be the system based on the progress blocking deployment of CRG framework.
The deployment schematic diagram of the test device of application system shown in Figure 8, in Fig. 8, to other tested application systems
System installs the jar packet of above-mentioned encapsulation when being tested first, the jar packet after installation be deployed in respectively host node (Master),
The functional unit of the functional unit of Gzone type, the functional unit of Czone type and Rzone type, wherein host node is negative
Duty triggering test assignment after triggering test assignment, can start the functional unit of Gzone type, and execution and Gzone first
The corresponding test case of the functional unit of type, is tested with the functional unit to Gzone type;It is successively right again later
The functional unit of Czone type and the functional unit of Rzone type are tested.It certainly, in practical applications, can also be by
According to other sequences to the functional unit of the functional unit of Gzone type, the functional unit of Czone type and Rzone type
It is tested, the application is not construed as limiting this.
Professional should further appreciate that, described in conjunction with the examples disclosed in the embodiments of the present disclosure
Object and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, hard in order to clearly demonstrate
The interchangeability of part and software generally describes each exemplary composition and step according to function in the above description.
These functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.
Professional technician can use different methods to achieve the described function each specific application, but this realization
It is not considered that exceeding scope of the present application.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can be executed with hardware, processor
The combination of software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only memory
(ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field
In any other form of storage medium well known to interior.
Above-described specific embodiment has carried out further the purpose of the application, technical scheme and beneficial effects
It is described in detail, it should be understood that being not used to limit the application the foregoing is merely the specific embodiment of the application
Protection scope, within the spirit and principles of this application, any modification, equivalent substitution, improvement and etc. done should all include
Within the scope of protection of this application.