CN109985387B - Automatic testing method and device - Google Patents

Automatic testing method and device Download PDF

Info

Publication number
CN109985387B
CN109985387B CN201910227885.1A CN201910227885A CN109985387B CN 109985387 B CN109985387 B CN 109985387B CN 201910227885 A CN201910227885 A CN 201910227885A CN 109985387 B CN109985387 B CN 109985387B
Authority
CN
China
Prior art keywords
state
operation state
virtual object
client
virtual
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.)
Active
Application number
CN201910227885.1A
Other languages
Chinese (zh)
Other versions
CN109985387A (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201910227885.1A priority Critical patent/CN109985387B/en
Publication of CN109985387A publication Critical patent/CN109985387A/en
Application granted granted Critical
Publication of CN109985387B publication Critical patent/CN109985387B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides an automatic testing method and device, wherein the method comprises the following steps: the method comprises the steps of obtaining a protocol log generated when a first game is operated from a game client, obtaining a first operation state of a virtual object in the virtual client, determining whether the virtual object is adjusted to be a second operation state from the first operation state or not according to the first operation state and the protocol log, wherein the second operation state is the next state of the first operation state, and if yes, adjusting the virtual object to be the second operation state from the first operation state, so that the virtual client is used for completing automatic testing of the first game, and testing efficiency is improved.

Description

Automatic testing method and device
Technical Field
The embodiment of the invention relates to the technical field of automatic testing, in particular to an automatic testing method and device.
Background
In the game development iteration process, the verification and the test of game functions are necessary, and the test efficiency of the game can be improved by adopting an automatic test, wherein the automatic test is a process for converting a test behavior driven by human into machine execution.
In the current game automation test scheme, an AirTest is usually adopted to identify icons in a game, a preset click logic is run, and some simple tests are completed, however, for some First-person perspective Shooting games (FPSs), since these games cannot be completed through simple click and sliding states, it is difficult to perform automation tests through a preset script, and therefore, the AirTest cannot be completed.
Disclosure of Invention
The embodiment of the invention provides an automatic testing method and device, which are used for realizing automatic testing and improving the game testing efficiency.
In a first aspect, an embodiment of the present invention provides an automated testing method, including:
acquiring a protocol log generated when a first game is operated from a game client;
acquiring a first operating state of a virtual object in the virtual client;
determining whether to adjust the virtual object from the first operating state to a second operating state according to the first operating state and a protocol log, wherein the second operating state is the next state of the first operating state;
if yes, the virtual object is adjusted from the first operation state to the second operation state.
Optionally, the determining whether to adjust the virtual object from the first operating state to the second operating state according to the first operating state and the protocol log includes:
determining a second operating state of the virtual object according to the first operating state and the protocol log;
and determining whether to adjust the virtual object from the first operating state to the second operating state according to the first operating state and the second operating state.
Optionally, the determining whether to adjust the virtual object from the first operating state to the second operating state according to the first operating state and the second operating state includes:
sending the first operating state to a server, and receiving a first message returned by the server, wherein the first message comprises a check result of the first operating state and a target state of the virtual object;
and if the verification result indicates that the verification is passed and the target state is consistent with the second operation state, determining to adjust the virtual object from the first operation state to the second operation state.
Optionally, the method further includes:
and if the verification result indicates that the verification is not passed and/or the target state is inconsistent with the second operation state, keeping the state of the virtual object as the first operation state.
Optionally, after the obtaining, from the game client, the protocol log generated when the first game is operated, the method further includes:
and analyzing the protocol log according to a preset analysis rule to obtain the analyzed protocol log.
Optionally, after analyzing the protocol log according to a preset analysis rule and obtaining the analyzed protocol log, the method further includes:
and acquiring the operation state of the virtual object corresponding to the analyzed protocol log according to the operation logic of the first game, wherein the operation logic is used for representing the operation sequence of the first game.
Optionally, after obtaining the operation state of the virtual object corresponding to the analyzed protocol log according to the operation logic of the first game, the method further includes:
and classifying and dividing the analyzed protocol logs according to a preset test case and the operation state of the virtual object.
In a second aspect, an embodiment of the present invention provides an automated testing method, including:
receiving a first operation state of a virtual object sent by a virtual client;
verifying the first operation state to obtain a verification result, and determining a target state of the virtual object;
sending a first message to the virtual client, the first message including a check result of the first operating state and a target state of the virtual object.
Optionally, the method further includes:
and sending the first operation state to a fighting client.
In a third aspect, an embodiment of the present invention provides an automated testing method, including:
acquiring a protocol log generated when a first game is operated;
and sending the protocol log to the virtual client according to a first request sent by the virtual client.
In a fourth aspect, an embodiment of the present invention provides a virtual client, including:
the acquisition module is used for acquiring a protocol log generated when a first game is operated from a game client;
the obtaining module is further configured to obtain a first operating state of a virtual object in the virtual client;
the determining module is used for determining whether to adjust the virtual object from the first operating state to a second operating state according to the first operating state and the protocol log, wherein the second operating state is the next state of the first operating state;
and if so, adjusting the virtual object from the first operation state to the second operation state.
Optionally, the determining module is specifically configured to:
determining a second operating state of the virtual object according to the first operating state and the protocol log;
and determining whether to adjust the virtual object from the first operating state to the second operating state according to the first operating state and the second operating state.
Optionally, the determining module is specifically configured to:
sending the first operating state to a server, and receiving a first message returned by the server, wherein the first message comprises a check result of the first operating state and a target state of the virtual object;
and if the verification result indicates that the verification is passed and the target state is consistent with the second operation state, determining to adjust the virtual object from the first operation state to the second operation state.
Optionally, the determining module is specifically configured to:
and if the verification result indicates that the verification is not passed and/or the target state is inconsistent with the second operation state, keeping the state of the virtual object as the first operation state.
Optionally, the obtaining module is further configured to:
and analyzing the protocol log according to a preset analysis rule to obtain the analyzed protocol log.
Optionally, the obtaining module is further configured to:
and acquiring the operation state of the virtual object corresponding to the analyzed protocol log according to the operation logic of the first game, wherein the operation logic is used for representing the operation sequence of the first game.
The processing module is further configured to:
and classifying and dividing the analyzed protocol logs according to a preset test case and the operation state of the virtual object.
In a fifth aspect, an embodiment of the present invention provides a server, including:
the receiving module is used for receiving a first operating state of a virtual object sent by a virtual client;
the determining module is used for verifying the first operation state to obtain a verification result and determining a target state of the virtual object;
a sending module, configured to send a first message to the virtual client, where the first message includes a check result of the first operating state and a target state of the virtual object.
Optionally, the sending module is further configured to:
and sending the first operation state to a spectator client so that the spectator client displays the first operation state.
In a sixth aspect, an embodiment of the present invention provides a game client, including:
the acquisition module is used for acquiring a protocol log generated when the first game is operated;
and the sending module is used for sending the protocol log to the virtual client according to the first request sent by the virtual client.
In a seventh aspect, an embodiment of the present invention provides a terminal, including: a memory and a processor;
the memory is used for storing program codes;
the processor is configured to invoke the program code to execute the automated testing method according to the first aspect.
In an eighth aspect, an embodiment of the present invention provides a server, including: a memory and a processor;
the memory is used for storing program codes;
the processor is used for calling the program codes to execute the automatic test method according to the second aspect.
In a ninth aspect, an embodiment of the present invention provides a terminal, including: a memory and a processor;
the memory is used for storing program codes;
the processor is used for calling the program codes to execute the automatic test method in the third aspect.
In a tenth aspect, an embodiment of the present invention provides a readable storage medium, on which a computer program is stored; the computer program, when executed, implements an automated testing method as described in the first aspect.
In an eleventh aspect, an embodiment of the present invention provides a readable storage medium, on which a computer program is stored; the computer program, when executed, implements an automated testing method as described in the second aspect.
In a twelfth aspect, an embodiment of the present invention provides a readable storage medium, on which a computer program is stored; the computer program, when executed, implements an automated testing method as described in the third aspect.
The embodiment of the invention provides an automatic testing method and device, wherein the method comprises the following steps: the method comprises the steps of obtaining a protocol log generated when a first game is operated from a game client, obtaining a first operation state of a virtual object in the virtual client, determining whether the virtual object is adjusted to be a second operation state from the first operation state or not according to the first operation state and the protocol log, wherein the second operation state is the next state of the first operation state, and if yes, adjusting the virtual object to be the second operation state from the first operation state, so that the virtual client is used for completing automatic testing of the first game, and testing efficiency is improved.
Drawings
Fig. 1 is a schematic view of an application scenario of an automatic test system according to an embodiment of the present invention;
FIG. 2 is a flow chart of an automated testing method according to an embodiment of the present invention;
FIG. 3 is a flow chart of an automated testing method according to another embodiment of the present invention;
fig. 4 is a schematic diagram of a virtual client according to an embodiment of the present invention;
FIG. 5 is a flow chart of an automated testing method according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of a virtual client according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a terminal according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of a server according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a server according to another embodiment of the present invention;
FIG. 10 is a schematic structural diagram of a game client according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a terminal according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, in an automatic test scheme of a game, airTest is a very common test method, specifically, airTest is used for identifying icons in the game, and a preset click logic is run to complete some simple tests.
In addition, in the current automatic test scheme, two methods for reproducing the BUG are provided, one is to record all operations of the virtual object through video, observe the playback video to position the BUG after the BUG appears, and the other is to add a log of game operation into the log, monitor the process of the BUG appearing and further position the BUG. However, for games, the BUG appearing during the test process is difficult to reproduce stably, so the first method of reproducing the BUG is not feasible; the log of the game operation is added into the log, which not only affects the operation efficiency of the code, but also has large log amount in the game when the BUG appears, all program logics and prepositive conditions appearing in the BUG need to be cleared, and then the BUG is reproduced according to the prepositive conditions, so that the workload is increased, and the BUG reproduction efficiency is reduced.
In order to solve the above problem, an embodiment of the present invention provides an automated testing method, which may include: the method comprises the steps of obtaining a protocol log generated when a first game is operated from a game client, analyzing the protocol log according to a preset analysis rule, obtaining the analyzed protocol log, obtaining a first operation state of a virtual object in the virtual client, determining a second operation state of the virtual object according to the first operation state and the analyzed protocol log, wherein the second operation state is the next state of the first operation state, and determining whether the virtual object is adjusted from the first operation state to the second operation state according to the first operation state and the second operation state, so that the virtual client is utilized to finish automatic testing of the first game, testing efficiency is improved, and meanwhile, reproduction of BUG is achieved.
First, the technical terms related to the present invention will be explained.
Game client protocol log: the game communicates with the server according to the agreed protocol during the running process, and the client records the protocol information such as the transferred protocol name, the parameter table and the like in a log, which is called a game client protocol log.
Virtual client side: the game client comprises a game engine, art resources, logic codes and the like, and the virtual client only comprises the simplest logic codes and is used for communicating with the server to complete the basic flow of the game. In the embodiment of the invention, the virtual client simulates the game client to establish communication with the server through the client protocol log.
And (3) observation: a function provided in an FPS game to observe operations of other virtual objects.
And (3) a client side for battle observation: the client capable of operating with other virtual objects, for example, the client on which the virtual object B in the same game as the virtual object a of the virtual client is located.
Fig. 1 is a schematic view of an application scenario of an automatic test system according to an embodiment of the present invention, and as shown in fig. 1, the automatic test system according to the embodiment may include: virtual client, server, game client, and spectator client. It should be noted that, although the number of each part shown in fig. 1 is one, the present embodiment is not limited to this, and may be at least one. The virtual client can run in any terminal, such as a computer, and the game client and the fighting client can be installed on the terminal, such as a mobile phone, a computer, and the like.
The user can log in the game and play the game through the game client and the fighting client respectively, and the user can load the game to the virtual client and run the game on the computer. The user can match the virtual object A of the spectator client and the virtual object B of the game client to the same game, so that the spectator can be carried out on the virtual object B of the virtual client.
Those skilled in the art will appreciate that when a game is run on a virtual client, only a series of game logic codes can be run, and the whole game interface cannot be displayed. In addition, the game in the embodiment of the invention can be any type of online game.
The client protocol log generated by the game client during game operation is stored in the client protocol log library.
The technical solution of the above embodiments of the present invention will be described in detail by using several specific embodiments.
Fig. 2 is a flowchart of an automated testing method according to an embodiment of the present invention, and as shown in fig. 2, the method according to the embodiment may include:
s201, the virtual client acquires a protocol log generated when the first game is operated from the game client.
Since many operations of the virtual object need to be confirmed by the server, the game client is confirmed by the server to execute the relevant operations, and the protocol returned by the server is the reason why the game client plays some animation or performs some operation. In this embodiment, when the user successfully logs in to the first game using the game client and operates the first game (playing the first game), the user interacts with the server to generate a protocol log with the server.
For example, in this embodiment, the game client acquires a protocol log generated when the first game is operated, and sends the protocol log to the virtual client, or the virtual client sends an acquisition request to the game client to receive the protocol log generated when the first game is operated, which is sent by the game client. Those skilled in the art may use any manner to implement that the virtual client obtains the protocol log generated when operating the first game from the game client, which is not described herein again.
The game client protocol log can be output according to a time sequence, and comprises a protocol name, specific parameter information and the like.
It should be noted that, the user successfully logs in the first game through the game client, the first game may be any game in the online game, and the number of the game clients is not limited to one.
S202, the virtual client acquires a first operation state of a virtual object in the virtual client.
The difference between the virtual client and the game client is that a user logs in a first game through the game client, a game interface corresponding to the first game is displayed on the game client, and the virtual client only comprises simplified logic codes for communicating with the server, that is, the game interface cannot be displayed on the virtual client. In this embodiment, the first operating state is a current state of a virtual object in the virtual client when the first game is loaded on the virtual client, and the first operating state may include blood volume information, position information, motion information, and the like, where the virtual object is a virtual character in the first game.
For example, the first operating state may be an initial state of a virtual object in the virtual client, for example, the action is upright at a certain position, and accordingly, the virtual client may obtain the initial state of the virtual object in the virtual client.
S203, the virtual client determines whether to adjust the virtual object from the first operation state to the second operation state according to the first operation state and the protocol log. The second operating state is the next state to the first operating state.
In this embodiment, after the protocol logs are obtained, according to the running logic of the first game, that is, the running sequence of the first game, for example, first entering the game lobby and then entering the game, the operating state represented by each protocol log is obtained, and then the first operating state is found by querying, and the second operating state of the virtual object is determined.
Next, the virtual client determines whether to adjust the virtual object from the first operating state to the second operating state according to the first operating state and the second operating state of the virtual object, and an implementation process of the virtual client determining whether to adjust the virtual object from the first operating state to the second operating state is similar to an implementation process in the prior art, and is not described here again.
And S204, if so, the virtual client adjusts the virtual object from the first operation state to the second operation state.
If it is determined that the virtual object is adjusted from the first operation state to the second operation state, for example, the current blood volume is increased from 10% to 100%. In the embodiment, the automatic test is completed by using the virtual client by increasing the current blood volume from 10% to 100%, and in the operation, the BUG does not appear.
And S205, if not, keeping the state of the virtual object as the first operation state.
If the virtual object is not adjusted from the first operation state to the second operation state, and the state of the virtual object is kept to be the first operation state, it is indicated that a BUG exists in the current automatic test, the next operation cannot be executed, and the test fails. Optionally, the test failure message is pushed to the user, so that the user can know the test condition in time, and meanwhile, the reproduction of the BUG is also realized.
The automated testing method provided in this embodiment obtains, from a game client, a protocol log generated when a first game is operated, obtains a first operation state of a virtual object in the virtual client, and determines, according to the first operation state and the protocol log, whether to adjust the virtual object from the first operation state to a second operation state, where the second operation state is a next state of the first operation state, and if so, adjusts the virtual object from the first operation state to the second operation state, so that the virtual client is used to complete an automated test on the first game, thereby improving testing efficiency, and achieving reproduction of a BUG.
Fig. 3 is a flowchart of an automated testing method according to another embodiment of the present invention, and as shown in fig. 3, the method according to this embodiment may include:
s301, the game client side obtains a protocol log generated when the first game is operated.
In this embodiment, the protocol logs generated when the first game is operated are a set of protocol logs corresponding to different operations. For a specific implementation process of S301, reference may be made to the relevant description of the embodiment shown in fig. 2, and details are not described here again.
S302, the game client sends the protocol log to the virtual client according to the first request sent by the virtual client.
In this embodiment, the game client sends the protocol log to the virtual client according to the first request sent by the virtual client, and accordingly, the virtual client obtains the protocol log generated when the first game is operated from the game client.
S303, the virtual client analyzes the protocol log according to a preset analysis rule to obtain the analyzed protocol log.
In this embodiment, the purpose of parsing the protocol log is to filter out logs irrelevant to the protocol log to obtain a parsed protocol log, where the parsed protocol log only includes a transceiver protocol log relevant to the server. The analyzed protocol log includes a protocol name, specific parameter information, and the like. The specific parsing process is similar to the parsing process in the prior art, and is not described here again.
S304, the virtual client side obtains the operation state of the virtual object corresponding to the analyzed protocol log according to the operation logic of the first game. The run logic is to characterize a run sequence of the first game.
In this embodiment, since the analyzed protocol logs respectively correspond to different operation states, the operation state of the virtual object corresponding to the analyzed protocol log is obtained according to the running logic of the first game and the time of generating the protocol log.
For example, the running logic of the first game is to enter the game main interface first, then shoot at a gun, and then jump at a parachute, and according to the time generated by each protocol log, the operation state corresponding to each protocol log can be obtained, for example, the operation state corresponding to the first protocol log is to enter the game main interface, the operation state corresponding to the second protocol log is to shoot at a gun, and the operation state corresponding to the third protocol log is to jump at a parachute.
S305, the virtual client classifies the analyzed protocol logs according to a preset test case and the operation state of the virtual object.
The present embodiment will be specifically described below with reference to fig. 4.
Fig. 4 is a schematic diagram of a virtual client according to an embodiment of the present invention, and as shown in fig. 4, the virtual client includes a frame rate simulation module and a protocol parsing module, where the frame rate simulation module includes a module for processing a network protocol event, a simulation frame module, and a frame logic processing module.
And the protocol analysis module is responsible for carrying out context analysis logic on the protocols in the protocol logs. The protocol analysis module comprises a test case module, an analysis module and a filtering module, wherein the test case module is used for dividing the protocol logs according to the test cases and classifying the test cases of each protocol log; the analysis module is used for analyzing the protocol log; the filtering module is used for filtering the protocol log to obtain a transceiving protocol log related to the server.
In this embodiment, the test case module in fig. 4 is used to classify and divide the analyzed protocol logs, and it should be understood that at least one protocol log corresponds to one test case.
For example, the operation states of the virtual object include running and parachuting, and if the running and the parachuting of the virtual object in the first game correspond to one test case, it is determined that the protocol log corresponding to the running and the protocol log corresponding to the parachuting correspond to one test case. Of course, the protocol logs corresponding to running and parachuting may also correspond to one test case, and there are two test cases in total.
Those skilled in the art should understand that, the classification and division of the parsed protocol log according to the preset test case may include, but are not limited to, the above manners.
S306, the virtual client acquires a first operation state of the virtual object in the virtual client.
In this embodiment, the execution process of S306 is similar to the execution process of step 202 shown in fig. 2, and is not described here again.
In addition, S306 may be executed before S301 or after S301, which is not limited in this embodiment.
S307, the virtual client determines a second operation state of the virtual object according to the first operation state and the classified protocol logs.
For example, in this embodiment, the first operation state includes shooting, the protocol log corresponding to the shooting is queried in the categorized and divided protocol logs, then the next protocol log of the protocol log corresponding to the shooting is determined, for example, the protocol logs corresponding to running and parachuting, and the second operation state of the virtual object includes running and parachuting.
S308, the virtual client sends the first operation state to the server.
S309, the virtual client receives a first message returned by the server.
Specifically, the virtual client sends a first operating state of the virtual object to the server, and the server receives the first operating state, verifies the first operating state to obtain a verification result, and determines a target state of the virtual object. For example, if the first operation state includes 10% of blood volume, the server needs to check whether the 10% of blood volume is lower than a predetermined blood volume, and if the lower than the predetermined blood volume passes the check; and when the server determines that the 10% blood volume is lower than the preset blood volume, determining a target state of the first operation state, wherein the target state comprises 100% blood volume.
Correspondingly, the server sends a first message to the virtual client, wherein the first message comprises a check result of the first operation state and a target state of the virtual object.
And S310, if the verification result indicates that the verification is passed and the target state is consistent with the second operation state, the virtual client determines to adjust the virtual object from the first operation state to the second operation state.
And if the verification result indicates that the verification is passed and the target state of the virtual object determined by the server is consistent with the second operation state, the virtual client determines to adjust the virtual object from the first operation state to the second operation state, and the test is successful for the blood adding operation.
S311, if the verification result indicates that the verification is not passed and/or the target state is inconsistent with the second operation state, keeping the state of the virtual object as the first operation state.
If the verification result indicates that the verification is failed and/or the target state is inconsistent with the second operation state, the state of the virtual object is kept to be the first operation state, the BUG occurs in the operation, and the test fails. Optionally, a message of test failure is pushed to the user.
According to the automatic testing method provided by the embodiment, a game client side obtains a protocol log generated when a first game is operated, a virtual client side analyzes the protocol log according to a preset analysis rule to obtain the analyzed protocol log, the virtual client side obtains the operation state of a virtual object corresponding to the analyzed protocol log according to the running logic of the first game, the virtual client side classifies and divides the analyzed protocol log according to a preset test case and the operation state of the virtual object, the virtual client side obtains a first operation state of the virtual object in the virtual client side, the virtual client side determines a second operation state of the virtual object according to the first operation state and the classified and divided protocol log, the virtual client side sends the first operation state to a server and receives a first message returned by the server, if the verification result indicates that the verification is passed and the target state is consistent with the second operation state, the virtual client side determines that the virtual object is adjusted from the first operation state to the second operation state, if the verification result indicates that the verification is passed and the second operation state is consistent with the verification result, the virtual client side determines that the virtual object is not adjusted to the first operation state or the second operation state, and the virtual object is not automatically testing efficiency is improved, and the efficiency is improved.
Fig. 5 is a flowchart of an automated testing method according to another embodiment of the present invention, and as shown in fig. 5, the method according to this embodiment may include:
s401, the game client side obtains a protocol log generated when the first game is operated.
S402, the game client sends the protocol log to the virtual client according to the first request sent by the virtual client.
And S403, the virtual client analyzes the protocol log according to a preset analysis rule to obtain the analyzed protocol log.
S404, the virtual client side obtains the operation state of the virtual object corresponding to the analyzed protocol log according to the operation logic of the first game.
S405, the virtual client classifies the analyzed protocol logs according to a preset test case and the operation state of the virtual object.
S406, the virtual client acquires a first operation state of the virtual object in the virtual client.
S407, the virtual client determines a second operation state of the virtual object according to the first operation state and the protocol log.
S408, the virtual client sends the first operation state to the server.
And S409, the server sends the first operation state to the fighting client.
In this embodiment, for the BUG on the game screen, the server may forward the first operating status of the virtual object to the spectator client, so that the performance of the virtual object in the virtual client is displayed on the spectator client. Optionally, the spectator client saves the representation of the virtual object in the virtual client in a screenshot mode at a preset time interval, or the user observes the representation of the virtual object in the virtual client at the spectator client. Further, the server can also forward the second operation state sent by the virtual client to the fighting client.
For example, a die-through phenomenon occurs when a virtual object in a virtual client collides a building by using a carrier, and an existing BUG reproduction scheme is adopted, so that a BUG is difficult to reproduce, and the BUG reproduction efficiency is low.
It should be understood by those skilled in the art that the above references to the first operating state and the second operating state are only exemplary to illustrate the implementation process of the present invention, and in practical applications, the virtual client needs to repeatedly send the operating state to the server according to the protocol log, and repeat the above process until the sending of the protocol log is completed, that is, the automation test is completed.
In this embodiment, the specific implementation process of S401 to S408 may refer to the related description of the embodiment shown in fig. 3, and in addition, after S409, the above-mentioned S309 to S311 may be executed, which is not described herein again.
In the automated testing method provided by this embodiment, a game client acquires a protocol log generated when a first game is operated, a virtual client analyzes the protocol log according to a preset analysis rule to acquire the analyzed protocol log, the virtual client acquires an operating state of a virtual object corresponding to the analyzed protocol log according to an operating logic of the first game, the virtual client classifies and divides the analyzed protocol log according to a preset test case and the operating state of the virtual object, the virtual client acquires a first operating state of the virtual object in the virtual client, the virtual client determines a second operating state of the virtual object according to the first operating state and the classified and divided protocol log, the virtual client sends the first operating state to a server and receives a first message returned by the server, if a verification result indicates that verification passes and the target state is consistent with the second operating state, the virtual client determines to adjust the virtual object from the first operating state to the second operating state, if the target state is consistent with the second operating state, the virtual client does not indicate that the virtual object passes the verification passes and the virtual client does not maintain the testing efficiency of the virtual object, and the virtual client does not utilize the automatic testing efficiency; meanwhile, the virtual objects in the virtual client side are subjected to fighting by the fighting client side, so that the BUG recurrence efficiency is improved.
Fig. 6 is a schematic structural diagram of a virtual client according to an embodiment of the present invention, and as shown in fig. 6, a virtual client 60 according to this embodiment includes: an acquisition module 601, a determination module 602, and a processing module 603.
An obtaining module 601, configured to obtain, from a game client, a protocol log generated when a first game is operated;
the obtaining module 601 is further configured to obtain a first operating state of a virtual object in the virtual client;
a determining module 602, configured to determine, according to a first operating state and a protocol log, whether to adjust a virtual object from the first operating state to a second operating state, where the second operating state is a next state of the first operating state;
the processing module 603 is configured to, if yes, adjust the virtual object from the first operating state to the second operating state.
Optionally, the determining module 602 is specifically configured to:
determining a second operating state of the virtual object according to the first operating state and the protocol log;
and determining whether to adjust the virtual object from the first operating state to the second operating state according to the first operating state and the second operating state.
Optionally, the determining module 602 is specifically configured to:
sending the first operating state to a server, and receiving a first message returned by the server, wherein the first message comprises a check result of the first operating state and a target state of the virtual object;
and if the verification result indicates that the verification is passed and the target state is consistent with the second operation state, determining to adjust the virtual object from the first operation state to the second operation state.
Optionally, the determining module 602 is specifically configured to:
and if the verification result indicates that the verification is not passed and/or the target state is inconsistent with the second operation state, keeping the state of the virtual object as the first operation state.
Optionally, the obtaining module 601 is further configured to:
and analyzing the protocol log according to a preset analysis rule to obtain the analyzed protocol log.
Optionally, the obtaining module 601 is further configured to:
and acquiring the operation state of the virtual object corresponding to the analyzed protocol log according to the operation logic of the first game, wherein the operation logic is used for representing the operation sequence of the first game.
The processing module 603 is further configured to:
and classifying and dividing the analyzed protocol logs according to a preset test case and the operation state of the virtual object.
The virtual client of this embodiment may be configured to execute the technical solutions of the virtual clients in the above embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of a terminal according to another embodiment of the present invention, and as shown in fig. 7, the terminal 70 of this embodiment may include: a memory 701 and a processor 702. The memory 701 and the processor 702 may be connected by a bus, for example.
The memory 701 is used for storing program codes;
the processor 702 is configured to invoke the program code to execute the technical solution of the virtual client in the foregoing method embodiments.
Fig. 8 is a schematic structural diagram of a server according to an embodiment of the present invention, and as shown in fig. 8, a server 80 according to the embodiment includes: a receiving module 801, a determining module 802 and a sending module 803.
A receiving module 801, configured to receive a first operating state of a virtual object sent by a virtual client;
a determining module 802, configured to verify the first operating state to obtain a verification result, and determine a target state of the virtual object;
a sending module 803, configured to send a first message to the virtual client, where the first message includes a check result of the first operating state and a target state of the virtual object.
Optionally, the sending module 803 is further configured to:
and sending the first operation state to a spectator client so that the spectator client displays the first operation state.
The server of this embodiment may be configured to execute the technical solutions of the servers in the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 9 is a schematic structural diagram of a server according to another embodiment of the present invention, and as shown in fig. 9, a server 90 according to this embodiment may include: a memory 901 and a processor 902. The memory 901 and the processor 902 may be connected by a bus, for example.
The memory 901 is used for storing program codes;
the processor 902 is configured to invoke the program code to execute the technical solution of the server in the foregoing method embodiments.
Fig. 10 is a schematic structural diagram of a game client according to an embodiment of the present invention, and as shown in fig. 10, the game client 100 of the embodiment includes: an acquisition module 101 and a sending module 102.
An obtaining module 101, configured to obtain a protocol log generated when a first game is operated;
the sending module 102 is configured to send the protocol log to the virtual client according to a first request sent by the virtual client.
The game client of this embodiment may be configured to execute the technical solutions of the game clients in the above embodiments of the methods, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 11 is a schematic structural diagram of a terminal according to another embodiment of the present invention, and as shown in fig. 11, the terminal 110 according to this embodiment may include: a memory 111 and a processor 112. The memory 111 and the processor 112 may be connected by a bus, for example.
The memory 111 is used for storing program codes;
the processor 112 is configured to invoke the program code to execute the technical solution of the game client in the foregoing embodiments of the methods.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media capable of storing program codes, such as Read-Only Memory (ROM), random Access Memory (RAM), magnetic disk, or optical disk.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and these modifications or substitutions do not depart from the spirit of the corresponding technical solutions of the embodiments of the present invention.

Claims (17)

1. An automated testing method applied to a virtual client includes:
acquiring a protocol log generated when a first game is operated from a game client;
acquiring a first operating state of a virtual object in the virtual client;
determining a second operating state of the virtual object according to the first operating state and the protocol log;
sending the first operating state to a server, and receiving a first message returned by the server, wherein the first message comprises a check result of the first operating state and a target state of the virtual object;
and if the verification result indicates that the verification is passed and the target state is consistent with the second operation state, determining to adjust the virtual object from the first operation state to the second operation state, wherein the second operation state is the next state of the first operation state.
2. The method of claim 1, further comprising:
and if the verification result indicates that the verification is not passed and/or the target state is inconsistent with the second operation state, keeping the state of the virtual object as the first operation state.
3. The method of claim 2, wherein after obtaining the protocol log generated when the first game is operated from the game client, the method further comprises:
and analyzing the protocol log according to a preset analysis rule to obtain the analyzed protocol log.
4. The method according to claim 3, wherein after the protocol log is parsed according to a preset parsing rule and the parsed protocol log is obtained, the method further comprises:
and acquiring the operation state of the virtual object corresponding to the analyzed protocol log according to the operation logic of the first game, wherein the operation logic is used for representing the operation sequence of the first game.
5. The method according to claim 4, wherein after obtaining the operation state of the virtual object corresponding to the parsed protocol log according to the operation logic of the first game, the method further comprises:
and classifying and dividing the analyzed protocol logs according to a preset test case and the operation state of the virtual object.
6. An automated testing method, applied to a server, includes:
receiving a first operation state of a virtual object sent by a virtual client;
verifying the first operation state to obtain a verification result, and determining a target state of the virtual object;
sending a first message to the virtual client, wherein the first message comprises a check result of the first operation state and a target state of the virtual object;
before the receiving the first operating state of the virtual object sent by the virtual client, the method further includes: and the virtual client determines a second operation state of the virtual object according to the first operation state and the protocol log, and if the verification result indicates that the verification is passed and the target state is consistent with the second operation state, the virtual client determines to adjust the virtual object from the first operation state to the second operation state, wherein the second operation state is the next state of the first operation state.
7. The method of claim 6, further comprising:
and sending the first operation state to a spectator client.
8. An automated testing method, applied to a game client, includes:
acquiring a protocol log generated when a first game is operated;
sending the protocol log to a virtual client according to a first request sent by the virtual client, so that the virtual client determines a second operation state of a virtual object according to a first operation state and the protocol log, sending the first operation state to a server, and receiving a first message returned by the server, wherein the first message comprises a check result of the first operation state and a target state of the virtual object; and if the verification result indicates that the verification is passed and the target state is consistent with the second operation state, determining to adjust the virtual object from the first operation state to the second operation state, wherein the second operation state is the next state of the first operation state.
9. A virtual client, comprising:
the acquisition module is used for acquiring a protocol log generated when a first game is operated from a game client;
the obtaining module is further configured to obtain a first operating state of a virtual object in the virtual client;
the determining module is used for determining whether to adjust the virtual object from the first operating state to a second operating state according to the first operating state and the protocol log, wherein the second operating state is the next state of the first operating state;
if so, adjusting the virtual object from the first operation state to the second operation state;
the determining module is specifically configured to determine a second operating state of the virtual object according to the first operating state and the protocol log; determining whether to adjust the virtual object from the first operating state to the second operating state according to the first operating state and the second operating state;
the determining module is specifically configured to send the first operating state to a server, and receive a first message returned by the server, where the first message includes a check result of the first operating state and a target state of the virtual object; and if the verification result indicates that the verification is passed and the target state is consistent with the second operation state, determining to adjust the virtual object from the first operation state to the second operation state.
10. A server, comprising:
the receiving module is used for receiving a first operating state of a virtual object sent by a virtual client;
the processing module is used for verifying the first operation state to obtain a verification result and determining a target state of the virtual object;
a sending module, configured to send a first message to the virtual client, where the first message includes a check result of the first operating state and a target state of the virtual object; when the verification result indicates that the verification is passed and the target state is consistent with the second operation state, the virtual client adjusts the virtual object from the first operation state to the second operation state, wherein the second operation state is the next state of the first operation state and is determined by the virtual client according to the first operation state and the protocol log.
11. A game client, comprising:
the acquisition module is used for acquiring a protocol log generated when the first game is operated;
a sending module, configured to send the protocol log to a virtual client according to a first request sent by the virtual client, so that the virtual client determines a second operating state of a virtual object according to a first operating state and the protocol log, send the first operating state to a server, and receive a first message returned by the server, where the first message includes a check result of the first operating state and a target state of the virtual object; and if the verification result indicates that the verification is passed and the target state is consistent with the second operation state, determining to adjust the virtual object from the first operation state to the second operation state, wherein the second operation state is the next state of the first operation state.
12. A terminal, comprising: a memory and a processor;
the memory is used for storing program codes;
the processor is used for calling the program codes to execute the automatic test method according to any one of claims 1 to 5.
13. A server, comprising: a memory and a processor;
the memory for storing program code;
the processor, configured to invoke the program code to execute the automated testing method according to claim 6 or 7.
14. A terminal, comprising: a memory and a processor;
the memory for storing program code;
the processor to invoke the program code to perform the automated testing method of claim 8.
15. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program; the computer program, when executed, implements an automated testing method according to any one of claims 1-5.
16. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program; the computer program, when executed, implements an automated testing method as claimed in claim 6 or 7.
17. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program; the computer program, when executed, implements the automated testing method of claim 8.
CN201910227885.1A 2019-03-25 2019-03-25 Automatic testing method and device Active CN109985387B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910227885.1A CN109985387B (en) 2019-03-25 2019-03-25 Automatic testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910227885.1A CN109985387B (en) 2019-03-25 2019-03-25 Automatic testing method and device

Publications (2)

Publication Number Publication Date
CN109985387A CN109985387A (en) 2019-07-09
CN109985387B true CN109985387B (en) 2022-10-04

Family

ID=67131399

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910227885.1A Active CN109985387B (en) 2019-03-25 2019-03-25 Automatic testing method and device

Country Status (1)

Country Link
CN (1) CN109985387B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485924B (en) * 2021-07-01 2023-07-18 网易(杭州)网络有限公司 Game test method, device, equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105721239A (en) * 2016-01-18 2016-06-29 网易(杭州)网络有限公司 Game test method, device and game system
CN108111464B (en) * 2016-11-24 2020-11-10 腾讯科技(深圳)有限公司 Data verification method and device
US10628294B2 (en) * 2017-03-23 2020-04-21 Electronic Arts Inc. Mock services for software infrastructures
CN107678970A (en) * 2017-10-20 2018-02-09 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN108255727A (en) * 2018-01-18 2018-07-06 网易(杭州)网络有限公司 Data receiver, sending method and device test system, storage medium

Also Published As

Publication number Publication date
CN109985387A (en) 2019-07-09

Similar Documents

Publication Publication Date Title
CN107025165B (en) Game automation test method and related device
US10628294B2 (en) Mock services for software infrastructures
CN109698771B (en) Game server pressure testing method and device
CN108228444B (en) Test method and device
CN110013672B (en) Method, device, apparatus and computer-readable storage medium for automated testing of machine-run games
CN111611121A (en) Hardware simulation test method, device and equipment
CN111258913A (en) Automatic algorithm testing method and device, computer system and readable storage medium
CN109522181B (en) Performance test method, device and equipment of distributed storage system
CN113342515A (en) Method, device and equipment for selecting server-free computing resources and storage medium
CN115510454A (en) Game testing method and device, electronic equipment and storage medium
CN113064816B (en) Testing device and testing method for programmable logic device software
CN109985387B (en) Automatic testing method and device
CN113238935A (en) Application testing method, system, device, medium, and computer program product
CN114064465A (en) Stability testing method based on Linux cloud platform
CN110737900B (en) Webpage function testing method and device, server and computer readable storage medium
CN113608990B (en) Terminal performance detection method, device and storage medium
CN112799956B (en) Asset identification capability test method, device and system device
CN115733741A (en) Abnormal scene testing method and device for system to be tested
CN114185773A (en) Program testing method, program testing device, electronic equipment and computer readable storage medium
CN113181637A (en) Game playback method and system
CN112087347A (en) Game server testing method and system
CN112199229A (en) Data processing method, device, equipment and storage medium
CN107276852B (en) Data security detection method and terminal
CN112473146A (en) Game fighting process information automatic testing method, device and system
KR102481254B1 (en) Apparatus and method for test automation service

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