Application regression testing method and device, equipment, medium and program product

Through log output Java agent and test execution Java agent generation and record test cases, the problem of relying on personal ability and environment complexity of regression testing of existing Java applications is solved, and efficient defect location and test results analysis are achieved.

CN120256288APending Publication Date: 2025-07-04TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411959195.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The existing Java application regression testing methods rely on personal abilities, high test environment requirements, low execution efficiency, little test result information, and lack of defect location indication.

Method used

Use the log to output Java agent instrumentation old version of Java application, generate audit log files, parse the log files through the test case generation tool to generate test cases, and use the test execution Java agent instrumentation new version of the application to record the execution data, use the result judgment tool to compare the test cases with the actual execution data, and obtain analysis results.

Benefits of technology

There is no need to modify the original application to automatically generate test cases, simplify the test execution environment, provide defect positioning information, and improve test quality and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256288A_ABST
    Figure CN120256288A_ABST
Patent Text Reader

Abstract

The invention discloses an application regression test method and device, equipment, a medium and a program product, and the method comprises the steps: carrying out the instrumentation of an old-version Java application through a log output Java agent, and enabling the old-version Java application to output an audit log file; analyzing and processing the audit log file by using a test case generation tool to generate a test case; performing instrumentation on the new-version Java application program by using the test execution Java agent, and recording actual execution data in the process of executing the test case by the new-version Java application program; and comparing each test case with the field of the corresponding actual execution data by using a result judgment tool to obtain a test analysis result. According to the invention, the regression test quality and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of program testing, and particularly to an application program regression testing method, device, equipment, medium, and program product. Background Art

[0002] Functional testing is an important activity for application program quality assurance. Whether it is the release of the initial version of an application program or the release of subsequent Java application program version updates, application program functional testing is required.

[0003] Common regression testing in functional testing is used for application program version updates, which is a common situation in the application program life cycle. For example, an old version of an application program includes five functions such as ABCDE. According to the actual usage feedback of application program users, there are several bugs in function C that need to be fixed; at the same time, the user hopes to add a new function F; the development team modifies the code and updates the program version accordingly, believing that: the bugs in function C have been fixed, and at the same time, the new function F has been added. For this application program version update, functional regression testing needs to be carried out: verify that functions ABDE are the same as before and have not changed.

[0004] However, the existing regression testing has the following problems: (1) Relying on personal ability; the design quality and coverage of test cases highly depend on the personal ability of testers.

[0005] (2) Having high requirements for the completeness of the test environment; when executing these test cases, the system to be tested and the systems it depends on need to be in place.

[0006] (3) Low execution efficiency and high labor intensity; for each test case, data of the system to be tested and the systems it depends on need to be prepared, which consumes a large amount of manpower.

[0007] (4) Providing little information in test results; there is only a test conclusion, lacking an indication of the location of program defects.

[0008] Therefore, there is an urgent need for a method for Java application program regression testing to solve the above technical problems and improve the quality and efficiency of regression testing. Summary of the Invention

[0009] The purpose of the present invention is to provide an application program regression testing method, device, equipment, medium, and program product to improve the quality and efficiency of regression testing.

[0010] To achieve the above purpose, the present invention provides the following technical solutions: In a first aspect, an embodiment of the present invention provides an application program regression testing method, and the method includes: Use a log output Java agent to instrument an old version of a Java application so that the old version of the Java application outputs an audit log file; Use a test case generation tool to parse and process the audit log file to generate test cases; Use a test execution Java agent to instrument a new version of a Java application and record the actual execution data during the execution of test cases in the new version of the Java application; Use a result determination tool to compare the fields of each test case with its corresponding actual execution data to obtain a test analysis result.

[0011] In a second aspect, an embodiment of the present invention provides an application regression testing apparatus, the apparatus includes: A log output Java agent for instrumenting an old version of a Java application so that the old version of the Java application outputs an audit log file; A test case generation tool for parsing and processing the audit log file to generate test cases; A test execution Java agent for instrumenting a new version of a Java application and recording the actual execution data during the execution of test cases in the new version of the Java application; A result determination tool for comparing the fields of each test case with its corresponding actual execution data to obtain a test analysis result.

[0012] In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program or instructions to implement the foregoing application regression testing method.

