The method of software test, equipment and system
Technical field
The present invention relates to software testing technology field, more particularly to a kind of method of software test, equipment and system.
Background technology
Software test is the true environment of the software application of simulation, and program is grasped in the true environment of simulation
Make, with discovery procedure mistake, weigh software quality, and whether the process that design requirement is estimated can be met to it.Software is surveyed
The true environment simulated during examination process is more similar to the true environment of software application, can more find that software goes out in actual applications
Existing program error, the software test result for obtaining can accurately more weigh the quality of software.Therefore, the method for software test,
It is to ensure that software test result can accurately weigh the key of software quality.
At present, the method for software test is:The corresponding test script of test equipment is obtained, the test script is by test
What the test sequencing of appearance was created, test content is determined according to the true applied environment of tested test system;Test equipment
Access tested according to the agreement and application programming interface of tested test system with the identity of user for being tested test system
System, the test content performed successively in test script is tested tested test system.Carry out multi-user simultaneously if desired
The test of operation, then according to number of users n, configure n platform identical test equipments, and test script is replicated into n parts, makes every survey
Examination equipment corresponds to portion test script, and n platforms test equipment performs respective test script and tested test system is surveyed simultaneously
Examination.
Realize it is of the invention during, inventor find prior art at least there is problems with:
For needing to carry out the test that multi-user operates simultaneously, then need to configure the number of users phase of quantity and operation simultaneously
Many same identical test equipments, increased the quantity of test equipment, improve the cost of software test, improve software survey
The implementation complexity of examination.
The content of the invention
In order to solve problem of the prior art, the embodiment of the invention provides a kind of method of software test, equipment and be
System.The technical scheme is as follows:
First aspect, there is provided a kind of method of software test, methods described includes:
Test script is obtained, the test script comprises at least the number of users of test operation and at least one test refers to
Order;
The test executing device quantity of each test equipment is determined according to the number of users, and for each test equipment is distributed
The different ID of test executing device quantity (Identity, mark), forms the corresponding ID groups of each test equipment;
The test executing device quantity and ID groups of each test equipment are sent to each test equipment, make each test equipment
The test executing device quantity test executing device is obtained, and is an ID in each test executing device distribution ID groups;
The test instruction is distributed to each test equipment, each test equipment is performed by each test executing device
The test instruction of distribution, obtains and returns implementing result;
The implementing result of each test equipment return is received and analyzed, test result is obtained.
It is described according to the number of users with reference in a first aspect, in the first possible implementation of first aspect
Determine the test executing device quantity of each test equipment, including:
Obtain the quantity of test equipment;
The number of users is carried out into down the result for rounding as the first quantity with the business of the quantity of the test equipment, and
Using the product of first quantity and the quantity of the test equipment as the second quantity;
Determine whether the number of users is identical with second quantity;
If the number of users is identical with second quantity, using first quantity as each test equipment
Test executing device quantity.
With reference to the first possible implementation of first aspect, in second possible implementation of first aspect
In, after whether the determination number of users is identical with second quantity, also include:
If the number of users is differed with second quantity, by the number of users and second quantity
Difference is used as the 3rd quantity;
The 3rd quantity test equipment is selected from the test equipment, by first quantity and predetermined number
The test executing device quantity of each test equipment alternatively, and using first quantity as non-selected each test
The test executing device quantity of equipment.
Second aspect, there is provided a kind of equipment of software test, the equipment includes:
Acquisition module, for obtaining test script, the test script comprises at least the number of users and extremely of test operation
Few test instruction;
Determining module, the test executing device quantity for determining each test equipment according to the number of users;
Distribute module, for being the different mark ID of each test equipment allocation for test actuator quantity, forms each
The corresponding ID groups of test equipment;
Sending module, for the test executing device quantity and ID groups of each test equipment to be sent into each test equipment,
Each test equipment is set to obtain the test executing device quantity test executing device, and in each test executing device distribution ID groups
An ID;
Distribution module, for the test instruction to be distributed into each test equipment, makes each test equipment pass through each
Test executing device performs the test instruction of distribution, obtains and return implementing result;
Analysis module, for receiving and analyze each test equipment return implementing result, obtain test result.
With reference to second aspect, in the first possible implementation of second aspect, the determining module, including:
Acquiring unit, the quantity for obtaining test equipment;
First determining unit, the business of the quantity of test equipment for the number of users to be obtained with the acquisition equipment
The result for rounding is carried out down as the first quantity;
Second determining unit, what the first quantity and the acquiring unit for first determining unit to be determined were obtained
The product of the quantity of test equipment is used as the second quantity;
3rd determining unit, for determining whether is the second quantity that the number of users determines with second determining unit
It is identical;
4th determining unit, for determining the number of users with the second quantity phase when the 3rd determining unit
Together, then using first quantity as each test equipment test executing device quantity.
With reference to the first possible implementation of second aspect, in second possible implementation of second aspect
In, the determining module also includes:
5th determining unit, for when the number of users is differed with second quantity, by the number of users
With the difference of second quantity as the 3rd quantity;
Select unit, for selecting the 3rd quantity test equipment from the test equipment;
6th determining unit, for by first quantity and predetermined number and alternatively each test equipment
Test executing device quantity;
7th determining unit, for using first quantity as each non-selected test equipment test executing device number
Amount.
The third aspect, there is provided a kind of method of software test, methods described includes:
Receive test executing device quantity and ID groups that testing and control equipment sends;
Obtain the test executing device quantity test executing device;
For the ID that each test executing device is distributed in an ID group;
The test instruction of the testing and control equipment distribution is received, and the test instruction is distributed to each test execution
Device, the test for making each test executing device perform distribution is instructed, and returns to implementing result;
The implementing result of each test executing device return is obtained, and implementing result is returned into the testing and control equipment.
It is described to obtain the test execution in the first possible implementation of the third aspect with reference to the third aspect
Device quantity test executing device, including:
The configuration of test executing device is obtained, the test executing device quantity test executing device is obtained according to the configuration.
Fourth aspect, there is provided a kind of equipment of software test, the equipment includes:
First receiver module, test executing device quantity and ID groups for receiving the transmission of testing and control equipment;
First acquisition module, for obtaining the test executing device quantity test executing device;
Distribute module, for the ID distributed in an ID group for each test executing device;
Second receiver module, the test instruction for receiving the testing and control equipment distribution;
Distribution module, the test instruction for second receiver module to be received is distributed to each test executing device,
The test for making each test executing device perform distribution is instructed, and returns to implementing result;
Second acquisition module, the implementing result for obtaining the return of each test executing device;
Sending module, sets for the implementing result that second acquisition module gets to be returned into the testing and control
It is standby.
With reference to fourth aspect, in the first possible implementation of fourth aspect, first acquisition module is used for
The configuration of test executing device is obtained, the test executing device quantity test executing device is obtained according to the configuration.
5th aspect, there is provided a kind of system of software test, the system includes:One testing and control equipment and at least
One test equipment;
The testing and control equipment, the equipment of the software test as described in second aspect;
The test equipment, the equipment of the software test as described in fourth aspect.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
By determining the test executing device quantity of each test equipment according to number of users, make each test equipment according to survey
Examination actuator quantity creates test executing device, and performs test script simultaneously by the test executing device for creating so that multiplex
During the test that family operates simultaneously, what is created in each test equipment is at least one test executing device and identical with number of users,
The quantity of test equipment is reduced, so as to reduce the cost of software test, the implementation complexity of software test is reduced.
Brief description of the drawings
Technical scheme in order to illustrate more clearly the embodiments of the present invention, below will be to that will make needed for embodiment description
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings
Accompanying drawing.
Fig. 1 is the implementation environment schematic diagram of the method for software test provided in an embodiment of the present invention;
Fig. 2 is a kind of method flow diagram of software test that the embodiment of the present invention one is provided;
Fig. 3 is the method flow diagram of another software test that the embodiment of the present invention one is provided;
Fig. 4 is a kind of method flow diagram of software test that the embodiment of the present invention two is provided;
Fig. 5 is a kind of device structure schematic diagram of software test that the embodiment of the present invention three is provided;
Fig. 6 is a kind of structural representation of determining module that the embodiment of the present invention three is provided;
Fig. 7 is the structural representation of another determining module that the embodiment of the present invention three is provided;
Fig. 8 is a kind of device structure schematic diagram of software test that the embodiment of the present invention four is provided;
Fig. 9 is a kind of system structure diagram of software test that the embodiment of the present invention five is provided.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
A kind of method of software test is the embodiment of the invention provides, Fig. 1 is refer to, it illustrates the embodiment of the present invention
The structural representation of the implementation environment involved by the method for the software test of offer.The implementation environment includes:Testing and control equipment
101st, 103 are devices under test equipment 102 and.
Wherein, the equipment that operation has the software test described in following embodiments three in testing and control equipment 101.In addition, should
Testing and control equipment 101 can be server, for be devices under 103 and test equipment 102 combined to provide the user
The service of software test.
The equipment just like the software test described in example below four is run in test equipment 102.In addition, the test equipment
102 can be server, and test equipment 102 includes test executing device.Test equipment 102 is receiving testing and control equipment
After the test instruction of 101 distributions, accessed by the test executing device and be devices under 103 and perform test instruction, think user
The service of software test is provided.
It can be the server that operation has tested test system to be devices under 103.
Between above-mentioned testing and control equipment 101 and test equipment 102, test equipment 102 and between being devices under 103
Can be communicated by wireless network or cable network.
Embodiment one
With reference to above-mentioned implementation environment, a kind of method for testing software is present embodiments provided, referring to Fig. 2, the present embodiment is provided
Method flow it is specific as follows:
201:Test script is obtained, test script comprises at least the number of users of test operation and at least one test refers to
Order;
202:The test executing device quantity of each test equipment is determined according to number of users, and for each test equipment is distributed
The different ID of test executing device quantity, forms the corresponding ID groups of each test equipment;
Further, the test executing device quantity of each test equipment is determined according to number of users, including:
Obtain the quantity of test equipment;
The business of number of users and the quantity of test equipment is carried out into down the result for rounding as the first quantity, and first is counted
The product of the quantity of amount and test equipment is used as the second quantity;
Determine whether number of users is identical with the second quantity;
If number of users is identical with the second quantity, using the first quantity as each test equipment test executing device number
Amount.
Further, it is determined that after whether number of users and the second quantity are identical, also including:
If number of users is differed with the second quantity, using the difference of number of users and the second quantity as the 3rd quantity;
The 3rd quantity test equipment is selected from test equipment, will be the first quantity and predetermined number and alternatively
The test executing device quantity of each test equipment, and using the first quantity as each non-selected test equipment test executing device
Quantity.
203:The test executing device quantity and ID groups of each test equipment are sent to each test equipment, each is tested
Equipment obtains test executing device quantity test executing device, and is an ID in each test executing device distribution ID groups;
204:Test instruction is distributed to each test equipment, each test equipment is performed by each test executing device
The test instruction of distribution, obtains and returns implementing result;
205:The implementing result of each test equipment return is received and analyzed, test result is obtained.
The present embodiment additionally provides another method for testing software, and referring to Fig. 3, the method flow that the present embodiment is provided is specific
It is as follows:
301:Receive test executing device quantity and ID groups that testing and control equipment sends;
302:Obtain test executing device quantity test executing device;
Further, test executing device quantity test executing device is obtained, including:
The configuration of test executing device is obtained, test executing device quantity test executing device is obtained according to configuration.
303:For the ID that each test executing device is distributed in an ID group;
304:The test instruction of testing and control equipment distribution is received, and test instruction is distributed to each test executing device,
The test for making each test executing device perform distribution is instructed, and returns to implementing result;
305:The implementing result of each test executing device return is obtained, and implementing result is returned into testing and control equipment.
Method provided in an embodiment of the present invention, by the test executing device number that each test equipment is determined according to number of users
Amount, make each test equipment according to test executing device quantity create test executing device, and by create test executing device simultaneously
Perform test script so that at the test that multi-user operates simultaneously, at least one test created in each test equipment is held
It is row device and identical with number of users, the quantity of test equipment is reduced, so as to reduce the cost of software test, reduce soft
The implementation complexity of part test.
Method in order to clearly illustrate a kind of software test that above-described embodiment is provided, with reference to above-described embodiment
Content, by taking following examples two as an example, is described in detail to a kind of method of software test, sees below embodiment two:
Embodiment two
A kind of method of software test is the embodiment of the invention provides, in order to make it easy to understand, with reference to above-described embodiment one
Content, with testing and control equipment as server A, test equipment is 2 servers, is respectively server B 1 and server B2, is surveyed
Comprising three test instructions in training sheet 1, refer respectively to make C1:Toward caching addition information A, instruction C2:Caching reading information A and
Instruction C3:In the way of order is performed as a example by execute instruction C2, the method that the present embodiment is provided is illustrated in detail.
Referring to Fig. 4, the method flow that the present embodiment is provided includes:
401:Testing and control equipment obtains test script;
Wherein, test script comprises at least number of users and at least one test instruction of test operation.
The present embodiment is not defined to the specific method that testing and control equipment obtains test script.Including but not limited to:
If user obtains the test script of user input by input equipment input test script, testing and control equipment;If with
Family obtains the incoming test script of user by the incoming test script of other storage devices, then testing and control equipment.
402:Testing and control equipment determines the test executing device quantity of each test equipment according to number of users;
The present embodiment does not determine the test executing device quantity of each test equipment to testing and control equipment according to number of users
Specific method be defined.For example, determining the test executing device quantity of each test equipment by following five steps.
Step one:Obtain the quantity of test equipment;
Due to each test can be configured before the method for the software test provided by the present embodiment carries out software test
Equipment and testing and control equipment, in configuration testing control device, can set corresponding each test of the testing and control equipment and set
Standby ID, to allow testing and control equipment to be communicated with each test equipment according to the ID of each test equipment, implements this implementation
The method of the software test that example is provided.Therefore, the quantity of the test equipment ID set in testing and control equipment is defined as test
The quantity of equipment.In addition to this it is possible to obtain the quantity of test equipment otherwise, the present embodiment is not to obtaining test
The specific method of the quantity of equipment is defined.
Step 2:The business of number of users and the quantity of test equipment is carried out into down the result for rounding as the first quantity, and
Using the product of the first quantity and the quantity of test equipment as the second quantity;
Example one:It it is 10 with number of users, the quantity of test equipment, will for as a example by 2As the first number
Amount, using 5 × 2=10 as the second quantity.
Example two:It it is 9 with number of users, the quantity of test equipment, will for as a example by 2As the first number
Amount, using 4 × 2=8 as the second quantity.
Step 3:Determine whether number of users is identical with the second quantity, if number of users is identical with the second quantity, hold
Row step 4, if number of users is differed with the second quantity, performs step 5;
For the ease of description, the present embodiment and subsequent embodiment are using the business of number of users and the quantity of test equipment as the
As a example by four quantity.Because the first quantity to the 4th quantity round and obtained in step 2, if the 4th quantity is whole
Number, then the first quantity is identical with the 4th quantity, so that the first quantity is the 4th quantity and surveys with the product of the quantity of test equipment
The product of the quantity of examination equipment, and the 4th quantity and the product of the quantity of test equipment are number of users, therefore so that this kind of situation
Under, it is identical with number of users with the second quantity of the product of the quantity of test equipment as the first quantity.
If the 4th quantity is non-integer, the first quantity is differed with the 4th quantity, so that the first quantity sets with test
The product of standby quantity is differed with the 4th quantity and the product of the quantity of test equipment, and the 4th quantity and the quantity of test equipment
Product is number of users, therefore so that in such cases, as the first quantity and the product of the quantity of test equipment the second quantity with
Number of users is differed.
By taking two examples in step 2 as an example, for example one, number of users is identical with the second quantity, is 10, holds
Step 4 is performed after row step 3.For example two, number of users is 10, and the second quantity is 9, is held after execution step 3
Row step 5.
Step 4:Using the first quantity as each test equipment test executing device quantity;
By taking the example one in step 2 as an example, using 5 as server B 1 and the test executing device quantity of server B2.
It should be noted that because the test executing device quantity of each test equipment is the first quantity, therefore, test is held
The total quantity of row device is the quantity of test equipment and the product of the first quantity.And the first quantity is identical with the 4th quantity, and the 4th number
Amount is number of users with the product of the quantity of test equipment, therefore the total quantity of test executing device is identical with number of users.So as to,
It is actual to perform when being tested by method for testing software provided in an embodiment of the present invention in the case of not increasing test equipment
The test executing device quantity of test operation is identical with the number of users of the test operation included in test script.
Step 5:Using the difference of number of users and the second quantity as the 3rd quantity, the 3rd quantity is selected from test equipment
Individual test equipment, by the test executing device quantity of the first quantity and predetermined number and alternatively each test equipment, and
Using the first quantity as each non-selected test equipment test executing device quantity.
Specifically chosen standard of the present embodiment not to selecting the 3rd quantity test equipment from test equipment is defined.
For example, randomly choosing the 3rd quantity test equipment from test equipment.
With the example two in step 2, predetermined number is as a example by 1, using 10-9=1 as the 3rd quantity, from test equipment
1 test equipment of random selection, such as server B 1, using 4+1=5 as server B 1 test executing device quantity, using 4 as taking
The quantity of business device B2.
Certainly, predetermined number can also be other numerical value, as long as ensureing each test equipment determined according to predetermined number
Test executing device quantity summation it is identical with number of users, the present embodiment is not limited the concrete numerical value of predetermined number
It is fixed.
403:Testing and control equipment is the different ID of each test equipment allocation for test actuator quantity, forms each survey
The corresponding ID groups of examination equipment;
It it is 10 with number of users, each test equipment allocation for test actuator quantity is as a example by 5, server A is clothes
Business device B1 distribution 2 different ID, i.e. ID1, ID2, ID3, ID4 and ID5, form the corresponding ID groups of server B 1:ID groups 1.For
Server B 2 distributes 2 different ID, i.e. ID6, ID7, ID8, ID9 and ID10, forms the corresponding ID groups of server B 2:ID groups 2.
Certainly, testing and control equipment is that the specific name of the ID of each test equipment distribution can also be other titles, this
Embodiment is not that the specific name of the ID of each test equipment distribution is defined to testing and control equipment.Test equipment is corresponding
The specific name of ID groups can also be other titles, and the specific name of the present embodiment ID groups not corresponding to test equipment is limited
It is fixed.
404:The test executing device quantity and ID groups of each test equipment are sent to each test and set by testing and control equipment
It is standby;
By taking the example in step 403 as an example, test executing device quantity 5 and ID groups 1 that server A will be distributed for server B 1
It is sent to server B 1;The test executing device quantity 5 and ID groups 2 distributed for server B 2 are sent to server B 2.
405:Test equipment receives the test executing device quantity and ID groups that testing and control equipment sends;
In due to the method for the software test of the present embodiment offer, test equipment is at least one, for convenience of description, this
Specifically performed in the method for software test provided in an embodiment of the present invention for test equipment in embodiment and subsequent embodiment
Process, explains by taking any test equipment as an example, such as server B 1.For other test equipments, such as server B 2,
The implementation process that can be provided according to the present embodiment and subsequent embodiment in the specific implementation is implemented, to complete the present embodiment
The method of the software test of offer.
For example, the test executing device quantity that the reception server A of server B 1 sends:5 and ID groups 1.
406:Test equipment obtains test executing device quantity test executing device;
Because meeting software test is related before the method for the software test provided by the present embodiment carries out software test
(Application Programming Interface, should according to the API of the agreement of tested test system, tested test system for personnel
With Program Interfaces) etc. determine test executing device configuration, to facilitate test executing device according to the configuration and tested test system
Connection carries out software test.Therefore, test equipment can obtain the configuration of predetermined test executing device, according to test execution
The configuration of device obtains test executing device quantity test executing device.In addition to this it is possible to obtain test otherwise hold
Row device quantity test executing device, the present embodiment is not limited obtaining test executing device quantity test executing device specific method
It is fixed.
Because test executing device is obtained according to the configuration of predetermined test executing device, therefore, test executing device
The application functions such as communication, reading, display with tested system client, but without the word of tested system client
The functions such as body, display mode, therefore test executing device can be as the simplified version client of tested system.As well as survey
Examination actuator has the core application functionalities such as communication, the reading of tested system client, needed for reducing test executing device
Resource a so that test equipment can obtain multiple test executing devices.For example, a test equipment obtains hundreds of tests and holds
Row device.
In addition, the function that test executing device has is in addition to functions described above, can also be according to the test content of software test
Difference is adjusted so that test executing device can have the function that tested test system actual customer end has.For example, software is surveyed
Need to test read functions in examination content, but display function need not be tested, then read functions are added in test executing device, delete
Except display function.Also due to test executing device has above-mentioned functions " customization " characteristic so that the test execution that the present embodiment is provided
Device can targetedly test various functions, and extending the method for providing software test by the present embodiment carries out software test
Implementation environment.The present embodiment is not defined to the concrete function that test executing device has.
Additionally, obtaining implementing for test executing device quantity test executing device for the configuration according to test executing device
Mode, can open test executing device quantity process, each process one test executing device of correspondence, and each test executing device
Configuration be the configuration of the test executing device for getting, test instruction is performed by Process flowchart test executing device, complete soft
Part is tested.
For example, server B 1 opens 5 processes, each process one test executing device of correspondence.
407:Test equipment is the ID that each test executing device is distributed in an ID group;
For example, server B 1 is test executing device 1 distributes ID1, and it is the distribution ID2 of test executing device 2, it is test executing device 3
Distribution ID3, is the distribution ID4 of test executing device 4, is the distribution of test executing device 5 ID5.It is, of course, also possible to according to other distribution principles
It is the ID in test executing device distribution ID groups, the present embodiment is not former to the specific distribution for the ID in test executing device distribution ID groups
Then it is defined.The title of test executing device can also be other names, and the present embodiment does not enter to the specific name of test executing device
Row is limited.
408:Testing and control equipment is distributed to each test equipment by instruction is tested;
Wherein, test instruction includes operational order and metainstruction.Operational order is used to describe what is initiated to system under test (SUT)
Operation, and metainstruction is used to describe what rule to perform operational order by.
For example:Instruction C1 and instruction C2 are operational order, and instruction C3 is metainstruction.
Because test instruction is included in test script, therefore, testing and control equipment first parses test script and obtains
Test instruction, then the test instruction that will be parsed is distributed to each test equipment.
By taking test script 1 as an example, server A parses instruction C1, instruction C2 and instruction C3 in test script 1, and will
Instruction C1, instruction C2 and instruction C3 are distributed to server B 1 and server B2.
In addition, if also including the ways of distribution of test instruction in test script, then testing and control equipment parses test
After instruction each test that instruction is distributed to the ways of distribution for meeting test instruction will be tested according to the ways of distribution of test instruction
Equipment.In addition, testing and control equipment can also be distributed to each test equipment, this reality by other methods by instruction is tested
Applying example does not instruct the specific method for being distributed to each test equipment to be defined test testing and control equipment.
With the ways of distribution comprising instruction C4, instruction C5 and test instruction in test script 2:C4 is performed by ID1 and ID3
Example, server A parses instruction C4 and instruction C5 in test script 1, it is determined that meeting the test of the ways of distribution of test instruction
Equipment is 1, the i.e. corresponding server B 1 of the ID groups 1 comprising ID1 and ID3, and instruction C4 is distributed into server B 1, will be instructed
C5 is distributed to server B 1 and B2.C4 and C5 will be instructed to be distributed to server B 1, instruction C5 is distributed to server B 2.
Wherein, the ways of distribution of test instruction can also be other contents, and the present embodiment is not to the distributor of test instruction
The particular content of formula is defined.The test equipment for meeting the ways of distribution of test instruction can also be other test equipments, this
Specific test equipment of the embodiment not to meeting the ways of distribution of test instruction is defined.Meet the ways of distribution of test instruction
Test equipment quantity can also be other quantity, the present embodiment to meet test instruction ways of distribution test equipment
Particular number be defined.
Additionally, for also being included in test script during the ways of distribution for testing instruction, in order that test equipment can
According to test instruction ways of distribution execute instruction, testing and control equipment except will test instruction be distributed to each test equipment it
Outward, also the ways of distribution for testing instruction can be in the lump distributed to test equipment, makes test equipment according to the distributor of test instruction
Instruction is distributed to each test executing device by formula.
The ways of distribution for testing instruction is not distributed to the present embodiment the concrete mode of test equipment to testing and control equipment
It is defined.For example:The ways of distribution for testing instruction is distributed to each test equipment, or the ways of distribution of instruction will be tested
It is distributed to the test equipment for meeting the ways of distribution.
Still by taking test script 2 as an example, server A is removed and for instruction C4 and C5 to be distributed to server B 1, and instruction C5 is distributed to
Outside server B 2, will also the ways of distribution of instruction be tested:C4 is performed by ID1 and ID3 and is distributed to server B 1 and server B2.
Or, server A is removed and for instruction C4 and C5 to be distributed to server B 1, and instruction C5 is distributed to outside server B 2,
To only the ways of distribution of instruction be tested:C4 is performed by ID1 and ID3 and is distributed to the server B 1 for meeting the ways of distribution.
409:Test equipment receives the test instruction of testing and control equipment distribution, and test instruction is distributed into each test
Actuator;
By taking instruction C1, instruction C2 and instruction C3 that server B 1 receives server A distribution as an example, B1 will instruct C1, refer to
C2 and instruction C3 is made to be distributed to test executing device 1 to test executing device 5.
In addition, if test equipment also receives test and refers in addition to the test for receiving the distribution of testing and control equipment is instructed
The ways of distribution of order, then test equipment according to test instruction ways of distribution by test instruction be distributed to meet test instruction point
Each test executing device of originating party formula.In addition, testing and control equipment can also will test instruction distribution by other methods
Each test equipment is given, the present embodiment will not tested testing and control equipment and instruct the specific method for being distributed to each test equipment
It is defined.
Instruction C4, the instruction C5 of server A distribution and the ways of distribution of test instruction are received with server B 1:C4 by
As a example by ID1 and ID3 is performed, it is the test executing device 3 of ID3 that B1 will instruct C4 to be distributed to the test executing device 1 and ID that ID is ID1,
Instruction C5 is distributed to test executing device 1 to test executing device 5.
410:Test executing device performs the test instruction of distribution, and returns to implementing result.
The test instruction that test executing device will be received is put into corresponding caching, according to the tested test system being pre-configured with
API initiate request operation to tested test system, test instruction is read from caching and performed after successfully request is initiated.
By taking instruction C1, instruction C2 and instruction C3 that test executing device 1 receives the distribution of server B 1 as an example, test executing device
1 initiates request operation according to the API of the tested test system being pre-configured with to tested test system, performs the instruction C1 in caching, refers to
C2 and instruction C3 is made, and implementing result is returned into server B 1.
411:Test equipment obtains the implementing result of each test executing device return, and implementing result is returned into test control
Control equipment;
After test equipment obtains the implementing result of each test executing device return, each implementing result can be counted, then
Statistics is returned into testing and control equipment.The present embodiment is not limited each implementing result is done into the particular content for counting
It is fixed, for example, doing cumulative statistics.
For example, the test result that server B 1 returns to test executing device 1 to test executing device 5, by each test result
Cumulative statistics is done, and accumulation result is returned into server A.
412:Testing and control equipment is received and analyzes the implementing result of each test equipment return, obtains test result.
The concrete analysis content of the implementing result that the present embodiment is not returned to testing and control equipment to each test equipment is entered
Row is limited, for example:Analyze the number of times that runs succeeded, the execution frequency of failure of each test instruction, each survey of each test instruction
Try minimum response duration, the peak response duration of each test instruction, average response duration, the institute of each test instruction of instruction
There is minimum overall response duration of test instruction etc..
The specific manifestation form of the present embodiment test result also not to obtaining is defined.For example:According to test result
Statistical report form is formed, or analysis report is formed according to test result.
Only with testing and control equipment as server A, test equipment is 2 servers to the above, is respectively server B 1
With server B2, comprising three test instructions in test script 1, refer respectively to make C1:Toward caching addition information A, instruction C2:It is slow
Deposit reading information A and instruction C3:In the way of order is performed as a example by execute instruction C2, to how using the soft of the present embodiment offer
The method of part test carries out software test and makes explanations explanation.Wherein, the title for testing the control device can also be other names
Claim, specific name of the present embodiment not to testing the control device is defined;The quantity of test equipment can also be counted for other
Amount, the present embodiment is not defined to the particular number of test equipment;The title of test equipment can also be other titles, this reality
Example is applied not to be defined the specific name of test equipment;Test script title can also be other titles, and the present embodiment is not right
The specific name of test script is defined;The quantity of the test instruction included in test script can also be other quantity, this
The particular number of embodiment test instruction not to being included in test script is defined;The title for testing instruction can also be it
Its title, specific name of the present embodiment not to test instruction is defined;The particular content for testing instruction can also be other
Content, particular content of the present embodiment not to test instruction is defined.
In addition, the method for the software test of the present embodiment offer is that software test is completed by way of Two-stage control, i.e.,
The testing and control equipment of the method for testing software provided using the present embodiment controls at least one test equipment, then by each test
Equipment controls at least one test executing device in it to perform test instruction, completes software test.Due to the mode of Two-stage control
With realize it is simple, easily extend the characteristics of, therefore extend the implementation environment of the method for the software test of the present embodiment offer.
Further, since the mode that test executing device performs test instruction can be to be immediately performed after receiving test instruction;
Can also be to store in caching test instruction after receiving test instruction, then read test is instructed and performed from caching.
Can also be constructed in addition to above-mentioned environment according to the distinct methods that test executing device performs test instruction, other implementation environments,
The specific implementation environment that the method for the software test that the present embodiment is not provided application the present embodiment carries out software test is limited
It is fixed.
Such as the first implementation environment:Construct the pressure test environment of high concurrent.
With pressure test environment as group chatting, as a example by receiving 1000 message of " hello " simultaneously in group, construction
Method can be:5 test equipments of configuration, the number of users of test operation is 1000, and test instruction is to send " you
It is good " message.Testing and control equipment determines that the test executing device quantity of each test equipment is 200, and test instruction is distinguished
5 test equipments are sent to, then each test equipment controls 200 test executing devices after same group is added, while sending
One " hello " message.Now tested group synchronization can be received and held respectively from 1000 tests in 5 test equipments
1000 " hello " message that row device sends, realize the pressure test of the high concurrent to the server and client side of system under test (SUT).
In addition to this it is possible to pass through the pressure test environment that other building methods construct high concurrent, the present embodiment is not right
The specific configuration method for constructing the pressure test environment of high concurrent is defined.
Such as second implementation environment:Build complicated test environment.
So that complicated test environment is to there is 200 users to send out message a variety of at random in group as an example, construction side
Method can be:1 test equipment of configuration, the number of users of test operation is 200, and test instruction is 200 various operations
Operational order, such as:Test instruction 1 is for " every 30 seconds transmission words:Hello ", test instruction 2 is for " every one table of transmission in 40 seconds
Feelings ", etc..200 test instructions are sent to test equipment by testing and control equipment, and test equipment is getting 200 tests
After actuator, test instruction 1 is transmitted to actuator 1, test instruction 2 is transmitted to actuator 2, the like.Each test
Actuator stores the test instruction of test equipment forwarding in respective caching, and performs test instruction.For example:Test execution
Device 1 performs the test instruction 1 in caching:Word is sent after waiting 30 seconds:Hello, performs the test in caching after being sent completely again
Instruction 1, so performs.Now the instruction in 200 test executing device reading cachings, after performing repeatedly, then can build
One multi-user is random to being tested the test environment that test system is operated.
In addition to this it is possible to passing through other building methods builds complicated test environment, the present embodiment is not multiple to building
The specific construction method of miscellaneous test environment is defined.
The method that the present embodiment is provided, by determining the test executing device quantity of each test equipment according to number of users,
Each test equipment is created test executing device according to test executing device quantity, and performed simultaneously by the test executing device for creating
Test script so that at the test that multi-user operates simultaneously, at least one test executing device created in each test equipment
And it is identical with number of users, reduce the quantity of test equipment, so as to reduce the cost of software test, reduce software survey
The implementation complexity of examination.
Embodiment three
A kind of equipment of software test is the embodiment of the invention provides, referring to Fig. 5, the equipment includes:
Acquisition module 501, for obtaining test script, test script comprises at least the number of users and at least of test operation
One test instruction;
Determining module 502, the test executing device quantity for determining each test equipment according to number of users;
Distribute module 503, for being the different ID of each test equipment allocation for test actuator quantity, forms each survey
The corresponding ID groups of examination equipment;
Sending module 504, sets for the test executing device quantity and ID groups of each test equipment to be sent into each test
It is standby, each test equipment is obtained test executing device quantity test executing device, and in each test executing device distribution ID groups
An ID;
Distribution module 505, for test instruction to be distributed into each test equipment, makes each test equipment be surveyed by each
Examination actuator performs the test instruction of distribution, obtains and return implementing result;
Analysis module 506, for receiving and analyze each test equipment return implementing result, obtain test result.
Referring to Fig. 6, determining module 502, including:
Acquiring unit 5021, the quantity for obtaining test equipment;
First determining unit 5022, the business for the quantity of the test equipment that number of users is obtained with acquisition equipment is carried out
Under the result that rounds as the first quantity;
Second determining unit 5023, what the first quantity and acquiring unit for the first determining unit 5022 to be determined were obtained
The product of the quantity of test equipment is used as the second quantity;
3rd determining unit 5024, for determining whether is the second quantity that number of users and the second determining unit 5023 determine
It is identical;
4th determining unit 5025, for determining that number of users is identical with the second quantity when the 3rd determining unit 5024, then
Using the first quantity as each test equipment test executing device quantity.
Referring to Fig. 7, determining module 502 also includes:
5th determining unit 5026, for when number of users and the second quantity are differed, number of users and second being counted
The difference of amount is used as the 3rd quantity;
Select unit 5027, for selecting the 3rd quantity test equipment from test equipment;
6th determining unit 5028, for by the first quantity and predetermined number and alternatively each test equipment
Test executing device quantity;
7th determining unit 5029, for using the first quantity as each non-selected test equipment test executing device number
Amount.
In sum, equipment described in the embodiment of the present invention, by the test that each test equipment is determined according to number of users
Actuator quantity, makes each test equipment create test executing device according to test executing device quantity, and held by the test for creating
Row device performs test script simultaneously so that at the test that multi-user operates simultaneously, at least created in each test equipment
It is individual test executing device and identical with number of users, the quantity of test equipment is reduced, so as to reduce the cost of software test,
Reduce the implementation complexity of software test.
Example IV
A kind of equipment of software test is the embodiment of the invention provides, referring to Fig. 8, the equipment includes:
First receiver module 801, test executing device quantity and mark ID groups for receiving the transmission of testing and control equipment;
First acquisition module 802, for obtaining test executing device quantity test executing device;
Distribute module 803, for the ID distributed in an ID group for each test executing device;
Second receiver module 804, the test instruction for receiving the distribution of testing and control equipment;
Distribution module 805, the test instruction for the second receiver module 804 to be received is distributed to each test execution
Device, the test for making each test executing device perform distribution is instructed, and returns to implementing result;
Second acquisition module 806, the implementing result for obtaining the return of each test executing device;
Sending module 807, for the implementing result that the second acquisition module 806 gets to be returned into testing and control equipment.
Wherein, the first acquisition module 802, the configuration for obtaining test executing device obtains test executing device according to configuration
Quantity test executing device.
In sum, equipment described in the embodiment of the present invention, by the test executing device number determined according to testing and control equipment
Amount creates test executing device, and performs test script simultaneously by the test executing device for creating so that operated simultaneously in multi-user
Test when, in each test equipment create it is at least one test executing device and identical with number of users, reduce test
The quantity of equipment, so as to reduce the cost of software test, reduces the implementation complexity of software test.
Embodiment five
A kind of system of software test is the embodiment of the invention provides, referring to Fig. 9, the system includes:One testing and control
The test equipment 902 of equipment 901 and at least one;
Testing and control equipment 901, the equipment of the software test as described in above-mentioned embodiment three, detailed in Example three;
Test equipment, the equipment of the software test as described in above-mentioned example IV, detailed in Example four.
In sum, equipment described in the embodiment of the present invention, by the test that each test equipment is determined according to number of users
Actuator quantity, makes each test equipment create test executing device according to test executing device quantity, and held by the test for creating
Row device performs test script simultaneously so that at the test that multi-user operates simultaneously, at least created in each test equipment
It is individual test executing device and identical with number of users, the quantity of test equipment is reduced, so as to reduce the cost of software test,
Reduce the implementation complexity of software test.
It should be noted that:Above-described embodiment provide software test equipment in software test, only with above-mentioned each work(
The division of energy module is carried out for example, in practical application, as needed can distribute by different functions above-mentioned functions
Module is completed, will the internal structure of equipment be divided into different functional modules, it is described above all or part of to complete
Function.In addition, the equipment of the software test of above-described embodiment offer, system belong to same with the embodiment of the method for realizing software test
One design, it implements process and refers to embodiment of the method, repeats no more here.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware
To complete, it is also possible to instruct the hardware of correlation to complete by program, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all it is of the invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included within the scope of the present invention.