CN115729824A - Script testing method, device, equipment and storage medium - Google Patents

Script testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115729824A
CN115729824A CN202211483360.2A CN202211483360A CN115729824A CN 115729824 A CN115729824 A CN 115729824A CN 202211483360 A CN202211483360 A CN 202211483360A CN 115729824 A CN115729824 A CN 115729824A
Authority
CN
China
Prior art keywords
target
script
state
execution
parameter
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.)
Pending
Application number
CN202211483360.2A
Other languages
Chinese (zh)
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.)
Peoples Insurance Company of China
Original Assignee
Peoples Insurance Company of China
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 Peoples Insurance Company of China filed Critical Peoples Insurance Company of China
Priority to CN202211483360.2A priority Critical patent/CN115729824A/en
Publication of CN115729824A publication Critical patent/CN115729824A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application provides a script testing method, a script testing device and a script testing storage medium, and belongs to the technical field of program testing. The method comprises the following steps: responding to the starting of the test task, and acquiring at least one state parameter of all the execution machines; determining comprehensive state parameters of each execution machine according to the state parameters; determining a target execution machine according to the comprehensive state parameters of each execution machine; determining the target waiting time of the script to be tested according to the comprehensive state parameters of the target execution machine; determining the target waiting time as the waiting time of the script to be tested to obtain a target script; and sending the target script to the target execution machine so that the target execution machine tests the target script. The method solves the problem of low script testing efficiency.

Description

