WO2019214109A1 - 测试过程的监控装置、方法及计算机可读存储介质 - Google Patents

测试过程的监控装置、方法及计算机可读存储介质 Download PDF

Info

Publication number
WO2019214109A1
WO2019214109A1 PCT/CN2018/102101 CN2018102101W WO2019214109A1 WO 2019214109 A1 WO2019214109 A1 WO 2019214109A1 CN 2018102101 W CN2018102101 W CN 2018102101W WO 2019214109 A1 WO2019214109 A1 WO 2019214109A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
code
subunit
execution
executed
Prior art date
Application number
PCT/CN2018/102101
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 WO2019214109A1 publication Critical patent/WO2019214109A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a monitoring apparatus, method, and computer readable storage medium for a testing process.
  • the test conditions are evaluated according to the execution success rate of the test cases, which cannot be realized.
  • the specific defect location of the code level is mainly because the existing test method cannot obtain the method call path of the system under test according to the monitoring of the test process. If the method call path of the system under test is obtained, only the method call path of the system under test can be obtained.
  • the static analysis method is used to analyze the logic of the source code of the system under test, and the method map is called by the method, and then the defect of the system under test is located at the code level according to the test result and the method call path map. It is low and results in a lower accuracy of the test.
  • the present application provides a monitoring device, a method, and a computer readable storage medium for testing a process, the main purpose of which is to solve the technical problem that the method calling path of the system under test cannot be obtained according to the monitoring of the testing process, and realize Test accurately and efficiently.
  • the present application provides a monitoring device for a test process, the device comprising a memory and a processor, wherein the memory stores a test monitor program executable on the processor, the test monitor program being The following steps are implemented when the processor is executed:
  • test sub-unit When detecting a test instruction triggered by the user based on the test sub-unit of the test case, executing the test sub-unit based on the test instruction to test the system under test;
  • the present application further provides a monitoring method for a testing process, the method comprising:
  • test sub-unit When detecting a test instruction triggered by the user based on the test sub-unit of the test case, executing the test sub-unit based on the test instruction to test the system under test;
  • the present application further provides a computer readable storage medium having a test monitor program stored thereon, the test monitor program being executable by one or more processors to implement The following steps:
  • test sub-unit When detecting a test instruction triggered by the user based on the test sub-unit of the test case, executing the test sub-unit based on the test instruction to test the system under test;
  • the monitoring device, the method and the computer readable storage medium of the testing process proposed by the application the user triggers the test instruction based on the test subunit in the test case one by one, tests the system under test, and the tested system executes the test subunit to obtain the code execution information.
  • the code call path generates a method call path corresponding to the test case.
  • Test case Corresponding call path to solve the technical problem can not be based on monitoring of the testing process, access to the system under test method in the testing process of the call path, to achieve accurate and efficient testing.
  • FIG. 1 is a schematic diagram of a preferred embodiment of a monitoring apparatus for a testing process of the present application
  • FIG. 2 is a schematic diagram of a program module of a test monitoring program in an embodiment of a monitoring device of a testing process of the present application
  • FIG. 3 is a flowchart of a first embodiment of a monitoring method of a testing process of the present application.
  • the application provides a monitoring device for a test process.
  • a monitoring device for a test process Referring to Figure 1, there is shown a schematic diagram of a preferred embodiment of a monitoring device for the testing process of the present application.
  • the monitoring device 1 of the testing process may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet computer, or a portable computer.
  • the monitoring device 1 of the test process includes at least a memory 11, a processor 12, a network interface 13, and a communication bus 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 the monitoring device 1 of the test process, such as the hard disk of the monitoring device 1 of the test process.
  • the memory 11 may also be an external storage device of the monitoring device 1 of the test process in other embodiments, such as a plug-in hard disk equipped on the monitoring device 1 of the test process, a smart memory card (SMC), and a secure digital device. (Secure Digital, SD) card, flash card, etc.
  • the memory 11 may also include an internal storage unit of the monitoring device 1 of the test process as well as an external storage device.
  • the memory 11 can be used not only for storing application software of the monitoring device 1 installed in the test process and various types of data, such as code of the test monitor 01, but also for temporarily storing data that has been output or will 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 monitor 01 and the like.
  • CPU Central Processing Unit
  • controller microcontroller
  • microprocessor or other data processing chip for running program code or processing stored in the memory 11.
  • Data such as executing test monitor 01 and the like.
  • the network interface 13 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 1 and other electronic devices.
  • a standard wired interface such as a WI-FI interface
  • Communication bus 14 is used to implement connection communication between these components.
  • Figure 1 shows only the monitoring device 1 with the test procedures of the components 11-14 and the test monitor 01, but it should be understood that not all of the illustrated components are required to be implemented, and that more or less may be implemented instead. Component.
  • the device 1 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 referred to as a display or display unit, as appropriate, for displaying information processed in the monitoring device 1 of the testing process and a user interface for displaying visualizations.
  • a test monitor program 01 is stored in the memory 11; when the processor 12 executes the test monitor program 01 stored in the memory 11, the following steps are implemented:
  • test sub-unit When a test command triggered by the user based on the test sub-unit of the test case is detected, the test sub-unit is executed based on the test instruction to test the system under test.
  • the pre-written test case is stored on the device of the embodiment.
  • a test case may include a plurality of test sub-units.
  • the tester performs the test, a communication connection between the device and the tested terminal is established, wherein the test is performed.
  • the system runs on the terminal under test.
  • the tester triggers the test command one by one based on the test subunit.
  • the monitoring device tests the system under test according to the corresponding test subunit, and the system under test runs the corresponding code according to the test subunit.
  • the corresponding system source code is executed by the code execution container, and the time information for executing each method is recorded in the process of executing the source code, mainly including each method being executed. Between the start time of the execution and the termination of the execution completion, after the test subunit is completed, the recorded time information is added to the execution code information and sent to the monitoring device.
  • a time period recording code is set in advance on the monitoring apparatus of the embodiment, and the time recording code is used to implement recording of the executed time of the method.
  • the tester triggers a code transmission instruction on the monitoring device, and when the monitoring device detects the code transmission instruction, acquires the time recording code, and sends the time recording code to the terminal where the system under test is located.
  • the time recording code is stored by the terminal for recording and the start time and the end time of the method are recorded according to the time recording code.
  • the time recording code is stored in the buffer area.
  • the code execution container loads the method to be executed into the container, and obtains the time record code from the cache area, respectively, and records the time record code before the code of the method to be executed. And after the code, the time record code is added, and then the method of loading the time record code is executed. During the execution of the method, the time record code records the start time and the end time of the method execution. It should be noted that when testing according to a test subunit, there may be multiple methods to be executed in the system under test. Therefore, it is necessary to add a time recording code before and after the code of each method, for each method. The start time and end time of execution are recorded.
  • the monitoring device When receiving the code execution information obtained by the test terminal and executing the test subunit, acquires the time information from the code execution information, and generates a method call path, specifically, according to the code execution time information, generates and
  • the step of the method call path corresponding to the test subunit includes: determining a method name of each method corresponding to the test subunit according to the code execution time information, and a sequence of execution of each method; according to the method name and each method The sequence of execution is performed to generate a method call path of the system under test during execution of the test subunit.
  • the monitoring device acquires, from the code execution information, a start time and an end time when the respective methods in the test subunit are executed, and the time information can be used to determine the sequence in which the respective methods are executed, and the plurality of methods can be determined through the sequence.
  • the calling relationship between the two, and then the method call path of the system under test during the execution of the test subunit is generated according to the method name and the order in which the respective methods are executed.
  • a test case generally contains multiple test subunits, and the testers will test one by one. Repeat the above steps.
  • the method call path corresponding to the test case is generated according to the method call path of each test subunit. Further, the obtained method call path is displayed on the display interface, and the tester analyzes the test condition according to the test result to locate the defect of the tested system, and may implement the path according to the method corresponding to the displayed test case. Quickly locate defects and achieve accurate and efficient testing.
  • test monitor program may also be executed by the processor to implement the following steps: during the test, the code test coverage of the source code of the system under test is monitored in real time, and the monitored result is obtained. Code test coverage is displayed in real time on the display interface.
  • the monitoring device of the test process proposed by the above embodiment the user triggers the test command based on the test subunit in the test case one by one, tests the system under test, and the tested system executes the test subunit to obtain code execution information, and according to the test subunit During the execution of the corresponding method, the start time and the end time of the method are recorded, and the code execution time information is added to the code execution information, and when the code execution information sent by the system under test is received, the data is obtained therefrom. The time information is obtained, and the method call path corresponding to the test subunit is obtained according to the obtained time information, and the above steps are repeated until all the test subunits included in the test case are executed, and the test case is generated according to the method corresponding to the brother test subunit.
  • Method of calling the path the solution of the present application monitors the process of testing the system under test by using the test case, obtains the time information of each method executed during the test, and automatically generates a method call corresponding to the test case according to the time information. path, The decision can not be based on monitoring the testing process, access to technical problems call path method in the testing process of the system under test, test to achieve accurate and efficient.
  • test monitor program may be further executed by the processor to perform the test based on the test instruction when the test command triggered by the test case based test subunit is detected by the user. Before the test subunit performs the test on the system under test, the following steps are also implemented:
  • the monitoring device of the embodiment can also monitor the code change of the system under test, firstly compare and analyze the system source code of the current version and the system source code of the historical version to determine which code lines are the changed code lines, including Modify and add code and then identify the code that has an association with these lines of code.
  • the execution of these codes is monitored to obtain test coverage for the change code and the associated code, because for the system under test, after the system is upgraded, the new function of the new version of the system is the main test. Objects, therefore, by monitoring the test coverage of the change code in real time, it is useful for testers to keep abreast of the test execution for these new features.
  • test monitor program may be further executed by the processor to implement the following steps: obtaining the test using the test case according to the changed code and the executed condition of the associated code During the process, the test coverage information of the change code and the associated code is obtained; and the mapping relationship between the test subunit and the code line of the system under test is obtained according to the test coverage information and the method call path corresponding to each test subunit.
  • the test coverage information of the change code and the associated code is obtained, that is, the code in the change code and the associated code is obtained during the test using the test case.
  • the line was executed.
  • the method and the code line have a corresponding relationship, and in combination with the method call path, the code line executed in each method can be determined, and then the executed code line corresponding to the test subunit can be obtained, that is, the test subunit is obtained.
  • the code line of the system under test here is mainly the code line in the above change code and associated code. In other embodiments, the mapping relationship between the complete code line and the test subunit can also be obtained by combining the code coverage of the complete system under test with the method invocation path.
  • mapping relationship is displayed on the display interface, so that the tester can analyze the test situation to achieve rapid positioning of defects, and further improve the efficiency and accuracy of the test.
  • test monitor 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.
  • a 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 monitor program in the monitoring device of the test process.
  • FIG. 2 it is a schematic diagram of a program module of a test monitoring program in an embodiment of a monitoring device of the testing process of the present application.
  • the test monitoring program can be divided into a test execution module 10 and an information acquiring module 20 And path generation module 30, illustratively:
  • the test execution module 10 is configured to: when detecting a test instruction triggered by a test subunit based on the test case, execute the test subunit based on the test instruction to test the system under test;
  • the information obtaining module 20 is configured to: obtain code execution time information from the code execution information when receiving code execution information obtained by executing the test subunit returned by the system under test, where the system to be tested In the process of executing the corresponding method according to the test subunit, recording the start time and the end time of the method being executed, and generating code execution time information to be added to the code execution information;
  • the path generation module 30 is configured to: generate a method call path corresponding to the test subunit according to the code execution time information;
  • the test execution module 10, the information acquisition module 20, and the path generation module 30 repeatedly perform the above operations until the test subunits included in the test case are all executed, and the path generation module 30 calls the path generation and the test according to the method corresponding to each test subunit.
  • the path is called by the method corresponding to the use case.
  • test execution module 10 the information acquisition module 20, and the path generation module 30 are substantially the same as those of the foregoing embodiment, and are not described herein again.
  • the present application also provides a monitoring method of the testing process.
  • FIG. 3 it is a flowchart of the first embodiment of the monitoring method of the testing process of the present application.
  • the method can be performed by a device that can be implemented by software and/or hardware.
  • the method of the present application will be described in the following embodiments with the monitoring device of the test process as the execution subject.
  • the monitoring method of the testing process includes:
  • Step S10 When detecting a test instruction triggered by the user based on the test subunit of the test case, the test subunit is executed based on the test instruction to test the system under test.
  • Step S20 when receiving code execution information obtained by executing the test subunit returned by the system under test, acquiring code execution time information from the code execution information, wherein the system under test is according to the During the execution of the corresponding method by the test subunit, the start time and the end time of the method are recorded, and the code execution time information is added to the code execution information.
  • a pre-written test case is stored on the monitoring device of the execution body of the embodiment.
  • a test case may include a plurality of test sub-units, and the tester establishes a communication connection between the monitoring device and the tested terminal when performing the test. Where the system under test runs on the terminal under test. The tester triggers the test command one by one based on the test subunit. When the test device detects the test command, the monitoring device tests the system under test according to the corresponding test subunit, and the system under test runs the corresponding code according to the test subunit.
  • the corresponding system source code is executed by the code execution container, and the time information for executing each method is recorded in the process of executing the source code, mainly including each method being executed. Between the start time of the execution and the termination of the execution completion, after the test subunit is completed, the recorded time information is added to the execution code information and sent to the monitoring device.
  • a recording code is set in advance on the monitoring device, and the time recording code is used to implement recording of the executed time of the method.
  • the tester triggers a code transmission instruction on the monitoring device, and when the monitoring device detects the code transmission instruction, acquires the time recording code, and sends the time recording code to the terminal where the system under test is located.
  • the time recording code is stored by the terminal for recording and the start time and the end time of the method are recorded according to the time recording code.
  • the time recording code is stored in the buffer area.
  • the code execution container loads the method to be executed into the container, and obtains the time record code from the cache area, respectively, and records the time record code before the code of the method to be executed. And after the code, the time record code is added, and then the method of loading the time record code is executed. During the execution of the method, the time record code records the start time and the end time of the method execution. It should be noted that when testing according to a test subunit, there may be multiple methods to be executed in the system under test. Therefore, it is necessary to add a time recording code before and after the code of each method, for each method. The start time and end time of execution are recorded.
  • Step S30 generating a method call path corresponding to the test subunit according to the code execution time information.
  • Step S40 the steps S10 to S30 are repeated until the test subunits included in the test case are all executed, and the method call path corresponding to the test case is generated according to the method call path corresponding to each test subunit.
  • step S30 includes the following refinement steps:
  • the code execution time information determines a method name of each method corresponding to the test subunit, and a sequence of execution of each method; and according to the method name and the sequence in which each method is executed, the test subunit is generated during execution The method call path of the system.
  • the monitoring device acquires, from the code execution information, a start time and an end time when the respective methods in the test subunit are executed, and the time information can be used to determine the sequence in which the respective methods are executed, and the plurality of methods can be determined through the sequence.
  • the calling relationship between the two, and then the method call path of the system under test during the execution of the test subunit is generated according to the method name and the order in which the respective methods are executed.
  • a test case generally contains multiple test subunits, and the testers will test one by one. Repeat the above steps.
  • the method call path corresponding to the test case is generated according to the method call path of each test subunit. Further, the obtained method call path is displayed on the display interface, and the tester analyzes the test condition according to the test result to locate the defect of the tested system, and may implement the path according to the method corresponding to the displayed test case. Quickly locate defects and achieve accurate and efficient testing.
  • the method further includes the steps of: real-time monitoring the code test coverage of the source code of the system under test during the testing process, and displaying the monitored code test coverage in real time on the display. On the interface.
  • the user triggers the test instruction based on the test subunit in the test case one by one, tests the system under test, and the tested system executes the test subunit to obtain code execution information, and according to the test subunit During the execution of the corresponding method, the start time and the end time of the method are recorded, and the code execution time information is added to the code execution information, and when the code execution information sent by the system under test is received, the data is obtained therefrom. The time information is obtained, and the method call path corresponding to the test subunit is obtained according to the obtained time information, and the above steps are repeated until all the test subunits included in the test case are executed, and the test case is generated according to the method corresponding to the brother test subunit.
  • Method of calling the path the solution of the present application monitors the process of testing the system under test by using the test case, obtains the time information of each method executed during the test, and automatically generates a method call corresponding to the test case according to the time information. path, The decision can not be based on monitoring the testing process, access to technical problems call path method in the testing process of the system under test, test to achieve accurate and efficient.
  • the method further includes the following steps:
  • the code change of the system under test can also be monitored.
  • a comparative analysis is performed to determine which code lines are changed code lines, including Modify and add code and then identify the code that has an association with these lines of code.
  • the execution of these codes is monitored to obtain test coverage for the change code and the associated code, because for the system under test, after the system is upgraded, the new function of the new version of the system is the main test. Objects, therefore, by monitoring the test coverage of the change code in real time, it is useful for testers to keep abreast of the test execution for these new features.
  • the method further includes the steps of: changing the code and the associated code during the test using the test case according to the changed code and the executed condition of the associated code Testing coverage information; obtaining a mapping relationship between the test subunit and the code line of the system under test according to the test coverage information and the method call path corresponding to each test subunit.
  • the test coverage information of the change code and the associated code is obtained, that is, the code in the change code and the associated code is obtained during the test using the test case.
  • the line was executed.
  • the method and the code line have a corresponding relationship, and in combination with the method call path, the code line executed in each method can be determined, and then the executed code line corresponding to the test subunit can be obtained, that is, the test subunit is obtained.
  • the code line of the system under test here is mainly the code line in the above change code and associated code. In other embodiments, the mapping relationship between the complete code line and the test subunit can also be obtained by combining the code coverage of the complete system under test with the method invocation path.
  • mapping relationship is displayed on the display interface, so that the tester can analyze the test situation to achieve rapid positioning of defects, and further improve the efficiency and accuracy of the test.
  • test monitor program is stored on the computer readable storage medium, and the test monitor program can be executed by one or more processors to implement the following operations:
  • test sub-unit When detecting a test instruction triggered by the user based on the test sub-unit of the test case, executing the test sub-unit based on the test instruction to test the system under test;
  • 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)
  • Monitoring And Testing Of Exchanges (AREA)

Abstract

一种测试过程的监控装置、方法以及一种计算机可读存储介质,包括存储器(11)和处理器(12),存储器(11)上存储有可在处理器(12)上运行的测试监控程序(01),该程序(01)被处理器(12)执行时实现如下步骤:当检测到用户基于测试用例的测试子单元触发的测试指令时,基于测试指令执行测试子单元以对被测系统进行测试(S10);在接收到被测系统返回的执行测试子单元得到的代码执行信息时,从代码执行信息中获取时间信息(S20);根据时间信息,生成与测试子单元对应的方法调用路径(S30);重复上述步骤,直至测试用例包含的测试子单元全部执行完成,根据各个测试子单元对应的方法调用路径生成与测试用例对应的方法调用路径(S40)。实现了准确高效的测试。

Description

测试过程的监控装置、方法及计算机可读存储介质
本申请基于巴黎公约申明享有2018年05月08日递交的申请号为2018104324756、名称为“测试过程的监控装置、方法及计算机可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种测试过程的监控装置、方法及计算机可读存储介质。
背景技术
现有的基于人工和自动化进行的系统测试中,需要根据测试情况对被测系统中的缺陷进行定位,而现有的测试方法中,根据测试用例的执行成功率来对测试情况评估,无法实现代码层级的具体缺陷定位,主要是由于现有的测试方法无法根据对测试过程的监控,获取到被测系统在测试过程中的方法调用路径,如果要获取被测系统的方法调用路径,只能通过静态分析的方法对被测系统的源代码的逻辑进行分析,自行绘制方法调用路径图,进而根据测试结果以及方法调用路径图对被测系统的缺陷进行代码层级的定位,这种方式不仅效率低下而且导致测试的准确率较低。
发明内容
本申请提供一种测试过程的监控装置、方法及计算机可读存储介质,其主要目的在于解决无法根据对测试过程的监控,获取到被测系统在测试过程中的方法调用路径的技术问题,实现准确高效的进行测试。
为实现上述目的,本申请提供一种测试过程的监控装置,该装置包括存储器和处理器,所述存储器中存储有可在所述处理器上运行的测试监控程序,所述测试监控程序被所述处理器执行时实现如下步骤:
当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试;
在接收到所述被测系统返回的执行所述测试子单元得到的代码执行信息时,从所述代码执行信息中获取代码执行时间信息,其中,所述被测系统在根据所述测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中;
根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径;
重复上述步骤,直至所述测试用例包含的测试子单元全部执行完成,根据各个测试子单元对应的方法调用路径生成与所述测试用例对应的方法调用路径。
此外,为实现上述目的,本申请还提供一种测试过程的监控方法,该方法包括:
当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试;
在接收到所述被测系统返回的执行所述测试子单元得到的代码执行信息时,从所述代码执行信息中获取代码执行时间信息,其中,所述被测系统在根据所述测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中;
根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径;
重复上述步骤,直至所述测试用例包含的测试子单元全部执行完成,根据各个测试子单元对应的方法调用路径生成与所述测试用例对应的方法调用路径。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有测试监控程序,所述测试监控程序可被一个或者多个处理器执行,以实现如下步骤:
当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试;
在接收到所述被测系统返回的执行所述测试子单元得到的代码执行信息时,从所述代码执行信息中获取代码执行时间信息,其中,所述被测系统在根据所述测试子单元执行对应的方法的过程中,对方法被执行的起始时间和 终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中;
根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径;
重复上述步骤,直至所述测试用例包含的测试子单元全部执行完成,根据各个测试子单元对应的方法调用路径生成与所述测试用例对应的方法调用路径。
本申请提出的测试过程的监控装置、方法及计算机可读存储介质,用户逐个基于测试用例中的测试子单元触发测试指令,对被测系统进行测试,被测系统执行测试子单元得到代码执行信息,并且在根据测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中,当接收到被测系统发送的代码执行信息时,从中获取时间信息,并根据获取到的时间信息获取与测试子单元对应的方法调用路径,重复上述步骤直至测试用例包含的测试子单元全部执行完成,根据哥哥测试子单元对应的方法调用路径生成测试用例对应的方法调用路径,本申请的方案对使用测试用例对被测系统进行测试的过程进行监控,获取测试过程中每一个方法被执行的时间信息,进而根据时间信息自动生成与测试案例对应的方法调用路径,解决了无法根据对测试过程的监控,获取到被测系统在测试过程中的方法调用路径的技术问题,实现准确高效的进行测试。
附图说明
图1为本申请测试过程的监控装置较佳实施例的示意图;
图2为本申请测试过程的监控装置一实施例中测试监控程序的程序模块示意图;
图3为本申请测试过程的监控方法第一实施例的流程图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种测试过程的监控装置。参照图1所示,为本申请测试过程的监控装置较佳实施例的示意图。
在本实施例中,测试过程的监控装置1可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、便携计算机等终端设备。该测试过程的监控装置1至少包括存储器11、处理器12,网络接口13,以及通信总线14。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是测试过程的监控装置1的内部存储单元,例如该测试过程的监控装置1的硬盘。存储器11在另一些实施例中也可以是测试过程的监控装置1的外部存储设备,例如测试过程的监控装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括测试过程的监控装置1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于测试过程的监控装置1的应用软件及各类数据,例如测试监控程序01的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行测试监控程序01等。
网络接口13可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置1与其他电子设备之间建立通信连接。
通信总线14用于实现这些组件之间的连接通信。
图1仅示出了具有组件11-14以及测试监控程序01的测试过程的监控装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
可选地,该装置1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在测试过程的监控装置1中处理的信息以及用于显示可视化的用户界面。
在图1所示的装置1实施例中,存储器11中存储有测试监控程序01;处理器12执行存储器11中存储的测试监控程序01时实现如下步骤:
当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试。
在接收到所述被测系统返回的执行所述测试子单元得到的代码执行信息时,从所述代码执行信息中获取代码执行时间信息,其中,所述被测系统在根据所述测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中。
本实施例的装置上存储有预先编写好的测试用例,一个测试用例可以包括多个测试子单元,测试人员在进行测试时,建立该装置与被测终端之间的通讯连接,其中,被测系统运行在被测终端上。测试人员逐个基于测试子单元触发测试指令,监控装置在检测到测试指令时,根据对应的测试子单元对被测系统进行测试,被测系统根据测试子单元运行相应的代码。
具体地,对于被测系统来说,在测试过程中,由代码执行容器来执行对应的系统源代码,并且在执行源代码的过程对执行各个方法的时间信息进行记录,主要包括各个方法被执行的开始时间和执行完成的终止之间,在测试子单元完成之后,将记录的时间信息添加至执行代码信息发送到监控装置。
可选地,作为一种实施方式,在本实施例的监控装置上预先设置好一段时间记录代码,该时间记录代码用于实现对方法的被执行时间的记录。在测试开始之间,测试人员在监控装置上触发代码发送指令,监控装置在检测到代码发送指令时,获取时间记录代码,并将所述时间记录代码发送至所述被测系统所在的终端,以供所述终端存储所述时间记录代码并根据所述时间记录代码对方法被执行的起始时间和终止时间进行记录。
被测终端在接收到时间记录代码时,将该时间记录代码存储至缓存区域。当根据测试子单元执行对应的方法的代码时,代码执行容器将待执行的方法加载至容器中,并从缓存区域获取上述时间记录代码,分别将时间记录代码在即将被执行的方法的代码之前和代码之后添加时间记录代码,然后执行加 载了时间记录代码的方法,在该方法的执行过程中,时间记录代码对方法被执行的起始时间和终止时间进行记录。需要说明的是,在根据一个测试子单元进行测试时,在被测系统中可能有多个方法需要执行,因此,需要在每一个方法的代码的前后添加时间记录代码,以对每一个方法的被执行的起始时间和终止时间进行记录。
根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径。
重复上述步骤,直至所述测试用例包含的测试子单元全部执行完成,根据各个测试子单元对应的方法调用路径生成与所述测试用例对应的方法调用路径。
监控装置在接收到被测终端发送的执行上述测试子单元得到的代码执行信息时,从代码执行信息中获取时间信息,进而生成方法调用路径,具体地,根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径的步骤包括:根据所述代码执行时间信息确定与该测试子单元对应的各个方法的方法名,以及各个方法执行的先后顺序;根据所述方法名和各个方法被执行的先后顺序,生成所述测试子单元执行过程中被测系统的方法调用路径。
监控装置从代码执行信息中获取到测试子单元被执行中的各个方法被执行的开始时间和终止时间,通过这些时间信息能够确定各个方法被执行的先后顺序,通过先后顺序能够确定多个方法之间的调用关系,然后根据方法名和各个方法被执行的先后顺序生成测试子单元执行过程中被测系统的方法调用路径。
可以理解的是,一个测试案例中一般包含有多个测试子单元,测试人员会逐个进行测试。重复执行上述步骤,当测试案例中的测试子单元全部执行完成后,根据各个测试子单元的方法调用路径生成测试用例对应的方法调用路径。进一步地,将得到的方法调用路径展示在显示界面上,测试人员在根据测试结果对测试情况进行分析以对被测系统的缺陷进行定位时,可以根据展示的该测试案例对应的方法调用路径实现对缺陷的快速定位,实现准确高效的进行测试。
进一步地,在一实施例中,测试监控程序还可被处理器执行,以实现如下步骤:在测试过程中,对被测系统的源代码的代码测试覆盖率进行实时监 控,并将监控得到的代码测试覆盖率实时地展示在显示界面上。
以上实施例提出的测试过程的监控装置,用户逐个基于测试用例中的测试子单元触发测试指令,对被测系统进行测试,被测系统执行测试子单元得到代码执行信息,并且在根据测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中,当接收到被测系统发送的代码执行信息时,从中获取时间信息,并根据获取到的时间信息获取与测试子单元对应的方法调用路径,重复上述步骤直至测试用例包含的测试子单元全部执行完成,根据哥哥测试子单元对应的方法调用路径生成测试用例对应的方法调用路径,本申请的方案对使用测试用例对被测系统进行测试的过程进行监控,获取测试过程中每一个方法被执行的时间信息,进而根据时间信息自动生成与测试案例对应的方法调用路径,解决了无法根据对测试过程的监控,获取到被测系统在测试过程中的方法调用路径的技术问题,实现准确高效的进行测试。
进一步地,在另一实施例中,测试监控程序还可被所述处理器执行,以在所述当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试的步骤之前,还实现如下步骤:
获取所述被测系统的当前版本的系统源代码,以及历史版本的系统源代码;
根据对当前版本的系统源代码和历史版本的系统源代码进行对比分析,确定当前版本的系统源代码的变更代码和所述变更代码的关联代码;
在所述测试用例的执行过程中,对所述变更代码和所述关联代码的被执行情况进行实时监控,获取所述变更代码和所述关联代码的被执行情况;
根据所述被执行情况计算所述变更代码和所述关联代码的测试覆盖率,并实时输出计算得到的测试覆盖率。
本实施例的监控装置还可对被测系统的代码变更情况进行监控,首先根据当前版本的系统源代码和历史版本的系统源代码进行对比分析,确定哪些代码行是发生变更的代码行,包括修改和新增的代码,然后确定与这些代码行具有关联关系的代码。在测试过程中,对这些代码的执行情况进行监控,获取针对变更代码和所述关联代码的测试覆盖率,因为对于被测系统来说, 系统升级以后,新版本系统的新功能是主要的测试对象,因此,通过对变更代码的测试覆盖率进行实时地监测,有益于测试人员及时了解到针对这些新功能的测试执行情况。
进一步地,在另一实施例中,测试监控程序还可被所述处理器执行,以实现如下步骤:根据所述变更代码和所述关联代码的被执行情况,获取使用所述测试用例进行测试的过程中,变更代码和关联代码的测试覆盖信息;根据所述测试覆盖信息和各个测试子单元对应的方法调用路径,获取测试子单元与被测系统的代码行之间的映射关系。
通过对变更代码和其关联代码的被执行情况的监控,获取变更代码和关联代码的测试覆盖信息,也就是说获取到使用该测试用例进行测试的过程中,变更代码和关联代码中有哪些代码行被执行了。而方法与代码行之间有对应关系,进而结合方法调用路径,可以确定每个方法中被执行的代码行,进而可以得到测试子单元对应的被执行的代码行,即获取到测试子单元与被测系统的代码行之间的映射关系。这里的被测系统的代码行主要是上述变更代码和关联代码中的代码行。在其他实施例中,还可以结合完整的被测系统的代码覆盖情况与方法调用路径获取完整的代码行与测试子单元之间的映射关系。
进一步地,将上述映射关系展示在显示界面上,以供测试人员根据对测试情况进行分析,实现对缺陷的快速定位,进一步提高测试的效率和准确度。
可选地,在其他的实施例中,测试监控程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述测试监控程序在测试过程的监控装置中的执行过程。
例如,参照图2所示,为本申请测试过程的监控装置一实施例中的测试监控程序的程序模块示意图,该实施例中,测试监控程序可以被分割为测试执行模块10、信息获取模块20和路径生成模块30,示例性地:
测试执行模块10用于:当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试;
信息获取模块20用于:在接收到所述被测系统返回的执行所述测试子单元得到的代码执行信息时,从所述代码执行信息中获取代码执行时间信息, 其中,所述被测系统在根据所述测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中;
路径生成模块30用于:根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径;
测试执行模块10、信息获取模块20和路径生成模块30重复执行上述操作,直至测试用例包含的测试子单元全部执行完成,路径生成模块30根据各个测试子单元对应的方法调用路径生成与所述测试用例对应的方法调用路径。
上述测试执行模块10、信息获取模块20和路径生成模块30等程序模块被执行时所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。
此外,本申请还提供一种测试过程的监控方法。参照图3所示,为本申请测试过程的监控方法第一实施例的流程图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。以下实施例中以测试过程的监控装置作为执行主体对本申请的方法进行说明。
在本实施例中,测试过程的监控方法包括:
步骤S10,当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试。
步骤S20,在接收到所述被测系统返回的执行所述测试子单元得到的代码执行信息时,从所述代码执行信息中获取代码执行时间信息,其中,所述被测系统在根据所述测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中。
作为本实施例的执行主体的监控装置上存储有预先编写好的测试用例,一个测试用例可以包括多个测试子单元,测试人员在进行测试时,建立监控装置与被测终端之间的通讯连接,其中,被测系统运行在被测终端上。测试人员逐个基于测试子单元触发测试指令,监控装置在检测到测试指令时,根据对应的测试子单元对被测系统进行测试,被测系统根据测试子单元运行相应的代码。
具体地,对于被测系统来说,在测试过程中,由代码执行容器来执行对应的系统源代码,并且在执行源代码的过程对执行各个方法的时间信息进行 记录,主要包括各个方法被执行的开始时间和执行完成的终止之间,在测试子单元完成之后,将记录的时间信息添加至执行代码信息发送到监控装置。
可选地,作为一种实施方式,在监控装置上预先设置好一段时间记录代码,该时间记录代码用于实现对方法的被执行时间的记录。在测试开始之间,测试人员在监控装置上触发代码发送指令,监控装置在检测到代码发送指令时,获取时间记录代码,并将所述时间记录代码发送至所述被测系统所在的终端,以供所述终端存储所述时间记录代码并根据所述时间记录代码对方法被执行的起始时间和终止时间进行记录。
被测终端在接收到时间记录代码时,将该时间记录代码存储至缓存区域。当根据测试子单元执行对应的方法的代码时,代码执行容器将待执行的方法加载至容器中,并从缓存区域获取上述时间记录代码,分别将时间记录代码在即将被执行的方法的代码之前和代码之后添加时间记录代码,然后执行加载了时间记录代码的方法,在该方法的执行过程中,时间记录代码对方法被执行的起始时间和终止时间进行记录。需要说明的是,在根据一个测试子单元进行测试时,在被测系统中可能有多个方法需要执行,因此,需要在每一个方法的代码的前后添加时间记录代码,以对每一个方法的被执行的起始时间和终止时间进行记录。
步骤S30,根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径。
步骤S40,重复步骤S10至步骤S30,直至所述测试用例包含的测试子单元全部执行完成,根据各个测试子单元对应的方法调用路径生成与所述测试用例对应的方法调用路径。
监控装置在接收到被测终端发送的执行上述测试子单元得到的代码执行信息时,从代码执行信息中获取时间信息,进而生成方法调用路径,具体地,步骤S30包括以下细化步骤:根据所述代码执行时间信息确定与该测试子单元对应的各个方法的方法名,以及各个方法执行的先后顺序;根据所述方法名和各个方法被执行的先后顺序,生成所述测试子单元执行过程中被测系统的方法调用路径。
监控装置从代码执行信息中获取到测试子单元被执行中的各个方法被执行的开始时间和终止时间,通过这些时间信息能够确定各个方法被执行的先 后顺序,通过先后顺序能够确定多个方法之间的调用关系,然后根据方法名和各个方法被执行的先后顺序生成测试子单元执行过程中被测系统的方法调用路径。
可以理解的是,一个测试案例中一般包含有多个测试子单元,测试人员会逐个进行测试。重复执行上述步骤,当测试案例中的测试子单元全部执行完成后,根据各个测试子单元的方法调用路径生成测试用例对应的方法调用路径。进一步地,将得到的方法调用路径展示在显示界面上,测试人员在根据测试结果对测试情况进行分析以对被测系统的缺陷进行定位时,可以根据展示的该测试案例对应的方法调用路径实现对缺陷的快速定位,实现准确高效的进行测试。
进一步地,在一实施例中,该方法还包括步骤:在测试过程中,对被测系统的源代码的代码测试覆盖率进行实时监控,并将监控得到的代码测试覆盖率实时地展示在显示界面上。
以上实施例提出的测试过程的监控方法,用户逐个基于测试用例中的测试子单元触发测试指令,对被测系统进行测试,被测系统执行测试子单元得到代码执行信息,并且在根据测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中,当接收到被测系统发送的代码执行信息时,从中获取时间信息,并根据获取到的时间信息获取与测试子单元对应的方法调用路径,重复上述步骤直至测试用例包含的测试子单元全部执行完成,根据哥哥测试子单元对应的方法调用路径生成测试用例对应的方法调用路径,本申请的方案对使用测试用例对被测系统进行测试的过程进行监控,获取测试过程中每一个方法被执行的时间信息,进而根据时间信息自动生成与测试案例对应的方法调用路径,解决了无法根据对测试过程的监控,获取到被测系统在测试过程中的方法调用路径的技术问题,实现准确高效的进行测试。
进一步地,在另一实施例中,该方法还包括如下步骤::
获取所述被测系统的当前版本的系统源代码,以及历史版本的系统源代码;
根据对当前版本的系统源代码和历史版本的系统源代码进行对比分析,确定当前版本的系统源代码的变更代码和所述变更代码的关联代码;
在所述测试用例的执行过程中,对所述变更代码和所述关联代码的被执行情况进行实时监控,获取所述变更代码和所述关联代码的被执行情况;
根据所述被执行情况计算所述变更代码和所述关联代码的测试覆盖率,并实时输出计算得到的测试覆盖率。
在该实施例中,还可对被测系统的代码变更情况进行监控,首先根据当前版本的系统源代码和历史版本的系统源代码进行对比分析,确定哪些代码行是发生变更的代码行,包括修改和新增的代码,然后确定与这些代码行具有关联关系的代码。在测试过程中,对这些代码的执行情况进行监控,获取针对变更代码和所述关联代码的测试覆盖率,因为对于被测系统来说,系统升级以后,新版本系统的新功能是主要的测试对象,因此,通过对变更代码的测试覆盖率进行实时地监测,有益于测试人员及时了解到针对这些新功能的测试执行情况。
进一步地,在另一实施例中,该方法还包括如下步骤:根据所述变更代码和所述关联代码的被执行情况,获取使用所述测试用例进行测试的过程中,变更代码和关联代码的测试覆盖信息;根据所述测试覆盖信息和各个测试子单元对应的方法调用路径,获取测试子单元与被测系统的代码行之间的映射关系。
通过对变更代码和其关联代码的被执行情况的监控,获取变更代码和关联代码的测试覆盖信息,也就是说获取到使用该测试用例进行测试的过程中,变更代码和关联代码中有哪些代码行被执行了。而方法与代码行之间有对应关系,进而结合方法调用路径,可以确定每个方法中被执行的代码行,进而可以得到测试子单元对应的被执行的代码行,即获取到测试子单元与被测系统的代码行之间的映射关系。这里的被测系统的代码行主要是上述变更代码和关联代码中的代码行。在其他实施例中,还可以结合完整的被测系统的代码覆盖情况与方法调用路径获取完整的代码行与测试子单元之间的映射关系。
进一步地,将上述映射关系展示在显示界面上,以供测试人员根据对测试情况进行分析,实现对缺陷的快速定位,进一步提高测试的效率和准确度。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有测试监控程序,所述测试监控程序可被一个或多个处理器执行,以实现如下操作:
本申请计算机可读存储介质具体实施方式与上述测试过程的监控装置和方法各实施例基本相同,在此不作累述。
当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试;
在接收到所述被测系统返回的执行所述测试子单元得到的代码执行信息时,从所述代码执行信息中获取代码执行时间信息,其中,所述被测系统在根据所述测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中;
根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径;重复上述步骤,直至所述测试用例包含的测试子单元全部执行完成,根据各个测试子单元对应的方法调用路径生成与所述测试用例对应的方法调用路径。
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种测试过程的监控装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的测试监控程序,所述测试监控程序被所述处理器执行时实现如下步骤:
    当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试;
    在接收到所述被测系统返回的执行所述测试子单元得到的代码执行信息时,从所述代码执行信息中获取代码执行时间信息,其中,所述被测系统在根据所述测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中;
    根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径;
    重复上述步骤,直至所述测试用例包含的测试子单元全部执行完成,根据各个测试子单元对应的方法调用路径生成与所述测试用例对应的方法调用路径。
  2. 如权利要求1所述的测试过程的监控装置,其特征在于,所述测试监控程序还可被所述处理器执行,以在所述当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试的步骤之前,还实现如下步骤:
    在检测到代码发送指令时,获取时间记录代码,并将所述时间记录代码发送至所述被测系统所在的终端,以供所述终端存储所述时间记录代码并根据所述时间记录代码对方法被执行的起始时间和终止时间进行记录。
  3. 如权利要求1所述的测试过程的监控装置,其特征在于,所述测试监控程序还可被所述处理器执行,以在所述当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试的步骤之前,还实现如下步骤:
    获取所述被测系统的当前版本的系统源代码,以及历史版本的系统源代码;
    根据对当前版本的系统源代码和历史版本的系统源代码进行对比分析,确定当前版本的系统源代码的变更代码和所述变更代码的关联代码;
    在所述测试用例的执行过程中,对所述变更代码和所述关联代码的被执行情况进行实时监控,获取所述变更代码和所述关联代码的被执行情况;
    根据所述被执行情况计算所述变更代码和所述关联代码的测试覆盖率,并实时输出计算得到的测试覆盖率。
  4. 如权利要求3所述的测试过程的监控装置,其特征在于,所述测试监控程序还可被所述处理器执行,以在所述测试用例的执行过程中,对所述变更代码和所述关联代码的被执行情况进行实时监控,获取所述变更代码和所述关联代码的被执行情况的步骤之后,还实现如下步骤:
    根据所述变更代码和所述关联代码的被执行情况,获取使用所述测试用例进行测试的过程中,变更代码和关联代码的测试覆盖信息;
    根据所述测试覆盖信息和各个测试子单元对应的方法调用路径,获取测试子单元与被测系统的代码行之间的映射关系。
  5. 如权利要求1所述的测试过程的监控装置,其特征在于,所述根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径的步骤包括:
    根据所述代码执行时间信息确定与该测试子单元对应的各个方法的方法名,以及各个方法执行的先后顺序;
    根据所述方法名和各个方法被执行的先后顺序,生成所述测试子单元执行过程中被测系统的方法调用路径。
  6. 如权利要求2所述的测试过程的监控装置,其特征在于,所述根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径的步骤包括:
    根据所述代码执行时间信息确定与该测试子单元对应的各个方法的方法名,以及各个方法执行的先后顺序;
    根据所述方法名和各个方法被执行的先后顺序,生成所述测试子单元执行过程中被测系统的方法调用路径。
  7. 如权利要求3所述的测试过程的监控装置,其特征在于,所述根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径的步骤包括:
    根据所述代码执行时间信息确定与该测试子单元对应的各个方法的方法 名,以及各个方法执行的先后顺序;
    根据所述方法名和各个方法被执行的先后顺序,生成所述测试子单元执行过程中被测系统的方法调用路径。
  8. 一种测试过程的监控方法,其特征在于,所述方法包括:
    当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试;
    在接收到所述被测系统返回的执行所述测试子单元得到的代码执行信息时,从所述代码执行信息中获取代码执行时间信息,其中,所述被测系统在根据所述测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中;
    根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径;
    重复上述步骤,直至所述测试用例包含的测试子单元全部执行完成,根据各个测试子单元对应的方法调用路径生成与所述测试用例对应的方法调用路径。
  9. 如权利要求8所述的测试过程的监控方法,其特征在于,所述当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试的步骤之前,所述方法还包括:
    在检测到代码发送指令时,获取时间记录代码,并将所述时间记录代码发送至所述被测系统所在的终端,以供所述终端存储所述时间记录代码并根据所述时间记录代码对方法被执行的起始时间和终止时间进行记录。
  10. 如权利要求8所述的测试过程的监控方法,其特征在于,所述当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试的步骤之前,所述方法还包括:
    获取所述被测系统的当前版本的系统源代码,以及历史版本的系统源代码;
    根据对当前版本的系统源代码和历史版本的系统源代码进行对比分析,确定当前版本的系统源代码的变更代码和所述变更代码的关联代码;
    在所述测试用例的执行过程中,对所述变更代码和所述关联代码的被执行情况进行实时监控,获取所述变更代码和所述关联代码的被执行情况;
    根据所述被执行情况计算所述变更代码和所述关联代码的测试覆盖率,并实时输出计算得到的测试覆盖率。
  11. 如权利要求10所述的测试过程的监控方法,其特征在于,在所述测试用例的执行过程中,对所述变更代码和所述关联代码的被执行情况进行实时监控,获取所述变更代码和所述关联代码的被执行情况的步骤之后,所述方法还包括:
    根据所述变更代码和所述关联代码的被执行情况,获取使用所述测试用例进行测试的过程中,变更代码和关联代码的测试覆盖信息;
    根据所述测试覆盖信息和各个测试子单元对应的方法调用路径,获取测试子单元与被测系统的代码行之间的映射关系。
  12. 如权利要求8所述的测试过程的监控方法,其特征在于,所述根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径的步骤包括:
    根据所述代码执行时间信息确定与该测试子单元对应的各个方法的方法名,以及各个方法执行的先后顺序;
    根据所述方法名和各个方法被执行的先后顺序,生成所述测试子单元执行过程中被测系统的方法调用路径。
  13. 如权利要求9所述的测试过程的监控方法,其特征在于,所述根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径的步骤包括:
    根据所述代码执行时间信息确定与该测试子单元对应的各个方法的方法名,以及各个方法执行的先后顺序;
    根据所述方法名和各个方法被执行的先后顺序,生成所述测试子单元执行过程中被测系统的方法调用路径。
  14. 如权利要求10所述的测试过程的监控方法,其特征在于,所述根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径的步骤包括:
    根据所述代码执行时间信息确定与该测试子单元对应的各个方法的方法名,以及各个方法执行的先后顺序;
    根据所述方法名和各个方法被执行的先后顺序,生成所述测试子单元执 行过程中被测系统的方法调用路径。
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有测试监控程序,所述测试监控程序可被一个或者多个处理器执行,以实现如下步骤:
    当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试;
    在接收到所述被测系统返回的执行所述测试子单元得到的代码执行信息时,从所述代码执行信息中获取代码执行时间信息,其中,所述被测系统在根据所述测试子单元执行对应的方法的过程中,对方法被执行的起始时间和终止时间进行记录,并生成代码执行时间信息添加至代码执行信息中;
    根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径;
    重复上述步骤,直至所述测试用例包含的测试子单元全部执行完成,根据各个测试子单元对应的方法调用路径生成与所述测试用例对应的方法调用路径。
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述测试监控程序还可被所述处理器执行,以在所述当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试的步骤之前,还实现如下步骤:
    在检测到代码发送指令时,获取时间记录代码,并将所述时间记录代码发送至所述被测系统所在的终端,以供所述终端存储所述时间记录代码并根据所述时间记录代码对方法被执行的起始时间和终止时间进行记录。
  17. 如权利要求15所述的计算机可读存储介质,其特征在于,所述测试监控程序还可被所述处理器执行,以在所述当检测到用户基于测试用例的测试子单元触发的测试指令时,基于所述测试指令执行所述测试子单元以对被测系统进行测试的步骤之前,还实现如下步骤:
    获取所述被测系统的当前版本的系统源代码,以及历史版本的系统源代码;
    根据对当前版本的系统源代码和历史版本的系统源代码进行对比分析,确定当前版本的系统源代码的变更代码和所述变更代码的关联代码;
    在所述测试用例的执行过程中,对所述变更代码和所述关联代码的被执行情况进行实时监控,获取所述变更代码和所述关联代码的被执行情况;
    根据所述被执行情况计算所述变更代码和所述关联代码的测试覆盖率,并实时输出计算得到的测试覆盖率。
  18. 如权利要求17所述的计算机可读存储介质,其特征在于,所述测试监控程序还可被所述处理器执行,以在所述测试用例的执行过程中,对所述变更代码和所述关联代码的被执行情况进行实时监控,获取所述变更代码和所述关联代码的被执行情况的步骤之后,还实现如下步骤:
    根据所述变更代码和所述关联代码的被执行情况,获取使用所述测试用例进行测试的过程中,变更代码和关联代码的测试覆盖信息;
    根据所述测试覆盖信息和各个测试子单元对应的方法调用路径,获取测试子单元与被测系统的代码行之间的映射关系。
  19. 如权利要求15所述的计算机可读存储介质,其特征在于,所述根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径的步骤包括:
    根据所述代码执行时间信息确定与该测试子单元对应的各个方法的方法名,以及各个方法执行的先后顺序;
    根据所述方法名和各个方法被执行的先后顺序,生成所述测试子单元执行过程中被测系统的方法调用路径。
  20. 如权利要求16所述的计算机可读存储介质,其特征在于,所述根据所述代码执行时间信息,生成与所述测试子单元对应的方法调用路径的步骤包括:
    根据所述代码执行时间信息确定与该测试子单元对应的各个方法的方法名,以及各个方法执行的先后顺序;
    根据所述方法名和各个方法被执行的先后顺序,生成所述测试子单元执行过程中被测系统的方法调用路径。
PCT/CN2018/102101 2018-05-08 2018-08-24 测试过程的监控装置、方法及计算机可读存储介质 WO2019214109A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810432475.6 2018-05-08
CN201810432475.6A CN108664372A (zh) 2018-05-08 2018-05-08 测试过程的监控装置、方法及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2019214109A1 true WO2019214109A1 (zh) 2019-11-14

Family

ID=63778872

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/102101 WO2019214109A1 (zh) 2018-05-08 2018-08-24 测试过程的监控装置、方法及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108664372A (zh)
WO (1) WO2019214109A1 (zh)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928770B (zh) * 2019-10-29 2023-11-28 航天信息股份有限公司 软件测试的方法、装置、系统、存储介质和电子设备
CN110851369A (zh) * 2019-11-19 2020-02-28 泰康保险集团股份有限公司 保单数据处理方法及装置
CN111858375B (zh) * 2020-07-28 2023-09-05 中国工商银行股份有限公司 软件测试方法、装置、电子设备和介质
CN112380125B (zh) * 2020-11-16 2024-04-26 中信银行股份有限公司 测试案例的推荐方法、装置、电子设备及可读存储介质
CN112579467A (zh) * 2020-12-28 2021-03-30 北京百家科技集团有限公司 一种测试方法、装置、计算机设备及存储介质
CN113342659A (zh) * 2021-06-11 2021-09-03 上海中通吉网络技术有限公司 一种自动调度代码覆盖率工具的方法
CN117421839A (zh) * 2023-11-06 2024-01-19 上海同星智能科技有限公司 汽车仿真测试过程中的程序步骤可视化实现方法及系统
CN117762718B (zh) * 2024-02-21 2024-04-26 北京壁仞科技开发有限公司 一种指令监测方法、装置、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101052020A (zh) * 2007-05-21 2007-10-10 中兴通讯股份有限公司 一种自动化测试执行过程的监控方法和系统
CN101246444A (zh) * 2008-03-03 2008-08-20 中兴通讯股份有限公司 一种模块测试方法及系统
CN101673233A (zh) * 2008-09-12 2010-03-17 英业达股份有限公司 测试项目的排程方法及其排程系统
CN107832206A (zh) * 2017-10-16 2018-03-23 深圳市牛鼎丰科技有限公司 测试方法、装置、计算机可读存储介质和计算机设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102460408B (zh) * 2009-06-01 2014-08-06 惠普开发有限公司 用于收集应用性能数据的系统和方法
CN102346710B (zh) * 2011-10-13 2015-04-29 北京航空航天大学 一种基于动态插桩技术的数据包处理时延分析方法
CN105302710B (zh) * 2014-07-03 2019-06-07 腾讯科技(深圳)有限公司 一种确定需要回归测试的测试用例的方法和装置
CN106445784B (zh) * 2016-09-27 2020-08-28 北京搜狐新动力信息技术有限公司 一种信息监控方法及装置
CN106933724B (zh) * 2017-03-16 2020-06-05 北京搜狐新媒体信息技术有限公司 一种分布式信息追踪系统、信息处理方法及装置
CN106790718A (zh) * 2017-03-16 2017-05-31 北京搜狐新媒体信息技术有限公司 服务调用链路分析方法及系统
CN107480029B (zh) * 2017-08-02 2019-02-15 北京深思数盾科技股份有限公司 一种函数调用时间的监控方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101052020A (zh) * 2007-05-21 2007-10-10 中兴通讯股份有限公司 一种自动化测试执行过程的监控方法和系统
CN101246444A (zh) * 2008-03-03 2008-08-20 中兴通讯股份有限公司 一种模块测试方法及系统
CN101673233A (zh) * 2008-09-12 2010-03-17 英业达股份有限公司 测试项目的排程方法及其排程系统
CN107832206A (zh) * 2017-10-16 2018-03-23 深圳市牛鼎丰科技有限公司 测试方法、装置、计算机可读存储介质和计算机设备

Also Published As

Publication number Publication date
CN108664372A (zh) 2018-10-16

Similar Documents

Publication Publication Date Title
WO2019214109A1 (zh) 测试过程的监控装置、方法及计算机可读存储介质
CN109302522B (zh) 测试方法、装置以及计算机系统和介质
CN107193750B (zh) 一种脚本录制方法和装置
US9824002B2 (en) Tracking of code base and defect diagnostic coupling with automated triage
WO2019085079A1 (zh) 接口测试方法、装置、计算机设备和存储介质
US8370816B2 (en) Device, method and computer program product for evaluating a debugger script
WO2018036273A1 (zh) 模拟测试方法、服务器、设备及计算机可读存储介质
WO2019218513A1 (zh) 测试过程的监控装置、方法及计算机可读存储介质
WO2019227708A1 (zh) 测试案例的在线调试装置、方法及计算机可读存储介质
CN108959067B (zh) 搜索引擎的测试方法、装置及计算机可读存储介质
CN110532185B (zh) 测试方法、装置、电子设备和计算机可读存储介质
US9507691B2 (en) Conditional component breakpoint setting system and method
CN111078567B (zh) 自动化测试平台的报告生成方法、终端和存储介质
US20200050534A1 (en) System error detection
CN112115051A (zh) 应用的页面遍历探测方法、装置、设备及可读存储介质
CN107908490B (zh) 一种服务器dc测试中gpu寄存器可靠性验证方法与系统
CA2811617C (en) Commit sensitive tests
CN112817831A (zh) 应用性能监测方法、装置、计算机系统和可读存储介质
WO2019148657A1 (zh) 关联环境测试方法、电子装置及计算机可读存储介质
US9563541B2 (en) Software defect detection identifying location of diverging paths
CN114218072A (zh) 测试脚本生成方法、装置、存储介质及计算机设备
JP5006824B2 (ja) テストプログラム管理システム
CN111930629A (zh) 页面测试方法、装置、电子设备及存储介质
JP6747161B2 (ja) ソフトウェア品質判定方法
CN113590498B (zh) 一种桌面操作系统应用启动时间的测试方法及系统

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: 18917702

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18917702

Country of ref document: EP

Kind code of ref document: A1