Test method and device, electronic equipment
Technical field
This specification one or more embodiment be related to computer application technology more particularly to a kind of test method and
Device, electronic equipment.
Background technique
In general, can be based on node test frame when testing operation system, will be carried in the operation system
Business to be tested be divided into multiple nodes to be tested according to business feature, and each node to be tested is tested.Right
When some node to be tested is tested, it may be necessary to using the test result of other nodes, these nodes be properly termed as this to
The testing advanced node of test node.
Summary of the invention
This specification provides a kind of test method, and the method is applied to the operation system based on node test frame;
The business to be tested carried in the operation system includes several nodes to be tested with data referencing relationship;Wherein, described
The asynchronous completion test of several nodes to be tested, and test result write-in is subjected to data with several nodes to be tested and is docked
Data pool;The described method includes:
Receive the test instruction for the either objective test node in several nodes to be tested;
Instructed in response to the test, determine in several nodes to be tested whether include and the target detection node
There are the testing advanced nodes of data referencing relationship;
If including that there are the preposition of data referencing relationship with the target detection node in several nodes to be tested
Test node, then the inquiry test result corresponding with the testing advanced node from the data pool, and will at least inquire
The test result as test input the target detection node is tested.
This specification also provides a kind of test device, and described device is applied to the business system based on node test frame
System;The business to be tested carried in the operation system includes several nodes to be tested with data referencing relationship;Wherein, institute
The asynchronous completion test of several nodes to be tested is stated, and test result write-in and several nodes to be tested are subjected to data pair
The data pool connect;Described device includes:
Receiving module, the test for receiving the either objective test node being directed in several nodes to be tested refer to
It enables;
Determining module, in response to test instruction, determine in several nodes to be tested whether include and institute
State testing advanced node of the target detection node there are data referencing relationship;
Test module, if for including that there are data to draw with the target detection node in several nodes to be tested
With the testing advanced node of relationship, then the inquiry test result corresponding with the testing advanced node from the data pool, and
At least the target detection node is tested using the test result inquired as test input.
This specification also provides a kind of electronic equipment, and the electronic equipment includes:
Processor;
For storing the memory of machine-executable instruction;
Wherein, it can be held by reading and executing the machine corresponding with the control logic of user's registration of the memory storage
Row instruction, the processor are prompted to:
Receive the test instruction for the either objective test node in several nodes to be tested;
Instructed in response to the test, determine in several nodes to be tested whether include and the target detection node
There are the testing advanced nodes of data referencing relationship;
If including that there are the preposition of data referencing relationship with the target detection node in several nodes to be tested
Test node, then the inquiry test result corresponding with the testing advanced node from the data pool, and will at least inquire
The test result as test input the target detection node is tested.
In the above-mentioned technical solutions, several nodes to be tested as included by the business to be tested carried in operation system
It can asynchronous completion test;Also, test result write-in is subjected to the data that data are docked with several nodes to be tested
Pond;Therefore, when being tested for any node to be tested in the business to be tested, it is no longer necessary to which synchronous waiting is preposition
Node test completes test and obtains test result, but the survey of testing advanced node can be directly inquired from the data pool
Test result, and the test result of the testing advanced node inquired is inputted into the node to be tested as test and is tested, from
And the test run speed of test frame can be greatly promoted, the test for reducing test frame is time-consuming.
Detailed description of the invention
Fig. 1 is the configuration diagram of the relevant technologies interior joint test frame;
Fig. 2 is a kind of configuration diagram of node test frame shown in one exemplary embodiment of this specification;
Fig. 3 is a kind of flow chart of test method shown in one exemplary embodiment of this specification;
Fig. 4 is a kind of hardware structure diagram of test device place equipment shown in one exemplary embodiment of this specification;
Fig. 5 is a kind of block diagram of test device shown in one exemplary embodiment of this specification.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with this specification.On the contrary, they are only and such as institute
The example of the consistent device and method of some aspects be described in detail in attached claims, this specification.
It is only to be not intended to be limiting this explanation merely for for the purpose of describing particular embodiments in the term that this specification uses
Book.The "an" of used singular, " described " and "the" are also intended to packet in this specification and in the appended claims
Most forms are included, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein is
Refer to and includes that one or more associated any or all of project listed may combine.
It will be appreciated that though various information may be described using term first, second, third, etc. in this specification, but
These information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not taking off
In the case where this specification range, the first information can also be referred to as the second information, and similarly, the second information can also be claimed
For the first information.Depending on context, word as used in this " if " can be construed to " ... when " or
" when ... " or " in response to determination ".
This specification be intended to provide it is a kind of for the operation system based on node test frame, to being taken in the operation system
Several nodes to be tested included by the business to be tested carried carry out the technical solution of asynchronous test.
Specifically, for the either objective test node in above-mentioned several nodes to be tested, can determine this it is several to
In test node, including with the target detection node there are when the testing advanced node of data referencing relationship, if from respectively with this
It does node to be tested to carry out in the data pool of data docking, inquiry test result corresponding with the testing advanced node, and at least
It is inputted the test result inquired as test, which is tested.
Wherein, node test frame can be on the basis of the Floor layer Technology of SOFA frame, be based on above-mentioned business system
The business feature for the business to be tested carried in system provides the test frame of test output by the way of node;And it is to be measured
Examination node then can be business interface corresponding with the business to be tested carried in the operation system, by calling these business to connect
Mouth can execute the business to be tested.
In the above-mentioned technical solutions, several nodes to be tested as included by the business to be tested carried in operation system
It can asynchronous completion test;Also, test result write-in is subjected to the data that data are docked with several nodes to be tested
Pond;Therefore, when being tested for any node to be tested in the business to be tested, it is no longer necessary to which synchronous waiting is preposition
Node test completes test and obtains test result, but the survey of testing advanced node can be directly inquired from the data pool
Test result, and the test result of the testing advanced node inquired is inputted into the node to be tested as test and is tested, from
And the test run speed of test frame can be greatly promoted, the test for reducing test frame is time-consuming.
Referring to FIG. 1, Fig. 1 is the configuration diagram of the relevant technologies interior joint test frame.
As shown in Figure 1, the business to be tested carried in the operation system based on the node test frame may include section
Point 1, node 2 and node 3.When testing node 1, need to utilize interface parameters corresponding with node 1;To node 2
When being tested, then the test result using node 1, and interface parameters corresponding with node 1 are needed;And to node 3 into
When row test, the test result using node 2, and interface parameters corresponding with node 3 are needed.In this case, it is inciting somebody to action
Node 3 is determined as target detection node when being tested, and node 1 and node 2 are the testing advanced node of node 3.
In the related technology, it is instructed according to the test of user, when node 3 being determined as target detection node being tested,
Interface parameters corresponding with node 1 can be inputted first as test, node 1 is tested, the test knot of node 1 is obtained
Fruit;Then can will interface parameters corresponding with node 2 and node 1 test result as test input, to node 2 into
Row test, obtains the test result of node 2;Finally can will interface parameters corresponding with node 3 and node 2 test knot
Fruit is tested node 3, as test input to complete this test.
Due to when testing node 3, needing synchronous waiting node 1 and the test of node 2 to complete, therefore to node 3
Test usually require to consume a longer time, testing efficiency is low.On the other hand, if any one in node 1 and node 2
Test crash can not then continue to test node 3, and when restarting to test node 3, it is also desirable to it is again right
Node 1 and node 2 are tested, to obtain the test result of node 1 and node 2, one of the test input as node 3
Point.
To solve the above-mentioned problems, this specification provides a kind of test method and device, electronic equipment.
Referring to FIG. 2, the framework that Fig. 2 is a kind of node test frame shown in one exemplary embodiment of this specification shows
It is intended to.
As shown in Fig. 2, the business to be measured carried in the operation system based on the node test frame may include section
Point 1, node 2 and node 3.Wherein, node 1, node 2 and node 3 can be with asynchronous executions, i.e., when testing node 3, no
It needs that node 1 and/or node 2 is waited to test again and completes;Furthermore, it is possible to test simultaneously multiple nodes.
On the other hand, node 1, node 2 and node 3 can be docked with pre-set data pool progress data respectively.
Referring to FIG. 3, Fig. 3 is a kind of flow chart of test method shown in one exemplary embodiment of this specification.
Above-mentioned test method can be applied to the operation system based on node test frame shown in Fig. 2, including as follows
Step:
Step 302, the test instruction for the either objective test node in several nodes to be tested is received.
In the present embodiment, above-mentioned operation system can export test page to user, can be in the test page
User shows node to be tested included by the business to be tested carried in the operation system, and user can be from these sections to be tested
It selects a node to be tested as target detection node in point, and clicks " test " button shown in the test page.
When detecting that user is directed to the clicking operation of " test " button, the test received for the target detection node can be determined
Instruction tests the target detection node so as to be instructed based on the test.By taking Fig. 2 as an example, the operation system to
In the test page of user's output, node 1, node 2 and node 3 can be shown, it is assumed that user selects node 3 as target detection
Node can be instructed then when detecting that user is directed to the clicking operation of " test " button based on the test for node 3, right
Node 3 is tested.
On the other hand, it if when the target detection node for selecting user is tested, needs to survey using with the target
The corresponding interface parameters of node is tried, then user can also input that target detection node is corresponding connects with this by the test page
Mouth parameter.
It, can also be when reaching preset trigger condition, by corresponding section to be tested in a kind of embodiment shown
Point is determined as target detection node, and triggers the test instruction generated for the target detection node.Continue by taking Fig. 2 as an example, it is false
Target can be determined as node 3 then when reaching morning 8:00 provided with the trigger condition of " morning 8:00 " by being set as node 3
Test node, and trigger the test instruction generated for node 3.
Step 304, instructed in response to the test, determine in several nodes to be tested whether include and the target
There are the testing advanced nodes of data referencing relationship for test node.
Determine that can be based on should when receiving the test instruction for above-mentioned target detection node in abovementioned steps 302
Test instruction is responded.Specifically, it is instructed in response to the test, it can be determined that the industry to be tested carried in above-mentioned operation system
In the included node to be tested of business, if including there are the testing advanced sections of data referencing relationship with the target detection node
Point.
By taking Fig. 2 as an example, it is assumed that when testing node 1, need to utilize interface parameters corresponding with node 1;Right
When node 2 is tested, then the test result using node 1, and interface parameters corresponding with node 1 are needed;And to section
When point 3 is tested, the test result using node 2, and interface parameters corresponding with node 3 are needed, then in such case
Under, when node 2 being determined as target detection node being tested, node 1 is that there are data referencing relationships with node 2
Testing advanced node;And when node 3 being determined as target detection node being tested, node 2 is that there are data with node 3
The testing advanced node of adduction relationship.
On the other hand, if when testing some node to be tested, it is no longer necessary to utilize other nodes to be tested
Test result, then explanation is not present and the target when the node to be tested being determined as target detection node being tested
There are the testing advanced nodes of data referencing relationship for test node.
It, can be according to the node of the node to be tested for some node to be tested in a kind of embodiment shown
Attribute judges the test result using other nodes to be tested whether is needed when testing the node to be tested, and really
The testing advanced node of the fixed node to be tested.It should be noted that the testing advanced node of some node to be tested can have
It is multiple, can also only have one.
Step 306, if including that there are data referencing passes with the target detection node in several nodes to be tested
The testing advanced node of system, then the inquiry test result corresponding with the testing advanced node from the data pool, and at least
The target detection node is tested using the test result inquired as test input.
According to the judging result in abovementioned steps 304, if it is determined that the business institute to be tested carried in above-mentioned operation system
Including node to be tested in, then can be with including there are the testing advanced nodes of data referencing relationship with the target detection node
From being carried out in the data pool that data are docked with each node to be tested respectively, inquiry test knot corresponding with the testing advanced node
Fruit, and the corresponding test result of the testing advanced node inquired is inputted as the test of the target detection node, to this
Target detection node is tested.
Alternatively, if when testing the target detection node, it is also necessary to utilize corresponding with the target detection node
Interface parameters, then the corresponding test result of the testing advanced node that can will be inquired, and with the target detection node
Corresponding interface parameters is inputted as the test of the target detection node, is tested the target detection node.
In a kind of embodiment shown, if it is determined that included by the business to be tested carried in above-mentioned operation system
It does not include with the target detection node there are the testing advanced node of data referencing relationship in node to be tested, then it can be direct
The target detection node is tested;Alternatively, can will interface parameters corresponding with the target detection node as the target
The test of test node inputs, and tests the target detection node.
In a kind of embodiment shown, the survey to above-mentioned target detection node (first object test node) is completed
After examination, the test result of the available target detection node, and the test result for the target detection node that will acquire is different
Above-mentioned data pool is written in step, i.e., after completing to the test of some target detection node, the target that can directly will acquire
The data pool is written in the test result of test node.
In this way, it is subsequent when testing another target detection node (the second target detection node), if necessary to benefit
With the test result of preceding aim test node (first object test node), (i.e. first object test node is the survey of the second target
Try the testing advanced node of node), then test corresponding with the first object test node can be inquired from the data pool
As a result, so as to directly using the corresponding test result of first object test node inquired as second target detection
A part of the test input of node, tests the second target detection node.
In a kind of embodiment shown, in order to realize after completing to the test of some target detection node, it will obtain
The data pool docked with the target detection node is written in the test result of the target detection node got, can with this
Blocker is set in the corresponding test case of target detection node.In this way, after completing to the test of the target detection node, it can
To intercept the test knot of the target detection node based on the blocker carried in test case corresponding with the target detection node
Fruit.It is subsequent, it can be by the test result asynchronous write for the target detection node the intercepted data pool.
In a kind of embodiment shown, be written and the target detection by the test result of some target detection node
When the data pool that node is docked, the testing attribute of the target detection node can be marked for the test result.Wherein, it tests
Attribute can be the node ID of the target detection node or the data characteristics of the corresponding test data of target detection node,
Such as: application scenarios belonging to the corresponding test data of target detection node etc., this specification to this with no restriction.
In this way, being directed to some node to be tested, can be judged according to the nodal community of the node to be tested to be measured to this
Whether examination node needs the test result using other nodes to be tested when being tested, and determines the test result for needing to utilize
The testing attribute of corresponding test node.It is subsequent, it, can when the node to be tested being determined as target detection node being tested
To inquire the test result that the target detection node needs to utilize according to the testing attribute, and will inquiry from above-mentioned data pool
The test result arrived is inputted as the test of the target detection node, is tested the target detection node.
In the above-mentioned technical solutions, several nodes to be tested as included by the business to be tested carried in operation system
It can asynchronous completion test;Also, test result write-in is subjected to the data that data are docked with several nodes to be tested
Pond;Therefore, when being tested for any node to be tested in the business to be tested, it is no longer necessary to which synchronous waiting is preposition
Node test completes test and obtains test result, but the survey of testing advanced node can be directly inquired from the data pool
Test result, and the test result of the testing advanced node inquired is inputted into the node to be tested as test and is tested, from
And the test run speed of test frame can be greatly promoted, the test for reducing test frame is time-consuming.
Corresponding with the embodiment of aforementioned test method, this specification additionally provides the embodiment of test device.
The embodiment of this specification test device can be using on an electronic device.Installation practice can pass through software reality
It is existing, it can also be realized by way of hardware or software and hardware combining.Taking software implementation as an example, as on a logical meaning
Device is to be read computer program instructions corresponding in nonvolatile memory by the processor of electronic equipment where it
Operation is formed in memory.For hardware view, as shown in figure 4, for the one of this specification test device place electronic equipment
Kind hardware structure diagram, other than processor shown in Fig. 4, memory, network interface and nonvolatile memory, embodiment
Electronic equipment where middle device can also include other hardware, repeat no more to this generally according to the actual functional capability of the test.
Referring to FIG. 5, Fig. 5 is a kind of block diagram of test device shown in one exemplary embodiment of this specification.The device
500 can be applied to electronic equipment shown in Fig. 4, which can be in the operation system based on node test frame
Electronic equipment;The business to be tested carried in the operation system includes several sections to be tested with data referencing relationship
Point;Wherein, the asynchronous completion test of several nodes to be tested, and test result is written and several nodes to be tested
Carry out the data pool of data docking;The device 500 may include:
Receiving module 501, for receiving the survey for the either objective test node being directed in several nodes to be tested
Examination instruction;
Determining module 502, in response to test instruction, determine in several nodes to be tested whether include with
There are the testing advanced nodes of data referencing relationship for the target detection node;
Test module 503, if for including that there are numbers with the target detection node in several nodes to be tested
According to the testing advanced node of adduction relationship, then the inquiry test knot corresponding with the testing advanced node from the data pool
Fruit, and at least the target detection node is tested using the test result inquired as test input.
In the present embodiment, blocker is equipped in test case corresponding with the target detection node;
Described device 500 can also include:
Writing module 504 for intercepting the test result of the target detection node based on the blocker, and will intercept
The data pool is written in the test result arrived.
In the present embodiment, the test result stored in the data pool, is marked with the test of corresponding test node
Attribute;
The test module 503 specifically can be used for:
Using the testing attribute of the testing advanced node as search index, from the data pool inquiry with it is described preposition
The corresponding test result of test node.
In the present embodiment, several nodes to be tested are business interface corresponding with the business to be tested.
In the present embodiment, the operation system is distributed system.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus
Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with
It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual
The purpose for needing to select some or all of the modules therein to realize this specification scheme.Those of ordinary skill in the art are not
In the case where making the creative labor, it can understand and implement.
System, device, module or the module that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can
To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of any several equipment.
Corresponding with the embodiment of aforementioned test method, this specification additionally provides the embodiment of a kind of electronic equipment.It should
Electronic equipment includes: processor and the memory for storing machine-executable instruction;Wherein, processor and memory are usual
It is connected with each other by internal bus.In other possible implementations, the equipment is also possible that external interface, with can
It is communicated with other equipment or component.
In the present embodiment, by reading and executing the corresponding with the control logic of user's registration of the memory storage
Machine-executable instruction, the processor are prompted to:
Receive the test instruction for the either objective test node in several nodes to be tested;
Instructed in response to the test, determine in several nodes to be tested whether include and the target detection node
There are the testing advanced nodes of data referencing relationship;
If including that there are the preposition of data referencing relationship with the target detection node in several nodes to be tested
Test node, then the inquiry test result corresponding with the testing advanced node from the data pool, and will at least inquire
The test result as test input the target detection node is tested.
In the present embodiment, blocker is equipped in test case corresponding with the target detection node;
By the executable finger of machine corresponding with the control logic of user's registration for reading and executing the memory storage
It enables, the processor is also prompted to:
The test result of the target detection node is intercepted based on the blocker, and the test result intercepted is written
The data pool.
In the present embodiment, the test result stored in the data pool, is marked with the test of corresponding test node
Attribute;
By the executable finger of machine corresponding with the control logic of user's registration for reading and executing the memory storage
It enables, the processor is prompted to:
Using the testing attribute of the testing advanced node as search index, from the data pool inquiry with it is described preposition
The corresponding test result of test node.
In the present embodiment, several nodes to be tested are business interface corresponding with the business to be tested.
In the present embodiment, the operation system is distributed system.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to this specification
Other embodiments.This specification is intended to cover any variations, uses, or adaptations of this specification, these modifications,
Purposes or adaptive change follow the general principle of this specification and undocumented in the art including this specification
Common knowledge or conventional techniques.The description and examples are only to be considered as illustrative, the true scope of this specification and
Spirit is indicated by the following claims.
It should be understood that this specification is not limited to the precise structure that has been described above and shown in the drawings,
And various modifications and changes may be made without departing from the scope thereof.The range of this specification is only limited by the attached claims
System.
The foregoing is merely the preferred embodiments of this specification, all in this explanation not to limit this specification
Within the spirit and principle of book, any modification, equivalent substitution, improvement and etc. done should be included in the model of this specification protection
Within enclosing.