[0013] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, in which a computer program or instructions are stored, and when the computer program or instructions are executed by a processor, the foregoing application regression testing method is implemented.

[0014] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program or instructions, and when the computer program or instructions are executed by a processor, the foregoing application regression testing method is implemented.

[0015] Technical effects and advantages of the present invention: Based on Java agent technology, the present invention can obtain audit log output without modifying the original application program; it also automatically generates test cases based on audit logs, avoiding the dependence on personal capabilities in manually designing test cases; therefore, the present invention can automatically generate test cases without modifying the application program. The test cases generated by the present invention include mock data, and the dependent systems other than the program under test do not need to be in place during test execution; based on Java agent technology, the dependent systems are mocked to simulate their real behaviors without the dependent programs, providing normal interactions for the program under test; therefore, the present invention simplifies the complexity of the test execution environment. The test analysis results of the present invention contain defect location information, and the test result analysis determines to cover the interaction links between systems, supports giving defect location hints for abnormal interaction links, provides important information for defect repair of application programs, and can accelerate the repair efficiency.

[0016] Other features and advantages of the present invention will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention can be achieved and obtained by the structures pointed out in the specification, claims, and drawings. Brief Description of the Drawings

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for description in the embodiments. Obviously, the following described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0018] Figure 1 It is a flowchart of a method for regression testing of an application program according to an embodiment of the present invention. Figure 2 It is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Detailed Embodiments

[0019] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0020] To solve the deficiencies of the prior art, an embodiment of the present invention discloses a method for regression testing of an application program, as Figure 1As shown in the figure, it includes the following steps: Step S1: Use the log output Java agent to instrument the old version Java application so that the old version Java application outputs an audit log file; Step S2: Use the test case generation tool to parse and process the audit log file to generate test cases; Step S3: Use the test execution Java agent to instrument the new version Java application and record the actual execution data during the execution of the test cases in the new version Java application; Step S4: Use the result determination tool to compare the fields of each test case with its corresponding actual execution data to obtain the test analysis result.

[0021] In some specific embodiments, Step S1: Use the log output Java agent to instrument the old version Java application so that the old version Java application outputs an audit log file, including: Based on the Java Instrumentation API mechanism, write the log output Java agent; Load the log output Java agent to instrument the old version Java application so that the old version Java application outputs an audit log file at a predetermined point (i.e., a specific point) during operation; Among them, during operation, the log output Java agent records the input and output, data reading and writing, and interactions with other systems of the old version Java application.

[0022] As shown in Table 1, the predetermined points include: the receiving call point, the sending call point, the called entry point, and the return exit point of the old version Java application.

[0023]

[0024] Table 1 Table of Predetermined Points and Corresponding Record Contents The audit log file is named: appcode.yyyymmddhh.audit.num.log; Among them, appcode: the English name abbreviation of the application system; num: a 3-digit number starting from 001 and incrementing.

[0025] The audit log file includes several audit records; Among them, as shown in Table 2, the fields of a single audit record include: timestamp, serial number, the initiating party of the interaction between systems, the called party of the interaction between systems, record level, and specific content;

[0026] Table 2 Content Table of a Single Audit Record As shown in Table 3, the fields of the record level include: data received by the application, data sent out by the application, internal data of the application before this transaction occurred, and internal data of the application after this transaction occurred.

[0027] Table 3 Content Table of the LOG_LEVEL Record Level

[0028] In this step, the present invention can record several key information of the old version Java application during runtime by outputting the audit log file.

[0029] In some specific embodiments, step S2: Use a test case generation tool to parse and process the audit log file to generate test cases, including: Parse the audit log file to obtain several audit records, group the audit records with the serial number field into a log group, and sort them in the order of time (i.e., transaction timestamp); generate a test case testcase for each log group.

[0030] Among them, as shown in Table 4, the test cases include: transaction serial number, transaction timestamp, application input, application output, internal data of the application before the transaction occurred, internal data of the application after the transaction occurred, interaction data between the application system and other systems; the interaction data between the application system and other systems includes: several mock sequences; Table 4 Structure Table of Test Case (testcase)

[0031] As shown in Table 5, the fields of the mock include: the called service mock.target, the system - to - system call request mock.request, and the system - to - system call response mock.response.

