CN111459823A - Game software testing method and device, storage medium and processor - Google Patents

Game software testing method and device, storage medium and processor Download PDF

Info

Publication number
CN111459823A
CN111459823A CN202010251802.5A CN202010251802A CN111459823A CN 111459823 A CN111459823 A CN 111459823A CN 202010251802 A CN202010251802 A CN 202010251802A CN 111459823 A CN111459823 A CN 111459823A
Authority
CN
China
Prior art keywords
operated
thread
area
operation type
game software
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
CN202010251802.5A
Other languages
Chinese (zh)
Other versions
CN111459823B (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 CN202010251802.5A priority Critical patent/CN111459823B/en
Publication of CN111459823A publication Critical patent/CN111459823A/en
Application granted granted Critical
Publication of CN111459823B publication Critical patent/CN111459823B/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
    • 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/3676Test management for coverage analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a game software testing method and device, a storage medium and a processor. Wherein, the method comprises the following steps: dividing a graphical user interface of game software into a plurality of operation areas, and configuring different weight values for each operation area in the plurality of operation areas; creating at least one thread, wherein the at least one thread is used for simulating touch operation executed by a touch medium to test; selecting a current region to be operated from a plurality of operation regions and determining a target operation type of the current region to be operated; and controlling at least one thread to execute the touch operation corresponding to the target operation type in the current region to be operated to obtain a test result. The invention solves the technical problems that the efficiency of testing the game software by the game software testing method in the related technology is lower and not comprehensive enough.

Description

Game software testing method and device, storage medium and processor
Technical Field
The invention relates to the field of software, in particular to a game software testing method and device, a storage medium and a processor.
Background
MonkeyTest in the software field is also called monkey testing, and Chinese also called the monkey testing, and the main functions of the MonkeyTest are as follows: as a test method of the automatic test, random pulse is utilized to realize random repeated operation on the tested software by simulating user event streams such as irregular instructions, operation modes (key input, touch screen input or gesture input and the like), so that the performances of the tested software such as stability, fault tolerance and the like are ensured.
Most operations of MOBA (Multiplayer Online Battle Arena) game software at the mobile phone end are touch operations performed by more than two fingers, even in extreme cases, a user may operate all the fingers, the operating frequencies of the user in different areas on a graphical user interface are different, and the operating frequencies of different operations such as dragging and clicking in different areas are also different. Therefore, when the traditional MonkeyTest is adopted for testing, the situation that a plurality of events are executed simultaneously cannot be well simulated, so that the test is not comprehensive enough; moreover, the conventional monkey test is fair to the graphical user interface, resulting in more time required to cover more high frequency regions and simulate high frequency operation, resulting in lower test efficiency.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a game software testing method and device, a storage medium and a processor, which are used for at least solving the technical problems that the efficiency of testing game software by using a game software testing method in the related technology is low and the game software is not comprehensive enough.
According to an aspect of an embodiment of the present invention, there is provided a game software testing method, including: dividing a graphical user interface of game software into a plurality of operation areas, and configuring different weight values for each operation area in the plurality of operation areas; creating at least one thread, wherein the at least one thread is used for simulating touch operation executed by a touch medium to test; selecting a current region to be operated from a plurality of operation regions and determining a target operation type of the current region to be operated; and controlling at least one thread to execute the touch operation corresponding to the target operation type in the current region to be operated to obtain a test result.
Optionally, selecting a current region to be operated from a plurality of operation regions includes: determining a first value interval based on weighted values corresponding to a plurality of operation areas, wherein the first value interval comprises a plurality of first subintervals, and the plurality of first subintervals are in one-to-one correspondence with the plurality of operation areas; generating a first random number within a first range of values; and obtaining an operation area corresponding to a first subinterval to which the first random number belongs, and obtaining a current area to be operated.
Optionally, configuring a different weight value for each of a plurality of operation types of each operation area, wherein determining a target operation type of a current to-be-operated area includes: determining a second numerical interval based on the weight values corresponding to the operation types, wherein the second numerical interval comprises a plurality of second subintervals, and the second subintervals are in one-to-one correspondence with the operation types; generating a second random number within a second range of values; and obtaining the operation type corresponding to the second subinterval to which the second random number belongs to obtain the target operation type.
Optionally, when the target operation type is a click operation type, controlling at least one thread to execute a touch operation corresponding to the target operation type in the current to-be-operated area to obtain a test result, including: selecting a first to-be-operated point from a plurality of operation points in a current to-be-operated area; and controlling at least one thread to execute touch operation corresponding to the click operation type on the first point to be operated to obtain a test result.
Optionally, when the target operation type is a drag operation type, controlling at least one thread to execute a touch operation corresponding to the target operation type in the current to-be-operated area to obtain a test result, including: selecting a new region to be operated from the plurality of operation regions; selecting a first point to be operated from a plurality of operation points in a current area to be operated, and selecting a second point to be operated from a plurality of operation points in a new area to be operated; and controlling at least one thread to execute touch operation corresponding to the dragging operation type between the first point to be operated and the second point to be operated, so as to obtain a test result.
Optionally, the minimum value of the first value interval is a first preset value, and the maximum value of the first value interval is a difference between a first weight sum and a second preset value, where the first weight sum is a sum of weight values corresponding to the plurality of operation areas; the minimum value of the second numerical interval is a third preset value, and the maximum value of the second numerical interval is the difference between a second weight sum and a fourth preset value, wherein the second weight sum is the sum of weight values corresponding to the plurality of operation types.
Optionally, different weight values are respectively configured for each operation region based on the operation frequency of each operation region.
Optionally, the number of the at least one thread is determined based on a third random number generated within a preset value interval.
Optionally, in the case that multiple threads are created, the method further includes: selecting a plurality of current areas to be operated from a plurality of operation areas and determining a target operation type of each current area to be operated, wherein the plurality of operation areas correspond to a plurality of threads one to one; and controlling each thread to execute the touch operation corresponding to the target operation type in the corresponding current region to be operated to obtain a test result.
According to another aspect of the embodiments of the present invention, there is also provided a game software testing apparatus, including: the dividing module is used for dividing the graphical user interface of the game software into a plurality of operation areas and configuring different weight values for each operation area in the plurality of operation areas; the device comprises a creating module, a judging module and a processing module, wherein the creating module is used for creating at least one thread, and the at least one thread is used for simulating touch operation executed by a touch medium to test; the selection module is used for selecting a current region to be operated from a plurality of operation regions and determining a target operation type of the current region to be operated; and the control module is used for controlling at least one thread to execute the touch operation corresponding to the target operation type in the current region to be operated so as to obtain a test result.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium, where the storage medium includes a stored program, and the device on which the storage medium is located is controlled to execute the above-mentioned test method of the game software when the program runs.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to run a program, where the program executes the method for testing game software.
In the embodiment of the invention, the realization principle of MonkeyTest is adopted, at least one point simultaneous touch operation is simulated by creating at least one thread, the graphical user interface is divided into a plurality of operation areas, different weighted values are configured for different operation areas, so that more-close and more-comprehensive test to a user is realized, the probability that a high-frequency area is randomly selected is higher, the technical effects of improving the test efficiency and enabling the test coverage to be more comprehensive are achieved, and the technical problems that the test efficiency of the game software is lower and the test efficiency of the game software is not comprehensive in the related art are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a method of testing game software according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a graphical user interface according to an embodiment of the present invention;
FIG. 3 is a flow chart of an alternative method of testing game software according to an embodiment of the present invention; and
fig. 4 is a schematic diagram of a testing device of game software according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Android, which is called Android in chinese, is an L inux-based operating system with free and open source codes, and is mainly used for mobile devices including smart phones, tablet computers, and the like, and also applied to other fields except mobile devices including televisions, digital cameras, game machines, smart watches, and the like.
The random operation in the traditional MonkeyTest adopts the pseudo-random generation, and the basic principle of the pseudo-random is as follows: a sequence of random numbers from [0,1] that are uniformly distributed is calculated using a deterministic algorithm, and the pseudo random numbers have statistical characteristics similar to those of random numbers, such as uniformity, independence, and the like, and thus the random numbers do not change as long as invariance (i.e., initial value) of the random seed is ensured, so that the pseudo random numbers are largely used by a computer for generation of random numbers.
The traditional MonkeyTest principle is as follows: the software is used for simulating key input, touch screen input, gesture input and the like of a user, and meanwhile, the operation is irregularly carried out, so that whether the equipment can stably run for a long time is ensured, and the abnormity mainly comprises interface overlapping, no response of the software, software crash and software pressure test.
The MonkeyTest execution mode mainly depends on an adb (Android Debug Bridge) tool of an Android, and the basic execution flow is as follows:
executing the adb shell to start an adb operation interface by using a command line interface provided by a computer operation system such as windows or L inux;
under the adb operation interface, using a monkey instruction, for example, if the name of the game software is com. monkey-p com. example-v 50, where-v denotes the feedback level, -p denotes the name of the application package used, com. example;
the execution can be carried out in such a way that MonkeyTest can be carried out on game software named com.
Meanwhile, the monkey test provides various events such as a touch event, an action event, a trace event, etc., and the percentage of execution can be adjusted by parameters such as: monkey-p com. example-v 50-pct-touch 100, i.e., one hundred percent execution touch events, other events are related as follows:
-pct-touch < percent >: adjusting the percentage of touch events (a touch event is a down-up event that occurs at a single location on the screen);
-pct-motion < percent >: adjusting the percentage of action events (an action event consists of a down event, a series of pseudo-random events and an up event somewhere on the screen);
-pct-trackball < percent >: adjusting the percentage of trace events (a trace event consists of one or several random moves, sometimes accompanied by a click);
-pct-nav < percent >: adjusting the percentage of "basic" navigation events (navigation events consist of up/down/left/right from the directional input device);
-pct-majornav < percent >: adjusting the percentage of "primary" navigation events (which typically cause actions in the graphical interface, such as middle keys, backspace keys, menu keys of the keyboard);
- - -pct-syskeys < percent >: adjust the percentage of "system" key events (these keys are usually reserved for use by the system, such as Home, Back, Start Call, End Call, and volume control keys);
-pct-anyseven < percent >: the percentages of other types of events are adjusted. It covers all other types of events, such as: keys, other less common device buttons, etc.;
the application of the monkey test to the mobile game software is taken as an example for explanation, when the monkey test program runs at the mobile terminal, the monkey test program can simulate different operations (such as key input, touch screen input, gesture input and the like) of a user at the mobile terminal, and random and repeated operation of the mobile game software is realized by continuously generating random pulses, so that the load of the mobile terminal is increased, meanwhile, due to continuous random and repeated operation, whether an interface which the user may operate is abnormal or not is tried to be found, and the stable running of the mobile game software is ensured. These exceptions are mainly bounded by face overlap, software no response, software crash, software stress test.
However, the traditional monkey test application has the following disadvantages in the MOBA game software of the mobile phone end: the stability test requirement of the MOBA game at the mobile phone end of the simulation user multi-point touch operation can not be well met; different weights of clicking and dragging in different areas cannot be achieved, and the aim of pertinence test of different areas is achieved; the test can not be distinguished according to the high-frequency area and the low-frequency area, so that the customized test requirement is met, and the requirement that a tester hopes to cover more high-frequency area tests in the shortest time is met.
In order to solve the above problem, according to an embodiment of the present invention, a method for testing game software is provided, which includes the following specific implementation flows:
FIG. 1 is a flow chart of a method of testing game software according to an embodiment of the present invention, it being noted that the steps shown in the flow chart of the figure may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is shown in the flow chart, in some cases the steps shown or described may be performed in an order different than here.
As shown in fig. 1, the method comprises the steps of:
step S102, dividing the graphical user interface of the game software into a plurality of operation areas, and configuring different weight values for each operation area in the plurality of operation areas.
The game software in the above steps may be MOBA type game software installed on the mobile device, but is not limited thereto, and may also be other types of game software. The graphical user interface can be an operation interface provided for a user in a game software battle, different operation controls are displayed on the operation interface, and the user can control the movement of game characters, execute battle skills, purchase equipment, perform social contact with other users and the like by operating the operation controls.
In the MOBA-type game software, the operation frequency of the user for different functions is different, for example, the operation frequency for controlling the movement of the game character is higher, and the operation frequency for making a social contact with other users is lower. In order to ensure that the coverage of the test can be more comprehensive, the graphical user interface can be divided into a plurality of operation areas based on the operation habits of the user, and different weight values can be configured for different operation areas. Optionally, different weight values may be configured for each operation region respectively based on the operation frequency of each operation region, where the higher the operation frequency is, the larger the weight value is, the easier the operation region is to be selected as the current region to be operated.
It should be noted that the shape of the operation area may be a rectangle, or may also be a non-rectangle such as a circle, a triangle, etc., but is not limited thereto, and in the embodiment of the present invention, a rectangle is taken as an example to illustrate for convenience of subsequently selecting a point to be operated, which needs to be tested.
For example, for the graphical user interface shown in fig. 2, the interface may be divided into 4 regions, i.e., upper left, lower left, upper right, and lower right, assuming that the whole interface uses the lower left corner as the origin of coordinates (0,0), the horizontal axis as the x-axis, the vertical axis as the y-axis, and the upper right corner as (x, y), and each operation region after division is as follows:
the range of the upper left operation area is a rectangular area consisting of (0, y/3), (0, y), (x/3, y/3), (x/3, y), and the operation area is mainly an operation area which is set by a user for opening a small map, purchasing equipment and fighting;
the range of the lower left operation area is a rectangular area consisting of (0,0), (0, y/3), (x/3,0), (x/3, y/3), and the operation area is mainly a fighting rocker operation area of a user;
the range of the upper right operation area is a rectangular area consisting of (x/3, y/2), (x/3, y), (x, y/2) and (x, y), and the operation area is mainly used for viewing battlefield information and functions related to social contact by a user;
the range of the lower right operation area is a rectangular area consisting of (x/3,0), (x/3, y/2), (x,0), (x, y/2), and the operation area is mainly the battle skill operation area of the user.
Assuming that the above four operation regions are denoted by A, B, C and D, respectively, the weight values configured for each operation region are denoted by TA, TB, TC, and TD, respectively.
Step S104, at least one thread is created, wherein the at least one thread is used for simulating the touch operation executed by the touch medium for testing.
The touch medium in the above steps may be a touch screen of a mobile device installed with game software, for example, but not limited to, a capacitive touch screen or a piezoelectric touch screen, and may also be other touch screens capable of implementing multi-point operation.
In the MOBA game software, most combat operations are performed by more than two fingers, and in order to ensure that multiple events can be simulated to be executed simultaneously, multiple threads can be created to simulate the multi-point simultaneous touch operation of a user, wherein each thread is used for simulating the touch operation of one point.
Alternatively, the number of at least one thread may be determined based on a third random number generated within a preset value interval, wherein the preset value interval may be [0, N-1 ]. A random number N (i.e. the third random number mentioned above) can be randomly generated in the interval by a pseudo-random algorithm, and N threads are created, so that 1 to N threads can be created to operate, and the operation is used for simulating the simultaneous clicking of a single finger or multiple fingers of a user. Since most users have 10 fingers, N is 10.
And step S106, selecting a current region to be operated from the plurality of operation regions and determining a target operation type of the current region to be operated.
The target operation type in the above step may be an operation type randomly selected from a plurality of operation types, for example, in MOBA-type game software, a user may perform a drag or click operation, and thus, a target operation type may be randomly selected from a drag operation type and a click operation type at each test.
Based on the MonkeyTest implementation principle, the method can utilize a pseudo-random algorithm to randomly select the current region to be operated from a plurality of operation regions, and on the basis, the step of selecting the current region to be operated from the plurality of operation regions comprises the following steps: determining a first value interval based on weighted values corresponding to a plurality of operation areas, wherein the first value interval comprises a plurality of first subintervals, and the plurality of first subintervals are in one-to-one correspondence with the plurality of operation areas; generating a first random number within a first range of values; and obtaining an operation area corresponding to a first subinterval to which the first random number belongs, and obtaining a current area to be operated.
The minimum value of the first value interval is a first preset value, and the maximum value of the first value interval is the difference between a first weight sum and a second preset value, wherein the first weight sum is the sum of weight values corresponding to the plurality of operation areas. Based on the implementation principle of the pseudo-random algorithm, the first preset value may be 0, and the second preset value may be 1, for example, when the first weight sum is TS, the first value interval is [0, TS-1 ].
For an operation area, one operation area may be randomly selected to operate according to weight values of different operation areas, for example, as shown in the graphical user interface shown in fig. 2, a first weight sum TS is TA + TB + TC + TD, a random number T (i.e., the above-mentioned first random number) is generated in [0, TS-1] by using a pseudo-random algorithm, and if T is within [0, TA-1], it is determined that a current area to be operated is an operation area a, that is, [0, TA-1] (i.e., the above-mentioned first subinterval) corresponds to the operation area a; if the T is in the [ TA, TA + TB-1], determining that the current region to be operated is an operation region B, namely, the subinterval [ TA, TA + TB-1] corresponds to the operation region B; if the T is within the [ TA + TB, TA + TB + TC-1], determining that the current region to be operated is an operation region C, namely, the subinterval [ TA + TB, TA + TB + TC-1] corresponds to the operation region C; and if the T is in the [ TA + TB + TC, TS-1], determining that the current region to be operated is an operation region D, namely, the subinterval [ TA + TB + TC, TS-1] corresponds to the operation region D.
Alternatively, a different weight value may be respectively configured for each of the plurality of operation types of each operation region. For the click operation type and the drag operation type, the weight values may be represented by CT1 and CT2, respectively.
Based on the MonkeyTest implementation principle, a target operation type can be randomly selected from a plurality of operation types by using a pseudo-random algorithm, and on the basis, the target operation type of the current region to be operated is determined, which comprises the following steps: determining a second numerical interval based on the weight values corresponding to the operation types, wherein the second numerical interval comprises a plurality of second subintervals, and the second subintervals are in one-to-one correspondence with the operation types; generating a second random number within a second range of values; and obtaining the operation type corresponding to the second subinterval to which the second random number belongs to obtain the target operation type.
The minimum value of the second numerical interval is a third preset value, and the maximum value of the second numerical interval is a difference between a second weight sum and a fourth preset value, wherein the second weight sum is a sum of weight values corresponding to the plurality of operation types. Based on the implementation principle of the pseudo-random algorithm, the third preset value may be 0, and the fourth preset value may be 1, for example, when the second weight sum is CTS, the first value interval is [0, CTS-1 ].
For the operation type, a target operation type may be randomly selected according to weight values of different operation types in different operation regions to perform an operation, for example, a second weight and CTS (CT 1+ CT 2), a random number C (i.e., the second random number described above) is generated in [0, CTS-1] by using a pseudo-random algorithm, and if C is within [0, CT1-1], the target operation type is determined to be a click operation type, that is, [0, CT1-1] (i.e., the second subinterval described above) corresponds to the click operation type; if C is within [ CT1, CTS-1], the target operation type is determined to be the drag operation type, i.e., [ CT1, CTS-1] corresponds to the drag operation type.
Step S108, controlling at least one thread to execute touch operation corresponding to the target operation type in the current area to be operated, and obtaining a test result.
Optionally, in a case where multiple threads are created, different threads may be used to simulate operations of a user at different points, and therefore, different threads may be controlled to perform touch operations in different operation areas, specifically, multiple current areas to be operated may be selected from the multiple operation areas and a target operation type of each current area to be operated may be determined, where the multiple operation areas correspond to the multiple threads one to one; and controlling each thread to execute the touch operation corresponding to the target operation type in the corresponding current region to be operated to obtain a test result.
Optionally, in a case that the target operation type is a click operation type, a first to-be-operated point may be selected from a plurality of operation points in the current to-be-operated area; and controlling at least one thread to execute touch operation corresponding to the click operation type on the first point to be operated to obtain a test result. Specifically, for the click operation type, a point P (i.e., the first point to be operated) in the current area to be operated may be selected by a pseudo-random algorithm, and a click operation instruction of the game software is invoked at the point, so as to simulate the click operation of the user. For example, as shown in the graphical user interface of fig. 2, if the current region to be operated is the upper left operation region, xp may be randomly selected in the interval [0, x/3], and yp may be randomly selected in the interval [ y/3, y ], so as to obtain the point P (xp, yp).
Under the condition that the target operation type is the drag operation type, selecting a new region to be operated from the plurality of operation regions; selecting a first point to be operated from a plurality of operation points in a current area to be operated, and selecting a second point to be operated from a plurality of operation points in a new area to be operated; and controlling at least one thread to execute touch operation corresponding to the dragging operation type between the first point to be operated and the second point to be operated, so as to obtain a test result. Specifically, as for the drag operation type, since the input of the simulation user is divided into pressing and releasing, two points P and Q (a first point to be operated and a second point to be operated, respectively) may be determined, and the pressing and releasing of the user may be used as the two input operations, thereby simulating the drag operation of the user. The first point to be operated may be a point P randomly selected from the current area to be operated, and the second point to be operated may be a point Q randomly selected from a new area to be operated.
It should be noted that the selection method of the new region to be operated is the same as the selection method of the current region to be operated, and the selection method of the second point to be operated is the same as the selection method of the first point to be operated, which is not described herein again.
A preferred embodiment of the present invention will be described in detail with reference to fig. 3.
Since the MonkeyTest is Android-carried and the implementation method thereof is Android-carried, in order to better optimize the MonkeyTest according to the area division principle, the MonkeyTest is implemented again according to the implementation principle of the MonkeyTest, and the MonkeyTest comprises the following parts:
simulating a user operation device: the click operation instruction of the software is called as input to simulate the click operation of a user; the pressing and the releasing of the user are used as two input operations, and the dragging operation of the user is simulated.
Coordinate division and point selection device: the coordinate division may be performed according to a region division principle and the points are selected by a pseudo-random algorithm according to the different regions.
A multithread generation device: 1 to N lines can be created for operation, and the operation is used for simulating single finger or multiple fingers of a user to operate simultaneously.
A random pulse device: the random pulse device is selected by using pseudo random numbers, and specifically comprises the following parts:
random number selecting means: n click times can be randomly selected at [0, N-1] through a pseudo-random number;
random area selection means: the weights of different operation areas can be set, and one operation area can be randomly selected for operation according to the weights of the different operation areas;
randomly operating the selection means: the weights of the click operation type and the drag operation type of each region can be set according to the different regions, and one operation type is randomly selected for operation according to the weights of the different operation types.
As shown in fig. 3, the specific execution flow of the present invention is as follows:
1. selecting the number n of times of operation required by the current MonkeyTest through a random number selection device;
2. the random times n randomly taken out by the random times selection device are transmitted into the multithreading generation device;
3. generating n threads by using a multithread generation device, and simulating n finger operations performed by a user at the same time;
4. for a single thread, selecting an area X needing to be clicked by using a random area selection device;
5. selecting a point P to be clicked in the area X by using a coordinate dividing and point selecting device;
6. randomly generating a currently selected operation O by using a random operation selection device according to the currently selected area X;
7. if the selection operation O is a click operation, clicking the point P by using the simulation user operation device;
8. if the selection operation O is a drag operation, the following process is performed: selecting a terminal area Y to be dragged by using a random area selection device; selecting a point Q needing to be loosened in the terminal area Y by using a coordinate dividing and point selecting device; dragging the starting point P to the end point Q by using a simulation user operation device;
9. and (5) repeating the steps 1 to 8 until the test is finished.
In the embodiment of the invention, the operation habit of the mobile phone MOBA game software user can be analyzed by combining the principle of the native monkey test, and the multi-point simultaneous touch operation of the user can be simulated in a multi-thread mode, so that the more comprehensive test closer to the user can be realized. Meanwhile, an operation interface of the mobile phone MOBA game is divided into four areas, different weights are set in different areas, a high-frequency area is selected randomly as far as possible, the high-frequency area can be tested more, different weights are set for clicking and dragging according to common operation of the area in different areas, and finally, the efficiency of MonkeyTest is faster and the coverage is more comprehensive, more comprehensive random user operation test is carried out in shorter time, and the MOBA game software of the tested mobile phone end can run more stably. Assuming that 100s is required for covering 100 points by clicking, the number of clicks per time is 5.5 (i.e. an average of 1-10), and the average number of clicks per time is only 19s (100 divided by 5.5) for covering 100 points.
According to the embodiment of the invention, the invention also provides a testing device of the game software. The device can execute the method for testing the game software provided by the embodiment, and the specific implementation scheme and the application scenario are the same as those of the embodiment, which are not described herein again.
Fig. 4 is a schematic diagram of a testing apparatus for game software according to an embodiment of the present invention, as shown in fig. 4, the apparatus including:
the dividing module 42 is configured to divide the graphical user interface of the game software into a plurality of operation areas, and configure different weight values for each of the plurality of operation areas;
a creating module 44, configured to create at least one thread, where the at least one thread is used to simulate a touch operation performed by a touch medium for testing;
a selecting module 46, configured to select a current region to be operated from multiple operation regions and determine a target operation type of the current region to be operated;
and the control module 48 is configured to control at least one thread to execute a touch operation corresponding to the target operation type in the current area to be operated, so as to obtain a test result.
Optionally, the selecting module 46 includes: the first determining unit is used for determining a first numerical value interval based on weighted values corresponding to a plurality of operation areas, wherein the first numerical value interval comprises a plurality of first subintervals which are in one-to-one correspondence with the plurality of operation areas; a first generating unit configured to generate a first random number located in a first numerical range; and the first acquisition unit is used for acquiring the operation area corresponding to the first subinterval to which the first random number belongs to obtain the current area to be operated.
Optionally, the dividing module 42 is further configured to configure a different weight value for each of the plurality of operation types of each operation area, where the selecting module 46 further includes: the second determining unit is used for determining a second numerical value interval based on the weight values corresponding to the operation types, wherein the second numerical value interval comprises a plurality of second subintervals which are in one-to-one correspondence with the operation types; a second generating unit configured to generate a second random number located within a second numerical range; and the second obtaining unit is used for obtaining the operation type corresponding to the second subinterval to which the second random number belongs to obtain the target operation type.
Optionally, in a case where the target operation type is a click operation type, the control module 48 includes: the selection unit is used for selecting a first point to be operated from a plurality of operation points in the current area to be operated; and the control unit is used for controlling at least one thread to execute touch operation corresponding to the click operation type on the first point to be operated so as to obtain a test result.
Alternatively, in the case where the target operation type is a drag operation type, the control module 48 includes: the selection unit is used for selecting a new region to be operated from the plurality of operation regions, selecting a first point to be operated from the plurality of operation points in the current region to be operated, and selecting a second point to be operated from the plurality of operation points in the new region to be operated; and the control unit is used for controlling at least one thread to execute touch operation corresponding to the dragging operation type between the first point to be operated and the second point to be operated so as to obtain a test result.
Optionally, the dividing module 42 is further configured to configure different weight values for each operation region respectively based on the operation frequency of each operation region.
Optionally, the creating module 44 is further configured to create a third random number generated in the preset value interval to determine the number of at least one thread.
Optionally, in the case of creating multiple threads, the selecting module 46 is further configured to select multiple current areas to be operated from multiple operation areas and determine a target operation type of each current area to be operated, where the multiple operation areas correspond to the multiple threads one to one; the control module 48 is further configured to control each thread to execute a touch operation corresponding to the target operation type in the corresponding current area to be operated, so as to obtain a test result.
According to an embodiment of the present invention, there is also provided a storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the test method of the game software in the above embodiment.
According to the embodiment of the invention, the processor is used for running the program, wherein the program executes the test method of the game software in the embodiment when running.
In the above embodiments of the present invention, 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.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (12)

1. A method for testing game software, comprising:
dividing a graphical user interface of game software into a plurality of operation areas, and configuring different weight values for each operation area in the plurality of operation areas;
creating at least one thread, wherein the at least one thread is used for simulating touch operation executed by a touch medium to test;
selecting a current region to be operated from the plurality of operation regions and determining a target operation type of the current region to be operated;
and controlling the at least one thread to execute the touch operation corresponding to the target operation type in the current region to be operated to obtain a test result.
2. The method of claim 1, wherein selecting a current region to be operated from the plurality of operation regions comprises:
determining a first value interval based on the weight values corresponding to the operation areas, wherein the first value interval comprises a plurality of first subintervals, and the first subintervals are in one-to-one correspondence with the operation areas;
generating a first random number within the first interval of values;
and acquiring an operation area corresponding to a first subinterval to which the first random number belongs to obtain the current area to be operated.
3. The method according to claim 1 or 2, wherein a different weight value is configured for each of the plurality of operation types of each operation area, respectively, wherein determining the target operation type of the current region to be operated comprises:
determining a second numerical interval based on the weight values corresponding to the operation types, wherein the second numerical interval comprises a plurality of second subintervals, and the second subintervals are in one-to-one correspondence with the operation types;
generating a second random number located within the second interval of values;
and obtaining the operation type corresponding to the second subinterval to which the second random number belongs to obtain the target operation type.
4. The method according to claim 1, wherein when the target operation type is a click operation type, controlling the at least one thread to execute a touch operation corresponding to the target operation type in the current region to be operated to obtain a test result, includes:
selecting a first to-be-operated point from a plurality of operation points in the current to-be-operated area;
and controlling the at least one thread to execute the touch operation corresponding to the click operation type on the first point to be operated to obtain the test result.
5. The method according to claim 1, wherein when the target operation type is a drag operation type, controlling the at least one thread to execute a touch operation corresponding to the target operation type in the current region to be operated to obtain a test result, includes:
selecting a new region to be operated from the plurality of operation regions;
selecting a first point to be operated from a plurality of operation points in the current area to be operated, and selecting a second point to be operated from a plurality of operation points in the new area to be operated;
and controlling the at least one thread to execute the touch operation corresponding to the dragging operation type between the first point to be operated and the second point to be operated, so as to obtain the test result.
6. The method of claim 3,
the minimum value of the first value interval is a first preset value, the maximum value of the first value interval is the difference between a first weight sum and a second preset value, wherein the first weight sum is the sum of weight values corresponding to the plurality of operation areas;
the minimum value of the second numerical interval is a third preset value, and the maximum value of the second numerical interval is the difference between a second weight sum and a fourth preset value, wherein the second weight sum is the sum of weight values corresponding to the plurality of operation types.
7. The method according to claim 1, wherein different weight values are respectively configured for each operation region based on the operation frequency of each operation region.
8. The method of claim 1, wherein the number of the at least one thread is determined based on a third random number generated within a preset value interval.
9. The method of claim 1, wherein in the case of creating multiple threads, the method further comprises:
selecting a plurality of current areas to be operated from the plurality of operation areas and determining a target operation type of each current area to be operated, wherein the plurality of operation areas correspond to the plurality of threads one by one;
and controlling each thread to execute the touch operation corresponding to the target operation type in the corresponding current region to be operated to obtain the test result.
10. A game software testing apparatus, comprising:
the game system comprises a dividing module, a judging module and a judging module, wherein the dividing module is used for dividing a graphical user interface of game software into a plurality of operation areas and configuring different weight values for each operation area in the plurality of operation areas;
the device comprises a creating module, a judging module and a processing module, wherein the creating module is used for creating at least one thread, and the at least one thread is used for simulating touch operation executed by a touch medium to test;
the selection module is used for selecting a current region to be operated from the plurality of operation regions and determining a target operation type of the current region to be operated;
and the control module is used for controlling the at least one thread to execute the touch operation corresponding to the target operation type in the current region to be operated so as to obtain a test result.
11. A storage medium, characterized in that the storage medium includes a stored program, wherein, when the program runs, a device where the storage medium is located is controlled to execute a test method of game software according to any one of claims 1 to 9.
12. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to execute a method of testing game software according to any one of claims 1 to 9 when running.
CN202010251802.5A 2020-04-01 2020-04-01 Method and device for testing game software, storage medium and processor Active CN111459823B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010251802.5A CN111459823B (en) 2020-04-01 2020-04-01 Method and device for testing game software, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010251802.5A CN111459823B (en) 2020-04-01 2020-04-01 Method and device for testing game software, storage medium and processor

Publications (2)

Publication Number Publication Date
CN111459823A true CN111459823A (en) 2020-07-28
CN111459823B CN111459823B (en) 2023-05-26

Family

ID=71680558

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010251802.5A Active CN111459823B (en) 2020-04-01 2020-04-01 Method and device for testing game software, storage medium and processor

Country Status (1)

Country Link
CN (1) CN111459823B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100076A (en) * 2020-09-24 2020-12-18 腾讯科技(深圳)有限公司 Game testing method, related device, equipment and storage medium
CN113138693A (en) * 2021-04-13 2021-07-20 Oppo广东移动通信有限公司 Operation identification method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080184239A1 (en) * 2007-01-30 2008-07-31 Microsoft Corporation Multi-threaded detection of a game software debugger
CN107544902A (en) * 2016-06-29 2018-01-05 阿里巴巴集团控股有限公司 Program testing method, device and equipment
CN109408384A (en) * 2018-10-16 2019-03-01 网易(杭州)网络有限公司 Test method, device, processor and the electronic device of software application

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080184239A1 (en) * 2007-01-30 2008-07-31 Microsoft Corporation Multi-threaded detection of a game software debugger
CN107544902A (en) * 2016-06-29 2018-01-05 阿里巴巴集团控股有限公司 Program testing method, device and equipment
CN109408384A (en) * 2018-10-16 2019-03-01 网易(杭州)网络有限公司 Test method, device, processor and the electronic device of software application

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100076A (en) * 2020-09-24 2020-12-18 腾讯科技(深圳)有限公司 Game testing method, related device, equipment and storage medium
CN112100076B (en) * 2020-09-24 2022-11-11 腾讯科技(深圳)有限公司 Game testing method, related device, equipment and storage medium
CN113138693A (en) * 2021-04-13 2021-07-20 Oppo广东移动通信有限公司 Operation identification method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111459823B (en) 2023-05-26

Similar Documents

Publication Publication Date Title
AU2017206394B2 (en) Method, system and device for testing and readable storage medium
US11559736B2 (en) Response method, apparatus and terminal to a control
CN106775425B (en) A kind of terminal and its function button display methods
KR20080073868A (en) Terminal and method for displaying menu
CN110193204A (en) Grouping method, device, storage medium and the electronic device of operating unit
WO2013188512A1 (en) Cursor control system and method
CN106909289B (en) A kind of operating method and mobile terminal of application controls
CN109857303B (en) Interaction control method and device
CN105988931B (en) Test method and device
CN111459823B (en) Method and device for testing game software, storage medium and processor
CN110302530A (en) Virtual unit control method, device, electronic equipment and storage medium
CN107357487B (en) Application control method, electronic equipment and computer storage media
CN106790828A (en) The control method and mobile terminal of a kind of mobile terminal
US11544088B1 (en) System and method for providing a customized graphical user interface based on user inputs
CN105843467A (en) Icon displaying method and device
CN104898880A (en) Control method and electronic equipment
CN106293327A (en) End application fast operating method and system
JP2019208952A (en) Program, recording medium, and control method
CN105739771B (en) A kind of display interface management method, device and terminal
CN102622233A (en) System and method for automatically generating user interface applicable to certain interactive terminal equipment
CN101833421A (en) Electronic device and method for acquiring user operation
CN113262476A (en) Position adjusting method and device of operation control, terminal and storage medium
CN113262472A (en) Processing method and device of option control, processor and electronic device
US20180188940A1 (en) Control input method and device for executing the same
CN106020712A (en) Touch control gesture recognition method and device

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