Script testing method, device, equipment and storage medium
Technical Field
The present application relates to the field of program testing technologies, and in particular, to a script testing method, apparatus, device, and storage medium.
Background
With the continuous development of computer technology, a large number of services can be realized through the internet. Before providing services via the internet, a program providing the services needs to be tested first.
Currently, in the prior art, when a program providing a service is tested, in order to improve the stability of the test, the waiting time in a script is usually increased.
However, the inventor finds that the prior art has at least the following technical problems: increasing the latency in the script results in a decrease in testing efficiency.
Disclosure of Invention
The application provides a script testing method, a script testing device and a script testing storage medium, which are used for solving the problem of low script testing efficiency.
In a first aspect, the present application provides a script testing method, including: responding to the starting of the test task, and acquiring at least one state parameter of all the execution machines; determining comprehensive state parameters of each execution machine according to the state parameters; determining a target execution machine according to the comprehensive state parameters of each execution machine; determining the target waiting time of the script to be tested according to the comprehensive state parameters of the target execution machine; determining the target waiting time as the waiting time of the script to be tested to obtain the target script; and sending the target script to the target execution machine so that the target execution machine tests the target script.
In a possible implementation manner, determining a target waiting time of a script to be tested according to a comprehensive state parameter of a target execution machine includes: determining a target parameter interval to which the comprehensive state parameter belongs according to the comprehensive state parameter of the target execution machine; searching a corresponding relation between a preset parameter interval and target waiting time according to the target parameter interval to obtain the target waiting time; or, inputting the comprehensive state parameters of the target execution machine into a preset waiting time calculation function to obtain the target waiting time.
In a possible implementation manner, determining the comprehensive state parameter of each execution machine according to the state parameters includes: searching a corresponding relation between a preset state parameter range and a parameter state value corresponding to any state parameter according to any state parameter of any execution machine to obtain a parameter state value corresponding to any state parameter; and inputting each state value corresponding to any execution machine into a preset comprehensive state parameter calculation function to obtain the comprehensive state parameter of any execution machine.
In one possible implementation, the state parameters include the occupancy rate of the central processing unit, the occupancy rate of the memory and the response speed; correspondingly, according to any state parameter of any execution machine, searching a corresponding relation between a preset state parameter range corresponding to any state parameter and a parameter state value to obtain a parameter state value corresponding to any state parameter, and the method comprises the following steps: searching a corresponding relation between a preset central processor occupancy rate range and a processor occupancy state value according to the central processor occupancy rate of any execution machine to obtain a corresponding processor occupancy state value; searching a corresponding relation between a preset memory occupancy rate range and a memory occupancy state value according to the memory occupancy rate of any execution machine to obtain a corresponding memory occupancy state value; and searching the corresponding relation between the preset response speed range and the response speed state value according to the response speed of any one execution machine to obtain the corresponding response speed state value.
In a possible implementation manner, inputting each state value corresponding to any one of the execution machines into a preset comprehensive state parameter calculation function to obtain a comprehensive state parameter of any one of the execution machines, including: and inputting the processor occupation state value, the memory occupation state value and the response speed state value corresponding to any execution machine into a preset comprehensive state parameter calculation function to obtain the comprehensive state parameter of any execution machine.
In a possible implementation manner, after determining the comprehensive state parameter of each execution machine according to the state parameter, the method further includes: and if the comprehensive state parameters of all the execution machines are smaller than the preset value, restarting all the execution machines, and executing the steps of obtaining the state parameters of the execution machines and calculating the comprehensive state parameters of the execution machines again.
In a possible implementation manner, after the step of re-executing the step of obtaining the state parameters of the execution machine and the step of calculating the comprehensive state parameters of the execution machine, the method further includes: and if the comprehensive state parameters of all the executors are smaller than the preset value, sending prompt information to the corresponding terminal equipment of the tester.
In a second aspect, the present application provides a script testing apparatus, comprising: the parameter acquisition module is used for responding to the starting of the test task and acquiring at least one state parameter of all the execution machines; the parameter determining module is used for determining the comprehensive state parameters of each execution machine according to the state parameters; the execution machine determining module is used for determining a target execution machine according to the comprehensive state parameters of all execution machines; the time determining module is used for determining the target waiting time of the script to be tested according to the comprehensive state parameters of the target execution machine; the script obtaining module is used for determining the target waiting time as the waiting time of the script to be tested to obtain the target script; and the script sending module is used for sending the target script to the target execution machine so that the target execution machine tests the target script.
In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively coupled to the processor; the memory stores computer execution instructions; the processor executes the computer executable instructions stored by the memory to cause the processor to perform the script test method as described in the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium having stored therein computer-executable instructions, which when executed by a processor, are used to implement the script testing method as described in the first aspect.
According to the script testing method, the device, the equipment and the storage medium, the state parameters of all the execution machines are obtained, the comprehensive state parameters of all the execution machines are determined, the target execution machine is determined according to the comprehensive state parameters of the target execution machine, the target waiting time of the script to be tested is determined, the target waiting time is used as the waiting time of the script to be tested, the target script is obtained, the target script is sent to the target execution machine for script testing, the execution machines with better states are found in all the execution machines, the waiting time of the script is changed according to the states of the selected execution machines, and the waiting time is more suitable for the selected execution machine, so that the testing efficiency is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic view of an application scenario of a script testing method provided in an embodiment of the present application;
FIG. 2 is a schematic flowchart of a script testing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a script testing apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. The drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the concepts of the application by those skilled in the art with reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
With the continuous development of computer technology and the internet, networks are providing more and more services, which need to be tested before being formally online to ensure the stability of the services.
When testing the provided service, the program or script to be tested can be sent to the fixed execution end, and the execution end is adopted to test the script, so as to reduce the error rate of the script, and set a long waiting time in the script, which causes the problem of low efficiency of the testing process.
In view of the above technical problems, the inventors propose the following technical idea: and finding out a target execution machine suitable for testing by acquiring the state parameters of the plurality of execution machines, and changing the waiting time in the script according to the state parameters of the target execution machine.
Fig. 1 is a schematic view of an application scenario of a script testing method provided in an embodiment of the present application. As in fig. 1, this scenario includes: server 101, execution machine 102.
The server 101 may be a single server, or may be implemented by using a server or a cluster of multiple servers with stronger processing capability and higher security, and may be replaced by a computer with stronger computing capability, a notebook computer, or the like, where possible.
The execution machine 102 may include a computer, a server, a tablet, a mobile phone, a Personal Digital Assistant (PDA), a notebook, etc., which are used to run scripts. The execution engine 102 may have two or more execution engines.
In a specific implementation process, the server 101 is configured to obtain state parameters of the execution machines 102, calculate comprehensive state parameters of the execution machines, select a target execution machine, determine a target waiting time of the script to be tested according to the comprehensive state parameters of the target execution machine, replace the waiting time in the script to be tested with the target waiting time, obtain a target script, and send the target script to the execution machines 102.
And the execution machine 102 is used for running the target script to obtain a test result.
It is to be understood that the illustrated structure of the embodiments of the present application does not constitute a specific limitation to the script test method. In other possible embodiments of the present application, the architecture may include more or fewer components than those shown in the drawings, or combine some components, or split some components, or arrange different components, which may be determined according to an actual application scenario and is not limited herein. The components shown in fig. 1 may be implemented by hardware, software, or a combination of software and hardware.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. These several specific embodiments may be combined with each other below, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a schematic flowchart of a script testing method according to an embodiment of the present application. The execution subject in the embodiment of the present application may be the server 101 in fig. 1, or may be a computer and/or a mobile phone, and the present embodiment is not particularly limited thereto. As shown in fig. 2, the method includes:
s201: in response to the initiation of the test task, at least one state parameter of all of the execution machines is obtained.
In this step, the test task may be started by receiving a test task starting instruction sent by the client corresponding to the tester, or by completing one test task in the test task queue and starting a new test task. The mode of acquiring the state parameter of the execution machine may be to send a state parameter acquiring instruction to the execution machine and receive the state parameter fed back by the execution machine.
The state parameters include, but are not limited to, central processing unit occupancy, memory occupancy, and response speed. The occupancy rate of the central processing unit and the occupancy rate of the memory can be obtained by sending command query to the execution machine, the response speed can also be obtained by sending a request to the execution machine and receiving the feedback of the execution machine, and the response time is obtained by the time difference between the sending time of the request and the receiving time of the feedback of the execution machine.
S202: and determining the comprehensive state parameters of each execution machine according to the state parameters.
In this step, a preset program, a script, a production formula rule or a mapping mode may be adopted to convert the state parameters and then input a preset formula to obtain the comprehensive state parameters.
The preset program, script, production rule or mapping mode may be preset by the tester.
In a possible implementation manner, in this step, determining the comprehensive state parameter of each execution machine according to the state parameter includes: step S202A or step S202B.
S202A: and searching the corresponding relation between the preset state parameter range and the parameter state value corresponding to any state parameter according to any state parameter of any execution machine to obtain the parameter state value corresponding to any state parameter.
In this step, a target state parameter range to which the state parameter belongs may be determined, and a parameter state value corresponding to the state parameter is found from the target state parameter range in a preset corresponding relationship between the state parameter range and the parameter state value.
Specifically, the state parameter range may be preset, and the target state parameter range to which the state parameter belongs may be determined by comparing the end sizes of the state parameter and the state parameter range.
The corresponding relationship between the state parameter range and the parameter state value can be shown in table 1, and the specific numerical values in table 1 are not limited in the present application.
TABLE 1 comparison table of state parameter range and parameter state value (schematic)
Figure BDA0003962623070000061
S202B: and inputting each state value corresponding to any execution machine into a preset comprehensive state parameter calculation function to obtain the comprehensive state parameter of any execution machine.
In this step, the integrated state parameter may be an output value of a preset integrated state parameter calculation function. The preset calculation function of the comprehensive state parameters may correspond to the types of the state parameters, and if two types of the state parameters are selected to calculate the comprehensive state parameters, the calculation function of the comprehensive state parameters may be different from the calculation function of selecting three types of the state parameters.
Wherein, the comprehensive state parameter calculation function may be as follows:
K=mF+nG+l
wherein K represents the comprehensive state parameter, F represents the numerical value of the first state parameter, G represents the numerical value of the second state parameter, and m, n and l represent constants.
S203: and determining the target execution machine according to the comprehensive state parameters of the execution machines.
In this step, the execution engine with the higher integrated state parameter of all the execution engines may be used as the target execution engine. It is conceivable that, depending on the calculation method of the integrated state parameter, an execution machine with a lower integrated state parameter among all execution machines may be used as the target execution machine.
S204: and determining the target waiting time of the script to be tested according to the comprehensive state parameters of the target execution machine.
In this step, the target latency may be a global latency.
In a possible implementation manner, the step of determining the target waiting time of the script to be tested according to the comprehensive state parameter of the target execution machine includes: step S204A, S204B, or step S204C.
S204A: and determining a target parameter interval to which the comprehensive state parameter belongs according to the comprehensive state parameter of the target execution machine.
In this step, the size of the integrated state parameter of the target execution machine may be compared with the end points of the preset multiple parameter intervals to obtain a target parameter interval to which the integrated state parameter of the target execution machine belongs.
For example, if the integrated state parameter of the target execution machine is 7, the preset first parameter interval is greater than or equal to 3 and less than 5, the preset second parameter interval is greater than or equal to 5 and less than 7, and the preset third parameter interval is greater than or equal to 7 and less than 9, the integrated state parameter of the target execution machine belongs to the third parameter interval, and the third parameter interval is determined as the target parameter interval. The application does not limit the specific values in the parameter interval.
S204B: and searching the corresponding relation between the preset parameter interval and the target waiting time according to the target parameter interval to obtain the target waiting time.
In this step, the correspondence between the parameter interval and the target waiting time is, for example, table 2.
TABLE 2 corresponding relationship between parameter interval and target waiting time (schematic)
Figure BDA0003962623070000071
For example, if the target parameter interval is 6.5-Ap x ≦ 7, the target wait time is 25 seconds. And 4-Ap x is less than or equal to 4.5, and the target waiting time is 50 seconds.
S204C: and inputting the comprehensive state parameters of the target execution machine into a preset waiting time calculation function to obtain the target waiting time.
In this step, the latency calculation function is, for example:
T=rS+q
wherein T represents a target waiting time, r and q represent constants, and S represents an integrated state parameter.
S205: and determining the target waiting time as the waiting time of the script to be tested to obtain the target script.
In this step, the target waiting time may be substituted for the original waiting time in the script to be tested, or the target waiting time may be written into a preset position in the script to be tested.
S206: and sending the target script to the target execution machine so that the target execution machine tests the target script.
In this step, sending the target script to the target execution machine may be sending over a network.
As can be seen from the description of the above embodiments, in the embodiments of the present application, by obtaining state parameters of all the execution machines, determining a comprehensive state parameter of each execution machine, determining a target execution machine according to the comprehensive state parameter of the target execution machine, determining a target waiting time of a script to be tested, taking the target waiting time as a waiting time of the script to be tested, obtaining a target script, and sending the target script to the target execution machine for script testing, the execution machines with better states are found in all the execution machines, and the waiting time of the script is changed according to the state of the selected execution machine, so that the waiting time is more suitable for the selected execution machine, thereby improving testing efficiency.
In one possible implementation, the state parameters include a central processing unit occupancy rate, a memory occupancy rate, and a response speed.
Correspondingly, in the step S202A, according to any state parameter of any execution machine, searching for a corresponding relationship between a preset state parameter range corresponding to any state parameter and a parameter state value, and obtaining a parameter state value corresponding to any state parameter, includes:
the 1 st row and the 2 nd row, the 1 st row and the 3 rd row, the 1 st row and the 4 th row of the table 1 can be divided into 3 tables to respectively represent the corresponding relation between the occupancy rate range of the central processing unit and the occupancy state value of the processor, the corresponding relation between the occupancy rate range of the memory and the occupancy state value of the memory, and the corresponding relation between the response speed range and the response speed state value.
S202A1: and searching the corresponding relation between the preset occupancy rate range of the central processing unit and the occupancy state value of the processor according to the occupancy rate of the central processing unit of any execution machine to obtain the corresponding occupancy state value of the processor.
In this step, for example, if the cpu occupancy of one of the execution machines is 4%, the corresponding processor occupancy status value is 10, if the cpu occupancy of the other execution machine is 45%, the corresponding processor occupancy status value is 6, and if the cpu occupancy of the other execution machine is 65%, the corresponding processor occupancy status value is 3.
S202A2: and searching the corresponding relation between the preset memory occupancy rate range and the memory occupancy state value according to the memory occupancy rate of any execution machine to obtain the corresponding memory occupancy state value.
In this step, for example, if the memory occupancy rate of one of the execution machines is 9%, the corresponding memory occupancy status value is 10, if the memory occupancy rate of the other execution machine is 50%, the corresponding memory occupancy status value is 7, and if the memory occupancy rate of another execution machine is 72%, the corresponding memory occupancy status value is 3.
S202A3: and searching the corresponding relation between the preset response speed range and the response speed state value according to the response speed of any execution machine to obtain the corresponding response speed state value.
In this step, for example, if the response speed of one of the execution machines is 12ms, the corresponding response speed status value is 9, if the response speed of the other execution machine is 20ms, the corresponding response speed status value is 8, and if the response speed of the other execution machine is 60, the corresponding response speed status value is 3.
In a possible implementation manner, in this step, the inputting each state value corresponding to any one of the execution machines into a preset integrated state parameter calculation function in S202B to obtain an integrated state parameter of any one of the execution machines specifically includes:
and inputting the processor occupation state value, the memory occupation state value and the response speed state value corresponding to any execution machine into a preset comprehensive state parameter calculation function to obtain the comprehensive state parameter of any execution machine.
Wherein, the comprehensive state parameter calculation function is, for example:
S=aX+bY+cZ+d
in the formula, S represents a comprehensive state parameter, a, b, c and d are constants, X represents a processor occupation state value, Y represents a memory occupation state value, and Z represents a response speed state value. Where a may be 30% or 0.3, b may be 30% or 0.3, c may be 40% or 0.4. The value of the constant can also be obtained from empirical values.
As can be seen from the description of the above embodiments, in the embodiments of the present application, the processor occupancy state value corresponding to the cpu occupancy of the execution machine, the memory occupancy state value corresponding to the memory occupancy, and the response speed state value corresponding to the response speed are obtained by respectively querying the corresponding relationship, and the processor occupancy state value, the memory occupancy state value, and the response speed state value are input into the preset comprehensive state parameter calculation function to obtain the comprehensive state parameter, so that the cpu occupancy, the memory occupancy, and the response speed are comprehensively considered, and the suitability of the obtained target execution machine is improved.
In a possible implementation manner, after determining the comprehensive state parameter of each execution machine according to the state parameter in step S202, the method further includes:
s210: and if the comprehensive state parameters of all the execution machines are smaller than the preset value, restarting all the execution machines, and executing the steps of obtaining the state parameters of the execution machines and calculating the comprehensive state parameters of the execution machines again.
In this step, the preset value may be obtained by receiving the setting information of the tester terminal device in advance. Restarting all the execution machines, or restarting the idle execution machine which does not perform script test. The manner of restarting all the execution machines may be to send a restart instruction to all the execution machines, so that the execution machines are restarted according to the restart instruction. The steps of obtaining the state parameters of the execution machine and the comprehensive state parameters of the computer execution machine may be steps S201 and S202.
Wherein the preset value is, for example, 4, 3, 2, etc.
As can be seen from the description of the above embodiments, in the embodiments of the present application, when the comprehensive state parameters of all the execution machines are smaller than the preset value, all the execution machines are restarted to achieve the purpose of improving the states of the execution machines, so as to improve the script testing efficiency, and after all the execution machines are restarted, the step of obtaining the comprehensive state parameters of the execution machines and the comprehensive state parameters of the computer execution machines is executed again, so that it can be determined again whether any execution machine can perform the script test, and a target execution machine is determined when any execution machine can perform the test.
In a possible implementation manner, after the step S210 re-executes the step of obtaining the state parameters of the execution machine and the comprehensive state parameters of the execution machine, the method further includes:
s211: and if the comprehensive state parameters of all the execution machines are smaller than the preset value, sending prompt information to the terminal equipment corresponding to the tester.
In this step, the prompt message is sent to the terminal device corresponding to the tester, and may be sent in a format of a short message, a message, or the like.
The prompt information includes, for example, "the state of the execution machine is not good," the parameters of the execution machine are not qualified, "and the content of the prompt information is not specifically limited in the embodiments of the present application.
It can be known from the description of the above embodiment that after all the actuators are restarted, when no comprehensive parameter of the actuator is greater than or equal to the preset value, the prompt message is sent to the terminal device corresponding to the tester, so that the tester can be prompted to perform troubleshooting or debugging, and the effect of subsequent testing efficiency is improved.
Fig. 3 is a schematic structural diagram of a script testing apparatus according to an embodiment of the present application. As shown in fig. 3, the script testing apparatus 300 includes: the device comprises a parameter acquisition module 301, a parameter determination module 302, an execution machine determination module 303, a time determination module 304, a script acquisition module 305 and a script sending module 306.
The parameter obtaining module 301 is configured to, in response to the starting of the test task, obtain at least one state parameter of all the execution machines.
And a parameter determining module 302, configured to determine, according to the state parameter, a comprehensive state parameter of each execution machine.
And the execution machine determining module 303 is configured to determine a target execution machine according to the comprehensive state parameter of each execution machine.
And the time determining module 304 is configured to determine the target waiting time of the script to be tested according to the comprehensive state parameter of the target execution machine.
And a script obtaining module 305, configured to determine the target waiting time as the waiting time of the script to be tested, so as to obtain the target script.
And the script sending module 306 is configured to send the target script to the target execution machine, so that the target execution machine tests the target script.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
In a possible implementation manner, the time determining module 304 is specifically configured to determine, according to the comprehensive state parameter of the target execution machine, a target parameter interval to which the comprehensive state parameter belongs. And searching the corresponding relation between the preset parameter interval and the target waiting time according to the target parameter interval to obtain the target waiting time. Or, inputting the comprehensive state parameter of the target execution machine into a preset waiting time calculation function to obtain the target waiting time.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
In a possible implementation manner, the parameter determining module 302 is specifically configured to search, according to any state parameter of any execution machine, a corresponding relationship between a preset state parameter range corresponding to any state parameter and a parameter state value, and obtain a parameter state value corresponding to any state parameter. And inputting each state value corresponding to any one execution machine into a preset comprehensive state parameter calculation function to obtain the comprehensive state parameter of any one execution machine.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
In one possible implementation, the state parameters include a central processing unit occupancy rate, a memory occupancy rate, and a response speed.
Correspondingly, the parameter determining module 302 is specifically configured to search a preset corresponding relationship between the occupancy rate range of the central processing unit and the processor occupancy state value according to the occupancy rate of the central processing unit of any one of the execution machines, so as to obtain a corresponding processor occupancy state value. And searching the corresponding relation between the preset memory occupancy rate range and the memory occupancy state value according to the memory occupancy rate of any execution machine to obtain the corresponding memory occupancy state value. And searching the corresponding relation between the preset response speed range and the response speed state value according to the response speed of any execution machine to obtain the corresponding response speed state value.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
In a possible implementation manner, the parameter determining module 302 is specifically configured to input the processor occupation state value, the memory occupation state value, and the response speed state value corresponding to any one of the execution machines into a preset comprehensive state parameter calculation function, so as to obtain a comprehensive state parameter of any one of the execution machines.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
In a possible implementation manner, the script testing apparatus 300 further includes: the execution engine restarts the module 307.
And an execution machine restarting module 307, configured to restart all execution machines if the comprehensive state parameters of all execution machines are smaller than the preset value, and re-execute the step of obtaining the state parameters of the execution machines and the comprehensive state parameters of the computer execution machines.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
In a possible implementation manner, the script testing apparatus 300 further includes: an information sending module 308.
And the information sending module 308 is configured to send prompt information to the terminal device corresponding to the tester if the comprehensive state parameters of all the execution machines are smaller than the preset value.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
In order to realize the above embodiments, the embodiments of the present application further provide an electronic device.
Referring to fig. 4, a schematic structural diagram of an electronic device 400 suitable for implementing the embodiment of the present application is shown, where the electronic device 400 may be a terminal device or a server. Among them, the terminal Device may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a Digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a Portable Multimedia Player (PMP), a car navigation terminal (e.g., a car navigation terminal), etc., and a fixed terminal such as a Digital TV, a desktop computer, etc. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 4, the electronic device 400 may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 401 and a Memory 402 communicatively connected to the processor, where the Memory 402 may be a Read Only Memory (ROM), and the processor 101 may perform various suitable actions and processes according to programs stored in the Memory 402, computer execution instructions, or programs loaded from a storage device 408 into a Random Access Memory (RAM) 403, so as to implement the script test method in any of the above embodiments. In the RAM 403, various programs and data necessary for the operation of the electronic apparatus 400 are also stored. The processor 401, memory 402 and RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, tape, hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices, either wirelessly or by wire, to exchange data. While fig. 4 illustrates an electronic device 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be alternatively implemented or provided.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or installed from the storage device 408, or installed from the memory 402. The computer program, when executed by the processor 401, performs the above-described functions defined in the methods of embodiments of the present application.
It should be noted that the computer readable storage medium mentioned above in the present application may be a computer readable signal medium or a computer storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer-readable storage medium may be included in the electronic device; or may be separate and not incorporated into the electronic device.
The computer-readable storage medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of Network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the module itself, for example, the parameter determination module may also be described as an "integrated status parameter determination module".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
The present application further provides a computer-readable storage medium, where a computer execution instruction is stored in the computer-readable storage medium, and when a processor executes the computer execution instruction, the technical solution of the script testing method in any of the above embodiments is implemented, and the implementation principle and the beneficial effect of the script testing method are similar to those of the script testing method, which can be referred to as the implementation principle and the beneficial effect of the script testing method, and are not described herein again.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The present application further provides a computer program product, including a computer program, where when the computer program is executed by a processor, the technical solution of the script testing method in any of the above embodiments is implemented, and the implementation principle and the beneficial effects of the computer program are similar to those of the script testing method, and reference may be made to the implementation principle and the beneficial effects of the script testing method, which are not described herein again.
The foregoing description is only exemplary of the preferred embodiments of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the disclosure. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A script testing method, comprising:
responding to the starting of the test task, and acquiring at least one state parameter of all the execution machines;
determining comprehensive state parameters of each execution machine according to the state parameters;
determining a target execution machine according to the comprehensive state parameters of each execution machine;
determining the target waiting time of the script to be tested according to the comprehensive state parameters of the target execution machine;
determining the target waiting time as the waiting time of the script to be tested to obtain a target script;
and sending the target script to the target execution machine so that the target execution machine tests the target script.
2. The method of claim 1, wherein determining a target latency of a script to be tested based on the composite state parameters of the target execution machine comprises:
determining a target parameter interval to which the comprehensive state parameter belongs according to the comprehensive state parameter of the target execution machine; searching a corresponding relation between a preset parameter interval and target waiting time according to the target parameter interval to obtain the target waiting time; or the like, or, alternatively,
and inputting the comprehensive state parameters of the target execution machine into a preset waiting time calculation function to obtain the target waiting time.
3. The method of claim 1, wherein determining the composite state parameter for each of the execution machines based on the state parameters comprises:
searching a corresponding relation between a preset state parameter range and a parameter state value corresponding to any state parameter according to any state parameter of any execution machine to obtain a parameter state value corresponding to any state parameter;
and inputting each state value corresponding to any one execution machine into a preset comprehensive state parameter calculation function to obtain the comprehensive state parameter of any one execution machine.
4. The method of claim 3, wherein the status parameters include CPU occupancy, memory occupancy, and response speed;
correspondingly, the searching for a corresponding relationship between a preset state parameter range corresponding to any state parameter and a parameter state value according to any state parameter of any execution machine to obtain a parameter state value corresponding to any state parameter includes:
searching a corresponding relation between a preset central processor occupancy rate range and a processor occupancy state value according to the central processor occupancy rate of any one execution machine to obtain a corresponding processor occupancy state value;
searching a corresponding relation between a preset memory occupancy rate range and a memory occupancy state value according to the memory occupancy rate of any one execution machine to obtain a corresponding memory occupancy state value;
and searching a corresponding relation between a preset response speed range and a response speed state value according to the response speed of any one of the execution machines to obtain a corresponding response speed state value.
5. The method of claim 4, wherein the inputting each state value corresponding to the any one of the execution machines into a preset integrated state parameter calculation function to obtain an integrated state parameter of the any one of the execution machines comprises:
and inputting the processor occupation state value, the memory occupation state value and the response speed state value corresponding to any one execution machine into a preset comprehensive state parameter calculation function to obtain the comprehensive state parameter of any one execution machine.
6. The method according to any one of claims 1 to 5, wherein after determining the composite state parameter of each of the execution machines according to the state parameters, further comprising:
and if the comprehensive state parameters of all the execution machines are smaller than the preset value, restarting all the execution machines, and executing the steps of obtaining the state parameters of the execution machines and calculating the comprehensive state parameters of the execution machines again.
7. The method of claim 6, wherein after the step of re-executing the steps of obtaining the state parameters of the execution machine and the comprehensive state parameters of the execution machine, further comprising:
and if the comprehensive state parameters of all the execution machines are smaller than the preset value, sending prompt information to the terminal equipment corresponding to the tester.
8. A script test apparatus, comprising:
the parameter acquisition module is used for responding to the starting of the test task and acquiring at least one state parameter of all the execution machines;
the parameter determining module is used for determining the comprehensive state parameters of each execution machine according to the state parameters;
the execution machine determining module is used for determining a target execution machine according to the comprehensive state parameters of all execution machines;
the time determining module is used for determining the target waiting time of the script to be tested according to the comprehensive state parameters of the target execution machine;
the script obtaining module is used for determining the target waiting time as the waiting time of the script to be tested to obtain the target script;
and the script sending module is used for sending the target script to the target execution machine so as to enable the target execution machine to test the target script.
9. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer execution instructions;
the processor executing the computer-executable instructions stored by the memory causes the processor to perform the script testing method of any one of claims 1 to 7.
10. A computer-readable storage medium having computer-executable instructions stored therein, which when executed by a processor, are configured to implement the script testing method of any one of claims 1 to 7.
CN202211483360.2A 2022-11-24 2022-11-24 Script testing method, device, equipment and storage medium Pending CN115729824A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211483360.2A CN115729824A (en) 2022-11-24 2022-11-24 Script testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211483360.2A CN115729824A (en) 2022-11-24 2022-11-24 Script testing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115729824A true CN115729824A (en) 2023-03-03