[0032] Table 5 Mock Structure Table

[0033] When generating test cases, the generation logic of the test cases is as follows: The fields in the test cases and the fields in the audit records correspond according to a predetermined correspondence relationship, and the specific correspondence relationship is shown in Table 6.

[0034] Table 6 Test Case Generation Logic Table

[0035] In some specific embodiments, step S3: Use the test execution Java agent to instrument the new version of the Java application and record the actual execution data during the execution of the test cases in the new version of the Java application, including: Step S31: Based on the Java Instrumentation API mechanism, write the test execution Java agent; Among them, the test execution Java agent records the input and output, data writing, and requests sent to other systems of the instrumented Java application, and the test execution Java agent can simulate other systems to make the instrumented Java application output actual execution data (i.e., real logs).

[0036] Step S32: Dynamically load the test execution Java agent into the new version of the Java application to be tested and instrument the new version of the Java application.

[0037] Step S33: Use the test driver tool to read each test case and call the new version of the Java application to be tested according to the content of each test case.

[0038] Step S34: Use the test execution tool and the test execution Java agent to make the new version of the Java application execute each test case, and record the output output of the new version of the Java application through the test execution Java agent. Specifically, it includes: (1) Use the test execution tool to read the internal data of the application (i.e., data_before) before the transaction in the test case and write data_before into the database.

[0039] (2) Read the application input input in the test case through the test execution tool and call the new version of the Java application according to the application input input.

[0040] (3) Use the test execution Java agent to read and record the transaction ID (transaction_id) in the test case; use the test execution Java agent to read the application input (input) of the new version of the Java application.

[0041] (4) The new version of the Java application will interact with other systems during operation; therefore, during each system interaction, use the test execution Java agent to simulate other systems and record the interaction data between systems, specifically including: During each system interaction, the test execution Java agent intercepts the call of the new version of the Java application to other systems and identifies the data (real.request) sent by the new version of the Java application to other systems; Use the test execution Java agent to simulate other systems to read the test case and find the mock response (i.e., the mock response where mock.request = real.request) that matches real.request; if found, return the found mock response to the new version of the Java application, and if not found, return error to the new version of the Java application.

[0042] (5) After the new version of the Java application completes the interaction with all other systems, use the test execution Java agent to record the application output (output) of the new version of the Java application to complete the execution of a test case.

[0043] Step S35: After the test case execution is completed, use the test execution Java agent to record and obtain the actual execution data (realcase) during the execution of the test case by the new version of the Java application. Among them, the structure and content of the actual execution data (realcase) are shown in Table 7, and the fields of the actual execution data (realcase) include: transaction ID, transaction timestamp, application system input, application system output, internal application data before the transaction, internal application data after the transaction, and interaction data between the application system and other systems.

[0044] Table 7 Content Table of Actual Execution Data (realcase)

[0045] The interaction data between the application system and other systems includes: several sequences of real; Among them, as shown in Table 8, the fields of real include: the called service real.target and the request real.request for inter-system calls.

[0046] Table 8 real structure table

[0047] In some specific embodiments, step S4: Use the result determination tool to compare each field of each test case with its corresponding actual execution data to obtain a test analysis result.

[0048] Among them, the comparison and determination logic for each field is shown in Table 9.

[0049] Table 9 Field comparison and determination logic

[0050] An embodiment of the present invention discloses an application regression testing device, and the device includes: A log output Java agent for instrumenting an old version of a Java application to cause the old version of the Java application to output an audit log file; A test case generation tool for parsing and processing the audit log file to generate test cases; A test execution Java agent for instrumenting a new version of a Java application; A test execution tool for causing the new version of the Java application to execute each test case to obtain actual execution data; A result determination tool for comparing the fields of each test case with its corresponding actual execution data to obtain a test analysis result.

[0051] Regarding the system in the above embodiments, the specific manners in which each unit module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0052] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, the structure of which is as Figure 2 shown, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program or instructions to implement the foregoing application regression testing method.

[0053] Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium, in which a computer program or instructions are stored, and when the computer program or instructions are executed by a processor, the foregoing application regression testing method is implemented.

[0054] Based on the same inventive concept, an embodiment of the present invention further provides a computer program product, including a computer program or instruction, which, when executed by a processor, implements the foregoing application program regression testing method.

[0055] Embodiment 1 Implementation scenario: Perform regression testing on an existing Java application - ticket sales application; the class to be tested is com.travelsky.EDS.sales.Issue; the specific testing process is as follows: Step S1: Write a log output Java agent, load the written log output Java agent to instrument the old version of the Java application (i.e., the original Java application), so that the old version of the Java application can output the required audit log file.

[0056] Among them, according to the Java specification, there are two implementation methods for java agent: static and dynamic; when implementing the solution of the present invention, these two methods can be selected according to the actual situation: if it is not desired to interrupt the operation of the old version of the application, the dynamic method can be used; if the restart of the old version of the application can be accepted, both methods are acceptable.

[0057] (1) Static method: It is necessary to implement the premain method and load it through the -java agent option when the JVM starts.

[0058] Among them, the loading method of the static java agent: java -javaagent:agent.jar -jar application.jar The premain method that needs to be implemented: public static void premain(String agentArgs, Instrumentation inst) { String className = "com.travelsky.EDS.sales.Issue"; transformClass(className,inst); } (2) Dynamic method: It is necessary to implement the agentmain method and dynamically insert it into the JVM through the Java Attach API.

[0059] Among them, the method for loading a dynamic Java agent is as follows: VirtualMachine jvm = VirtualMachine.attach(jvmPid); jvm.loadAgent(agent.getAbsolutePath()); jvm.detach(); The agentmain method needs to be implemented: public static void agentmain(String agentArgs, Instrumentation inst) { String className = "com.travelsky.EDS.sales.Issue"; transformClass(className,inst); } The method for supporting the output of audit log files is as follows: Implementing a ClassFileTransformer using the javaassistant library; its function is to modify the bytecode of an old version of a Java program to add the function of logging output at appropriate positions in the old version of the Java application; the core code snippet is as follows: public byte[] transform( ClassLoader loader, String className, Class<?>classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) { byte[] byteCode = classfileBuffer; ... / / Modify the bytecode to add behavior (print logs) CtClass cc = cp.get(targetClassName); CtMethod m = cc.getDeclaredMethod("somemethod"); m.insertBefore("logger.info(abcde)"); ... byteCode = cc.toBytecode(); cc.detach(); return byteCode; } Step S2: When the old version of the Java application after instrumentation runs, an audit log file is generated, and test cases are generated based on the audit log file.

[0060] Among them, a fragment of the log file obtained is as follows: 20240326233912.032:EDS202403261234567890:SAT:EDS.issue:STAT_IN> { "pnr": "ABCDEF", "printer": 3 } 20240326233912.033:EDS202403261234567890:EDS.issue:or.retrieve:STAT_OUT> { "pnr": "ABCDEF" } 20240326233912.045:EDS202403261234567890:or.retrieve:EDS.issue:STAT_IN> { "name": "zhangl", "segment": "CA1201", "fare": "CNY1200.00" } 20240326233912.032:EDS202403261234567891:SAT:EDS.issue:STAT_IN> { "pnr": "XYZWAB", "printer": 3 } 20240326233912.056:EDS202403261234567890:EDS.issue:edilink.issue:STAT_OUT> { "ticket": "888-1234567890", "pax_name": "zhangl", "segment": "CA1201", "fare": "CNY1200.00" } 20240326233912.093:EDS202403261234567890:edilink.issue:EDS.issue:STAT_IN> { "ticket": "888-1234567890", "ERC": "130+3" } 20240326233912.095:EDS202403261234567890:EDS.issue:SAT:DATA_AFTER> { "pnr": "ABCDEF", "tickets": "888-1234567890", "fare": "CNY1200.00", "name": "zhangl", "segment": "CA1201", "dais": "20240326 23:39:12", } 20240326233912.099:EDS202403261234567890:EDS.issue:SAT:STAT_OUT> { "code": "EDS_000", "detail": { "pnr": "ABCDEF", "tickets": "888-1234567890", "fare": "CNY1200.00" }} Among them, when generating test cases, the fields with the same serial number field (i.e., transaction_id) are grouped into a log group in the order of the transaction timestamp time_stamp; one test case is generated for one log group.

[0061] And when generating test cases, the generation logic of the test cases is as follows: The fields in the test cases and the fields in the audit records are in accordance with a predetermined correspondence relationship, and the specific correspondence relationship is shown in Table 10.

[0062] Table 10 Implementation Table of Test Case Generation Logic

[0063] Based on the above log file fragment, generate test case - EDS202403261234567890; including: Group by transaction_id to obtain the log group as: 20240326233912.032:EDS202403261234567890:SAT:EDS.issue:STAT_IN> { "pnr": "ABCDEF", "printer": 3 } 20240326233912.033:EDS202403261234567890:EDS.issue:or.retrieve:STAT_OUT> { "pnr": "ABCDEF" } 20240326233912.045:EDS202403261234567890:or.retrieve:EDS.issue:STAT_IN> { "name": "zhangl", "segment": "CA1201", "fare": "CNY1200.00" } / / The data with the transaction number EDS202403261234567891 originally here belongs to another transaction (another group).

[0064] 20240326233912.056:EDS202403261234567890:EDS.issue:edilink.issue:STAT_OUT> { "ticket": "888-1234567890", "pax_name": "zhangl", "segment": "CA1201", "fare": "CNY1200.00" } 20240326233912.093:EDS202403261234567890:edilink.issue:EDS.issue:STAT_IN> { "ticket": "888-1234567890", "ERC": "130+3" } 20240326233912.095:EDS202403261234567890:EDS.issue:SAT:DATA_AFTER> { "pnr": "ABCDEF", "tickets": "888-1234567890", "fare": "CNY1200.00", "name": "zhangl", "segment": "CA1201", "dais": "20240326 23:39:12", } 20240326233912.099:EDS202403261234567890:EDS.issue:SAT:STAT_OUT> { "code": "EDS_000", "detail": { "pnr": "ABCDEF", "tickets": "888-1234567890", "fare": "CNY1200.00" }} Then, according to the above field correspondence, the finally generated test case is as follows: { "transaction_id": "EDS202403261234567890", "time_stamp": "20240326233912.032", "input": { "pnr": "ABCDEF", "printer": 3 }, "output": { "code": "EDS_000", "detail": { "pnr": "ABCDEF", "tickets": "888-1234567890", "fare": "CNY1200.00" } }, "data_before": {}, "data_after": { "pnr": "ABCDEF", "tickets": "888-1234567890", "fare": "CNY1200.00", "name": "zhangl", "segment": "CA1201", "dais": "20240326 23:39:12", } , "mocks": { "target": "or.retrieve", "request": { "pnr": "ABCDEF" }, "response": { "name": "zhangl", "segment": "CA1201", "fare": "CNY1200.00" } }, { "target": "edilink.issue", "request": { "ticket": "888-1234567890", "pax_name": "zhangl", "segment": "CA1201", "fare": "CNY1200.00" }, "response": { "ticket": "888-1234567890", "ERC": "130+3" } } } Step S3: Write a test execution Java agent (with the same principle as the log output Java agent), load the test execution Java agent to instrument the new version of the Java application; use the driver tool to start executing each test case.

[0065] Case 1. The execution of the test case - EDS202403261234567890 is as follows: (1) Start the execution of the test case, use the test execution tool to read the input in the test case and send it to the new version of the Java application; Among them, the input is: { "pnr": "ABCDEF", "printer": 3 } (2) Use the test execution Java agent to read and record the transaction_id (transaction serial number) in the test case; use the test execution Java agent to record the input (application input) of the new version of the Java application.

[0066] (3) During the operation of the new version of the Java application, interact with other systems or.retrieve: ​The test execution Java agent records the data sent by the new version Java application to or.retrieve as real.request. Among them, the data sent by the new version Java application to or.retrieve is: { "pnr": "ABCDEF" } The test execution Java agent simulates the other system or.retrieve to read the test case and finds the mock.response where mock.request = real.request. Among them, the found mock.response data is: { "name": "zhangl", "segment": "CA1201", "fare": "CNY1200.00" } The test execution Java agent returns the found mock.response to the new version Java application.

[0067] (4)During the operation of the new version Java application and interacting with the other system edilink.issue: The test execution Java agent records the data sent by the new version Java application to edilink.issue as real.request. Among them, the data sent by the new version Java application to edilink.issue is: { "ticket": "888-1234567890", "pax_name": "zhangl", "segment": "CA1201", "fare": "CNY1200.00" } The test execution Java agent simulates the other system edilink.issue to read the test case and finds the mock.response where mock.request = real.request. Among them, the found mock.response data is: { "ticket": "888-1234567890", "ERC": "130+3"} The test execution Java agent returns the found mock.response to the new version Java application.

[0068] (5)After the new version Java application completes the interaction and calculation with all other systems, the new version Java application outputs output (application output), and the test execution Java agent records the output, completing the execution of the test case.

[0069] Among them, the output output is: { "code": "EDS_000", "detail": { "pnr": "ABCDEF", "tickets": "888-1234567890", "fare": "CNY1200.00" } } Case 2: Assume that there is a problem with the edilink logic of the new version Java application. Then the execution of test case - EDS202403261234567890 is as follows: (1)Start the execution of the test case, use the test execution tool to read the input in the test case and send it to the new version Java application; Among them, the input is: { "pnr": "ABCDEF", "printer": 3 } (2)Use the test execution Java agent to read and record the transaction_id (transaction serial number) in the test case; use the test execution Java agent to record the input (application input) of the new version Java application.

[0070] (3)The new version Java application is running and interacting with other systems or.retrieve: The test execution Java agent records the data sent by the new version Java application to or.retrieve, denoted as real.request. Among them, the data sent by the new version Java application to or.retrieve is: { "pnr": "ABCDEF" } The test execution Java agent simulates other systems or.retrieve reads test cases to find the mock.response where mock.request = real.request. Among them, the found mock.response data is: { "name": "zhangl", "segment": "CA1201", "fare": "CNY1200.00" } The test execution Java agent returns the found mock.response to the new version Java application.

[0071] (4) During the operation of the new version Java application and interacting with other systems edilink.issue, assume there is a bug in the application logic here, that is, the fare is incorrect: The test execution Java agent records the data sent by the new version Java application to edilink.issue as real.request. Among them, the data sent by the new version Java application to edilink.issue is: { "ticket": "888-1234567890", "pax_name": "zhangl", "segment": "CA1201", "fare": "CNY1220.00" / / The fare is incorrect, the correct output should be "CNY1200.00" } The test execution Java agent simulates other systems edilink.issue to read test cases and find the mock.response where mock.request = real.request.

[0072] Not found! The test execution Java agent returns an error to the new version Java application.

[0073] After the new version of the Java application completes the interaction and calculation with all other systems, the new version of the Java application outputs output (application output), and the test execution Java agent records the output to complete the execution of the test case.

[0074] Among them, the output output is: { "code": "EDS_001", / / The output here is incorrect. The correct output should be "EDS_000" "errmsg": "internal error: call edilink.issue failed." } Step S4: Compare each field of each test case with its corresponding actual execution data according to Table 9 to obtain the test analysis result.

[0075] For Case 1, the fields of testcase and realcase are consistent. The test analysis result is: The test passes.

[0076] For Case 2, the output in the fields of testcase and realcase is inconsistent. The test analysis result is: The test fails; Among them, the defect location information is edilink.issue; the difference is "fare": "CNY1220.00".

[0077] It can be seen from the defect location information of Case 2 that: There is a problem with the data called edilink.issue, and the fare data is incorrect. Based on this, the code writer can get a prompt to check the code related to the fare data.

[0078] Finally, it should be noted that the above are only the preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. An application regression testing method, characterized in that, The method includes: Using a log output Java agent to instrument an old version of a Java application, so that the old version of the Java application outputs an audit log file; Using a test case generation tool to parse and process the audit log file to generate test cases; Using a test execution Java agent to instrument a new version of a Java application and record the actual execution data during the execution of the test cases by the new version of the Java application; Using a result determination tool to compare the fields of each test case with its corresponding actual execution data to obtain a test analysis result.

