CN110688301A - Server testing method and device, storage medium and computer equipment - Google Patents

Server testing method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN110688301A
CN110688301A CN201910780190.6A CN201910780190A CN110688301A CN 110688301 A CN110688301 A CN 110688301A CN 201910780190 A CN201910780190 A CN 201910780190A CN 110688301 A CN110688301 A CN 110688301A
Authority
CN
China
Prior art keywords
behavior
server
state
node
tested
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910780190.6A
Other languages
Chinese (zh)
Other versions
CN110688301B (en
Inventor
王宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Koubei Network Technology Co Ltd
Original Assignee
Zhejiang Koubei Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Koubei Network Technology Co Ltd filed Critical Zhejiang Koubei Network Technology Co Ltd
Priority to CN201910780190.6A priority Critical patent/CN110688301B/en
Publication of CN110688301A publication Critical patent/CN110688301A/en
Application granted granted Critical
Publication of CN110688301B publication Critical patent/CN110688301B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Abstract

The invention discloses a server testing method, a server testing device, a storage medium and computer equipment, relates to the technical field of information, and mainly aims to reduce the testing cost of a server and improve the testing efficiency of the server. The method comprises the following steps: acquiring and operating a behavior tree of an intelligent hardware device corresponding to a server to be tested, wherein the behavior tree is generated based on a preset behavior tree generation template, each state of the intelligent hardware device and each behavior; and simulating each interaction process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree, and testing the server to be tested. The invention is suitable for testing the server.

Description

Server testing method and device, storage medium and computer equipment
Technical Field
The present invention relates to the field of information technologies, and in particular, to a server testing method, apparatus, storage medium, and computer device.
Background
With the progress of science and technology and the arrival of 5G, the Internet of things appears, wherein intelligent hardware equipment is an important ring in the Internet of things, and the appearance of various intelligent hardware equipment meets the working and living needs of people, such as an intelligent cooking machine, an intelligent food cabinet and an intelligent milk tea making machine. In order to ensure that the intelligent hardware device can meet actual use requirements when being formally online during development of the intelligent hardware device, a server for scheduling or controlling the intelligent hardware device generally needs to be tested, for example, the stability or portability of the server is tested.
At present, because it is difficult to have enough space to build a real environment of the intelligent hardware equipment, the server is usually tested by using test scripts of each interface of the intelligent hardware equipment. However, if the server is tested in the above manner, a tester needs to compile an interface test script, and the ability of the tester to compile the interface test script is high, so that the tester needs to learn a script development language in advance or master the script development language, and needs to know the internal implementation of the server, and then the compiling and creating of the test case can be realized, which causes high testing cost of the server and low testing efficiency of the server.
Disclosure of Invention
In view of this, the present invention provides a server testing method, an apparatus, a storage medium, and a computer device, and mainly aims to implement a behavior tree based on an intelligent hardware device, perform black box testing on a server without knowing internal implementation of a server and writing a test script, so that cost of server testing can be reduced, and testing efficiency of the server can be improved.
According to a first aspect of the present invention, there is provided a server testing method, including:
acquiring and operating a behavior tree of an intelligent hardware device corresponding to a server to be tested, wherein the behavior tree is generated based on a preset behavior tree generation template, each state of the intelligent hardware device and each behavior;
and simulating each interaction process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree, and testing the server to be tested.
Optionally, the simulating, by polling each state node and each behavior node in the behavior tree, each interaction process of the intelligent hardware device with the server to be tested includes:
polling a first state node in the behavior tree, and reporting a state corresponding to the first state node to the server to be tested, wherein the server to be tested is used for issuing a behavior execution instruction according to the state corresponding to the first state node;
according to the fact that the behavior execution instruction contains a first behavior identifier to be executed, inquiring a corresponding first behavior node from the behavior tree and executing;
and after the first action node is executed, continuously polling other state nodes, and continuously executing other action nodes according to the action execution instruction sent by the server to be tested until the test on the server to be tested is executed.
Optionally, the simulating each interaction process between the intelligent hardware device and the server to be tested by polling each state node and each behavior node in the behavior tree, and the simulating each interaction process between the intelligent hardware device and the server to be tested, includes:
if the polled state node is an initial state node, executing a connection behavior node to simulate the intelligent hardware equipment to submit identity verification information and connection information to the server to be tested, and setting the state to be a connected state;
if the polled state node is a connected state node, executing an initialization behavior node to simulate the intelligent hardware equipment to submit equipment information to the server to be tested, and setting the state to be an initialization completion state;
if the polled state node is an initialized state node, executing a manufacturing task request behavior node to simulate the intelligent hardware equipment to request a manufacturing task from the server to be tested, if the manufacturing task exists, starting manufacturing, and setting the state to be a manufacturing state, and if the manufacturing task does not exist, setting the state to be an idle state;
if the polled state node is an idle state node, executing a manufacturing task request behavior node to simulate the intelligent hardware equipment to request a manufacturing task from the server to be tested, if the manufacturing task exists, starting manufacturing, and setting the state to be a manufacturing state, and if the manufacturing task does not exist, setting the state to be an idle state;
and if the polled state node is a manufacturing state node, executing a manufacturing behavior node to simulate the intelligent hardware equipment to execute a manufacturing process, reporting manufacturing task completion information to the server to be tested, and setting the state to be an idle state until the test on the server to be tested is completed.
Optionally, running the behavior tree of the intelligent hardware device corresponding to the server to be tested includes:
if the server to be tested needs to be subjected to pressure testing, simultaneously operating a plurality of behavior trees of the intelligent hardware equipment;
the simulating each interaction process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree comprises:
and polling each state node and each behavior node in the behavior trees through a plurality of threads respectively, and simulating each interactive process of the intelligent hardware equipment and the server to be tested respectively.
Optionally, obtaining a behavior tree of the intelligent hardware device corresponding to the server to be tested includes:
acquiring a work flow chart of the intelligent hardware equipment;
analyzing the workflow diagram to obtain each state and each behavior;
and correspondingly filling and packaging each state and each behavior into each state node and each behavior node of the preset behavior tree generation template to obtain the behavior tree.
Optionally, obtaining a behavior tree of the intelligent hardware device corresponding to the server to be tested includes:
outputting a preset behavior tree generation template;
receiving the states and the behaviors input through the preset behavior tree generation template;
and correspondingly filling and packaging each state and each behavior into each state node and each behavior node of the preset behavior tree generation template to obtain the behavior tree.
Further, after simulating each interaction process of the intelligent hardware device with the server to be tested by polling each state node and each behavior node in the behavior tree, the method further includes:
recording the actual execution result of each behavior node;
and generating a test report of the server to be tested according to the expected result and the actual execution result of each behavior node.
According to a second aspect of the present invention, there is provided a server testing apparatus comprising:
the device comprises an acquisition unit, a comparison unit and a comparison unit, wherein the acquisition unit is used for acquiring a behavior tree of the intelligent hardware equipment corresponding to the server to be tested, and the behavior tree is generated based on a preset behavior tree generation template, each state and each behavior of the intelligent hardware equipment;
a running unit for running the behavior tree;
and the testing unit is used for simulating each interaction process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree, and testing the server to be tested.
Optionally, the test unit is specifically configured to poll a first state node in the behavior tree, and report a state corresponding to the first state node to the server to be tested, where the server to be tested is configured to issue a behavior execution instruction according to the state corresponding to the first state node; according to the fact that the behavior execution instruction contains a first behavior identifier to be executed, inquiring a corresponding first behavior node from the behavior tree and executing; and after the first action node is executed, continuously polling other state nodes, and continuously executing other action nodes according to the action execution instruction sent by the server to be tested until the test on the server to be tested is executed.
Optionally, the test unit is specifically configured to execute a connection behavior node if the polled state node is an initial state node, so as to simulate the intelligent hardware device to submit authentication information and connection information to the server to be tested, and set the state to be a connected state;
if the polled state node is a connected state node, executing an initialization behavior node to simulate the intelligent hardware equipment to submit equipment information to the server to be tested, and setting the state to be an initialization completion state;
if the polled state node is an initialized state node, executing a manufacturing task request behavior node to simulate the intelligent hardware equipment to request a manufacturing task from the server to be tested, if the manufacturing task exists, starting manufacturing, and setting the state to be a manufacturing state, and if the manufacturing task does not exist, setting the state to be an idle state;
if the polled state node is an idle state node, executing a manufacturing task request behavior node to simulate the intelligent hardware equipment to request a manufacturing task from the server to be tested, if the manufacturing task exists, starting manufacturing, and setting the state to be a manufacturing state, and if the manufacturing task does not exist, setting the state to be an idle state;
and if the polled state node is a manufacturing state node, executing a manufacturing behavior node to simulate the intelligent hardware equipment to execute a manufacturing process, reporting manufacturing task completion information to the server to be tested, and setting the state to be an idle state until the test on the server to be tested is completed.
Optionally, the running unit is specifically configured to run the plurality of behavior trees of the intelligent hardware device simultaneously if the server to be tested needs to be subjected to a stress test;
the testing unit is specifically configured to poll each state node and each behavior node in the behavior trees through a plurality of threads, and simulate each interaction process between the intelligent hardware device and the server to be tested.
Optionally, the obtaining unit is specifically configured to obtain a workflow diagram of the intelligent hardware device; analyzing the workflow diagram to obtain each state and each behavior; and correspondingly filling and packaging each state and each behavior into each state node and each behavior node of the preset behavior tree generation template to obtain the behavior tree.
Optionally, the obtaining unit is specifically configured to output a preset behavior tree generation template; receiving the states and the behaviors input through the preset behavior tree generation template; and correspondingly filling and packaging each state and each behavior into each state node and each behavior node of the preset behavior tree generation template to obtain the behavior tree.
Further, the apparatus further comprises:
the recording unit is used for recording the actual execution result of each behavior node;
and the generating unit is used for generating a test report of the server to be tested according to the expected result and the actual execution result of each behavior node.
The invention provides a server testing method, a device, a storage medium and computer equipment, compared with the prior method for testing a server by utilizing each interface testing script of intelligent hardware equipment, the method can generate a behavior tree of the intelligent hardware equipment in advance based on a preset behavior tree generation template, each state and each behavior of the intelligent hardware equipment, can acquire and operate the behavior tree of the intelligent hardware equipment corresponding to the server to be tested when the server needs to be tested, can simulate each interactive process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree, and test the server to be tested, thereby being capable of carrying out black box test on the server without acquiring the internal implementation of a service end and compiling the testing script, and further reducing the cost of the server testing, the testing efficiency of the server is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flow chart illustrating a server testing method according to an embodiment of the present invention;
FIG. 2 is a state flow diagram illustrating a behavior tree of an intelligent hardware device according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a server testing framework provided by an embodiment of the invention;
FIG. 4 is a schematic diagram illustrating a behavior tree of an intelligent hardware device according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram illustrating a server testing apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of another server testing apparatus provided in an embodiment of the present invention;
fig. 7 shows a physical structure diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As described in the background art, at present, because it is difficult to have enough space to build a real environment of an intelligent hardware device, a server is usually tested by using test scripts of each interface of the intelligent hardware device. However, if the server is tested in the above manner, a tester needs to compile an interface test script, and the ability of the tester to compile the interface test script is high, so that the tester needs to learn a script development language in advance or master the script development language, and needs to know the internal implementation of the server, and then the compiling and creating of the test case can be realized, which causes high testing cost of the server and low testing efficiency of the server.
In order to solve the above technical problem, an embodiment of the present invention provides a server testing method, as shown in fig. 1, where the method includes:
101. and acquiring and operating a behavior tree of the intelligent hardware equipment corresponding to the server to be tested.
The intelligent hardware equipment can be intelligent hardware equipment connected to the Internet of things, and specifically can be an intelligent cooking machine, an intelligent meal cabinet, an intelligent milk tea making machine and the like. The server to be tested may be a server for controlling the intelligent hardware device, and the behavior tree may be generated based on a preset behavior tree generation template, each state of the intelligent hardware device, and each behavior. The behavior tree can be obtained by filling and packaging the states and the behaviors into the preset behavior tree generation template, and the behavior tree of the intelligent hardware equipment is generated through the preset behavior tree generation template, so that the construction and creation processes of the test case of the server can be simplified, and a test script does not need to be written. The states may be states of the intelligent hardware device during operation, and correspondingly, the behaviors may be behaviors of the intelligent hardware device during operation, each state has a behavior corresponding thereto, for example, if the state of the intelligent hardware device is an initial state node, a behavior corresponding to the intelligent hardware device to be executed may be a behavior of connecting a server, and if the state of the intelligent hardware device is a connected state node, a behavior corresponding to the intelligent hardware device to be executed may be an initialized behavior, and the like.
It should be noted that the execution subject testing apparatus in the embodiment of the present invention may be a testing client, or may also be a testing server, and if the testing apparatus is a testing client, the embodiment of the present invention may obtain a behavior tree corresponding to an intelligent hardware device according to an intelligent hardware device identifier when receiving a server testing instruction including the intelligent hardware device identifier. If the testing device is a testing server, the embodiment of the invention can acquire the behavior tree corresponding to the intelligent hardware equipment according to the intelligent hardware equipment identifier when receiving the testing request of the server carrying the intelligent hardware equipment identifier. After the behavior tree of the intelligent hardware device is obtained, the behavior tree of the intelligent hardware device can be automatically triggered to operate, for example, the behavior tree of the intelligent hardware device can be operated by triggering a behavior tree operation instruction.
102. And simulating each interaction process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree, and testing the server to be tested.
For the embodiment of the present invention, when polling the status node, the testing device may report the status corresponding to the polled status node to the to-be-tested server, so that the to-be-tested server may issue the behavior execution instruction according to the received status, after receiving the behavior execution instruction, the testing device searches and executes the behavior node corresponding to the behavior execution instruction, specifically, may extract the behavior code or file from the searched behavior node, and may implement the corresponding behavior of the simulated intelligent hardware device by executing the behavior code or file. For example, if the polled state node is an initial state node, the behavior execution instruction issued by the server to be tested according to the initial state may be: and initializing the instruction, wherein the test device can search the initialization code from the behavior tree after receiving the initialization instruction, can simulate the intelligent hardware equipment to submit the identity verification information and the connection information to the server to be tested by executing the initialization code, and set the state to be the connected state, so that the initialization simulation process of the intelligent hardware equipment can be completed, the initialization control code test of the server to be tested can be completed, and similarly, the test of other control codes of the server to be tested can be completed.
It should be noted that the behavior tree may be a state machine polling mechanism with a node being deeply traversed, the behavior tree may simply simulate the workflow and abnormal conditions of the intelligent hardware device, and may selectively simulate the state and behavior of the intelligent hardware device, and by polling the state and behavior of the intelligent hardware device, the control server corresponding to the intelligent hardware device may be continuously cycled for testing, and may be separated from the code warehouse, so as to implement black box testing of the server.
Compared with the prior art that the server is tested by utilizing each interface test script of the intelligent hardware equipment, the server testing method provided by the embodiment of the invention can generate the template based on the preset behavior tree, and the behavior tree of the intelligent hardware equipment is generated in advance by each state and each behavior of the intelligent hardware equipment, can acquire and operate the behavior tree of the intelligent hardware equipment corresponding to the server to be tested when the server is required to be tested, can simulate each interactive process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree, and test the server to be tested, so that the server can be tested in a black box mode without acquiring the internal implementation of a server end and writing the test script, and further can reduce the cost of the server test, the testing efficiency of the server is improved.
Further, in order to better describe the process of the server testing method, as a refinement and an extension of the above embodiment, the embodiment of the present invention provides several alternative embodiments, but is not limited thereto, and specifically, the following embodiments are provided:
for an optional embodiment of the present invention, in order to implement the testing of the server to be tested, the specific process of step 102 may include: polling a first state node in the behavior tree, and reporting a state corresponding to the first state node to the server to be tested, wherein the server to be tested is used for issuing a behavior execution instruction according to the state corresponding to the first state node; according to the fact that the behavior execution instruction contains a first behavior identifier to be executed, inquiring a corresponding first behavior node from the behavior tree and executing; and after the first action node is executed, continuously polling other state nodes, and continuously executing other action nodes according to the action execution instruction sent by the server to be tested until the test on the server to be tested is executed.
It should be noted that the behavior tree may include a start node, a state judgment node, a state node, a behavior node, and a flow node, and the behavior tree may be polled from the start node, then the state judgment node is polled, and the first state node and other state nodes except the first state node are polled according to the state parameters of the state judgment node. In addition, after the behavior node is executed, the state of the intelligent hardware device can be modified, and after the state is modified, the testing device can continue to poll other state nodes.
In a specific application scenario, as shown in fig. 2 and fig. 3, if the state nodes are: an initial state node, a connected state node, an initialized state node, an idle state node, and a manufacturing state node, the specific process of step 102 may include:
if the polled state node is an initial state node, executing a connection behavior node to simulate the intelligent hardware equipment to submit identity verification information and connection information to the server to be tested, and setting the state to be a connected state;
if the polled state node is a connected state node, executing an initialization behavior node to simulate the intelligent hardware equipment to submit equipment information to the server to be tested, and setting the state to be an initialization completion state;
if the polled state node is an initialized state node, executing a manufacturing task request behavior node to simulate the intelligent hardware equipment to request a manufacturing task from the server to be tested, if the manufacturing task exists, starting manufacturing, and setting the state to be a manufacturing state, and if the manufacturing task does not exist, setting the state to be an idle state;
if the polled state node is an idle state node, executing a manufacturing task request behavior node to simulate the intelligent hardware equipment to request a manufacturing task from the server to be tested, if the manufacturing task exists, starting manufacturing, and setting the state to be a manufacturing state, and if the manufacturing task does not exist, setting the state to be an idle state;
and if the polled state node is a manufacturing state node, executing a manufacturing behavior node to simulate the intelligent hardware equipment to execute a manufacturing process, reporting manufacturing task completion information to the server to be tested, and setting the state to be an idle state until the test on the server to be tested is completed. The manufacturing process can comprise the following steps: the sub-step 1, the sub-step 2, the sub-step 3, the sub-step N, and the like may be performed in the order of the sub-steps.
Specifically, a connection server code may be extracted from the connection behavior node, so as to simulate the intelligent hardware device to submit authentication information and connection information to the server to be tested, and set the state to the connected state. The initialization code can be extracted from the initialization behavior node, so that the intelligent hardware equipment is simulated to submit equipment information to the server to be tested, and the state is set to be the initialization completion state. The method can extract a manufacturing task request code from a manufacturing task request behavior node, so as to simulate the intelligent hardware equipment to request a manufacturing task from the server to be tested, if the manufacturing task exists, the manufacturing is started, the state is set to be a manufacturing state, and if the manufacturing task does not exist, the state is set to be an idle state. The manufacturing behavior node can be manufactured to extract a manufacturing code, so that the intelligent hardware equipment is simulated to execute a manufacturing process, manufacturing task completion information is reported to the server to be tested, and the state is set to be an idle state until the test on the server to be tested is completed.
As another alternative embodiment of the present invention, as shown in fig. 4, in order to improve the pressure testing efficiency, when the server to be tested needs to be pressure tested, a plurality of behavior trees of the intelligent hardware device may be run simultaneously, and then a plurality of threads are used to poll each state node and each behavior node in the plurality of behavior trees, so as to simulate each interactive process between the intelligent hardware device and the server to be tested.
For another optional embodiment of the present invention, two ways of obtaining or generating a behavior tree of an intelligent hardware device corresponding to a server to be tested are also provided:
the first way may include: acquiring a work flow chart of the intelligent hardware equipment; analyzing the workflow diagram to obtain each state and each behavior; and correspondingly filling and packaging each state and each behavior into each state node and each behavior node of the preset behavior tree generation template to obtain the behavior tree. The process of analyzing the workflow diagram may be: and extracting each state and each behavior of the intelligent hardware equipment from the workflow diagram.
The second way may include: outputting a preset behavior tree generation template; receiving the states and the behaviors input through the preset behavior tree generation template; and correspondingly filling and packaging each state and each behavior into each state node and each behavior node of the preset behavior tree generation template to obtain the behavior tree. The states and the behaviors may be input by a user through a template displayed or output.
For another alternative embodiment of the present invention, in order to obtain the server test result and simplify the statistical and analysis process of the tester, the method further includes: recording the actual execution result of each behavior node; and generating a test report of the server to be tested according to the expected result and the actual execution result of each behavior node.
Further, as a specific implementation of fig. 1, an embodiment of the present invention provides a server testing apparatus, as shown in fig. 5, where the apparatus includes: an acquisition unit 21, an operation unit 22 and a test unit 22.
The obtaining unit 21 may be configured to obtain a behavior tree of the intelligent hardware device corresponding to the server to be tested, where the behavior tree is generated based on a preset behavior tree generation template, each state of the intelligent hardware device, and each behavior. The obtaining unit 21 is a main function module in the apparatus for obtaining a behavior tree of the intelligent hardware device corresponding to the server to be tested.
The running unit 22 may be configured to run the behavior tree. The operation unit 22 is a main functional module for operating the behavior tree in the device.
The testing unit 23 may be configured to simulate each interaction process between the intelligent hardware device and the server to be tested by polling each state node and each behavior node in the behavior tree, and test the server to be tested. The testing unit 23 is a main function module, which is also a core module, in the apparatus, for simulating each interaction process between the intelligent hardware device and the server to be tested by polling each state node and each behavior node in the behavior tree, and testing the server to be tested.
In a specific application scenario, the testing unit 21 may be specifically configured to poll a first state node in the behavior tree, and report a state corresponding to the first state node to the server to be tested, where the server to be tested is configured to issue a behavior execution instruction according to the state corresponding to the first state node; according to the fact that the behavior execution instruction contains a first behavior identifier to be executed, inquiring a corresponding first behavior node from the behavior tree and executing; and after the first action node is executed, continuously polling other state nodes, and continuously executing other action nodes according to the action execution instruction sent by the server to be tested until the test on the server to be tested is executed.
In a specific application scenario, the testing unit 23 may be specifically configured to execute a connection behavior node if the polled state node is an initial state node, so as to simulate the intelligent hardware device submitting authentication information and connection information to the server to be tested, and set the state to be a connected state;
if the polled state node is a connected state node, executing an initialization behavior node to simulate the intelligent hardware equipment to submit equipment information to the server to be tested, and setting the state to be an initialization completion state;
if the polled state node is an initialized state node, executing a manufacturing task request behavior node to simulate the intelligent hardware equipment to request a manufacturing task from the server to be tested, if the manufacturing task exists, starting manufacturing, and setting the state to be a manufacturing state, and if the manufacturing task does not exist, setting the state to be an idle state;
if the polled state node is an idle state node, executing a manufacturing task request behavior node to simulate the intelligent hardware equipment to request a manufacturing task from the server to be tested, if the manufacturing task exists, starting manufacturing, and setting the state to be a manufacturing state, and if the manufacturing task does not exist, setting the state to be an idle state;
and if the polled state node is a manufacturing state node, executing a manufacturing behavior node to simulate the intelligent hardware equipment to execute a manufacturing process, reporting manufacturing task completion information to the server to be tested, and setting the state to be an idle state until the test on the server to be tested is completed.
In a specific application scenario, the running unit 22 is specifically configured to run the plurality of behavior trees of the intelligent hardware device simultaneously if the server to be tested needs to be subjected to a stress test.
The testing unit 23 is specifically configured to poll each state node and each behavior node in the plurality of behavior trees through a plurality of threads, and simulate each interaction process between the intelligent hardware device and the server to be tested.
The running unit 22 is specifically configured to run a plurality of behavior trees of the intelligent hardware device at the same time if the server to be tested needs to be subjected to a stress test;
the testing unit 23 may be specifically configured to poll each state node and each behavior node in the behavior trees through a plurality of threads, and simulate each interaction process between the intelligent hardware device and the server to be tested.
For the embodiment of the present invention, the obtaining unit 21 may be specifically configured to obtain a workflow diagram of the intelligent hardware device; analyzing the workflow diagram to obtain each state and each behavior; and correspondingly filling and packaging each state and each behavior into each state node and each behavior node of the preset behavior tree generation template to obtain the behavior tree.
The obtaining unit 21 may be further configured to output a preset behavior tree generation template; receiving the states and the behaviors input through the preset behavior tree generation template; and correspondingly filling and packaging each state and each behavior into each state node and each behavior node of the preset behavior tree generation template to obtain the behavior tree.
For the embodiment of the present invention, in order to obtain the test result of the server and simplify the process of statistics and analysis performed by the tester, the apparatus further includes: a recording unit 24 and a generating unit 25, as shown in fig. 6.
The recording unit 24 may be configured to record actual execution results of the behavior nodes.
The generating unit 25 may be configured to generate a test report of the server to be tested according to the expected result and the actual execution result of each behavior node.
It should be noted that other corresponding descriptions of the functional modules related to the server testing apparatus provided in the embodiment of the present invention may refer to the corresponding description of the method shown in fig. 1, and are not described herein again.
Based on the method shown in fig. 1, correspondingly, an embodiment of the present invention further provides a storage medium, where at least one executable instruction is stored in the storage medium, where the executable instruction causes a processor to perform the following steps: acquiring and operating a behavior tree of an intelligent hardware device corresponding to a server to be tested, wherein the behavior tree is generated based on a preset behavior tree generation template, each state of the intelligent hardware device and each behavior; and simulating each interaction process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree, and testing the server to be tested.
Based on the above-mentioned embodiments of the method shown in fig. 1 and the apparatus shown in fig. 5, the embodiment of the present invention further provides a computer device, as shown in fig. 7, including a processor (processor)31, a communication Interface (communication Interface)32, a memory (memory)33, and a communication bus 34. Wherein: the processor 31, the communication interface 32, and the memory 33 communicate with each other via a communication bus 34. A communication interface 34 for communicating with network elements of other devices, such as clients or other servers. The processor 31 is configured to execute a program, and may specifically execute relevant steps in the above data conversion method embodiment. In particular, the program may include program code comprising computer operating instructions. The processor 31 may be a central processing unit CPU or a Specific integrated circuit asic (application Specific integrated circuit) or one or more integrated circuits configured to implement an embodiment of the present invention.
The terminal comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs. And a memory 33 for storing a program. The memory 33 may comprise a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory), such as at least one disk memory. The program may specifically be adapted to cause the processor 31 to perform the following operations: acquiring and operating a behavior tree of an intelligent hardware device corresponding to a server to be tested, wherein the behavior tree is generated based on a preset behavior tree generation template, each state of the intelligent hardware device and each behavior; and simulating each interaction process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree, and testing the server to be tested.
According to the technical scheme, the behavior tree of the intelligent hardware equipment can be generated in advance based on the preset behavior tree generation template, each state and each behavior of the intelligent hardware equipment, when the server needs to be tested, the behavior tree of the intelligent hardware equipment corresponding to the server to be tested can be obtained and operated, each interaction process of the intelligent hardware equipment and the server to be tested can be simulated by polling each state node and each behavior node in the behavior tree, the server to be tested is tested, black box testing can be carried out on the server, internal implementation of a server side is not required to be known, a testing script is not required to be written, testing cost of the server can be reduced, and testing efficiency of the server is improved.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be appreciated that the relevant features of the method and apparatus described above are referred to one another. In addition, "first", "second", and the like in the above embodiments are for distinguishing the embodiments, and do not represent merits of the embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in a server test apparatus according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (10)

