CN111176961B - Application program testing method and device and storage medium - Google Patents

Application program testing method and device and storage medium Download PDF

Info

Publication number
CN111176961B
CN111176961B CN201911234522.7A CN201911234522A CN111176961B CN 111176961 B CN111176961 B CN 111176961B CN 201911234522 A CN201911234522 A CN 201911234522A CN 111176961 B CN111176961 B CN 111176961B
Authority
CN
China
Prior art keywords
test
instruction
algorithm
client
data packet
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
CN201911234522.7A
Other languages
Chinese (zh)
Other versions
CN111176961A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911234522.7A priority Critical patent/CN111176961B/en
Publication of CN111176961A publication Critical patent/CN111176961A/en
Application granted granted Critical
Publication of CN111176961B publication Critical patent/CN111176961B/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/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3414Workload generation, e.g. scripts, playback

Abstract

The invention discloses an application program testing method, a device and a storage medium, wherein the application program testing method can be applied to a testing client, the testing client comprises a command word analysis layer based on a go language, and the method comprises the following steps: the command word analysis layer acquires a test instruction for a target application program; the test instruction is generated by an instruction algorithm based on a go language; the command word analysis layer analyzes the test instruction into an analysis test instruction matched with an operating system of the test client; and the command word analysis layer sends the analysis test instruction to a test execution engine of the test client so that the test execution engine tests the target application program according to the analysis test instruction to generate test feedback information. The invention realizes cross-platform use of the instruction algorithm based on the go language, and the instruction algorithm does not need to be repeatedly compiled for different operating systems, thereby reducing the test cost and improving the test efficiency.

Description