2. The method for regression testing of an application program according to claim 1, wherein Using a log output Java agent to instrument an old version of a Java application, so that the old version of the Java application outputs an audit log file, including: Based on the Java Instrumentation API mechanism, writing a log output Java agent; Loading the log output Java agent to instrument the old version of the Java application, so that the old version of the Java application outputs an audit log file at a predetermined point during operation; Wherein, during operation, the log output Java agent records the input and output, data reading and writing, and interactions with other systems of the old version of the Java application.

3. The application program regression test method according to claim 2, wherein The predetermined points include: the receiving call point, the sending call point, the called entry point, and the return exit point of the old version of the Java application.

4. The application program regression test method according to claim 2, wherein The audit log file includes a number of audit records; Wherein, a single audit record includes: a timestamp, a serial number, the initiator of the interaction between systems, the called party of the interaction between systems, a record level, and specific content; The record levels include: data received by the application program, data sent by the application program, internal data of the application program before this transaction occurs, and internal data of the application program after this transaction occurs.

5. The application program regression test method according to claim 1, wherein The test cases include: a transaction serial number, a transaction timestamp, application program input, application program output, internal data of the application program before the transaction occurs, internal data of the application program after the transaction occurs, and interaction data between the application system and other systems; The interaction data between the application system and other systems includes: a number of mock sequences; Wherein, each mock includes: the called service mock.target, the system - to - system call request mock.request, and the system - to - system call response mock.response.

6. The method for application program regression testing according to claim 4, wherein Using a test case generation tool to parse and process the audit log file to generate test cases, including: Parse the audit log file using a test case generation tool to obtain several audit records. Group the audit records with the serial number field into a log group and sort them in chronological order. Generate a test case (testcase) for each log group. Among them, when generating the test case, the generation logic of the test case is as follows: The fields in the test case and the fields in the audit record follow a predetermined correspondence.

7. An application regression testing method according to claim 5, characterized in that Use the test execution Javaagent to instrument the new version of the Java application and record the actual execution data during the execution of the test case in the new version of the Java application, including: Dynamically load the test execution Java agent into the new version of the Java application under test. Use the test execution Java agent to record the input (input) of the new version of the Java application, use the test execution Java agent to record the interaction data between systems during each system interaction of the new version of the Java application, and record the output (output) of the new version of the Java application to complete the execution of the test case. Use the test execution Java agent to record and obtain the actual execution data (realcase) during the execution of the test case in the new version of the Java application.

8. The method for application program regression testing according to claim 1, wherein The method further includes using a test execution tool to cause the new version of the Java application to execute each test case, including: Use the test execution tool to read each test case and call the new version of the Java application under test according to the content of each test case. Use the test execution tool to cause the new version of the Java application to execute each test case and obtain the output (output) of the new version of the Java application.

9. The method for application program regression testing according to claim 7, wherein During each system interaction, simulate other systems through the test execution Java agent, including: During each system interaction, the test execution Java agent intercepts the call of the new version of the Java application to other systems and identifies the data (real.request) sent by the new version of the Java application to other systems. Use the test execution Java agent to simulate other systems, including: Use the test execution Java agent to read the test case and find the mock.response that matches the real.request; if found, return the found mock.response to the new version of the Java application, and if not found, return error to the new version of the Java application.

10. The method for regression testing of an application according to claim 7 or 8, characterized in that The fields of the actual execution data (realcase) include: transaction serial number, transaction timestamp, application system input, application system output, internal application data before the transaction, internal application data after the transaction, and interaction data between the application system and other systems. The interaction data between the application system and other systems includes: several sequences of real. Among them, the fields of real include: the called service real.target and the request real.request for inter-system calls.

11. An application regression testing device, characterized in that The device includes: A log output Java agent for instrumenting an old version of a Java application to cause the old version of the Java application to output an audit log file; A test case generation tool for parsing and processing the audit log file to generate test cases; A test execution Java agent for instrumenting a new version of a Java application and recording the actual execution data during the execution of test cases by the new version of the Java application; A result determination tool for comparing the fields of each test case with its corresponding actual execution data to obtain a test analysis result.

12. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program or instructions to implement an application program regression test method according to any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, A computer program or instructions are stored in the computer-readable storage medium, and when the computer program or instructions are executed by a processor, an application program regression test method according to any one of claims 1-10 is implemented.

14. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, an application program regression test method according to any one of claims 1-10 is implemented.