WO2019169757A1 - 测试控制和测试执行装置、方法及计算机存储介质 - Google Patents

测试控制和测试执行装置、方法及计算机存储介质 Download PDF

Info

Publication number
WO2019169757A1
WO2019169757A1 PCT/CN2018/089181 CN2018089181W WO2019169757A1 WO 2019169757 A1 WO2019169757 A1 WO 2019169757A1 CN 2018089181 W CN2018089181 W CN 2018089181W WO 2019169757 A1 WO2019169757 A1 WO 2019169757A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
response time
result data
indicator
preset
Prior art date
Application number
PCT/CN2018/089181
Other languages
English (en)
French (fr)
Inventor
赖洲维
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019169757A1 publication Critical patent/WO2019169757A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Definitions

  • the present application relates to the field of computer technology, and in particular, to a test control and test execution apparatus, method, and computer storage medium.
  • test execution device In the process of performance testing of distributed test systems, when testing is required under large concurrency, one test execution device cannot support more concurrent tests. In this case, multiple test execution devices need to be distributed. Support for large concurrent tests.
  • communication and data transmission are generally implemented between the control machine and the test execution device through a TCP (Transmission Control Protocol) protocol. Further, the control of the test execution device is implemented and the execution result directly returned by the test execution device is received through the channel. Since the synchronization performance in the distributed test has a great influence on the test result, the communication and the test mode are executed for the test.
  • TCP Transmission Control Protocol
  • the synchronization control of the device is relatively poor, and the number of concurrent requests is too large, resulting in loss of data packets during the transmission process.
  • multiple test machines are executed concurrently, which is lower than the result of testing with a single test execution device, resulting in direct Affects the test results, which affects the judgment of system performance.
  • the present application provides a test control and test execution device, method and computer storage medium, the main purpose of which is to solve the problem that the distributed performance test result is inaccurate in the existing test solution.
  • the present application provides a test control apparatus for a distributed test system, the apparatus comprising a memory and a processor, wherein the memory stores a test control program executable on the processor, the test control
  • the program implements the following steps when executed by the processor:
  • the device Simultaneously transmitting a test open command to the connected plurality of test execution devices, wherein the plurality of test execution devices concurrently execute the test script according to the test open command to test the test object, wherein the plurality of test executions
  • the device When receiving the test result data sent by the test object, the device records the test response time, and writes the test response time and the test result data back to the database server;
  • test response time and test result data of the test object are read from the database server;
  • the present application provides a test execution apparatus for a distributed test system, the apparatus comprising a memory and a processor, wherein the memory stores a test execution program executable on the processor, the test execution
  • the program implements the following steps when executed by the processor:
  • test control device When receiving the test open command sent by the test control device, executing the test script to test the test object;
  • test result data returned by the test object Upon receiving the test result data returned by the test object, recording the test response time, and writing the test response time and the test result data back to the database server for the test control device to read the test from the database server.
  • the response time and the test result data are obtained, and the indicator result of the test object on the preset test indicator item is obtained according to the test response time and the test result data.
  • the present application further provides a test control method for a distributed test system, the method comprising:
  • the device Simultaneously transmitting a test open command to the connected plurality of test execution devices, wherein the plurality of test execution devices concurrently execute the test script according to the test open command to test the test object, wherein the plurality of test executions
  • the device When receiving the test result data sent by the test object, the device records the test response time, and writes the test response time and the test result data back to the database server;
  • test response time and test result data of the test object are read from the database server;
  • the present application further provides a test execution method of a distributed test system, the method comprising:
  • test control device When receiving the test open command sent by the test control device, executing the test script to test the test object;
  • test result data returned by the test object Upon receiving the test result data returned by the test object, recording the test response time, and writing the test response time and the test result data back to the database server for the test control device to read the test from the database server.
  • the response time and the test result data are obtained, and the indicator result of the test object on the preset test indicator item is obtained according to the test response time and the test result data.
  • the present application further provides a computer readable storage medium having a test control program stored thereon, the test control program being executable by one or more processors to implement The steps of the test control method of the distributed test system as described above.
  • the test control and test execution device, method and computer storage medium provided by the present application are synchronously sent by the test control device to the connected plurality of test execution devices, so that the plurality of test execution devices concurrently execute the test according to the test start command.
  • the test script is executed to test the test object, and the test execution device records the test response time when receiving the test result data sent by the test object, and writes the test response time and the test result data back to the database server in multiple tests.
  • the execution device reads the test response time and the test result data from the database server, and obtains the indicator result of the test object on the preset test indicator item according to the obtained data and displays it.
  • the application controls the plurality of test execution devices to execute the test script synchronously by the test control device, ensures the synchronization of the test script execution, and the test execution device writes back to the database server after receiving the running result data, and the control device ends the test.
  • statistical analysis is performed to avoid the phenomenon of packet loss during transmission, improve the accuracy of performance testing, and solve the problem of inaccurate distributed performance test results in the existing test scheme.
  • FIG. 1 is a schematic diagram of a preferred embodiment of a test control apparatus for a distributed test system of the present application
  • FIG. 2 is a schematic diagram of a program module of a test control program in an embodiment of a test control device of a distributed test system of the present application;
  • FIG. 3 is a schematic diagram of a preferred embodiment of a test execution device of a distributed test system of the present application
  • FIG. 4 is a flow chart of a preferred embodiment of a test control method for a distributed test system of the present application
  • FIG. 5 is a flowchart of a preferred embodiment of a test execution method of a distributed test system of the present application.
  • the application provides a test control device for a distributed test system.
  • FIG. 1 a schematic diagram of a preferred embodiment of a test control device for a distributed test system of the present application is shown.
  • the test control device of the distributed test system may be a PC (Personal Computer), or may be a mobile terminal device having a display function such as a smart phone, a tablet computer, or a portable computer.
  • PC Personal Computer
  • the test control device of the distributed test system may be a PC (Personal Computer), or may be a mobile terminal device having a display function such as a smart phone, a tablet computer, or a portable computer.
  • the test control device of the distributed test system includes at least a memory 11, a processor 12, a communication bus 13, and a network interface 14.
  • the memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
  • the memory 11 may in some embodiments be an internal storage unit of a test control device of a distributed test system, such as a hard disk of a test control device of the distributed test system.
  • the memory 11 may also be an external storage device of the test control device of the distributed test system in other embodiments, such as a plug-in hard disk equipped with a test control device of the distributed test system, and a smart memory card (Smart Media Card, SMC). ), Secure Digital (SD) card, Flash Card, etc.
  • SD Secure Digital
  • the memory 11 may also include an internal storage unit of the test control device of the distributed test system as well as an external storage device.
  • the memory 11 can be used not only for storing application software of various types of data installed in the test control device of the distributed test system, such as code for testing the control program, but also for temporarily storing data that has been output or is to be output.
  • the processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11. Data, such as executing test control programs, etc.
  • CPU Central Processing Unit
  • controller microcontroller
  • microprocessor microprocessor or other data processing chip for running program code or processing stored in the memory 11.
  • Data such as executing test control programs, etc.
  • Communication bus 13 is used to implement connection communication between these components.
  • the network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
  • a standard wired interface such as a WI-FI interface
  • Figure 1 shows only the test control device of the distributed test system with components 11-14 and test control programs, but it should be understood that not all illustrated components may be implemented, and alternative implementations may be more or less s component.
  • the device may further include a user interface
  • the user interface may include a display
  • an input unit such as a keyboard
  • the optional user interface may further include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like.
  • the display may also be suitably referred to as a display screen or display unit for displaying information processed in the test control device of the distributed test system and a user interface for displaying the visualization.
  • a test control program is stored in the memory 11; when the processor 12 executes the test control program stored in the memory 11, the following steps are implemented:
  • the device Simultaneously transmitting a test open command to the connected plurality of test execution devices, wherein the plurality of test execution devices concurrently execute the test script according to the test open command to test the test object, wherein the plurality of test executions
  • the device When receiving the test result data sent by the test object, the device records the test response time, and writes the test response time and the test result data back to the database server.
  • test control device of the distributed test system proposed in this embodiment is connected to a plurality of test execution devices when used for testing, and controls the operation of the test execution device by sending test commands to the test execution device, for example,
  • the instruction in the embodiment is triggered by the corresponding shell script.
  • the test execution device pre-stores test scripts for executing test task information.
  • the test execution device sends a processing request to the test object, and receives the processing result of the test object on the processing request, that is, the test result data.
  • the test object can be a system, an interface, or an application. The specific content of the processing request needs to be determined according to the function of the test object.
  • the test control device synchronously transmits a test open command to the connected plurality of test execution devices, the command being triggered by the corresponding shell script, and the test execution device performing the test when receiving the test open command sent by the test control device
  • the script tests the test object, records the test response time when receiving the test result data returned by the test object, and writes the test response time and test result data back to the database server for the test control device to read from the database server.
  • the test response time and the test result data are taken, and the test result of the test object on the preset test index item is obtained according to the test response time and the test result data.
  • a large number of processing requests need to be sent to the test object at the same time to test the performance of the test object.
  • twenty test execution devices are connected to the test control device, and each test execution device can synchronously transmit three. If hundreds of processing requests are processed, the distributed test system can simultaneously send 6,000 processing requests at the same time. This number is only for illustration. In actual testing, the number of specific test execution devices and each test execution can be set as needed. The number of requests that the device can send at the same time.
  • Each execution machine is deployed with a thread group containing multiple threads. During the test, all the threads in the thread group can be started according to the script.
  • test response time and the test result data of the test object are read from the database server.
  • the test object is a registration interface provided by the target business system, and the registration interface provides a registration function.
  • each execution device simultaneously triggers a registration request to the registration interface in a multi-threaded manner, and the target service system
  • the received registration request is processed by the registration interface and the result of the request processing is returned.
  • the execution device records the response time of the registration interface for each request, and each execution device writes the running result data in the cache back to the database server.
  • the database is deployed on a server independent of the above-described control device and executing device, which may be a time series server influxDB.
  • the step of obtaining, according to the obtained test response time and the test result data, the indicator result of the test object on the preset test indicator item and displaying the method includes:
  • the preset test indicator items may include but are not limited to the following items: average response time, 90% response time, number of requests per second, response failure rate, and throughput.
  • the average response time and the 90% response time can be calculated according to the response time obtained from the database and the total request amount, and the response failure rate can be calculated according to the test result data.
  • test execution device when testing, there may be a need to test multiple functions of a test object. In this case, multiple test scripts need to be stored in the test execution program, respectively, for initiating corresponding processing to the test object. request. Therefore, for the test execution device, when the test open command sent by the test control device is received, the steps of executing the test script to test the test object include:
  • test task information When receiving the test start command sent by the test control device, determining test task information to be executed according to the test open command, and searching and determining the test task information according to the mapping relationship between the preset test task information and the test script Test script; execute the found test script to test the test object.
  • test scripts are stored on the test execution device, and a mapping relationship between the test script and the test task information is established, and the test open command sent by the test control device includes test task information, and the test execution device is When receiving the test open command, the test script corresponding to the test task information needs to be searched according to the above mapping relationship and executed.
  • the control device and the execution device of the distributed test generally implement data transmission through the TCP protocol, but when the amount of concurrent is large, multiple execution devices simultaneously send a large amount of test result data to the control device, resulting in a transmission process. The data packet is lost, which leads to a large error in the test result.
  • the test control device proposed in this embodiment does not need to transmit test result data through the TCP protocol, and the test execution device writes the data back to the database server from the cache when the processing result returned by the test object is obtained, and the server is independent of the test control.
  • the device and the test execution device provide data storage functions separately, thus avoiding packet loss and improving the accuracy of test results.
  • the test control device provided in this embodiment synchronously sends a test open command to a plurality of connected test execution devices, so that the plurality of test execution devices execute test scripts concurrently according to the test open command to test and test the test object.
  • the execution device records the test response time, writes the test response time and the test result data back to the database server, and after the test execution script is executed by the plurality of test execution devices, from the database server.
  • the test response time and the test result data are read, and the indicator result of the test object on the preset test indicator item is obtained and displayed according to the acquired data.
  • the application controls the plurality of test execution devices to execute the test script synchronously by the test control device, ensures the synchronization of the test script execution, and the test execution device writes back to the database server after receiving the running result data, and the control device ends the test.
  • statistical analysis is performed to avoid the phenomenon of packet loss during transmission, improve the accuracy of performance testing, and solve the problem of inaccurate distributed performance test results in the existing test scheme.
  • the test control program may also be divided into one or more modules, one or more modules being stored in the memory 11 and being processed by one or more processors (this embodiment is The processor 12) is executed to complete the application, and the module referred to in the present application refers to a series of computer program instruction segments capable of performing a specific function for describing the execution process of the test control program in the test control device of the distributed test system. .
  • FIG. 2 it is a schematic diagram of a program module of a test control program in an embodiment of a test control apparatus of a distributed test system of the present application.
  • the test control program may be divided into an instruction sending module 10 and data.
  • the reading module 20 and the result analysis module 30 are exemplarily:
  • the command sending module 10 is configured to: synchronously send a test open command to the connected plurality of test execution devices, wherein the plurality of test execution devices concurrently execute the test script according to the test open command, and test the test object, wherein The plurality of test execution devices record the test response time when receiving the test result data sent by the test object, and write back the test response time and the test result data to the database server;
  • the data reading module 20 is configured to: after the plurality of test execution devices execute the completion test script, read the test response time and the test result data of the test object from the database server;
  • the result analysis module 30 is configured to: obtain the indicator result of the test object on the preset test indicator item according to the obtained test response time and the test result data, and display the indicator result.
  • the present application also provides a test execution device of a distributed test system.
  • FIG. 3 it is a schematic diagram of a preferred embodiment of the test execution device of the distributed test system of the present application.
  • the test execution device of the distributed test system may be a PC (Personal Computer), or may be a portable terminal device having a display function such as a smart phone, a tablet computer, or a portable computer.
  • PC Personal Computer
  • portable terminal device having a display function such as a smart phone, a tablet computer, or a portable computer.
  • the test execution device of the distributed test system includes at least a memory 21, a processor 22, a communication bus 23, and a network interface 24.
  • the memory 21 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
  • the memory 21 may, in some embodiments, be an internal storage unit of a test execution device of a distributed test system, such as a hard disk of a test execution device of the distributed test system.
  • the memory 21 may also be an external storage device of the test execution device of the distributed test system in other embodiments, such as a plug-in hard disk equipped with a test execution device of the distributed test system, and a smart memory card (Smart Media Card, SMC). ), Secure Digital (SD) card, Flash Card, etc.
  • SD Secure Digital
  • the memory 21 may also include an internal storage unit of the test execution device of the distributed test system as well as an external storage device.
  • the memory 21 can be used not only for storing application software installed in the test execution device of the distributed test system and various types of data, such as code for testing the control program, but also for temporarily storing data that has been output or will be output.
  • the processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 21. Data, such as executing test control programs, etc.
  • CPU Central Processing Unit
  • controller microcontroller
  • microprocessor microprocessor or other data processing chip for running program code or processing stored in the memory 21. Data, such as executing test control programs, etc.
  • Communication bus 23 is used to implement connection communication between these components.
  • the network interface 24 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
  • a standard wired interface such as a WI-FI interface
  • Figure 3 shows only the test execution device of the distributed test system with components 21-24 and test control programs, but it should be understood that not all illustrated components may be implemented, alternative implementations may be more or less s component.
  • a test execution program is stored in the memory 21; when the processor 22 executes the test execution program stored in the memory 21, the following steps are implemented:
  • test control device When receiving the test open command sent by the test control device, executing the test script to test the test object;
  • test result data returned by the test object Upon receiving the test result data returned by the test object, recording the test response time, and writing the test response time and the test result data back to the database server for the test control device to read the test from the database server.
  • the response time and the test result data are obtained, and the indicator result of the test object on the preset test indicator item is obtained according to the test response time and the test result data.
  • the step of executing the test script to test the test object includes:
  • test task information When receiving the test start command sent by the test control device, determining test task information to be executed according to the test open command, and searching and determining the test task information according to the mapping relationship between the preset test task information and the test script Test script
  • test execution device of the distributed test system of the present application refers to the description in the test control device of the distributed test system described above, and no further description is provided herein.
  • the present application also provides a test control method for a distributed test system.
  • FIG. 4 it is a flowchart of a preferred embodiment of a test control method for a distributed test system of the present application. The method can be performed by a device that can be implemented by software and/or hardware.
  • test control method of the distributed test system includes:
  • Step S10 synchronously transmitting a test opening instruction to the connected plurality of test execution devices, so that the plurality of test execution devices concurrently execute the test script according to the test open command, and testing the test object, wherein the plurality of test objects
  • the test execution device records the test response time when receiving the test result data sent by the test object, and writes the test response time and the test result data back to the database server.
  • test control device when used for testing, it is connected to a plurality of test execution devices, and controls the operation of the test execution device by sending a test command to the test execution device, for example, an instruction such as opening, stopping, file transfer, etc., wherein The test instructions in this embodiment are all triggered by the corresponding shell script.
  • the test execution device pre-stores test scripts for executing test task information.
  • the test execution device sends a processing request to the test object, and receives the processing result of the test object on the processing request, that is, the test result data.
  • the test object can be a system, an interface, or an application. The specific content of the processing request needs to be determined according to the function of the test object.
  • the test control device synchronously transmits a test open command to the connected plurality of test execution devices, the command being triggered by the corresponding shell script, and the test execution device performing the test when receiving the test open command sent by the test control device
  • the script tests the test object, records the test response time when receiving the test result data returned by the test object, and writes the test response time and test result data back to the database server for the test control device to read from the database server.
  • the test response time and the test result data are taken, and the test result of the test object on the preset test index item is obtained according to the test response time and the test result data.
  • a large number of processing requests need to be sent to the test object at the same time to test the performance of the test object.
  • twenty test execution devices are connected to the test control device, and each test execution device can synchronously transmit three. If hundreds of processing requests are processed, the distributed test system can simultaneously send 6,000 processing requests at the same time. This number is only for illustration. In actual testing, the number of specific test execution devices and each test execution can be set as needed. The number of requests that the device can send at the same time.
  • Each execution machine is deployed with a thread group containing multiple threads. During the test, all the threads in the thread group can be started according to the script.
  • Step S20 after the plurality of test execution devices execute the completion test script, read the test response time and the test result data of the test object from the database server.
  • Step S30 Acquire and display the indicator result of the test object on the preset test indicator item according to the obtained test response time and the test result data.
  • the test object is a registration interface provided by the target business system, and the registration interface provides a registration function.
  • each execution device simultaneously triggers a registration request to the registration interface in a multi-threaded manner, and the target service system
  • the received registration request is processed by the registration interface and the result of the request processing is returned.
  • the execution device records the response time of the registration interface for each request, and each execution device writes the running result data in the cache back to the database server.
  • the database is deployed on a server independent of the above-described control device and executing device, which may be a time series server influxDB.
  • the step S30 includes:
  • the preset test indicator items may include but are not limited to the following items, such as average response time, 90% response time, number of requests per second, response failure rate, and throughput.
  • the average response time and the 90% response time can be calculated according to the response time obtained from the database and the total request amount, and the response failure rate can be calculated according to the test result data.
  • test execution device when testing, there may be a need to test multiple functions of a test object. In this case, multiple test scripts need to be stored in the test execution program, respectively, for initiating corresponding processing to the test object. request. Therefore, for the test execution device, when the test open command sent by the test control device is received, the steps of executing the test script to test the test object include:
  • test task information When receiving the test start command sent by the test control device, determining test task information to be executed according to the test open command, and searching and determining the test task information according to the mapping relationship between the preset test task information and the test script Test script; execute the found test script to test the test object.
  • test scripts are stored on the test execution device, and a mapping relationship between the test script and the test task information is established, and the test open command sent by the test control device includes test task information, and the test execution device is When receiving the test open command, the test script corresponding to the test task information needs to be searched according to the above mapping relationship and executed.
  • the control device and the execution device of the distributed test generally implement data transmission through the TCP protocol, but when the amount of concurrent is large, multiple execution devices simultaneously send a large amount of test result data to the control device, resulting in a transmission process. The data packet is lost, which leads to a large error in the test result.
  • the test control device proposed in this embodiment does not need to transmit test result data through the TCP protocol, and the test execution device writes the data back to the database server from the cache when the processing result returned by the test object is obtained, and the server is independent of the test control.
  • the device and the test execution device provide data storage functions separately, thus avoiding packet loss and improving the accuracy of test results.
  • the test control method provided in this embodiment synchronously sends a test open command to a plurality of connected test execution devices, so that the plurality of test execution devices execute test scripts concurrently according to the test open command to test and test the test object.
  • the execution device When receiving the test result data sent by the test object, the execution device records the test response time, writes the test response time and the test result data back to the database server, and after the test execution script is executed by the plurality of test execution devices, from the database server
  • the test response time and the test result data are read, and the indicator result of the test object on the preset test indicator item is obtained and displayed according to the acquired data.
  • the application controls the plurality of test execution devices to execute the test script synchronously by the test control device, ensures the synchronization of the test script execution, and the test execution device writes back to the database server after receiving the running result data, and the control device ends the test.
  • statistical analysis is performed to avoid the phenomenon of packet loss during transmission, improve the accuracy of performance testing, and solve the problem of inaccurate distributed performance test results in the existing test scheme.
  • the present application also provides a test execution method of a distributed test system.
  • FIG. 5 it is a flowchart of a preferred embodiment of a test execution method for a distributed test system of the present application. The method can be performed by a device that can be implemented by software and/or hardware.
  • test execution method of the distributed test system includes:
  • Step S40 when receiving the test opening instruction sent by the test control device, executing the test script to test the test object;
  • Step S50 when receiving the test result data returned by the test object, recording the test response time, and writing back the test response time and the test result data to the database server for the test control device to be from the database server.
  • the test response time and the test result data are read, and the indicator result of the test object on the preset test indicator item is obtained according to the test response time and the test result data.
  • the step S40 includes: when receiving the test start command sent by the test control device, determining the test task information to be executed according to the test open command, according to the mapping relationship between the preset test task information and the test script. Find a test script corresponding to the determined test task information; execute the found test script to test the test object.
  • test execution method of the distributed test system of the present application refers to the description in the test control method of the distributed test system, which is not described herein.
  • test control program is stored on the computer readable storage medium, and the test control program can be executed by one or more processors to implement the following operations:
  • the device Simultaneously transmitting a test open command to the connected plurality of test execution devices, wherein the plurality of test execution devices concurrently execute the test script according to the test open command to test the test object, wherein the plurality of test executions
  • the device When receiving the test result data sent by the test object, the device records the test response time, and writes the test response time and the test result data back to the database server;
  • test response time and test result data of the test object are read from the database server;
  • test execution program is stored on the computer storage medium, and the test execution program can be executed by one or more processors to:
  • test control device When receiving the test open command sent by the test control device, executing the test script to test the test object;
  • test result data returned by the test object Upon receiving the test result data returned by the test object, recording the test response time, and writing the test response time and the test result data back to the database server for the test control device to read the test from the database server.
  • the response time and the test result data are obtained, and the indicator result of the test object on the preset test indicator item is obtained according to the test response time and the test result data.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.

Abstract

一种分布式测试系统的测试控制装置,包括存储器和处理器,存储器上存储有可在处理器上运行的测试控制程序,该程序被处理器执行时实现如下步骤:同步地向连接的多台测试执行装置发送测试开启指令,以供多台测试执行装置根据测试开启指令并发地执行测试脚本,对测试对象进行测试(S10);在多台测试执行装置执行完成测试脚本后,从数据库服务器中读取测试对象的测试响应时间和测试结果数据(S20);根据获取到的测试响应时间和测试结果数据获取测试对象在预设的测试指标项上的指标结果并展示(S30)。还提出一种分布式测试系统的测试控制方法以及一种计算机可读存储介质。上述方案解决了采用现有的测试方案中做分布式性能测试结果不准确的问题。

Description

测试控制和测试执行装置、方法及计算机存储介质
本申请基于巴黎公约申明享有2018年03月06日递交的申请号为201810182952.8、名称为“测试控制和测试执行装置、方法及计算机存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种测试控制和测试执行装置、方法及计算机存储介质。
背景技术
在分布式测试系统进行性能测试的过程中,当需要在大并发下进行测试时,一台测试执行装置就没法支持更大并发的测试了,这时需要采用多台测试执行装置分布式来支持大并发的测试。但在目前Jmeter(一种基于Java的压力测试工具)提供的分布式测试系统中,控制机与测试执行装置之间一般是通过TCP(Transmission Control Protocol,传输控制协议)协议实现通信以及数据传输,进而实现对测试执行装置的控制并通过这种渠道接收测试执行装置直接返回的执行结果,由于在分布式测试中同步性的高低对于测试结果的影响较大,这种通信以及测试方式对于测试执行装置的同步性控制比较差,而且由于并发的请求量过大导致传输过程数据包丢失等原因,导致多台测试机并发执行时,比采用单台测试执行装置测试的结果值偏低,导致直接影响了测试结果,从而影响对系统性能的判断。
发明内容
本申请提供一种测试控制和测试执行装置、方法及计算机存储介质,其主要目的在于解决采用现有的测试方案中做分布式性能测试结果不准确的问题。
为实现上述目的,本申请提供一种分布式测试系统的测试控制装置,该装置包括存储器和处理器,所述存储器中存储有可在所述处理器上运行的测 试控制程序,所述测试控制程序被所述处理器执行时实现如下步骤:
同步地向连接的多台测试执行装置发送测试开启指令,以供所述多台测试执行装置根据所述测试开启指令并发地执行测试脚本,对测试对象进行测试,其中,所述多台测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器中;
在所述多台测试执行装置执行完成测试脚本后,从所述数据库服务器中读取所述测试对象的测试响应时间和测试结果数据;
根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示。
为实现上述目的,本申请提供一种分布式测试系统的测试执行装置,该装置包括存储器和处理器,所述存储器中存储有可在所述处理器上运行的测试执行程序,所述测试执行程序被所述处理器执行时实现如下步骤:
在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试;
在接收到测试对象返回的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器,以供所述测试控制装置从所述数据库服务器中读取测试响应时间和测试结果数据,并根据测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果。
此外,为实现上述目的,本申请还提供一种分布式测试系统的测试控制方法,该方法包括:
同步地向连接的多台测试执行装置发送测试开启指令,以供所述多台测试执行装置根据所述测试开启指令并发地执行测试脚本,对测试对象进行测试,其中,所述多台测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器中;
在所述多台测试执行装置执行完成测试脚本后,从所述数据库服务器中读取所述测试对象的测试响应时间和测试结果数据;
根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的 测试指标项上的指标结果并展示。
此外,为实现上述目的,本申请还提供一种分布式测试系统的测试执行方法,该方法包括:
在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试;
在接收到测试对象返回的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器,以供所述测试控制装置从所述数据库服务器中读取测试响应时间和测试结果数据,并根据测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有测试控制程序,所述测试控制程序可被一个或者多个处理器执行,以实现如上所述的分布式测试系统的测试控制方法的步骤。
本申请提出的测试控制和测试执行装置、方法及计算机存储介质,由测试控制装置同步地向连接的多台测试执行装置发送测试开启指令,以供多台测试执行装置根据该测试开启指令并发地执行测试脚本,以对测试对象进行测试,测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,将测试响应时间和测试结果数据回写到数据库服务器中,在多台测试执行装置执行完成测试脚本后,从数据库服务器中读取测试响应时间和测试结果数据,并根据获取的数据获取测试对象在预设的测试指标项上的指标结果并展示。本申请由测试控制装置控制多台测试执行装置同步地执行测试脚本,保证了测试脚本执行的同步性,并且测试执行装置在接收到运行结果数据后回写到数据库服务器,由控制装置在测试结束后从数据库中读取后进行统计分析,避免出现传输过程中数据包丢失的现象,提高了性能测试的准确性,解决了采用现有的测试方案中做分布式性能测试结果不准确的问题。
附图说明
图1为本申请分布式测试系统的测试控制装置较佳实施例的示意图;
图2为本申请分布式测试系统的测试控制装置一实施例中测试控制程序的程序模块示意图;
图3为本申请分布式测试系统的测试执行装置较佳实施例的示意图;
图4为本申请分布式测试系统的测试控制方法较佳实施例的流程图;
图5为本申请分布式测试系统的测试执行方法较佳实施例的流程图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种分布式测试系统的测试控制装置。参照图1所示,为本申请分布式测试系统的测试控制装置较佳实施例的示意图。
在本实施例中,分布式测试系统的测试控制装置可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、便携计算机等具有显示功能的可移动式终端设备。
该分布式测试系统的测试控制装置至少包括存储器11、处理器12,通信总线13,以及网络接口14。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是分布式测试系统的测试控制装置的内部存储单元,例如该分布式测试系统的测试控制装置的硬盘。存储器11在另一些实施例中也可以是分布式测试系统的测试控制装置的外部存储设备,例如分布式测试系统的测试控制装置上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括分布式测试系统的测试控制装置的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于分布式测试系统的测试控制装置的应用软件及各类数据,例如测试控制程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器 11中存储的程序代码或处理数据,例如执行测试控制程序等。
通信总线13用于实现这些组件之间的连接通信。
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置与其他电子设备之间建立通信连接。
图1仅示出了具有组件11-14以及测试控制程序的分布式测试系统的测试控制装置,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
可选地,该装置还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在分布式测试系统的测试控制装置中处理的信息以及用于显示可视化的用户界面。
在图1所示的装置实施例中,存储器11中存储有测试控制程序;处理器12执行存储器11中存储的测试控制程序时实现如下步骤:
同步地向连接的多台测试执行装置发送测试开启指令,以供所述多台测试执行装置根据所述测试开启指令并发地执行测试脚本,对测试对象进行测试,其中,所述多台测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器中。
需要说明的是,本实施例中提出的分布式测试系统的测试控制装置在用于测试时,与多台测试执行装置连接,通过向测试执行装置发送测试指令控制测试执行装置的运行,例如开启、停止、文件传输等指令,其中,本实施例中的测试指令均通过对应的shell脚本触发。测试执行装置上预先存储有用于执行测试任务信息的测试脚本,当运行这些测试脚本时,测试执行装置会向测试对象发送处理请求,并接收测试对象对处理请求的处理结果,即测试结果数据。其中,测试对象可以是系统、接口或者应用程序等。其中,处理请求的具体内容需要根据测试对象的功能来确定。
在开始测试时,测试控制装置同步地向连接的多台测试执行装置发送测 试开启指令,该指令通过对应的shell脚本触发,测试执行装置在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试,在接收到测试对象返回的测试结果数据时,记录测试响应时间,并将测试响应时间和测试结果数据回写到数据库服务器,以供测试控制装置从数据库服务器中读取测试响应时间和测试结果数据,并根据测试响应时间和测试结果数据获取测试对象在预设的测试指标项上的指标结果。
一般在性能测试时,需要同时向测试对象发送大量的处理请求以对测试对象的性能进行测试,例如,设置二十台测试执行装置与测试控制装置连接,每台测试执行装置可以同步地发送三百条处理请求,则分布式测试系统则能够同时实现同时发送六千条处理请求,该数字只为举例说明,在实际测试中,可以根据需要设置具体的测试执行装置的数量以及每台测试执行装置可同时发送的请求的数量,其中,每台执行机上都部署有包含有多个线程的线程组,测试时能够根据脚本同时启动线程组中的所有线程。
在所述多台测试执行装置执行完成测试脚本后,从所述数据库服务器中读取所述测试对象的测试响应时间和测试结果数据。
根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示。
例如,测试对象是目标业务系统提供的注册接口,该注册接口提供注册功能,多台测试执行装置运行测试脚本后,各台执行装置同时多线程地触发向该注册接口发送注册请求,目标业务系统通过该注册接口对接收到的注册请求进行处理并返回对请求处理的结果,执行装置记录注册接口对各个请求的响应时间,各台执行装置将缓存中的运行结果数据回写到数据库服务器中。
关于用于存储运行结果数据的数据库,该数据库部署在独立于上述控制装置和执行装置的服务器上,该数据库可以是时间序列服务器influxDB。
作为一种实施方式,所述根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示的步骤包括:
根据预设的测试指标项对应的统计方式对获取到的测试响应时间和测试结果数据进行统计;根据统计结果获取所述测试指标项对应的指标结果,并按照预设的可视化方式展示所述测试指标项的指标结果。其中,预设的测试指标项可以包括但不限于以下几项:如平均响应时间、90%响应时间、每秒钟 请求数、响应失败率、吞吐量。其中,如平均响应时间、90%响应时间可以根据从数据库中获取的响应时间以及总体请求量来计算,响应失败率可以根据测试结果数据来计算。
此外,由于在进行测试时,可能会出现需要对一个测试对象的多个功能进行测试,此时,需要在测试执行程序中存储多个不同的测试脚本,分别用于向测试对象发起对应的处理请求。故,对于测试执行装置来说,将在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试的步骤包括:
在接收到测试控制装置发送的测试开启指令时,根据所述测试开启指令确定待执行的测试任务信息,根据预设的测试任务信息与测试脚本之间的映射关系查找与确定的测试任务信息对应的测试脚本;执行查找到的测试脚本,以对测试对象进行测试。
也就是说,在测试执行装置上存储有多个测试脚本,并且建立测试脚本与测试任务信息之间的映射关系,测试控制装置发送的测试开启指令中包含有与测试任务信息,测试执行装置在接收到测试开启指令时,需要根据上述映射关系查找与测试任务信息对应的测试脚本并执行。
在现有技术中,分布式测试的控制装置与执行装置一般通过TCP协议实现数据的传输,但是当并发量大时,多台执行装置同时向控制装置发送大量的测试结果数据,导致出现传输过程中数据包丢失,进而造成测试结果误差大。本实施例提出的测试控制装置不需要通过TCP协议传输测试结果数据,测试执行装置在得到测试对象返回的处理结果时,从缓存中将这些数据回写到数据库服务器中,该服务器独立于测试控制装置和测试执行装置,单独提供数据存储功能,因此能够避免出现数据包丢失的情况,提高测试结果的准确度。
本实施例提出的测试控制装置,同步地向连接的多台测试执行装置发送测试开启指令,以供多台测试执行装置根据该测试开启指令并发地执行测试脚本,以对测试对象进行测试,测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,将测试响应时间和测试结果数据回写到数据库服务器中,在多台测试执行装置执行完成测试脚本后,从数据库服务器中读取测试响应时间和测试结果数据,并根据获取的数据获取测试对象在预 设的测试指标项上的指标结果并展示。本申请由测试控制装置控制多台测试执行装置同步地执行测试脚本,保证了测试脚本执行的同步性,并且测试执行装置在接收到运行结果数据后回写到数据库服务器,由控制装置在测试结束后从数据库中读取后进行统计分析,避免出现传输过程中数据包丢失的现象,提高了性能测试的准确性,解决了采用现有的测试方案中做分布式性能测试结果不准确的问题。
可选地,在其他的实施例中,测试控制程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述测试控制程序在分布式测试系统的测试控制装置中的执行过程。
例如,参照图2所示,为本申请分布式测试系统的测试控制装置一实施例中的测试控制程序的程序模块示意图,该实施例中,测试控制程序可以被分割为指令发送模块10、数据读取模块20和结果分析模块30,示例性地:
指令发送模块10用于:同步地向连接的多台测试执行装置发送测试开启指令,以供所述多台测试执行装置根据所述测试开启指令并发地执行测试脚本,对测试对象进行测试,其中,所述多台测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器中;
数据读取模块20用于:在所述多台测试执行装置执行完成测试脚本后,从所述数据库服务器中读取所述测试对象的测试响应时间和测试结果数据;
结果分析模块30用于:根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示。
上述指令发送模块10、数据读取模块20和结果分析模块30等程序模块被执行时所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。
此外,本申请还提出一种分布式测试系统的测试执行装置,参照图3所示,为本申请分布式测试系统的测试执行装置较佳实施例的示意图。
在本实施例中,分布式测试系统的测试执行装置可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、便携计算机等具有显示功能的可移动式终端设备。
该分布式测试系统的测试执行装置至少包括存储器21、处理器22,通信总线23,以及网络接口24。
其中,存储器21至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器21在一些实施例中可以是分布式测试系统的测试执行装置的内部存储单元,例如该分布式测试系统的测试执行装置的硬盘。存储器21在另一些实施例中也可以是分布式测试系统的测试执行装置的外部存储设备,例如分布式测试系统的测试执行装置上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器21还可以既包括分布式测试系统的测试执行装置的内部存储单元也包括外部存储设备。存储器21不仅可以用于存储安装于分布式测试系统的测试执行装置的应用软件及各类数据,例如测试控制程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器22在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器21中存储的程序代码或处理数据,例如执行测试控制程序等。
通信总线23用于实现这些组件之间的连接通信。
网络接口24可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置与其他电子设备之间建立通信连接。
图3仅示出了具有组件21-24以及测试控制程序的分布式测试系统的测试执行装置,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
在图3所示的装置实施例中,存储器21中存储有测试执行程序;处理器22执行存储器21中存储的测试执行程序时实现如下步骤:
在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试;
在接收到测试对象返回的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器,以供所述测试控制装置从所述数据库服务器中读取测试响应时间和测试结果数据,并根据测试响 应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果。
可选地,所述在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试的步骤包括:
在接收到测试控制装置发送的测试开启指令时,根据所述测试开启指令确定待执行的测试任务信息,根据预设的测试任务信息与测试脚本之间的映射关系查找与确定的测试任务信息对应的测试脚本;
执行查找到的测试脚本,以对测试对象进行测试。
本申请分布式测试系统的测试执行装置的具体实施方式请参见上述分布式测试系统的测试控制装置中的描述,在此不再累述。
此外,本申请还提供一种分布式测试系统的测试控制方法。参照图4所示,为本申请分布式测试系统的测试控制方法较佳实施例的流程图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。
在本实施例中,分布式测试系统的测试控制方法包括:
步骤S10,同步地向连接的多台测试执行装置发送测试开启指令,以供所述多台测试执行装置根据所述测试开启指令并发地执行测试脚本,对测试对象进行测试,其中,所述多台测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器中。
以下以测试控制装置作为执行主体对本实施例的方法进行说明。需要说明的是,该测试控制装置在用于测试时,与多台测试执行装置连接,通过向测试执行装置发送测试指令控制测试执行装置的运行,例如开启、停止、文件传输等指令,其中,本实施例中的测试指令均通过对应的shell脚本触发。测试执行装置上预先存储有用于执行测试任务信息的测试脚本,当运行这些测试脚本时,测试执行装置会向测试对象发送处理请求,并接收测试对象对处理请求的处理结果,即测试结果数据。其中,测试对象可以是系统、接口或者应用程序等。其中,处理请求的具体内容需要根据测试对象的功能来确定。
在开始测试时,测试控制装置同步地向连接的多台测试执行装置发送测试开启指令,该指令通过对应的shell脚本触发,测试执行装置在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试,在 接收到测试对象返回的测试结果数据时,记录测试响应时间,并将测试响应时间和测试结果数据回写到数据库服务器,以供测试控制装置从数据库服务器中读取测试响应时间和测试结果数据,并根据测试响应时间和测试结果数据获取测试对象在预设的测试指标项上的指标结果。
一般在性能测试时,需要同时向测试对象发送大量的处理请求以对测试对象的性能进行测试,例如,设置二十台测试执行装置与测试控制装置连接,每台测试执行装置可以同步地发送三百条处理请求,则分布式测试系统则能够同时实现同时发送六千条处理请求,该数字只为举例说明,在实际测试中,可以根据需要设置具体的测试执行装置的数量以及每台测试执行装置可同时发送的请求的数量,其中,每台执行机上都部署有包含有多个线程的线程组,测试时能够根据脚本同时启动线程组中的所有线程。
步骤S20,在所述多台测试执行装置执行完成测试脚本后,从所述数据库服务器中读取所述测试对象的测试响应时间和测试结果数据。
步骤S30,根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示。
例如,测试对象是目标业务系统提供的注册接口,该注册接口提供注册功能,多台测试执行装置运行测试脚本后,各台执行装置同时多线程地触发向该注册接口发送注册请求,目标业务系统通过该注册接口对接收到的注册请求进行处理并返回对请求处理的结果,执行装置记录注册接口对各个请求的响应时间,各台执行装置将缓存中的运行结果数据回写到数据库服务器中。
关于用于存储运行结果数据的数据库,该数据库部署在独立于上述控制装置和执行装置的服务器上,该数据库可以是时间序列服务器influxDB。
作为一种实施方式,所述步骤S30包括:
根据预设的测试指标项对应的统计方式对获取到的测试响应时间和测试结果数据进行统计;根据统计结果获取所述测试指标项对应的指标结果,并按照预设的可视化方式展示所述测试指标项的指标结果。其中,预设的测试指标项可以包括但不限于以下几项:如平均响应时间、90%响应时间、每秒钟请求数、响应失败率、吞吐量。其中,如平均响应时间、90%响应时间可以根据从数据库中获取的响应时间以及总体请求量来计算,响应失败率可以根据测试结果数据来计算。
此外,由于在进行测试时,可能会出现需要对一个测试对象的多个功能进行测试,此时,需要在测试执行程序中存储多个不同的测试脚本,分别用于向测试对象发起对应的处理请求。故,对于测试执行装置来说,将在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试的步骤包括:
在接收到测试控制装置发送的测试开启指令时,根据所述测试开启指令确定待执行的测试任务信息,根据预设的测试任务信息与测试脚本之间的映射关系查找与确定的测试任务信息对应的测试脚本;执行查找到的测试脚本,以对测试对象进行测试。
也就是说,在测试执行装置上存储有多个测试脚本,并且建立测试脚本与测试任务信息之间的映射关系,测试控制装置发送的测试开启指令中包含有与测试任务信息,测试执行装置在接收到测试开启指令时,需要根据上述映射关系查找与测试任务信息对应的测试脚本并执行。
在现有技术中,分布式测试的控制装置与执行装置一般通过TCP协议实现数据的传输,但是当并发量大时,多台执行装置同时向控制装置发送大量的测试结果数据,导致出现传输过程中数据包丢失,进而造成测试结果误差大。本实施例提出的测试控制装置不需要通过TCP协议传输测试结果数据,测试执行装置在得到测试对象返回的处理结果时,从缓存中将这些数据回写到数据库服务器中,该服务器独立于测试控制装置和测试执行装置,单独提供数据存储功能,因此能够避免出现数据包丢失的情况,提高测试结果的准确度。
本实施例提出的测试控制方法,同步地向连接的多台测试执行装置发送测试开启指令,以供多台测试执行装置根据该测试开启指令并发地执行测试脚本,以对测试对象进行测试,测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,将测试响应时间和测试结果数据回写到数据库服务器中,在多台测试执行装置执行完成测试脚本后,从数据库服务器中读取测试响应时间和测试结果数据,并根据获取的数据获取测试对象在预设的测试指标项上的指标结果并展示。本申请由测试控制装置控制多台测试执行装置同步地执行测试脚本,保证了测试脚本执行的同步性,并且测试执行装置在接收到运行结果数据后回写到数据库服务器,由控制装置在测试结 束后从数据库中读取后进行统计分析,避免出现传输过程中数据包丢失的现象,提高了性能测试的准确性,解决了采用现有的测试方案中做分布式性能测试结果不准确的问题。
此外,本申请还提供一种分布式测试系统的测试执行方法。参照图5所示,为本申请分布式测试系统的测试执行方法较佳实施例的流程图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。
在本实施例中,分布式测试系统的测试执行方法包括:
步骤S40,在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试;
步骤S50,在接收到测试对象返回的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器,以供所述测试控制装置从所述数据库服务器中读取测试响应时间和测试结果数据,并根据测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果。
可选地,步骤S40包括:在接收到测试控制装置发送的测试开启指令时,根据所述测试开启指令确定待执行的测试任务信息,根据预设的测试任务信息与测试脚本之间的映射关系查找与确定的测试任务信息对应的测试脚本;执行查找到的测试脚本,以对测试对象进行测试。
本申请分布式测试系统的测试执行方法的具体实施方式请参见上述分布式测试系统的测试控制方法中的描述,在此不再累述。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有测试控制程序,所述测试控制程序可被一个或多个处理器执行,以实现如下操作:
同步地向连接的多台测试执行装置发送测试开启指令,以供所述多台测试执行装置根据所述测试开启指令并发地执行测试脚本,对测试对象进行测试,其中,所述多台测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器中;
在所述多台测试执行装置执行完成测试脚本后,从所述数据库服务器中读取所述测试对象的测试响应时间和测试结果数据;
根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示。
或者,该计算机存储介质上存储有测试执行程序,所述测试执行程序可被一个或多个处理器执行,以实现如下操作:
在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试;
在接收到测试对象返回的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器,以供所述测试控制装置从所述数据库服务器中读取测试响应时间和测试结果数据,并根据测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果。
本申请计算机可读存储介质的具体实施方式与上述分布式测试系统的测试控制装置和方法各实施例基本相同,在此不作累述。
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种分布式测试系统的测试控制装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的测试控制程序,所述测试控制程序被所述处理器执行时实现如下步骤:
    同步地向连接的多台测试执行装置发送测试开启指令,以供所述多台测试执行装置根据所述测试开启指令并发地执行测试脚本,对测试对象进行测试,其中,所述多台测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器中;
    在所述多台测试执行装置执行完成测试脚本后,从所述数据库服务器中读取所述测试对象的测试响应时间和测试结果数据;
    根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示。
  2. 如权利要求1所述的分布式测试系统的测试控制装置,其特征在于,所述根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示的步骤包括:
    根据预设的测试指标项对应的统计方式对获取到的测试响应时间和测试结果数据进行统计;
    根据统计结果获取所述测试指标项对应的指标结果,并按照预设的可视化方式展示所述测试指标项的指标结果。
  3. 如权利要求1所述的分布式测试系统的测试控制装置,其特征在于,所述数据库服务器上采用的数据库为时间序列服务器influxDB,所述预设的测试指标项包括平均响应时间、90%响应时间、每秒钟请求数、响应失败率、吞吐量。
  4. 如权利要求2所述的分布式测试系统的测试控制装置,其特征在于,所述数据库服务器上采用的数据库为时间序列服务器influxDB,所述预设的测试指标项包括平均响应时间、90%响应时间、每秒钟请求数、响应失败率、吞吐量。
  5. 一种分布式测试系统的测试执行装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的测试执行程序, 所述测试执行程序被所述处理器执行时实现如下步骤:
    在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试;
    在接收到测试对象返回的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器,以供所述测试控制装置从所述数据库服务器中读取测试响应时间和测试结果数据,并根据测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果。
  6. 如权利要求5所述的分布式测试系统的测试执行装置,其特征在于,所述在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试的步骤包括:
    在接收到测试控制装置发送的测试开启指令时,根据所述测试开启指令确定待执行的测试任务信息,根据预设的测试任务信息与测试脚本之间的映射关系查找与确定的测试任务信息对应的测试脚本;
    执行查找到的测试脚本,以对测试对象进行测试。
  7. 一种分布式测试系统的测试控制方法,其特征在于,所述方法包括:
    同步地向连接的多台测试执行装置发送测试开启指令,以供所述多台测试执行装置根据所述测试开启指令并发地执行测试脚本,对测试对象进行测试,其中,所述多台测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器中;
    在所述多台测试执行装置执行完成测试脚本后,从所述数据库服务器中读取所述测试对象的测试响应时间和测试结果数据;
    根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示。
  8. 如权利要求7所述的分布式测试系统的测试控制方法,其特征在于,所述根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示的步骤包括:
    根据预设的测试指标项对应的统计方式对获取到的测试响应时间和测试结果数据进行统计;
    根据统计结果获取所述测试指标项对应的指标结果,并按照预设的可视 化方式展示所述测试指标项的指标结果。
  9. 如权利要求7所述的分布式测试系统的测试控制方法,其特征在于,所述数据库服务器上采用的数据库为时间序列服务器influxDB,所述预设的测试指标项包括平均响应时间、90%响应时间、每秒钟请求数、响应失败率、吞吐量。
  10. 如权利要求8所述的分布式测试系统的测试控制方法,其特征在于,所述数据库服务器上采用的数据库为时间序列服务器influxDB,所述预设的测试指标项包括平均响应时间、90%响应时间、每秒钟请求数、响应失败率、吞吐量。
  11. 一种分布式测试系统的测试执行方法,其特征在于,所述方法包括:
    在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试;
    在接收到测试对象返回的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器,以供所述测试控制装置从所述数据库服务器中读取测试响应时间和测试结果数据,并根据测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果。
  12. 如权利要求11所述的分布式测试系统的测试执行方法,其特征在于,所述在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试的步骤包括:
    在接收到测试控制装置发送的测试开启指令时,根据所述测试开启指令确定待执行的测试任务信息,根据预设的测试任务信息与测试脚本之间的映射关系查找与确定的测试任务信息对应的测试脚本;
    执行查找到的测试脚本,以对测试对象进行测试。
  13. 如权利要求11所述的分布式测试系统的测试执行方法,其特征在于,所述数据库服务器上采用的数据库为时间序列服务器influxDB,所述预设的测试指标项包括平均响应时间、90%响应时间、每秒钟请求数、响应失败率、吞吐量。
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有测试控制程序,所述测试控制程序可被一个或者多个处理器执行,以实现如下步骤:
    同步地向连接的多台测试执行装置发送测试开启指令,以供所述多台测试执行装置根据所述测试开启指令并发地执行测试脚本,对测试对象进行测试,其中,所述多台测试执行装置在接收到测试对象发送的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器中;
    在所述多台测试执行装置执行完成测试脚本后,从所述数据库服务器中读取所述测试对象的测试响应时间和测试结果数据;
    根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示。
  15. 如权利要求14所述的计算机可读存储介质,其特征在于,所述根据获取到的测试响应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果并展示的步骤包括:
    根据预设的测试指标项对应的统计方式对获取到的测试响应时间和测试结果数据进行统计;
    根据统计结果获取所述测试指标项对应的指标结果,并按照预设的可视化方式展示所述测试指标项的指标结果。
  16. 如权利要求14所述的计算机可读存储介质,其特征在于,所述数据库服务器上采用的数据库为时间序列服务器influxDB,所述预设的测试指标项包括平均响应时间、90%响应时间、每秒钟请求数、响应失败率、吞吐量。
  17. 如权利要求15所述的计算机可读存储介质,其特征在于,所述数据库服务器上采用的数据库为时间序列服务器influxDB,所述预设的测试指标项包括平均响应时间、90%响应时间、每秒钟请求数、响应失败率、吞吐量。
  18. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有测试执行程序,所述测试控制程序可被一个或者多个处理器执行,以实现如下步骤:
    在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试;
    在接收到测试对象返回的测试结果数据时,记录测试响应时间,并将所述测试响应时间和测试结果数据回写到数据库服务器,以供所述测试控制装置从所述数据库服务器中读取测试响应时间和测试结果数据,并根据测试响 应时间和测试结果数据获取所述测试对象在预设的测试指标项上的指标结果。
  19. 如权利要求18所述的计算机可读存储介质,其特征在于,所述在接收到测试控制装置发送的测试开启指令时,执行测试脚本以对测试对象进行测试的步骤包括:
    在接收到测试控制装置发送的测试开启指令时,根据所述测试开启指令确定待执行的测试任务信息,根据预设的测试任务信息与测试脚本之间的映射关系查找与确定的测试任务信息对应的测试脚本;
    执行查找到的测试脚本,以对测试对象进行测试。
  20. 如权利要求18所述的计算机可读存储介质,其特征在于,所述数据库服务器上采用的数据库为时间序列服务器influxDB,所述预设的测试指标项包括平均响应时间、90%响应时间、每秒钟请求数、响应失败率、吞吐量。