1. A server testing method is characterized by comprising the following steps:
acquiring and operating a behavior tree of an intelligent hardware device corresponding to a server to be tested, wherein the behavior tree is generated based on a preset behavior tree generation template, each state of the intelligent hardware device and each behavior;
and simulating each interaction process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree, and testing the server to be tested.
2. The method of claim 1, wherein simulating each interaction process of the intelligent hardware device with the server to be tested by polling each state node and each behavior node in the behavior tree comprises:
polling a first state node in the behavior tree, and reporting a state corresponding to the first state node to the server to be tested, wherein the server to be tested is used for issuing a behavior execution instruction according to the state corresponding to the first state node;
according to the fact that the behavior execution instruction contains a first behavior identifier to be executed, inquiring a corresponding first behavior node from the behavior tree and executing;
and after the first action node is executed, continuously polling other state nodes, and continuously executing other action nodes according to the action execution instruction sent by the server to be tested until the test on the server to be tested is executed.
3. The method of claim 1, wherein simulating each interaction process of the intelligent hardware device with the server to be tested by polling each status node and each behavior node in the behavior tree, and simulating each interaction process of the intelligent hardware device with the server to be tested comprises:
if the polled state node is an initial state node, executing a connection behavior node to simulate the intelligent hardware equipment to submit identity verification information and connection information to the server to be tested, and setting the state to be a connected state;
if the polled state node is a connected state node, executing an initialization behavior node to simulate the intelligent hardware equipment to submit equipment information to the server to be tested, and setting the state to be an initialization completion state;
if the polled state node is an initialized state node, executing a manufacturing task request behavior node to simulate the intelligent hardware equipment to request a manufacturing task from the server to be tested, if the manufacturing task exists, starting manufacturing, and setting the state to be a manufacturing state, and if the manufacturing task does not exist, setting the state to be an idle state;
if the polled state node is an idle state node, executing a manufacturing task request behavior node to simulate the intelligent hardware equipment to request a manufacturing task from the server to be tested, if the manufacturing task exists, starting manufacturing, and setting the state to be a manufacturing state, and if the manufacturing task does not exist, setting the state to be an idle state;
and if the polled state node is a manufacturing state node, executing a manufacturing behavior node to simulate the intelligent hardware equipment to execute a manufacturing process, reporting manufacturing task completion information to the server to be tested, and setting the state to be an idle state until the test on the server to be tested is completed.
4. The method of claim 1, wherein running the behavior tree of the intelligent hardware device corresponding to the server to be tested comprises:
if the server to be tested needs to be subjected to pressure testing, simultaneously operating a plurality of behavior trees of the intelligent hardware equipment;
the simulating each interaction process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree comprises:
and polling each state node and each behavior node in the behavior trees through a plurality of threads respectively, and simulating each interactive process of the intelligent hardware equipment and the server to be tested respectively.
5. The method of claim 1, wherein obtaining the behavior tree of the intelligent hardware device corresponding to the server to be tested comprises:
acquiring a work flow chart of the intelligent hardware equipment;
analyzing the workflow diagram to obtain each state and each behavior;
and correspondingly filling and packaging each state and each behavior into each state node and each behavior node of the preset behavior tree generation template to obtain the behavior tree.
6. The method of claim 1, wherein obtaining the behavior tree of the intelligent hardware device corresponding to the server to be tested comprises:
outputting a preset behavior tree generation template;
receiving the states and the behaviors input through the preset behavior tree generation template;
and correspondingly filling and packaging each state and each behavior into each state node and each behavior node of the preset behavior tree generation template to obtain the behavior tree.
7. The method of claim 1, wherein after simulating each interaction process of the intelligent hardware device with the server under test by polling each state node and each behavior node in the behavior tree, the method further comprises:
recording the actual execution result of each behavior node;
and generating a test report of the server to be tested according to the expected result and the actual execution result of each behavior node.
8. A server testing apparatus, comprising:
the device comprises an acquisition unit, a comparison unit and a comparison unit, wherein the acquisition unit is used for acquiring a behavior tree of the intelligent hardware equipment corresponding to the server to be tested, and the behavior tree is generated based on a preset behavior tree generation template, each state and each behavior of the intelligent hardware equipment;
a running unit for running the behavior tree;
and the testing unit is used for simulating each interaction process of the intelligent hardware equipment and the server to be tested by polling each state node and each behavior node in the behavior tree, and testing the server to be tested.
9. A storage medium having a computer program stored thereon, the storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform operations corresponding to the server test method of any one of claims 1-7.
10. A computer device comprising a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus, and the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the server test according to any one of claims 1-7.
CN201910780190.6A 2019-08-22 2019-08-22 Server testing method and device, storage medium and computer equipment Active CN110688301B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910780190.6A CN110688301B (en) 2019-08-22 2019-08-22 Server testing method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910780190.6A CN110688301B (en) 2019-08-22 2019-08-22 Server testing method and device, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN110688301A true CN110688301A (en) 2020-01-14
CN110688301B CN110688301B (en) 2021-03-02