Family

ID=85297928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211483360.2A Pending CN115729824A (en) 2022-11-24 2022-11-24 Script testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115729824A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991747A (en) * 2023-09-26 2023-11-03 新华三技术有限公司 Method, device, electronic equipment and storage medium for analyzing test error item

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991747A (en) * 2023-09-26 2023-11-03 新华三技术有限公司 Method, device, electronic equipment and storage medium for analyzing test error item
CN116991747B (en) * 2023-09-26 2023-12-15 新华三技术有限公司 Method, device, electronic equipment and storage medium for analyzing test error item

Similar Documents

Publication Publication Date Title
CN110321958B (en) Training method of neural network model and video similarity determination method
CN111581291A (en) Data processing method and device, electronic equipment and readable medium
CN112596720A (en) Service operation method and device, electronic equipment and computer storage medium
CN115729824A (en) Script testing method, device, equipment and storage medium
CN112257478A (en) Code scanning method, device, terminal and storage medium
CN111625422A (en) Thread monitoring method and device, electronic equipment and computer readable storage medium
US20190258736A1 (en) Dynamic Execution of ETL Jobs Without Metadata Repository
CN112965916A (en) Page testing method, page testing device, electronic equipment and readable storage medium
CN112084024A (en) Memory monitoring method, device, medium and electronic equipment
US20230359483A1 (en) Method for applet page rendering, electronic device and storage medium
CN112286808B (en) Application program testing method and device, electronic equipment and medium
CN112506781B (en) Test monitoring method, device, electronic equipment, storage medium and program product
CN113176937A (en) Task processing method and device and electronic equipment
CN113297277A (en) Test statistic determination method, device, readable medium and electronic equipment
CN113971192A (en) Data processing method and device, readable medium and electronic equipment
CN113779461A (en) Data loading method and device and electronic equipment
CN111538717A (en) Data processing method and device, electronic equipment and computer readable medium
CN112799863A (en) Method and apparatus for outputting information
CN111625707B (en) Recommendation response method, device, medium and equipment
CN111258670B (en) Method and device for managing component data, electronic equipment and storage medium
CN111562913B (en) Method, device and equipment for pre-creating view component and computer readable medium
CN115373972A (en) Interface testing method and device, storage medium and electronic equipment
CN111209042B (en) Method, device, medium and electronic equipment for establishing function stack
CN113641587A (en) Operation interface test method, device, terminal and storage medium
CN112784199A (en) Event flow processing method, device, storage medium and program product

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