PCT/CN2018/089181 2018-03-06 2018-05-31 测试控制和测试执行装置、方法及计算机存储介质 WO2019169757A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810182952.8A CN108519943A (zh) 2018-03-06 2018-03-06 测试控制和测试执行装置、方法及计算机存储介质
CN201810182952.8 2018-03-06

Publications (1)

Publication Number Publication Date
WO2019169757A1 true WO2019169757A1 (zh) 2019-09-12

Family

ID=63433486

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/089181 WO2019169757A1 (zh) 2018-03-06 2018-05-31 测试控制和测试执行装置、方法及计算机存储介质

Country Status (2)

Country Link
CN (1) CN108519943A (zh)
WO (1) WO2019169757A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112153410A (zh) * 2020-09-30 2020-12-29 郑州信大捷安信息技术股份有限公司 一种流媒体服务高并发测试方法和系统
US20220091843A1 (en) * 2020-09-22 2022-03-24 Alpha Networks Inc. Distributed system for software verification

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108924009B (zh) * 2018-07-12 2020-08-25 深圳市极致汇仪科技有限公司 一种高吞吐量的测试方法及测试系统
CN109739741A (zh) * 2018-11-26 2019-05-10 北京网众共创科技有限公司 系统测试方法和装置、存储介质及电子装置
CN109669867B (zh) * 2018-12-11 2024-03-12 平安科技(深圳)有限公司 测试装置、自动化测试方法和计算机可读存储介质
CN109753438A (zh) * 2019-01-14 2019-05-14 上海挚极信息科技有限公司 基于jmeter的性能测试平台及方法
CN111277464B (zh) * 2020-01-20 2022-11-11 平安科技(深圳)有限公司 物联网设备连接测试方法、装置及计算机可读存储介质
CN111858276A (zh) * 2020-07-06 2020-10-30 珠海西山居移动游戏科技有限公司 一种获取服务器压测数据的方法及系统
CN113014452A (zh) * 2021-03-01 2021-06-22 鹏城实验室 网络流量测试方法、装置、测试端以及存储介质
CN113297028A (zh) * 2021-03-18 2021-08-24 中国平安人寿保险股份有限公司 一种脚本执行方法、装置、计算机设备及存储介质
CN115277481B (zh) * 2022-09-22 2022-12-20 东方合智数据科技(广东)有限责任公司 性能指标监控方法、装置、设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141962A (zh) * 2011-04-07 2011-08-03 北京航空航天大学 一种安全性分布式测试框架系统及其测试方法
CN103970650A (zh) * 2014-04-09 2014-08-06 广州杰赛科技股份有限公司 分布式测试方法和装置
CN107341098A (zh) * 2017-07-13 2017-11-10 携程旅游信息技术(上海)有限公司 软件性能测试方法、平台、设备及存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5371883A (en) * 1993-03-26 1994-12-06 International Business Machines Corporation Method of testing programs in a distributed environment
CN102035896B (zh) * 2010-12-31 2012-12-05 北京航空航天大学 一种适用于软件系统的基于ttcn-3的分布式测试框架
CN102035697B (zh) * 2010-12-31 2012-04-18 中国电子科技集团公司第十五研究所 一种文件系统的并发连接数性能测试系统和方法
CN102841846B (zh) * 2012-08-27 2015-08-19 北京邮电大学 一种基于Hadoop的软件测试方法、装置和系统
CN106201852A (zh) * 2015-04-29 2016-12-07 展讯通信(上海)有限公司 一种分布式测试方法及测试系统
CN107544895A (zh) * 2016-06-28 2018-01-05 中兴通讯股份有限公司 Hadoop大数据平台测试系统及方法
CN106649088A (zh) * 2016-10-09 2017-05-10 网易(杭州)网络有限公司 一种分布式压力测试方法和系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141962A (zh) * 2011-04-07 2011-08-03 北京航空航天大学 一种安全性分布式测试框架系统及其测试方法
CN103970650A (zh) * 2014-04-09 2014-08-06 广州杰赛科技股份有限公司 分布式测试方法和装置
CN107341098A (zh) * 2017-07-13 2017-11-10 携程旅游信息技术(上海)有限公司 软件性能测试方法、平台、设备及存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220091843A1 (en) * 2020-09-22 2022-03-24 Alpha Networks Inc. Distributed system for software verification
US11586435B2 (en) * 2020-09-22 2023-02-21 Alpha Networks Inc. Distributed system for software verification
CN112153410A (zh) * 2020-09-30 2020-12-29 郑州信大捷安信息技术股份有限公司 一种流媒体服务高并发测试方法和系统
CN112153410B (zh) * 2020-09-30 2022-02-22 郑州信大捷安信息技术股份有限公司 一种流媒体服务高并发测试方法和系统