Family

ID=69108499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910780190.6A Active CN110688301B (en) 2019-08-22 2019-08-22 Server testing method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN110688301B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2386662A1 (en) * 2001-05-24 2002-11-24 Lincoln Global, Inc. System and method for facilitating welding system diagnostics
US20160155070A1 (en) * 2011-06-08 2016-06-02 Accenture Global Services Limited Decision tree machine learning
CN105656688A (en) * 2016-03-03 2016-06-08 腾讯科技(深圳)有限公司 State control method and device
CN106339302A (en) * 2016-08-22 2017-01-18 腾讯科技(深圳)有限公司 Test method and device for client
CN106899441A (en) * 2017-03-16 2017-06-27 网易(杭州)网络有限公司 Malfunctioning node localization method and device
CN107526682A (en) * 2017-08-16 2017-12-29 网易(杭州)网络有限公司 Generation method, device and the equipment of the AI behavior trees of test machine people
CN108283809A (en) * 2018-02-11 2018-07-17 腾讯科技(深圳)有限公司 Data processing method, device, computer equipment and storage medium
US10055516B1 (en) * 2014-06-27 2018-08-21 Sprint Comunications Company L.P. Testing open mobile alliance server payload on an open mobile alliance client simulator
CN108780303A (en) * 2016-03-03 2018-11-09 玛格兹诺有限公司 The control process of robot with behavior tree framework
CN109344059A (en) * 2018-09-20 2019-02-15 天津龙拳风暴科技有限公司 A kind of server stress test method and device
CN109460348A (en) * 2018-10-31 2019-03-12 网易(杭州)网络有限公司 The pressure of game server surveys method and apparatus
CN109684217A (en) * 2018-12-25 2019-04-26 网易(杭州)网络有限公司 A kind of method and device of computer games check, electronic equipment, storage medium
CN110083541A (en) * 2019-04-30 2019-08-02 网易(杭州)网络有限公司 Game test method, device, computer storage medium and electronic equipment

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2386662A1 (en) * 2001-05-24 2002-11-24 Lincoln Global, Inc. System and method for facilitating welding system diagnostics
US20160155070A1 (en) * 2011-06-08 2016-06-02 Accenture Global Services Limited Decision tree machine learning
US10055516B1 (en) * 2014-06-27 2018-08-21 Sprint Comunications Company L.P. Testing open mobile alliance server payload on an open mobile alliance client simulator
CN108780303A (en) * 2016-03-03 2018-11-09 玛格兹诺有限公司 The control process of robot with behavior tree framework
CN105656688A (en) * 2016-03-03 2016-06-08 腾讯科技(深圳)有限公司 State control method and device
CN106339302A (en) * 2016-08-22 2017-01-18 腾讯科技(深圳)有限公司 Test method and device for client
CN106899441A (en) * 2017-03-16 2017-06-27 网易(杭州)网络有限公司 Malfunctioning node localization method and device
CN107526682A (en) * 2017-08-16 2017-12-29 网易(杭州)网络有限公司 Generation method, device and the equipment of the AI behavior trees of test machine people
CN108283809A (en) * 2018-02-11 2018-07-17 腾讯科技(深圳)有限公司 Data processing method, device, computer equipment and storage medium
CN109344059A (en) * 2018-09-20 2019-02-15 天津龙拳风暴科技有限公司 A kind of server stress test method and device
CN109460348A (en) * 2018-10-31 2019-03-12 网易(杭州)网络有限公司 The pressure of game server surveys method and apparatus
CN109684217A (en) * 2018-12-25 2019-04-26 网易(杭州)网络有限公司 A kind of method and device of computer games check, electronic equipment, storage medium
CN110083541A (en) * 2019-04-30 2019-08-02 网易(杭州)网络有限公司 Game test method, device, computer storage medium and electronic equipment

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
JOSÉ ÁNGEL SEGURA-MUROS等: "Integration of an Automated Hierarchical Task Planner in ROS Using Behaviour Trees", 《2017 6TH INTERNATIONAL CONFERENCE ON SPACE MISSION CHALLENGES FOR INFORMATION TECHNOLOGY (SMC-IT)》 *
MADHUMITHA P等: "Application of Decision trees for the identification of weld central line in austenitic stainless steel weld joints", 《2014 INTERNATIONAL CONFERENCE ON COMPUTATION OF POWER, ENERGY, INFORMATION AND COMMUNICATION (ICCPEIC)》 *
李焜等: "MOBA游戏人工智能的设计与实现", 《电脑与信息技术》 *
李琳: "基于移动平台的动作游戏核心系统设计与实现", 《中国优秀硕士学位论文全文数据库·信息科技辑》 *