Application program testing method and device and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for testing an application program, and a storage medium.
Background
An application program is one of important components of a computer operating system, the computer equipment and the operating system are required to be coordinated and matched when the application program works normally, the stability of the application program is required to be tested before the application program is released, and the stability test is a test for enabling the application to continuously run for a period of time and detecting whether the application can run stably without obstacles or not by loading a certain service pressure to the application.
In the related art, when performing stability testing on an Application program, in order to be able to adapt to different operating systems such as an android system and an IOS system, each operating system is usually packaged into a set of uniform API (Application Programming Interface) so as to implement a cross-platform stability testing.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide an application program testing method, an application program testing device, and a storage medium. The technical scheme is as follows:
in one aspect, an application program testing method is provided, which is applied to a testing client, where the testing client includes a command word parsing layer based on a go language, and the method includes:
the command word analysis layer acquires a test instruction for a target application program; the test instruction is generated by an instruction algorithm based on a go language;
the command word analysis layer analyzes the test instruction into a test instruction matched with an operating system of the test client to obtain an analysis test instruction;
and the command word analysis layer sends the analysis test instruction to a test execution engine of the test client so that the test execution engine tests the target application program according to the analysis test instruction to generate test feedback information.
In another aspect, an application program testing method is provided, which is applied to a testing server, where the testing server includes a preset instruction algorithm library, and an instruction algorithm in the preset instruction algorithm library is an instruction algorithm based on a go language, and the method includes:
acquiring a test task aiming at a target application program; the test task comprises an instruction algorithm identification;
determining a target instruction algorithm matched with the instruction algorithm identification in a preset instruction algorithm library;
running the target instruction algorithm according to the test task to generate the test instruction;
packaging the test instruction into a test instruction data packet which accords with a rapid transmission control protocol (KCP);
and sending the test instruction data packet to a test client so that a command word analysis layer of the test client acquires the test instruction, analyzing the test instruction into an analysis test instruction matched with an operating system of the test client, sending the analysis test instruction to a test execution engine of the test client, and testing the target application program by the test execution engine according to the analysis test instruction to generate test feedback information.
In another aspect, there is provided an application testing apparatus, the apparatus including a command word parsing layer based on a go language, when the apparatus performs the application test using the command word parsing layer, the apparatus including:
the first acquisition module is used for acquiring a test instruction aiming at a target application program; the test instruction is generated by an instruction algorithm based on a go language;
the first analysis module is used for analyzing the test instruction into a test instruction matched with the operating system of the test client to obtain an analysis test instruction;
and the first sending module is used for sending the analysis test instruction to a test execution engine of the test client so that the test execution engine tests the target application program according to the analysis test instruction and generates test feedback information.
Optionally, the device further comprises a preset instruction algorithm library, wherein an instruction algorithm in the preset instruction algorithm library is an instruction algorithm based on a go language; correspondingly, the device further comprises:
the third acquisition module is used for acquiring a test task aiming at the target application program; the test task comprises an instruction algorithm identification;
the second determining module is used for determining a target instruction algorithm matched with the instruction algorithm identifier in a preset instruction algorithm library;
and the second generation module is used for operating the target instruction algorithm according to the test task to generate the test instruction.
Optionally, the apparatus further comprises:
the first receiving module is used for receiving a test instruction data packet sent by the test server; the test instruction data packet is obtained by packaging a test instruction by the test server based on a rapid transmission control protocol (KCP); the test instruction is generated by the test server running a go language-based instruction algorithm according to a test task aiming at the target application program;
and the first analysis module is used for analyzing the test instruction data packet according to the rapid transmission control protocol KCP to obtain the test instruction.
Optionally, the apparatus further comprises:
the first packaging module is used for packaging the test feedback information into test feedback data conforming to a rapid transmission control protocol (KCP);
and the third sending module is used for sending the test feedback data packet to the test server.
In another aspect, an application program testing apparatus is provided, which includes a preset instruction algorithm library, an instruction algorithm in the preset instruction algorithm library is an instruction algorithm based on a go language, and when the apparatus executes the application program test by using the preset instruction algorithm library, the apparatus includes:
the second acquisition module is used for acquiring a test task aiming at the target application program; the test task comprises an instruction algorithm identification;
the first determining module is used for determining a target instruction algorithm matched with the instruction algorithm identifier in a preset instruction algorithm library;
the first generation module is used for running the target instruction algorithm according to the test task to generate the test instruction;
the first packaging module is used for packaging the test instruction into a test instruction data packet which accords with a rapid transmission control protocol (KCP);
and the second sending module is used for sending the test instruction data packet to a test client so that a command word analysis layer of the test client acquires the test instruction, analyzes the test instruction into an analysis test instruction matched with an operating system of the test client, sends the analysis test instruction to a test execution engine of the test client, and tests the target application program according to the analysis test instruction by the test execution engine to generate test feedback information.
Optionally, the second sending module includes:
the first writing module is used for writing the test instruction data packet into a first buffer queue of a double-buffer queue and sending the test instruction data packet to a test client through the first buffer queue;
the double-buffer queue comprises a first buffer queue and a second buffer queue, wherein the first buffer queue is used for storing the test instruction, and the second buffer queue is used for storing the test feedback information.
Optionally, the apparatus further comprises:
the second receiving module is used for receiving the test feedback data packet returned by the test client; the test feedback data packet is obtained by packaging the test feedback information by the test client based on the rapid transmission control protocol KCP;
a second writing module, configured to write the test feedback data packet into a second buffer queue of the double buffer queue;
a reading module, configured to read the test feedback data packet from the second buffer queue;
and the second analysis module is used for analyzing the test feedback data packet based on the rapid transmission control protocol KCP to obtain the test feedback information.
In another aspect, a test server is provided, which includes a processor and a memory, where the memory stores a preset instruction algorithm based on a go language, and at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the application program test method on the test server side.
In another aspect, a testing client is provided, which includes a processor and a go language-based command word parsing layer, where the go language-based command word parsing layer includes at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the above-mentioned application testing method on the testing client side.
In another aspect, a computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the application testing method as described above.
According to the embodiment of the invention, the test instruction aiming at the target application program is obtained through the command word analysis layer based on the go language, the test instruction is generated by the instruction algorithm based on the go language, the test instruction is analyzed into the analysis test instruction matched with the operating system of the test client through the command word analysis layer, and then the command word analysis layer sends the analysis test instruction to the test execution engine of the test client, so that the test execution engine tests the target application program according to the analysis test instruction and generates the test feedback information, therefore, the cross-platform use of the instruction algorithm is realized based on the go language, the API of different operating systems is not required to be packaged, the instruction algorithm is not required to be repeatedly written for different operating systems, the test cost is greatly reduced, and the test efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic illustration of an implementation environment provided by an embodiment of the invention;
FIG. 2 is a flowchart illustrating an application testing method according to an embodiment of the present invention;
FIG. 3(a) is an alternative diagram of a local test scenario provided by an embodiment of the present invention;
FIG. 3(b) is an alternative diagram of an online test scenario provided by an embodiment of the present invention;
FIG. 4 is a flowchart illustrating another method for testing an application according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating another method for testing an application according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating another method for testing an application according to an embodiment of the present invention;
FIG. 7 is a block diagram of an alternative architecture of an application test system according to an embodiment of the present invention;
FIG. 8 is a flowchart illustrating another method for testing an application according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of an application testing apparatus according to an embodiment of the present invention;
FIG. 10 is a schematic structural diagram of another application testing apparatus according to an embodiment of the present invention;
fig. 11 is a block diagram of a hardware structure of a server according to an embodiment of the present invention;
fig. 12 is a block diagram of a hardware structure of a terminal according to an embodiment of the present invention.
Detailed Description
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 obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the 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 server 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.
Referring to fig. 1, a schematic diagram of an implementation environment according to an embodiment of the present invention is shown, where the implementation environment may include a test server 110 and at least one test client 120.
At least one test client 120 is configured with an application program 121 to be tested and a test execution engine 122 for executing a test instruction, and it can be understood that the test execution engine 122 is adapted to the type of the operating system of the test client, and the application programs 121 to be tested in different test clients may be the same or different.
The testing client 120 may be a hardware device with various operating systems, such as a smart phone, a desktop computer, a tablet computer, and a notebook computer, or may be software configured in the hardware device, such as an application program. The operating system may include, but is not limited to, an Android (Android) operating system, which is a Linux-based operating system with free and open source codes, and an IOS operating system, which is a proprietary mobile operating system developed by apple for mobile devices.
The test server 110 may be connected to and communicate with the test client 120 through a network, and may send a test instruction to the test client 120, and also may receive test feedback information returned by the test client, where the network may be a wireless network or a wired network, and the test server 120 may be a server operating independently, or a server cluster including multiple servers.
Please refer to fig. 2, which is a flowchart illustrating an application testing method according to an embodiment of the present invention, wherein the method can be applied to any testing client in fig. 1. It is noted that the present specification provides the method steps as described in the examples or flowcharts, but may include more or less steps based on routine or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. In actual system or product execution, sequential execution or parallel execution (e.g., parallel processor or multi-threaded environment) may be possible according to the embodiments or methods shown in the figures. Specifically, as shown in fig. 2, the method may include:
s201, a command word analysis layer acquires a test instruction aiming at a target application program; the test instruction is generated by an instruction algorithm based on a go language.
The command word parsing layer is an interface object based on a go language in the testing client, the target application program is an application program to be tested in the testing client, and the target application program can be but is not limited to an instant messaging program, such as a QQ (quick Q) and a WeChat.
Go (also called gold) is a static strong type, compiling type and concurrent programming language developed by Google, and is developed based on the refer operating system, and is formally announced in 11 months in 2009 to become an open source code project, and is implemented on Linux and Mac OS X systems, and is added with the implementation under the Windows system later.
The testing method of the embodiment of the present specification can be applied to a scenario in which a testing client performs local testing, that is, networking is not required, as shown in fig. 3(a), that is, the testing client does not communicate with a testing server in the whole testing process, and the testing client can perform local testing generally when a network is interrupted; the method can also be applied to an online test scenario, as shown in fig. 3(b), that is, in the whole test process, the test client is connected and communicated with the test server to complete the test.
Aiming at the local test scene of fig. 3(a), a preset instruction algorithm library is locally configured at a test client, an instruction algorithm in the preset instruction algorithm library is an instruction algorithm based on a go language, specifically, an instruction algorithm logic is compiled by adopting the go language, and the compiled instruction algorithm logic is compiled into a dependency package which can be called by different operating systems through a golobile tool, so that multi-platform use of a set of codes is realized.
The instruction algorithm in the preset instruction algorithm library may be, but is not limited to, an algorithm for automatically generating a test instruction according to a test task, such as a weighted random algorithm, a fast traversal algorithm, a Q-learning algorithm, and the like. In order to facilitate the search of the instruction algorithms in the preset instruction algorithm library, an instruction algorithm identifier can be allocated to each instruction algorithm, and the instruction algorithm identifier is used for uniquely identifying one instruction algorithm.
Based on the above description, in the local test scenario, as shown in fig. 4, before step S201, the method may further include:
s401, a test client acquires a test task aiming at the target application program; the test task includes an instruction algorithm identification.
The test task is a task for testing the target application program, and may be determined according to a service scenario related to the target application program, where the target application program is a WeChat, and the service scenario may include, but is not limited to, payment, mobile phone recharging, and the like. A service scenario model may be formed according to a service scenario, where the service scenario model may be a quantitative description of a service scenario, for example, the service scenario model is composed of a condition and an action part, and when the condition is satisfied, an action (action) is executed.
The instruction algorithm identification is used for uniquely determining the instruction algorithm in the preset instruction algorithm library, and the instruction algorithm identification in the test task can be selected according to the actual test requirement.
And S403, the test client determines a target instruction algorithm matched with the instruction algorithm identifier in the preset instruction algorithm library.
S405, the test client runs the target instruction algorithm according to the test task to generate the test instruction.
After the test instruction is generated, a command word analysis layer in the test client can obtain the test instruction.
For the online test scenario of fig. 3(b), a preset instruction algorithm library may be configured in the test server, where an instruction algorithm in the preset instruction algorithm library is an instruction algorithm based on a go language, specifically, a go language is used to write an instruction algorithm logic, and the written instruction algorithm logic is compiled into a dependency package that can be called by different operating systems through a golobile tool, so as to implement multi-platform use of a set of codes.
The instruction algorithm in the preset instruction algorithm library may be, but is not limited to, an algorithm for automatically generating a test instruction according to a test task, such as a weighted random algorithm, a fast traversal algorithm, a Q-learning algorithm, and the like. In order to facilitate the search of the instruction algorithms in the preset instruction algorithm library, an instruction algorithm identifier can be allocated to each instruction algorithm, and the instruction algorithm identifier is used for uniquely identifying one instruction algorithm.
Based on the above description, in the online test scenario, as shown in fig. 5, before step S201, the method may further include:
s501, the test client receives a test instruction data packet sent by the test server.
The test instruction data packet refers to a data packet of a test instruction encapsulated by a specified protocol. The test instruction is generated by the test server running a go language-based instruction algorithm according to a test task for the target application program, and as can be understood, the instruction algorithm is an instruction algorithm in a preset instruction algorithm library.
In order to reduce the latency of the communication between the test client and the test server, in the embodiment of the present specification, the designated protocol is based on a fast transmission control protocol KCP (i.e., KCP protocol). The KCP protocol is a reliable transmission layer ARQ protocol of a transmission layer, the attention point of the KCP protocol is mainly on controlling the reliability of data and improving the transmission speed, therefore, the KCP does not stipulate a lower layer transmission protocol, UDP is generally used as the lower layer transmission protocol, a control header is added to a data packet of the KCP layer protocol on the basis of a UDP data message, when user data is large and is larger than the range capable of being borne by one UDP packet (larger than mss), the KCP protocol stores user data fragments in a plurality of KCP packets, and each KCP packet is called as a fragment.
In this embodiment of the present specification, a KCP object may be created at a test client and a test server, and when creating the KCP object, it is necessary to ensure that session numbers of both communication parties are consistent, so that mutual data packets can be approved, and a lower layer protocol output function of the KCP is set, so that the KCP can call the output function when transmitting data.
S503, the test client analyzes the test instruction data packet according to the rapid transmission control protocol KCP to obtain the test instruction.
After receiving the test instruction data packet sent by the test server, the test client can analyze the test instruction data packet according to the rapid transmission control protocol (KCP) to obtain a test instruction, and then a command word analysis layer of the test client can obtain the test instruction.
S203, the command word analysis layer analyzes the test instruction into a test instruction matched with the operating system of the test client, and an analysis test instruction is obtained.
In this embodiment of the present specification, the command word parsing layer based on the go language may parse, when receiving the test instruction, the test instruction based on the current operating system of the test client to obtain a parsing test instruction adapted to the current operating system, where parsing may include obtaining a control tree, finding a control, and performing a ui (user interface) operation.
And S205, the command word analysis layer sends the analysis test instruction to a test execution engine of the test client, so that the test execution engine tests the target application program according to the analysis test instruction to generate test feedback information.
The test execution engine may be run in a simulator or a real device, and performs a stability test on the application program to be tested by sending a pseudorandom user event stream (such as a key input, a touch screen input, a gesture input, and the like) to the system.
Taking the Android system as an example, the test execution engine may include an accessitivyservice (acquiring a control tree, triggering a control operation) module, a Robotium (triggering a coordinate operation, recording and playing back a script) module, and a Hook SDK (capturing an exception log, performing a thread security test) module.
Taking the IOS system as an example, the test execution engine may include an XCTest (get control tree, trigger control operation) module, a Hook dynamic library (get interface information) module, and a Socket communication (send interface information) module.
In the embodiment of the present specification, for an online test scenario, in order to reduce a time delay of communication between a test client and a test server, after the test client generates test feedback information, the test feedback information may be packaged into a test feedback data packet conforming to a fast transmission protocol KCP, and then the test feedback data packet is sent to the test server, so that the test server performs corresponding service logic processing according to the test feedback information after receiving the test feedback information. Specifically, the application layer of the test client may call a dynamic link library file, i.e., a so library file, through the protocol layer interface, and send test feedback data conforming to the KCP protocol through the so library file.
Therefore, the embodiment of the invention obtains the test instruction aiming at the target application program through the command word analysis layer based on the go language, the test instruction is generated by the instruction algorithm based on the go language, the test instruction is analyzed into the analysis test instruction matched with the operating system of the test client through the command word analysis layer, and then the command word analysis layer sends the analysis test instruction to the test execution engine of the test client, so that the test execution engine tests the target application program according to the analysis test instruction and generates the test feedback information, thereby realizing the cross-platform use of the instruction algorithm based on the go language, avoiding the packaging of APIs of different operating systems, avoiding the repeated compiling of the instruction algorithm for different operating systems, greatly reducing the test cost and improving the test efficiency.
In addition, aiming at an online test scene, based on the encapsulation of the KCP protocol on the test instruction and the test feedback information, the communication time delay between the test client and the test server is reduced, and therefore the test efficiency under the scene is improved.
Referring to fig. 6, another application program testing method according to an embodiment of the present invention is shown, where the method can be applied to the testing server in fig. 1, that is, an application scenario of the method is an online testing scenario. As shown in fig. 6, the method may include:
s601, a test server acquires a test task aiming at a target application program; the test task includes an instruction algorithm identification.
The test server is provided with a preset instruction algorithm library, the instruction algorithm in the preset instruction algorithm library is an instruction algorithm based on a go language, specifically, a go language is adopted to compile instruction algorithm logic, and the compiled instruction algorithm logic is compiled into a dependency package which can be called by different operating systems through a golobile tool, so that multi-platform use of a set of codes is realized. The instruction algorithms in the preset instruction algorithm library may include, but are not limited to, weighted random algorithms, fast traversal algorithms, Q-learning algorithms, and the like, which are used to automatically generate test instructions according to test tasks. In order to facilitate the search of the instruction algorithms in the preset instruction algorithm library, an instruction algorithm identifier can be allocated to each instruction algorithm, and the instruction algorithm identifier is used for uniquely identifying one instruction algorithm.
The test task is a task for testing the target application program, and may be determined according to a service scenario related to the target application program, where the target application program is a WeChat, and the service scenario may include, but is not limited to, payment, mobile phone recharging, and the like. A service scenario model may be formed according to a service scenario, where the service scenario model may be a quantitative description of a service scenario, for example, the service scenario model is composed of a condition and an action part, and when the condition is satisfied, an action (action) is executed.
As shown in fig. 7, the system architecture schematic diagram for implementing the application program testing method according to the embodiment of the present invention includes a testing server, a database server, and a testing client (including an Android system and an IOS system), where the database server may include a testing data module and a task configuration module, where the testing data module may be configured to store user path information and testing feedback information, where the user path information is an operation sequence corresponding to each service scenario when a real user operates an application program, and the operation sequence is a path in an application logic level, for example, the operation sequence of the user is a- > B- > C- > D. And the task configuration module is used for realizing the test task configuration of each test client. The test server can obtain the data in the test data module from the database server, and construct a service scene model according to the data in the test data module.
In the embodiment of the present specification, the instruction algorithm identifier in the test task may be selected according to the actual test requirement.
S603, the test server determines a target instruction algorithm matched with the instruction algorithm identification in a preset instruction algorithm library.
And S605, the test server runs the target instruction algorithm according to the test task to generate the test instruction.
Specifically, the test server may determine a corresponding service scenario model according to the test task, and then operate a target instruction algorithm according to the service scenario model, thereby obtaining a test instruction matched with the test task.
S607, the test server packages the test instruction into a test instruction data packet conforming to the rapid transmission control protocol KCP.
In this embodiment of the present description, the test server may encapsulate the test instruction into a test instruction data packet conforming to a KCP protocol, and during the specific encapsulation, a control header may be added to data of the test instruction to ensure reliability and order of the data, and then fragment the test instruction according to an MSS (maximum output data size), where one fragment is a data packet, and when the fragment is fragmented, a maximum length (MTU) of each frame specified by a data link layer needs to be considered, and a size of the KCP is 24 bytes of an MTU-KCP header.
And S609, the test server sends the test instruction data packet to the test client.
After receiving the test instruction data packet sent by the test server, the test client can analyze the test instruction data packet according to the rapid transmission control protocol KCP to obtain a test instruction, and then a command word analysis layer of the test client obtains the test instruction, analyzes the test instruction into an analysis test instruction adapted to an operating system of the test client, and sends the analysis test instruction to a test execution engine of the test client, and the test execution engine tests the target application program according to the analysis test instruction to generate test feedback information.
In practical application, when sending a test instruction data packet to a test client, a test server stores the test instruction data packet to be sent in a buffer queue, and then arranges the sending of the test instruction data packet according to the actual sending condition of the data packet in the buffer queue. However, the conventional single buffer queue processing has the problems that the data processing speed of a producer consumer is inconsistent, the buffer queue length is not well controlled, data loss may be caused by limiting the queue length, and too many resources are occupied if the queue length is not limited, so that the sending of a test instruction of a test server and the receiving of test feedback information are influenced, the communication delay is caused, and the test efficiency is reduced.
In order to achieve non-delay and improve the testing efficiency of the communication between the testing server and the testing client, as shown in fig. 7, the communication between the testing server and the testing client may be implemented through a double buffer queue, where the double buffer queue includes a first buffer queue and a second buffer queue, the first buffer queue is used to store the testing instruction, and the second buffer queue is used to store the testing feedback information. The double-buffer queue can be constructed by encapsulating a queue structure and defining a queue operation protocol.
Based on the above description, step S609, when implemented, may include: and writing the test instruction data packet into a first buffer queue of a double-buffer queue, and sending the test instruction data packet to a test client through the first buffer queue.
Specifically, when a test instruction data packet is obtained by packaging the KCP, a unique identifier (usually, a serial number) is fragmented for each fragment (i.e., data packet) corresponding to the test instruction, and all the test instruction data packets are placed in a queue to be sent of the KCP according to the data packet identifier, in addition, the KCP records the serial number of a next KCP data packet to be sent in a first buffer queue and the serial number of a next KCP data packet to be sent which is to be confirmed, and determines to move the test instruction data packet in the queue to be sent of the KCP to the first buffer queue according to a receiving window maintained by the KCP. For example, there are 4 test instruction data packets in the queue to be sent of the KCP, the sequence number of the next KCP data packet to be sent in the first buffer queue is 11, and the sequence number of the next KCP data packet to be confirmed is 9 (that is, 8 has confirmed, 9, 10 have sent but have not yet been confirmed by the test client), assuming that the receiving window maintained by the KCP is 5, since there are two data packets sent but have not yet been confirmed in the first buffer queue, the first 3 test instruction data packets with the earlier sequence numbers can be taken from the queue to be sent of the KCP and placed in the first buffer queue, and the sequence numbers are set to 11,12, and 13.
The test client informs the test server of the sequence number of the received packet after receiving a data packet, the test server continues to send after receiving the confirmation, and if the test server does not receive the confirmation of a data packet with a certain sequence number within a certain time, the data packet is lost, at the moment, the test server retransmits the lost data packet, so that the test server caches the data packet to be confirmed, and retransmission is convenient. In order to improve the transmission speed when a packet is lost, the KCP may initiate retransmission of a lost data packet according to the number of times a certain data packet is skipped, for example, the test server sends 1,2,3,4,5 data packets, the data packet returned by the test client is 1,3,4,5, when receiving the data packet 3, the KCP determines that the data packet 2 is skipped 1 time, and when receiving the data packet 4, determines that the data packet 2 is skipped 2 times, and then it may be determined that the data packet 2 is lost at this time, and may directly initiate retransmission of the data packet 2, thereby greatly improving the transmission speed when a packet is lost.
In practical applications, after the test server sends the test instruction data packet to the test client, as shown in fig. 8, the method may further include:
s611, receiving a test feedback data packet returned by the test client; and the test feedback data packet is obtained by packaging the test feedback information by the test client based on the rapid transmission control protocol KCP.
S613, writing the test feedback data packet into a second buffer queue of the double buffer queue.
S615, reading the test feedback data packet from the second buffer queue.
S617, analyzing the test feedback data packet based on the fast transmission control protocol KCP to obtain the test feedback information.
Therefore, the cross-platform use of the instruction algorithm is realized based on the go language, namely the instruction algorithm is feasible to be deployed in the background and test clients of different operating systems (Android system and IOS system), and the cross-platform test of the application program is realized. And the communication between the test server and the test client is realized through a KCP protocol and a double buffer queue, so that the non-delay issuing and receiving of the test instruction and the test feedback information are realized, and the test efficiency of the application program is greatly improved.
An embodiment of the present invention further provides an application program testing method, which may be applied to the application program testing system shown in fig. 1 or fig. 7, wherein the testing server includes a preset instruction algorithm library, an instruction algorithm in the preset instruction algorithm library is an instruction algorithm method based on a go language, the testing client includes a command word parsing layer based on the go language, and the method includes:
the method comprises the steps that a test server obtains a test task aiming at a target application program, wherein the test task comprises an instruction algorithm identifier; determining a target instruction algorithm matched with the instruction algorithm identification in a preset instruction algorithm library; running the target instruction algorithm according to the test task to generate the test instruction; packaging the test instruction into a test instruction data packet which accords with a rapid transmission control protocol (KCP); and sending the test instruction data packet to a test client.
The test client receives a test instruction data packet sent by a test server; analyzing the test instruction data packet according to the rapid transmission control protocol KCP to obtain a test instruction; a command word analysis layer of a test client acquires a test instruction for a target application program; the command word analysis layer analyzes the test instruction into a test instruction matched with an operating system of the test client to obtain an analysis test instruction; and the command word analysis layer sends the analysis test instruction to a test execution engine of the test client so that the test execution engine tests the target application program according to the analysis test instruction and generates test feedback information.
Please refer to fig. 9, which is a schematic structural diagram illustrating an application testing apparatus according to an embodiment of the present invention, wherein the apparatus corresponds to the methods for testing an application at a client side according to the foregoing embodiments, and therefore the methods for testing an application at a client side are also applicable to the application testing apparatus.
As shown in fig. 9, the apparatus includes a command word parsing layer based on a go language, and when the apparatus performs the application test using the command word parsing layer, the apparatus may include:
a first obtaining module 910, configured to obtain a test instruction for a target application; the test instruction is generated by an instruction algorithm based on a go language;
a first parsing module 920, configured to parse the test instruction into a test instruction adapted to the operating system of the test client, so as to obtain a parsed test instruction;
a first sending module 930, configured to send the analysis test instruction to a test execution engine of the test client, so that the test execution engine tests the target application according to the analysis test instruction, and generates test feedback information.
As an optional implementation manner, the apparatus may further include a preset instruction algorithm library, and an instruction algorithm in the preset instruction algorithm library is an instruction algorithm based on a go language; correspondingly, the device further comprises:
the third acquisition module is used for acquiring a test task aiming at the target application program; the test task comprises an instruction algorithm identification;
the second determining module is used for determining a target instruction algorithm matched with the instruction algorithm identifier in a preset instruction algorithm library;
and the second generation module is used for operating the target instruction algorithm according to the test task to generate the test instruction.
As an optional embodiment, the apparatus may further include:
the first receiving module is used for receiving a test instruction data packet sent by the test server; the test instruction data packet is obtained by packaging a test instruction by the test server based on a rapid transmission control protocol (KCP); the test instruction is generated by the test server running a go language-based instruction algorithm according to a test task aiming at the target application program;
and the first analysis module is used for analyzing the test instruction data packet according to the rapid transmission control protocol KCP to obtain the test instruction.
As an optional embodiment, the apparatus may further include:
the first packaging module is used for packaging the test feedback information into test feedback data conforming to a rapid transmission control protocol (KCP);
and the third sending module is used for sending the test feedback data packet to the test server.
Please refer to fig. 10, which is a schematic structural diagram illustrating another application testing apparatus according to an embodiment of the present invention, wherein the apparatus corresponds to the methods for testing an application on a testing server side provided in the foregoing embodiments, and therefore the methods for testing an application on a testing server side are also applicable to the application testing apparatus.
As shown in fig. 10, the apparatus includes a preset instruction algorithm library, an instruction algorithm in the preset instruction algorithm library is an instruction algorithm based on a go language, and when the apparatus performs the application test by using the preset instruction algorithm library, the apparatus may include:
a second obtaining module 1010, configured to obtain a test task for a target application; the test task comprises an instruction algorithm identification;
a first determining module 1020, configured to determine a target instruction algorithm in a preset instruction algorithm library, where the target instruction algorithm matches the instruction algorithm identifier;
a first generating module 1030, configured to run the target instruction algorithm according to the test task, and generate the test instruction;
the first encapsulating module 1040 is configured to encapsulate the test instruction into a test instruction data packet conforming to a fast transmission control protocol KCP;
the second sending module 1050 is configured to send the test instruction data packet to a test client, so that a command word parsing layer of the test client obtains the test instruction, parses the test instruction into a parsing test instruction adapted to an operating system of the test client, sends the parsing test instruction to a test execution engine of the test client, and tests the target application program according to the parsing test instruction by the test execution engine to generate test feedback information.
As an optional implementation, the second sending module 1050 may include:
the first writing module is used for writing the test instruction data packet into a first buffer queue of a double-buffer queue and sending the test instruction data packet to a test client through the first buffer queue;
the double-buffer queue comprises a first buffer queue and a second buffer queue, wherein the first buffer queue is used for storing the test instruction, and the second buffer queue is used for storing the test feedback information.
As an optional embodiment, the apparatus may further include:
the second receiving module is used for receiving the test feedback data packet returned by the test client; the test feedback data packet is obtained by packaging the test feedback information by the test client based on the rapid transmission control protocol KCP;
a second writing module, configured to write the test feedback data packet into a second buffer queue of the double buffer queue;
a reading module, configured to read the test feedback data packet from the second buffer queue;
and the second analysis module is used for analyzing the test feedback data packet based on the rapid transmission control protocol KCP to obtain the test feedback information.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
The embodiment of the invention also provides an application program testing system, which comprises a testing server and a testing client, wherein the testing server comprises a preset instruction algorithm library, an instruction algorithm in the preset instruction algorithm library is an instruction algorithm method based on a go language, the testing client comprises a command word analysis layer based on the go language, wherein,
the test server is used for acquiring a test task aiming at a target application program, and the test task comprises an instruction algorithm identifier; determining a target instruction algorithm matched with the instruction algorithm identification in a preset instruction algorithm library; running the target instruction algorithm according to the test task to generate the test instruction; packaging the test instruction into a test instruction data packet which accords with a rapid transmission control protocol (KCP); and sending the test instruction data packet to a test client.
The test client is used for receiving a test instruction data packet sent by the test server; analyzing the test instruction data packet according to the rapid transmission control protocol KCP to obtain a test instruction; the method comprises the steps of obtaining a test instruction aiming at a target application program through a command word analysis layer, analyzing the test instruction into a test instruction matched with an operating system of a test client to obtain an analysis test instruction, and sending the analysis test instruction to a test execution engine of the test client so that the test execution engine can test the target application program according to the analysis test instruction to generate test feedback information.
The application program testing device of the embodiment of the invention realizes cross-platform use of the instruction algorithm based on the go language, and the instruction algorithm does not need to be repeatedly compiled for different operating systems, thereby greatly reducing the testing cost and improving the testing efficiency; and the communication between the test server and the test client is realized through a KCP protocol and a double buffer queue, so that the non-delay issuing and receiving of the test instruction and the test feedback information are realized, and the test efficiency of the application program is further improved.
The embodiment of the invention provides a test server, which comprises a processor and a memory, wherein a preset instruction algorithm based on a go language and at least one instruction or at least one program are stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to realize the test method of the application program at the test server side.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and application tests by executing the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to use of the apparatus, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory may also include a memory controller to provide the processor access to the memory.
Fig. 11 is a block diagram of a hardware structure of a server running an application testing method according to an embodiment of the present invention, and as shown in fig. 11, the server 1100 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 1110 (the processors 1110 may include but are not limited to Processing devices such as a microprocessor MCU or a programmable logic device FPGA), a memory 1130 for storing data, and one or more storage media 1120 (e.g., one or more mass storage devices) for storing applications 1123 or data 1122. The memory 1130 and the storage medium 1120 may be, among other things, transient storage or persistent storage. The program stored in the storage medium 1120 may include one or more modules, each of which may include a series of instruction operations for a server. Still further, the central processor 1110 may be configured to communicate with the storage medium 1120, and execute a series of instruction operations in the storage medium 1120 on the server 1100. The server 1100 may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input-output interfaces 1140, and/or one or more operating systems 1121, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
The input output interface 1140 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the server 1100. In one example, i/o Interface 1140 includes a Network adapter (NIC) that may be coupled to other Network devices via a base station to communicate with the internet. In one example, the input/output interface 1140 can be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
The embodiment of the invention provides a testing client, which comprises a processor and a go language-based command word parsing layer, wherein the go language-based command word parsing layer comprises at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to realize the application program testing method on the testing client side.
Fig. 12 is a block diagram of a hardware structure of a terminal running an application testing method according to an embodiment of the present invention, specifically: the terminal may include RF (Radio Frequency) circuitry 1210, memory 1220 including one or more computer-readable storage media, input unit 1230, display unit 1240, sensors 1250, audio circuitry 1260, WiFi (wireless fidelity) module 1270, processor 1280 including one or more processing cores, and power supply 1290. Those skilled in the art will appreciate that the terminal structure shown in fig. 12 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 1210 is configured to receive and transmit signals during a message transmission or communication process, and in particular, receive downlink information of a base station and then send the received downlink information to one or more processors 1280 for processing; in addition, data relating to uplink is transmitted to the base station. In general, RF circuit 1210 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuit 1210 may also communicate with networks and other terminals through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), and the like.
The memory 1220 may be used to store software programs and modules, and the processor 1280 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1220. The memory 1220 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, and the like; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 1220 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 1220 may also include a memory controller to provide the processor 1280 and the input unit 1230 access to the memory 1220.
The input unit 1230 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 1230 may include a touch-sensitive surface 1231 and other input devices 1232. The touch-sensitive surface 1231, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 1231 (e.g., operations by a user on or near the touch-sensitive surface 1231 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch-sensitive surface 1231 may comprise both touch detection means and touch controller portions. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 1280, and can receive and execute commands sent by the processor 1280. Additionally, the touch-sensitive surface 1231 can be implemented in a variety of types, including resistive, capacitive, infrared, and surface acoustic wave. The input unit 1230 may include other input devices 1232 in addition to the touch-sensitive surface 1231. In particular, other input devices 1232 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1240 may be used to display information input by or provided to the user and various graphical user interfaces of the terminal, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 1240 may include a Display panel 1241, and optionally, the Display panel 1241 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, touch-sensitive surface 1231 may overlay display panel 1241, and when touch-sensitive surface 1231 detects a touch operation thereon or thereabout, processor 1280 may determine the type of touch event, and processor 1280 may then provide a corresponding visual output on display panel 1241 based on the type of touch event. Touch-sensitive surface 1231 and display panel 1241 may be implemented as two separate components for input and output functions, although touch-sensitive surface 1231 may be integrated with display panel 1241 for input and output functions in some embodiments.
The terminal may also include at least one sensor 1250, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 1241 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 1241 and/or a backlight when the terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the terminal is stationary, and can be used for applications of recognizing terminal gestures (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal, detailed description is omitted here.
Audio circuitry 1260, speaker 1261, microphone 1262 may provide an audio interface between a user and the terminal. The audio circuit 1260 can transmit the received electrical signal converted from the audio data to the speaker 1261, and the audio signal is converted into a sound signal by the speaker 1261 and output; on the other hand, the microphone 1262 converts the collected sound signal into an electric signal, is received by the audio circuit 1260, is converted into audio data, is processed by the audio data output processor 1280, and is then transmitted to, for example, another terminal via the RF circuit 1210, or outputs the audio data to the memory 1220 for further processing. The audio circuit 1260 may also include an earbud jack to provide communication of peripheral headphones with the terminal.
WiFi belongs to short distance wireless transmission technology, and the terminal can help the user to send and receive e-mail, browse web pages, access streaming media, etc. through the WiFi module 1270, which provides wireless broadband internet access for the user. Although fig. 12 shows the WiFi module 1270, it is understood that it does not belong to the essential constitution of the terminal, and it can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 1280 is a control center of the terminal, connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the terminal and processes data by operating or executing software programs and/or modules stored in the memory 1220 and calling data stored in the memory 1220, thereby integrally monitoring the terminal. Optionally, processor 1280 may include one or more processing cores; preferably, the processor 1280 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into the processor 1280.
The terminal further includes a power supply 1290 (e.g., a battery) for supplying power to various components, and preferably, the power supply may be logically connected to the processor 1280 through a power management system, so that functions of managing charging, discharging, and power consumption are implemented through the power management system. Power supply 1290 may also include any component or components of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the terminal may further include a camera, a bluetooth module, and the like, which are not described herein again. In this embodiment, the terminal further includes a memory and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors. The one or more programs include instructions for performing the application testing method on the testing client side provided by the method embodiments described above.
It will be understood by those skilled in the art that the structures shown in fig. 11 and 12 are only schematic and do not limit the structure of the electronic device. For example, the test server 1100 may also include more or fewer components than shown in FIG. 11, or have a different configuration than shown in FIG. 11. The testing client 1200 may also include more or fewer components than shown in FIG. 12, or have a different configuration than shown in FIG. 12.
The embodiment of the present invention further provides a computer-readable storage medium, which can be disposed in a server to store at least one instruction or at least one program for implementing an application program testing method on a testing server side, where the at least one instruction or the at least one program is loaded and executed by the processor to implement the application program testing method provided by the above method embodiment.
Embodiments of the present invention also provide a computer-readable storage medium, which may be disposed in a terminal to store at least one instruction or at least one program for implementing an application testing method on a testing client side, where the at least one instruction or the at least one program is loaded and executed by the processor to implement the application testing method provided by the foregoing method embodiments.
Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to: 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.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. An application program testing method is applied to a testing client, wherein the testing client comprises a command word parsing layer based on a go language, and the method comprises the following steps:
receiving a test instruction data packet sent by a test server; the test instruction data packet is obtained by packaging a test instruction by the test server based on a rapid transmission control protocol (KCP); the test instruction is generated by the test server running a go language-based instruction algorithm according to a test task aiming at a target application program; the instruction algorithm based on the go language is a dependence package which can be called by different operating systems and is compiled by a command algorithm logic compiled by the go language through a golobile tool;
analyzing the test instruction data packet according to the rapid transmission control protocol (KCP) so that the command word analysis layer obtains the test instruction; analyzing the test instruction into a test instruction matched with an operating system of the test client to obtain an analysis test instruction; and sending the analysis test instruction to a test execution engine of the test client so that the test execution engine tests the target application program according to the analysis test instruction and generates test feedback information.
2. The application testing method of claim 1, wherein the testing client further comprises a preset instruction algorithm library, the preset instruction algorithm library comprising the instruction algorithm based on the go language; the method further comprises the following steps:
acquiring a test task aiming at the target application program; the test task comprises an instruction algorithm identification;
determining a target instruction algorithm matched with the instruction algorithm identification in a preset instruction algorithm library;
and running the target instruction algorithm according to the test task to generate the test instruction.
3. The application testing method of claim 1, wherein after generating the test feedback information, the method further comprises:
packaging the test feedback information into a test feedback data packet which accords with a rapid transmission control protocol (KCP);
and sending the test feedback data packet to the test server.
4. The application program testing method is characterized by being applied to a testing server, wherein the testing server comprises a preset instruction algorithm library, an instruction algorithm in the preset instruction algorithm library is an instruction algorithm based on a go language, and the instruction algorithm based on the go language is a dependency package which can be called by different operating systems and is compiled by an instruction algorithm logic compiled by the go language through a gomobile tool; the method comprises the following steps:
acquiring a test task aiming at a target application program; the test task comprises an instruction algorithm identification;
determining a target instruction algorithm matched with the instruction algorithm identification in a preset instruction algorithm library;
running the target instruction algorithm according to the test task to generate a test instruction;
packaging the test instruction into a test instruction data packet which accords with a rapid transmission control protocol (KCP);
and sending the test instruction data packet to a test client so that a command word analysis layer of the test client acquires the test instruction, analyzing the test instruction into an analysis test instruction matched with an operating system of the test client, sending the analysis test instruction to a test execution engine of the test client, and testing the target application program by the test execution engine according to the analysis test instruction to generate test feedback information.
5. The application program testing method of claim 4, wherein the sending the test instruction data packet to a test client comprises:
writing the test instruction data packet into a first buffer queue of a double-buffer queue, and sending the test instruction data packet to a test client through the first buffer queue;
the double-buffer queue comprises a first buffer queue and a second buffer queue, wherein the first buffer queue is used for storing the test instruction, and the second buffer queue is used for storing the test feedback information.
6. The application testing method of claim 5, wherein after sending the test instruction packet to a test client, the method further comprises:
receiving a test feedback data packet returned by the test client; the test feedback data packet is obtained by packaging the test feedback information by the test client based on the rapid transmission control protocol KCP;
writing the test feedback data packet into a second buffer queue of the double buffer queues;
reading the test feedback data packet from the second buffer queue;
and analyzing the test feedback data packet based on the rapid transmission control protocol (KCP) to obtain the test feedback information.
7. An apparatus for testing an application, the apparatus comprising a command word parsing layer based on a go language, the apparatus comprising, when the apparatus performs the application test using the command word parsing layer:
the first receiving module is used for receiving a test instruction data packet sent by the test server; the test instruction data packet is obtained by packaging a test instruction by the test server based on a rapid transmission control protocol (KCP); the test instruction is generated by the test server running a go language-based instruction algorithm according to a test task aiming at a target application program; the instruction algorithm based on the go language is a dependence package which can be called by different operating systems and is compiled by a command algorithm logic compiled by the go language through a golobile tool;
the first analysis module is used for analyzing the test instruction data packet according to the rapid transmission control protocol KCP to obtain the test instruction;
the first acquisition module is used for acquiring the test instruction; analyzing the test instruction into a test instruction matched with an operating system of the test client to obtain an analysis test instruction;
and the first sending module is used for sending the analysis test instruction to a test execution engine of the test client so that the test execution engine tests the target application program according to the analysis test instruction and generates test feedback information.
8. An application program testing device is characterized by comprising a preset instruction algorithm library, wherein an instruction algorithm in the preset instruction algorithm library is an instruction algorithm based on a go language, and the instruction algorithm based on the go language is a dependency package which can be called by different operating systems and is compiled by a instruction algorithm logic compiled by the go language through a mobile tool; when the device executes the application program test by using the preset instruction algorithm library, the method comprises the following steps:
the second acquisition module is used for acquiring a test task aiming at the target application program; the test task comprises an instruction algorithm identification;
the first determining module is used for determining a target instruction algorithm matched with the instruction algorithm identifier in a preset instruction algorithm library;
the first generation module is used for running the target instruction algorithm according to the test task to generate a test instruction;
the first packaging module is used for packaging the test instruction into a test instruction data packet which accords with a rapid transmission control protocol (KCP);
and the second sending module is used for sending the test instruction data packet to a test client so that a command word analysis layer of the test client acquires the test instruction, analyzes the test instruction into an analysis test instruction matched with an operating system of the test client, sends the analysis test instruction to a test execution engine of the test client, and tests the target application program according to the analysis test instruction by the test execution engine to generate test feedback information.
9. A computer readable storage medium having stored therein at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement the application testing method of any one of claims 1 to 3 or claims 4 to 6.
10. A computer device comprising a processor and a memory, wherein said memory stores a preset instruction algorithm based on a go language, and at least one instruction or at least one program, said at least one instruction or said at least one program being loaded and executed by said processor to implement the application testing method according to any one of claims 1 to 3 or claims 4 to 6.
CN201911234522.7A 2019-12-05 2019-12-05 Application program testing method and device and storage medium Active CN111176961B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911234522.7A CN111176961B (en) 2019-12-05 2019-12-05 Application program testing method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911234522.7A CN111176961B (en) 2019-12-05 2019-12-05 Application program testing method and device and storage medium

Publications (2)

Publication Number Publication Date
CN111176961A CN111176961A (en) 2020-05-19
CN111176961B true CN111176961B (en) 2022-03-29

Family

ID=70650182

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911234522.7A Active CN111176961B (en) 2019-12-05 2019-12-05 Application program testing method and device and storage medium

Country Status (1)

Country Link
CN (1) CN111176961B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111708704A (en) * 2020-06-19 2020-09-25 腾讯科技(深圳)有限公司 Cloud real machine testing method and device, terminal and storage medium
CN113835994A (en) * 2020-06-24 2021-12-24 上海莉莉丝科技股份有限公司 Golang language-based server stress testing system, method and computer-readable storage medium
CN111813519A (en) * 2020-06-30 2020-10-23 积成电子股份有限公司 IEC 61850 multi-client-oriented multi-task concurrent testing method and system
CN112000396B (en) * 2020-08-06 2024-04-12 上海电气集团股份有限公司 Method, device, equipment and storage medium for testing and controlling fuel cell system
CN113204492A (en) * 2021-05-28 2021-08-03 中国工商银行股份有限公司 Android application testing method and device
TW202307670A (en) * 2021-08-02 2023-02-16 新加坡商蝦皮Ip新加坡私人有限公司 Device and method for automated generation of parameter testing requests
CN114116520B (en) * 2021-12-08 2023-05-26 抖音视界有限公司 Algorithm evaluation method, device, gateway and storage medium
CN114489007A (en) * 2022-01-18 2022-05-13 上汽通用五菱汽车股份有限公司 Vehicle in-loop testing method, system, equipment and computer readable storage medium
CN115022328B (en) * 2022-06-24 2023-08-08 脸萌有限公司 Server cluster, testing method and device of server cluster and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104834602A (en) * 2015-05-20 2015-08-12 广州华多网络科技有限公司 Program issuing method, device and system
CN108021498A (en) * 2016-11-04 2018-05-11 南京大学 A kind of test job amount distribution method based on software reliability prediction
CN109005194A (en) * 2018-09-04 2018-12-14 厦门安胜网络科技有限公司 Portless shadow communication means and computer storage medium based on KCP agreement
CN109189676A (en) * 2018-08-20 2019-01-11 北京旷视科技有限公司 Face unlocks method for testing software, device and test macro
CN109871284A (en) * 2017-12-05 2019-06-11 北京元比特科技有限责任公司 The virtualization technology and method that a kind of application program is executed across Language Runtime
CN110401645A (en) * 2019-07-15 2019-11-01 珠海市杰理科技股份有限公司 Data penetrate transmission method, device, system, client and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100229058A1 (en) * 2009-03-04 2010-09-09 Suresh Goyal Method and apparatus for system testing using scan chain decomposition
US9292416B2 (en) * 2012-10-12 2016-03-22 Vmware, Inc. Software development kit testing
CN105630488A (en) * 2015-12-18 2016-06-01 上海爱数信息技术股份有限公司 Docker container technology-based continuous integration realizing method
CN108170480A (en) * 2017-12-25 2018-06-15 北京康拓科技有限公司 A kind of startup method based on u-boot guiding μ C/OS operating systems

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104834602A (en) * 2015-05-20 2015-08-12 广州华多网络科技有限公司 Program issuing method, device and system
CN108021498A (en) * 2016-11-04 2018-05-11 南京大学 A kind of test job amount distribution method based on software reliability prediction
CN109871284A (en) * 2017-12-05 2019-06-11 北京元比特科技有限责任公司 The virtualization technology and method that a kind of application program is executed across Language Runtime
CN109189676A (en) * 2018-08-20 2019-01-11 北京旷视科技有限公司 Face unlocks method for testing software, device and test macro
CN109005194A (en) * 2018-09-04 2018-12-14 厦门安胜网络科技有限公司 Portless shadow communication means and computer storage medium based on KCP agreement
CN110401645A (en) * 2019-07-15 2019-11-01 珠海市杰理科技股份有限公司 Data penetrate transmission method, device, system, client and storage medium

Also Published As

Publication number Publication date
CN111176961A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN111176961B (en) Application program testing method and device and storage medium
CN108959000B (en) Server pressure testing method, system and terminal
CN109117361B (en) Remote debugging method, related equipment and system for small program
CN107040609B (en) Network request processing method and device
CN106970790B (en) Application program creating method, related equipment and system
CN110032512B (en) Debugging method of small program, related equipment and terminal
CN106412093B (en) A kind of method for uploading of data, apparatus and system
CN107329901B (en) Data packet capturing method, terminal, server and storage medium
CN108039963B (en) Container configuration method and device and storage medium
CN106598584B (en) Method, device and system for processing resource file
CN109088844B (en) Information interception method, terminal, server and system
WO2018077041A1 (en) Method and apparatus for running application
CN106649126B (en) Method and device for testing application program
CN104679627A (en) Testing method and device
CN113377469A (en) Business interface display method and device for mobile application, terminal and storage medium
CN115756881A (en) Data processing method, device, equipment and storage medium based on SDK
CN106708555B (en) A kind of method and apparatus loading plug-in unit
CN111475359A (en) System testing method, device and storage medium under multi-message interaction scene
CN106919458B (en) Method and device for Hook target kernel function
CN111273955A (en) Thermal restoration plug-in optimization method and device, storage medium and electronic equipment
CN108664389B (en) Test method, test device and terminal
CN106709330B (en) Method and device for recording file execution behaviors
CN111562910A (en) Packaging method and related equipment
CN110198324B (en) Data monitoring method and device, browser and terminal
CN109145598B (en) Virus detection method and device for script file, terminal and storage medium

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