Also Published As

Publication number Publication date
CN108519943A (zh) 2018-09-11

Similar Documents

Publication Publication Date Title
WO2019169757A1 (zh) 测试控制和测试执行装置、方法及计算机存储介质
US11240126B2 (en) Distributed tracing for application performance monitoring
CN107341098B (zh) 软件性能测试方法、平台、设备及存储介质
US9483378B2 (en) Method and system for resource monitoring of large-scale, orchestrated, multi process job execution environments
WO2019085079A1 (zh) 接口测试方法、装置、计算机设备和存储介质
WO2019085073A1 (zh) 接口测试方法、装置、计算机设备和存储介质
WO2019214109A1 (zh) 测试过程的监控装置、方法及计算机可读存储介质
WO2019218513A1 (zh) 测试过程的监控装置、方法及计算机可读存储介质
US10515078B2 (en) Database management apparatus, database management method, and storage medium
US9753717B2 (en) Timing report framework for distributed software upgrades
WO2019227708A1 (zh) 测试案例的在线调试装置、方法及计算机可读存储介质
US20140365833A1 (en) Capturing trace information using annotated trace output
US20180300229A1 (en) Root cause analysis of non-deterministic tests
US11436133B2 (en) Comparable user interface object identifications
CN112202628B (zh) 一种WiFi模块串口协议自动化测试系统及方法
WO2019140850A1 (zh) 测试案例推荐方法、电子装置及可读存储介质
CN111177113A (zh) 数据迁移方法、装置、计算机设备和存储介质
US9563541B2 (en) Software defect detection identifying location of diverging paths
US9910760B2 (en) Method and apparatus for interception of synchronization objects in graphics application programming interfaces for frame debugging
US7610293B2 (en) Correlation of resource usage in a database tier to software instructions executing in other tiers of a multi tier application
CN112817831A (zh) 应用性能监测方法、装置、计算机系统和可读存储介质
US11068371B2 (en) Method and apparatus for simulating slow storage disk
CN115712559A (zh) 测试硬件管理软件的方法、装置及电子设备
WO2015062003A1 (en) User interface tester
US10719425B2 (en) Happens-before-based dynamic concurrency analysis for actor-based programs

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18908356

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09.12.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18908356

Country of ref document: EP

Kind code of ref document: A1