Also Published As

Publication number Publication date
CN110688301B (en) 2021-03-02

Similar Documents

Publication Publication Date Title
WO2016095554A1 (en) Test method, device and system for application
JP5324792B2 (en) System and method for verifying system operation
CN104268079B (en) A kind of method and system of POS Application testings
CN109302522A (en) Test method, device and computer system and medium
CN106648556B (en) Method and device for front-end and back-end integrated development test
CN110750458A (en) Big data platform testing method and device, readable storage medium and electronic equipment
CN111859832B (en) Chip simulation verification method and device and related equipment
CN108459850B (en) Method, device and system for generating test script
CN102567172A (en) Concurrent workload simulation for application performance testing
CN108111364B (en) Service system testing method and device
CN107992403B (en) IO performance test method, device, equipment and computer readable storage medium
CN111831542B (en) API application debugging method and device and storage medium
CN111258913A (en) Automatic algorithm testing method and device, computer system and readable storage medium
CN105607997A (en) Background service test method, apparatus and system for software product
CN112650676A (en) Software testing method, device, equipment and storage medium
CN110888805A (en) RESTful API playback test method and system
CN112256944A (en) Automatic website data crawling method based on JMeter
CN107622017A (en) A kind of analytic method of general automation software test
CN109684177A (en) Information feedback method and device
CN110688301B (en) Server testing method and device, storage medium and computer equipment
CN117370203A (en) Automatic test method, system, electronic equipment and storage medium
CN114546814A (en) Recording playback method, recording playback device and storage medium
CN112433953A (en) Embedded automatic testing method, device, equipment and medium based on network game client
CN111708712A (en) User behavior test case generation method, flow playback method and electronic equipment
CN111190786A (en) UVM-based test framework, test platform and test method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant