A test method and device based on an automated test tool

By introducing a program execution monitoring module and a case analysis tool, test cases are automatically generated, solving the high cost problem in the early stages of system development and improving testing efficiency.

CN115309663BActive Publication Date: 2026-07-07AGRICULTURAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AGRICULTURAL BANK OF CHINA
Filing Date
2022-09-19
Publication Date
2026-07-07

Smart Images

  • Figure CN115309663B_ABST
    Figure CN115309663B_ABST
Patent Text Reader

Abstract

The application discloses a test method based on an automatic test tool, which comprises the following steps: according to a first program running record in an automatic execution of a first test case, analyzing a correlation between inputs and outputs of each program in a system, and judging whether a tested program has an influence on the inputs or outputs of each program in the system; when the tested program has an influence on the inputs or outputs of each program in the system, generating a second test case according to the influenced inputs or outputs; according to a second program running record in the automatic execution of the second test case, analyzing the influence of the tested program on the running of each program in the system, and marking a target program and test data which are influenced; according to the marked target program and test data, generating a third test case and executing the third test case, setting an interface field to which the test data belongs in a transaction module to which the target program belongs for testing, and obtaining a test result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, specifically to a testing method and apparatus based on automated testing tools. Background Technology

[0002] With the development of network technology, automated testing has become increasingly widespread in the field of program testing. Replacing manual testing with automated testing can save labor costs and improve testing efficiency. Automated testing generally refers to the automation of software testing. Software testing involves running a system or application under preset conditions and evaluating the results. These preset conditions should include both normal and abnormal conditions.

[0003] In related technologies, testers actively configure test data and test cases for each test, and automated testing tools execute automated tests under preset conditions. However, these technologies lack analysis of the program execution or test cases used in automated testing. Furthermore, such automated testing relies on testers' thorough familiarity with the system under test and a relatively stable version. In the early stages of system development, frequent program changes necessitate continuously rebuilding the test assets required for automated testing, which takes considerable time. Therefore, the implementation cost of automated testing is high. Summary of the Invention

[0004] In view of this, in order to realize the analysis of program execution and test cases of automated testing, the first aspect of this application provides a testing method based on automated testing tools, the method comprising:

[0005] Based on the first program execution record during the automated execution of the first test case, the correlation between the inputs and outputs of each program in the system is analyzed to determine whether the program under test affects the inputs or outputs of each program in the system; wherein, the first program execution record is obtained by the program execution monitoring module by monitoring the input, execution and output of the program;

[0006] When the program under test affects the input or output of the program in the system, a second test case is generated based on the affected input or output.

[0007] Based on the second program execution record during the automated execution of the second test case, analyze the impact of the tested program on the operation of each program in the system, and mark the affected target program and test data;

[0008] Based on the tagged target program and test data, generate a third test case;

[0009] By automating the execution of the third test case, the interface field containing the test data is set in the transaction module of the target program for testing, and the test results are obtained.

[0010] Optionally, the method further includes:

[0011] Based on the third test case and the test results, associated test cases related to the tagged target program and test data are generated; wherein, the associated test cases are supplemented into the first test case for use in subsequent tests.

[0012] Optionally, after generating associated test cases related to the tagged target program and test data based on the third test case and the test results, the method further includes:

[0013] Based on the associated test cases, test rules for the program under test are generated; wherein, the test rules for the program under test are used to generate test cases related to the program under test in automated testing.

[0014] Optionally, after analyzing the correlation between the inputs and outputs of each program in the system based on the first program execution record during the automated execution of the first test case, and determining whether the program under test affects the inputs or outputs of each program in the system, the process further includes:

[0015] Test scenarios are generated based on the impact of the program under test on the inputs or outputs of other programs in the system and the correlation between the inputs and outputs of other programs in the system.

[0016] Optionally, the method further includes:

[0017] Based on the analysis of the execution records of the first program, the execution relationships between the preceding and succeeding programs, and the correlation between the inputs and outputs of each program in the system, a system execution logic diagram containing the relationships between each program in the system is generated.

[0018] A second aspect of this application provides a testing apparatus based on an automated testing tool, the apparatus comprising:

[0019] The analysis module is used to: analyze the correlation between the inputs and outputs of each program in the system based on the first program execution record during the automated execution of the first test case, and determine whether the program under test affects the inputs or outputs of each program in the system; wherein, the first program execution record is obtained by the program execution monitoring module by monitoring the input, execution and output of the program;

[0020] The test case generation module is used to generate a second test case based on the affected input or output when the program under test affects the input or output of the program in the system.

[0021] The analysis module is also used to: analyze the impact of the tested program on the operation of each program in the system based on the second program execution record during the automated execution of the second test case, and mark the affected target program and test data;

[0022] The test case generation module is also used to: generate a third test case based on the tagged target program and test data;

[0023] The automated testing module is used to: automatically execute the third test case, set the interface field to which the test data belongs in the transaction module to which the target program belongs, perform the test, and obtain the test results.

[0024] Optionally, the case generation module is further used for:

[0025] Based on the third test case and the test results, associated test cases related to the tagged target program and test data are generated; wherein, the associated test cases are supplemented into the first test case for use in subsequent tests.

[0026] Optionally, the device further includes:

[0027] The test rule generation module is used to: generate test rules for the program under test based on the associated test cases; wherein the test rules for the program under test are used to generate test cases related to the program under test in automated testing.

[0028] Optionally, the device further includes:

[0029] The test scenario generation module is used to generate test scenarios based on the correlation between the inputs and outputs of each program in the system and the impact of the program under test on the inputs or outputs of each program in the system.

[0030] Optionally, the device further includes:

[0031] The drawing module is used to generate a system operation logic diagram containing the programs in the system and the relationships between them, based on the operation relationships between the preceding and succeeding programs obtained by analyzing the first program's operation record, as well as the correlation relationships between the inputs and outputs of each program in the system.

[0032] As can be seen from the above technical solutions, this application introduces a program execution monitoring module. Through automated execution of test cases, a case analysis tool analyzes the relationships between the inputs and outputs of various programs in the system, as well as the impact of the tested program on existing programs, based on the program execution records obtained by the monitoring module. It marks the affected target programs and test data, and further tests the target programs and test data, analyzing specific test points. The embodiments of this application have the following advantages: by using the program execution records obtained by the monitoring module during program execution, and adding a case analysis tool to automated testing, after automated execution of test cases, the case analysis tool analyzes the relationships between the inputs and outputs of various programs in the system. Based on the target programs and test data affected by the tested program, test points are analyzed, thus realizing the analysis of program execution and test cases after automated testing.

[0033] In addition, this application can automatically generate test cases, saving testers the manpower cost of manually configuring test data and test cases before each test, and improving the efficiency of testing work. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 Flowcharts provided for embodiments of this application;

[0036] Figure 2 A flowchart for generating a test scenario is provided as another embodiment of this application;

[0037] Figure 3 A flowchart illustrating the logical relationship of the generation system provided in another embodiment of this application;

[0038] Figure 4 This is a schematic diagram of an apparatus according to an embodiment of this application. Detailed Implementation

[0039] This application introduces a program execution monitoring module to monitor the program's input, execution, and output to obtain program execution records. It also incorporates a case analysis tool into automated testing. After automatically executing test cases, it analyzes the impact of the tested program on the input, execution, or output of various programs in the system based on the program execution records. It marks the affected target programs and test data, sets the interface field to which the test data belongs in the transaction module to which the target program belongs, and conducts testing to obtain test results.

[0040] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.

[0041] See Figure 1 As shown, the method for implementing this application includes the following steps:

[0042] Step 101: Based on the first program execution record during the automated execution of the first test case, analyze the correlation between the inputs and outputs of each program in the system, and determine whether the program under test affects the inputs or outputs of each program in the system.

[0043] When executing the first test case automatically, a program running monitoring module is introduced to monitor the input, operation and output of the system program and generate the first program running record. The first program running record records the running status of each program in the system before and after the program under test is added to the system. The running status may include parameters such as program input, output results and running process.

[0044] After the test cases are executed automatically, the automated testing tool triggers the case analysis tool to analyze the relationship between the inputs and outputs of each program in the system based on the first program's execution record. By comparing the changes in the inputs and outputs of each program in the system before and after the program under test is added, it is determined whether the program under test affects the inputs or outputs of each program in the system.

[0045] Step 102: When the program under test affects the input or output of the program in the system, generate a second test case based on the affected input or output.

[0046] When it is determined that a new program affects the input or output of the program in the system, further testing is required on the affected input or output. The automated testing tool triggers the test case generation tool to generate a second test case and executes it automatically.

[0047] Step 103: Based on the second program execution record during the automated execution of the second test case, analyze the impact of the tested program on the operation of each program in the system, and mark the affected target program and test data.

[0048] When the second test case is executed automatically, the program execution monitoring module monitors the input, execution and output of the system program and generates the second program execution record. By comparing the parameters such as program input, output results and execution process of the tested program before and after it is added to the system in the second program execution record with the case analysis tool, the program and test data whose parameters such as program input, output results and execution process have changed are obtained, and test process flags are set to mark the program and test data.

[0049] The case analysis tool focuses on different aspects when analyzing the first and second program execution records. When analyzing the first program execution record, the focus is on the inputs and outputs of each program in the system. However, when analyzing the second program execution record, the focus is on the execution status of each program in the system, including parameters such as program inputs, output results, and execution process, in order to identify the target program and test data affected by the program under test.

[0050] If the analysis result of the case analysis tool in the first program running record is that the tested program does not affect the input or output of other programs in the system, then the running status of each program in the system can be obtained by analyzing the first program running record, the affected target program and test data can be marked, and then proceed to step 104.

[0051] Step 104: Generate a third test case based on the tagged target program and test data.

[0052] Based on the target program and test data marked in step 103, the test case generation tool generates the third test case and further analyzes the specific test points in the target program and test data.

[0053] However, when analysis of the second program execution record shows that the program under test did not affect the operation of other programs in the system, since the program under test was marked during the testing process, the automated testing tool triggers the test case generation tool to generate the third test case based on the markings on the program under test itself, in order to further analyze the specific test points in the program under test. In addition, the third test case can also help testers analyze test points during manual testing.

[0054] Step 105: By automatically executing the third test case, in the transaction module to which the target program belongs, set the interface field to which the test data belongs for testing and obtain the test results.

[0055] When executing the third test case automatically, specific test points are analyzed through the tagged target program and test data. The interface fields to which the test data belongs are set, and a large number of tests are performed on the transaction module to which the target program belongs. The test results are obtained based on the test data generated during the test process.

[0056] This application provides a testing method based on automated testing tools. By introducing a program execution monitoring module, the input, execution, and output of the program in the system are monitored, and program execution records are generated. A case analysis tool is added to the automated testing. After the test cases are executed automatically, the case analysis tool analyzes the correlation between the inputs and outputs of the various programs in the system. Based on the target program affected by the program under test and the test data, the test points are analyzed, thus realizing the analysis of program execution and test cases after automated testing.

[0057] In this application, the test cases generated by the test case generation tool can be output in the form of charts, text, etc., to intuitively illustrate the automated testing process. It should be understood that the first test case, the second test case, the third test case, etc., in this application are a collection of one or more test cases executed in the automated testing process.

[0058] After obtaining the test results, associated test cases for the program under test can be generated based on the test results. The process of obtaining the test results is described in steps 101 to 105, and further includes the following steps:

[0059] Step 106: Based on the third test case and the test results, generate associated test cases related to the tagged target program and test data.

[0060] When the third test case is executed automatically, a third program execution record is generated through the program execution monitoring module. Based on the third program execution record, the test case analysis tool analyzes the test cases related to the program under test and generates associated test cases from the third test cases. These associated test cases can be added to the first test case for use as test assets in subsequent tests.

[0061] Furthermore, based on the associated test cases, test rules for the program under test and test points can be generated. The generation of the associated test cases, as described in steps 101 to 106, further includes the following steps:

[0062] Step 107: Generate test rules for the program under test based on the associated test cases.

[0063] Based on the associated test cases, the test case analysis tool analyzes the test rules for the program under test and the test points. The test points are the target programs and test data marked in step 103. These test rules can be used to generate test cases related to the program under test in subsequent tests, saving testers the manpower cost of actively configuring test data and test cases before each test and improving testing efficiency.

[0064] In automated testing, test scenarios can be generated by analyzing the impact of the program under test on the inputs and outputs of various programs in the system. (See also...) Figure 2 As shown, another embodiment provided in this application includes the following steps:

[0065] Step 201: Based on the first program execution record during the automated execution of the first test case, analyze the correlation between the inputs and outputs of each program in the system, and determine whether the program under test affects the inputs or outputs of each program in the system.

[0066] The program execution monitoring module obtains the first program execution record during the automated execution of the first test case, and analyzes the correlation between the inputs and outputs of each program in the system based on the program execution record.

[0067] Step 202: Generate a test scenario based on the impact of the program under test on the inputs or outputs of each program in the system and the correlation between the inputs and outputs of each program in the system.

[0068] When test cases affect the inputs and outputs of programs in the system, test cases related to the affected inputs and outputs can be obtained based on the correlation between the inputs and outputs of each program in the system. These test cases together generate the test scenario.

[0069] Test scenarios are the outputs of the effects of the program under test on other programs in the system during automated testing, so that testers can use them as a reference when they need to perform manual testing on the program under test.

[0070] During automated testing, a system operation logic diagram can also be drawn between the various programs in the system. See also Figure 3 As shown, it includes the following steps:

[0071] Step 301: Analyze the first program's execution record to obtain the execution relationship between the preceding and following programs, as well as the correlation between the inputs and outputs of each program in the system.

[0072] Step 302: Generate a system operation logic diagram that includes the programs in the system and the relationships between them.

[0073] By introducing a program execution monitoring module, the input, execution, and output of the program in the system are monitored during the execution of the first test case, generating the first program execution record. The case analysis tool analyzes the first program execution record to obtain the execution relationship between the preceding and succeeding programs in the system and the correlation between the input and output of each program in the system. The drawing tool draws a system execution logic diagram based on the execution relationship and the correlation, wherein the system execution logic diagram includes each program in the system and the correlation between each program.

[0074] When a new program is added to the system, the position of the new program in the system can be analyzed by running each program in the system, based on the program running records, the correlation between the inputs and outputs of each program in the system, and the generated system running logic diagram, and the system running logic diagram can be updated.

[0075] By generating a system operation logic diagram, the structure and operation logic of the entire system can be visualized. During system handover, this helps testers quickly understand the system structure and the relationships between various programs.

[0076] See Figure 4 As shown, the apparatus used in this application includes an analysis module 401, a case generation module 402, and an automated testing module 403.

[0077] Analysis module 401 is used to analyze the correlation between the inputs and outputs of each program in the system based on the first program execution record during the automated execution of the first test case, and to determine whether the program under test affects the inputs or outputs of each program in the system; wherein, the first program execution record is obtained by the program execution monitoring module by monitoring the input, execution and output of the program.

[0078] The test case generation module 402 is used to generate a second test case based on the affected input or output when the program under test affects the input or output of the program in the system.

[0079] The analysis module 401 is also used to analyze the impact of the tested program on the operation of each program in the system based on the second program running record during the automated execution of the second test case, and to mark the affected target program and test data.

[0080] The case generation module 402 is also used to generate a third test case based on the marked target program and test data.

[0081] The automated testing module 403 is used to automatically execute the third test case, set the interface field to which the test data belongs in the transaction module to which the target program belongs, and obtain the test results.

[0082] The test case generation module 402 is further configured to generate associated test cases related to the tagged target program and test data based on the third test case and the test results; the automated test module 403 is further configured to automatically execute the first test case and the second test case.

[0083] Furthermore, Figure 4The device shown may further include a test rule generation module, a test scenario generation module, and a drawing module.

[0084] The test rule generation module is used to generate test rules for the program under test based on the associated test cases; the test scenario generation module is used to generate test scenarios based on the correlation between the inputs and outputs of each program in the system and the impact of the program under test on the inputs or outputs of each program in the system; the drawing module is used to generate a system operation logic diagram containing the programs in the system and the correlations between them based on the operation relationships between the preceding and succeeding programs obtained by analyzing the first program's operation records and the correlation between the inputs and outputs of each program in the system.

[0085] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0086] It should be understood that the steps described in the method embodiments of this application may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this application is not limited in this respect.

[0087] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A testing method based on automated testing tools, characterized in that, The method includes: Based on the first program execution record during the automated execution of the first test case, the correlation between the inputs and outputs of each program in the system is analyzed to determine whether the program under test affects the inputs or outputs of each program in the system; wherein, the first program execution record is obtained by the program execution monitoring module by monitoring the input, execution and output of the program; When the program under test affects the input or output of the program in the system, a second test case is generated based on the affected input or output. Based on the second program execution record during the automated execution of the second test case, analyze the impact of the tested program on the operation of each program in the system, and mark the affected target program and test data; Based on the tagged target program and test data, generate a third test case; By automating the execution of the third test case, the interface field containing the test data is set in the transaction module of the target program for testing, and the test results are obtained.

2. The method according to claim 1, characterized in that, The method further includes: Based on the third test case and the test results, associated test cases related to the tagged target program and test data are generated; wherein, the associated test cases are supplemented into the first test case for use in subsequent tests.

3. The method according to claim 2, characterized in that, After generating associated test cases related to the tagged target program and test data based on the third test case and the test results, the method further includes: Based on the associated test cases, test rules for the program under test are generated; wherein, the test rules for the program under test are used to generate test cases related to the program under test in automated testing.

4. The method according to claim 1, characterized in that, After analyzing the correlation between the inputs and outputs of each program in the system based on the first program execution record during the automated execution of the first test case, and determining whether the program under test affects the inputs or outputs of each program in the system, the process further includes: Test scenarios are generated based on the impact of the program under test on the inputs or outputs of other programs in the system and the correlation between the inputs and outputs of other programs in the system.

5. The method according to claim 1, characterized in that, The method further includes: Based on the analysis of the execution records of the first program, the execution relationships between the preceding and succeeding programs, and the correlation between the inputs and outputs of each program in the system, a system execution logic diagram containing the relationships between each program in the system is generated.

6. A testing device based on automated testing tools, characterized in that, The device includes: The analysis module is used to: analyze the correlation between the inputs and outputs of each program in the system based on the first program execution record during the automated execution of the first test case, and determine whether the program under test affects the inputs or outputs of each program in the system; wherein, the first program execution record is obtained by the program execution monitoring module by monitoring the input, execution and output of the program; The test case generation module is used to generate a second test case based on the affected input or output when the program under test affects the input or output of the program in the system. The analysis module is also used to: analyze the impact of the tested program on the operation of each program in the system based on the second program execution record during the automated execution of the second test case, and mark the affected target program and test data; The test case generation module is also used to: generate a third test case based on the tagged target program and test data; The automated testing module is used to: automatically execute the third test case, set the interface field to which the test data belongs in the transaction module to which the target program belongs, perform the test, and obtain the test results.

7. The apparatus according to claim 6, characterized in that, The case generation module is also used for: Based on the third test case and the test results, associated test cases related to the tagged target program and test data are generated; wherein, the associated test cases are supplemented into the first test case for use in subsequent tests.

8. The apparatus according to claim 7, characterized in that, The device further includes: The test rule generation module is used to: generate test rules for the program under test based on the associated test cases; wherein the test rules for the program under test are used to generate test cases related to the program under test in automated testing.

9. The apparatus according to claim 6, characterized in that, The device further includes: The test scenario generation module is used to generate test scenarios based on the correlation between the inputs and outputs of each program in the system and the impact of the program under test on the inputs or outputs of each program in the system.

10. The apparatus according to claim 6, characterized in that, The device further includes: The drawing module is used to generate a system operation logic diagram containing the programs in the system and the relationships between them, based on the operation relationships between the preceding and succeeding programs obtained by analyzing the first program's operation record, as well as the correlation relationships between the inputs and outputs of each program in the system.