Summary of the invention
In order to address the above problem, further improve the automaticity of distributed automatization test frame, improve the efficient that test assignment is distributed, fundamental purpose of the present invention is to propose a kind of test assignment auto-allocation method based on test execution function dynamics.
In the present invention, the test main control computer passes through the requirement of analytical test task to test execution function power, can the dynamics size select suitable test execution machine automatically according to test execution, finishes the automatic distribution of test assignment.Concrete steps are as follows:
During (1) by GUI control desk definition test assignment, decompose complicated test assignment T, be expressed as and-or-tree (T) structure, and describe corresponding eca rule set, write the test execution document scene.
(2) the test main control computer is resolved the test execution document scene, to each the atomic test task among the and-or-tree (T), iteration is carried out following steps: obtain the resource situation that current each test execution machine is had, calculate the test execution energy dynamics of each test execution machine to this atomic test task, give a test execution machine according to test assignment allocation criterion with this atomic test Task Distribution then, and atomic test Task Distribution situation is write in the test execution document scene based on test execution function dynamics.
Only being assigned as of test assignment distributes all atomic test tasks among the and-or-tree (T), give each test execution machine with the atomic test Task Distribution, and tree goes up other non-atomic test task executions and coordination, for example synchronously " with " task, select " or " task dispatching, finish according to the description of eca rule in the test execution document scene by the test main control computer.
Technique effect of the present invention is for the distributed automatization test frame provides a kind of automatic test method for allocating tasks, further to have improved the automaticity of automated test frame.
Related definition
Define 1 test assignment
Be the test use cases of realizing that the fc-specific test FC target will be carried out.Test use cases as the required execution of compatibility test between complete operation system and the database.Test assignment atomize test assignment and complex task.
Define 2 atomic test tasks
Atomic test task t
iBe defined in and carry out test assignment and divide one of the timing not minimal set of subdivisible test case, it is the least unit of participating in the distribution.Task t
iCan be one and the incoherent independent test case of other test case, also can be one group of test case that is associated.
Define 3 complicated test assignments
Be the ordered set that is made of the relevant atomic test task of a series of logics, complicated test assignment can be decomposed into the atomic test set of tasks.
Define 4 complicated test assignments " with-or tree " (and-or-tree) describe
Complicated test assignment is decomposed into the atomic test task, and complicated test assignment is decomposed into the atomic test task description and is:
ComplicatedTask=<DecomID,AtomTaskSet,Relation,OTHERS>
Wherein, DecomID represents the sign of complicated test assignment, in order to distinguish each different complicated test assignment that is decomposed; AtomTaskSet represents the atomic test task-set; Relation={And, Or, Enable, Facilitae ..., the various relation of interdependences of expression atomic test task; OTHERS has described other attributive character of complicated test assignment, comprises the attribute such as difficulty, importance of complicated test assignment.
Various relation of interdependences have constituted the architectural feature of the complicated test assignment that is decomposed jointly between atomic test task and atomic test task.Usually adopt the task expression framework TAEMS of field independence to describe complicated test assignment decomposition, TAEMS adopt " with-or tree " decomposable process and the task resolution of expression task, it is the task executable unit of method as minimum, has quantized the property value such as quality, expense, time of method correspondence with the mode of probability; Simultaneously it utilizes cumulative function to express connection between the levels task, disclose between these tasks " with-or " relation.Method of the present invention is that the atomic test task is corresponding with the method among the TAEMS, and the complicated test assignment T correspondence of definition decomposition " with-or tree " (and-or-tree) be described below:
If the structure of arbitrary complicated test assignment T can be described as one " with-or the tree ", note is made and-or-tree (T), the root node of tree is represented complicated test assignment T, the leaf node of tree is represented the atomic test task that can independently be finished by single test execution machine, and agreement: certain node of if tree has son's task, so the actuating logic between its son's task otherwise complete " with ", otherwise complete " or ", note is made and-F (t
1, t
2..., t
n) or or-F (t
1, t
2..., t
m), wherein F is a node identification, t
iIt is the child of F.
And-or-tree (T) is represented with ECA (event-condition-action) regular collection of equal valuely, eca rule is by the combination of condition, the for example conjunction of condition (∧), extract (∨) describe the combination condition relation, have also described the execution dependence of executed activity simultaneously.
Define the executive capability and the executive capability degree of 5 test execution machines
The executive capability degree of test execution machine has been described the system resource condition of test execution machine, and expression test execution machine is finished the ability size of atomic test task.It is Abil that note test execution machine a has the executive capability of carrying out atomic test task t
aT, test execution machine a for the executive capability degree of atomic test task t is
When
The time, test execution machine a has the ability of carrying out atomic test task t.
Test execution machine a is for the executive capability degree of atomic test task t
Wherein
η=η
t/η
a (1)
η
tBe to finish the required maximum duration of atomic test task t, η
aBe that test execution machine a finishes the required time of atomic test task t,
Be the demand of atomic test task t to k class resource,
Be that (the current k class resource that has is: the sum of such resource that test execution machine a has deducts and accepted the number of resources that the atomic test task takies the current k class resource that has of test execution machine a, for example save as the total internal memory that has in the current freedom that has of test execution machine a and deduct the internal memory of usefulness), μ
kBe the weight of respective resources,
Q is the classification number of resource; ω
1And ω
2Importance in atomic test task t is determined ratio, ω in time and resource
1+ ω
2=1.
If Abil
A1T ∧ Abil
A2T and
Then claim test execution machine a
1The executive capability degree greater than test execution machine a
2The executive capability degree.
Define 6 atomic test Task Distribution standards
This method adopts the atomic test Task Distribution standard based on test execution energy dynamics.
Given atomic test task t, t ∈ AT (AT is the atomic test task-set), any two test execution machine a1 and a2 are based on the atomic test Task Distribution standard of test execution energy dynamics
Be defined as:
The executive capability of test execution machine a1 is Abil
A1T, the executive capability of a2 is Abil
A2T, and the executive capability degree of test execution machine a1
Executive capability degree more than or equal to test execution machine a2
Then preferentially atomic test task t is distributed to test execution machine a1.
Embodiment
In a distributed automatization test execution system, every machine that participates in test assignment is called test machine, and test machine is divided into test main control computer and test execution machine.The test main control computer is the test machine of operation GUI test console, test master control unit and test result collection and integrated component, and the test execution machine is the test machine of operation test execution parts.There is and has only a main control computer in the system, can have 1 to N platform test machine.When making up the test execution system, form the test main control computer at a test machine deploy GUI test console, test master control unit and test result collecting part, be responsible for test assignment definition, the distribution of test assignment, test result is collected and groundwork such as integrated.Arrive N platform test machine deploy test execution parts 1,, be responsible for the concrete execution of test assignment as the test execution machine, also can be at test main control computer deploy test execution parts, at this moment, this machine has test master control and test execution dual-use function.
The environmental parameter and the system identifier of the test machine of every participation have been defined in the CONFIG.SYS, test execution pattern (compiling, execution, removing) and the used application program of execution pattern.The test execution document scene has been put down in writing all test assignments, and describe the deployment of test assignment and carried out flow process, be test dispatching and the foundation of carrying out control.The execution result journal file has write down test case output information and the test execution log information that produces in the measuring executing process.
The configuration information of each test machine in test console definition test assignment by graphical user interface, the distributed test system, and the information of definition write in test execution configuration and the test execution document scene.In the test execution document scene, complicated test assignment be represented as " with-or tree " and eca rule gather.
Complicated test assignment is expressed as " with-or tree " and the method gathered of eca rule:
Specifically be that complicated test assignment is decomposed into the atomic test task, complicated test assignment is decomposed into the atomic test task:
ComplicatedTask=<DecomID,AtomTaskSet,Relation,OTHERS>
Wherein, DecomID represents the sign of complicated test assignment, in order to distinguish each different complicated test assignment that is decomposed; AtomTaskSet represents the atomic test task-set; Relation={And, Or, Enable, Facilitae ..., the various relation of interdependences of expression atomic test task; OTHERS has described other attributive character of complex task, comprises the attribute such as difficulty, importance of task.
Various relation of interdependences have constituted the architectural feature of the complicated test assignment that is decomposed jointly between atomic test task and atomic test task.Usually adopt the task expression framework TAEMS of field independence to describe complicated test assignment decomposition, TAEMS adopt " with-or tree " decomposable process and the task resolution of expression task, it is the task executable unit of method as minimum, has quantized the property value such as quality, expense, time of method correspondence with the mode of probability; Simultaneously it utilizes cumulative function to express connection between the levels task, disclose between these tasks " with-or " relation.Method of the present invention is that the atomic test task is corresponding with the method among the TAEMS, and the complicated test assignment T correspondence of definition decomposition " with-or tree " (and-or-tree) be described below:
If the structure of arbitrary complicated test assignment T can be described as one " with-or the tree ", note is made and-or-tree (T), the root node of tree is represented complicated test assignment T, the leaf node of tree is represented the atomic test task that can independently be finished by single test execution machine, and agreement: certain node of if tree has son's task, so the actuating logic between its son's task otherwise complete " with ", otherwise complete " or ", note is made and-F (t
1, t
2..., t
n) or or-F (t
1, t
2..., t
m), wherein F is a node identification, t
iBe the child of F, the and-T among Fig. 2 (1,2) for example, and-1 (3,4,5), or-2 (6,7) etc.
And-or-tree (T) is represented with ECA (event-condition-action) regular collection of equal valuely, eca rule is by the combination of condition, the for example conjunction of condition (∧), extract (∨) describe the combination condition relation, have also described the execution dependence of executed activity simultaneously.The part eca rule of and-or-tree shown in Figure 2 (T) is expressed as: On done (1) AND done (2) if union (1,2)=TRUE then done (T); On done (8) OR done (9) if choice (8,9)=TRUE then done (6).Wherein, done (finishing), union (synchronously with) and choice (selection or) they are first-order predicates.
As shown in Figure 3, be process flow diagram based on test machine energy dynamics test assignment auto-allocation method.When test job starts, the test main control computer reads and resolves the test execution configuration and the test execution document scene of tester's definition, the test main control computer is resolved the information of each test execution machine of current test execution configuration file definition, and obtain the current resource situation that has of test execution machine by communication system, to each the atomic test task in the test execution scene, calculate the executive capability degree of each test execution machine, according to test assignment allocation criterion the atomic test Task Distribution is tested to corresponding each test execution machine, and atomic test Task Distribution and deployment information are write the test execution document scene based on the executive capability degree.
Wherein, about the method for the executive capability degree that calculates each test execution machine:
The executive capability degree of test execution machine has been described the system resource condition of test execution machine, and expression test execution machine is finished the ability size of atomic test task.It is Abil that note test execution machine a has the executive capability of carrying out atomic test task t
aT, test execution machine a for the executive capability degree of atomic test task t is
When
The time, test execution machine a has the ability of carrying out atomic test task t.
Test execution machine a for the executive capability degree of atomic test task t is
Wherein
η=η
t/η
a (1)
η
tBe to finish the required maximum duration of atomic test task t, η
aBe that test execution machine a finishes the required time of atomic test task t,
Be the demand of atomic test task t to k class resource,
Be that (the current k class resource that has of test execution machine a is: the sum of such resource that test execution machine a has deducts the number of resources that is received an assignment and take to the current k class resource that has of test execution machine a, for example save as the total internal memory that has in the current freedom that has of test execution machine a and deduct the internal memory of usefulness), μ
kBe the weight of respective resources,
Q is the classification number of resource; ω
1And ω
2Importance in task t is determined ratio, ω in time and resource
1+ ω
2=1.
If Abil
A1T ∧ Abil
A2T and
Then claim test execution machine a
1The executive capability degree greater than test execution machine a
2The executive capability degree.
This method adopts the Task Distribution standard based on test execution energy dynamics.
Given atomic test task t, t ∈ AT (AT is the atomic test task-set), any two test execution machine a1 and a2 are based on the Task Distribution standard of test execution energy dynamics
Be defined as:
The executive capability of test execution machine a1 is Abil
A1T, the executive capability of a2 is Abil
A2T, and the executive capability degree of test execution machine a1
Executive capability degree more than or equal to test execution machine a2
Then preferentially atomic test task t is distributed to test execution machine a1.
In measuring executing process, main control end is monitored the execution of each test execution machine.Each test execution machine is tested according to a definite sequence after receiving the atomic test task, and in the test process, the test execution machine feeds back to main control computer with test execution information and test result.Test machine with other carries out then needing to send synchronization request to main control computer synchronously if desired, by main control computer control between the test execution machine synchronously, and finish defined each non-atomic test task executions in the test execution scene.
Test console is the graphical user interface that defines, manages and report at test assignment.Finish the establishment and the management of test assignment by control desk, carry out the test execution configuration, and test assignment and test configurations information sent to the test execution server, finish the test result log analysis work that the test execution server returns, the test execution report information is provided, and the flow process of whole test is carried out unified management with communicating by letter.
The test execution server receives test assignment, test execution configuration and the test execution scene information that control desk sends, according to test assignment and test execution configuration information, the test execution server carries out the distribution of test assignment, the deployment of test script, the scheduling and the execution of test assignment, and the collection test result information, after the end of test (EOT) final testing result daily record is transmitted back to control desk.
Between test console and the test execution server, and test master control and test executing device information interaction finished by communication subsystem in the test execution server.Communication subsystem is the basis that distributed testing is carried out, for Activities such as test script deployment, test dispatching, test result collection provide support.