Test code modification method and apparatus

JP2026141596AActive Publication Date: 2026-09-04MUFG BANK LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2025028263
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2026-09-04
Estimated Expiration
2045-02-25

AI Technical Summary

Benefits of technology

【0008】 本発明によれば、アプリケーションを修正したときに、修正後のアプリケーションのテストを容易に行うことができる。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026141596000001_ABST
    Figure 2026141596000001_ABST
Patent Text Reader

Abstract

When an application is modified, it is easy to test the modified application. [Solution] A method according to one embodiment of the present invention is a method for modifying the test code of an application, comprising inputting the test code for the application before modification, screen information of the application before modification, screen information of the application after modification, and a prompt instructing the AI ​​to detect the difference between the screen information of the application before modification and the screen information of the application after modification, causing the AI ​​to output the difference, and inputting a prompt instructing the AI ​​to modify the test code for the application before modification based on the difference or the difference modified by the user, causing the AI ​​to output the test code for the application after modification.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a test code modification method and apparatus. [Background Art]

[0002] Conventionally, during and after the development of an application such as a web application, tests are performed to verify whether the application operates correctly. For example, as a front-end test, an end-to-end test (E2E test) is performed to verify whether screen transitions of the application are performed correctly.

[0003] A test must be performed every time the application is modified, and a test code used for testing the application is required each time the application is modified. [Prior Art Documents] [Patent Documents]

[0004] [Patent Document 1] Japanese Unexamined Patent Application Publication No. 2007-102654 [Summary of the Invention] [Problem to be Solved by the Invention]

[0005] However, it takes a lot of time for a person to code a test code used for testing an application. Therefore, tools for automating application testing are provided. Conventional tools for automating application testing require specialized knowledge, and there is a demand for easier application testing.

[0006] Therefore, in the present invention, when an application is modified, testing of the modified application is easily performed. [Means for Solving the Problem]

[0007] A method according to one embodiment of the present invention is a method for modifying the test code of an application, comprising inputting the test code for the application before modification, screen information of the application before modification, screen information of the application after modification, and a prompt instructing the AI ​​to detect the difference between the screen information of the application before modification and the screen information of the application after modification, causing the AI ​​to output the difference, and inputting a prompt instructing the AI ​​to modify the test code for the application before modification based on the difference or a difference modified by the user, causing the AI ​​to output the test code for the application after modification. [Effects of the Invention]

[0008] According to the present invention, when an application is modified, it is possible to easily test the modified application. [Brief explanation of the drawing]

[0009] [Figure 1] This diagram shows the overall configuration of one embodiment of the present invention. [Figure 2] This is a sequence diagram of the modification of test code related to one embodiment of the present invention. [Figure 3] This is a functional block diagram of a test code correction device according to one embodiment of the present invention. [Figure 4] This is a hardware configuration diagram of a test code correction device according to one embodiment of the present invention. [Modes for carrying out the invention]

[0010] Embodiments of the present invention will be described below with reference to the drawings.

[0011] <Explanation of Terms> • "Application" can be any application (also called application software, software, application program, or program). For example, an application can be a web application. For example, an application may be modified (also called a version upgrade or update) to add features, fix bugs, etc. A "test" is a test to verify that an application works correctly. For example, a test is an end-to-end test (E2E test), which is a type of front-end test. For example, a test is a test of the application's screen transitions. "Test code" is code written in a programming language used to test whether an application functions correctly. Test code is not limited to a specific format. Test code is not limited to a specific programming language or testing library. For example, the programming language of the test code may be Java and the testing library may be Selenide (Selenium), but it is not limited to these. "Screen information" refers to the information of each screen included in the application. For example, screen information is the DOM (Document Object Model) information of the screens included in the application. For example, "screen information" only includes the information written within the body tag of the DOM (i.e., it does not include information written within tags other than the body tag). • "Generative AI (Artificial Intelligence)" is an artificial intelligence system that generates text and other responses to prompts. For example, the Generative AI has a file referencing function (a function that references files pasted into the prompt). Furthermore, using GPT-4o resulted in higher accuracy in detecting differences between the screen information of the application before modification and the screen information of the application after modification compared to using GPT-4 Turbo. Also, using GPT-4o allowed for the correct modification of the test code based on the detected differences.

[0012] <Overall Structure> Figure 1 shows the overall configuration according to one embodiment of the present invention. The test code correction device 10 can send and receive data with the generation AI providing device 20 via any network (although Figure 1 describes the case where there is one test code correction device 10, multiple test code correction devices 10 may be connected to the generation AI providing device). Each of these will be described below.

[0013] <<Test Code Correction Tool>> The test code modification device 10 uses the generated AI 21 of the generated AI provider device 20 to modify the test code for the application before modification into test code for the application after modification. The test code modification device 10 is a personal computer, tablet, smartphone, etc.

[0014] Specifically, the test code modification device 10 inputs the test code for the application before modification, the screen information of the application before modification, the screen information of the application after modification, and a prompt instructing the AI ​​21 to detect the difference between the screen information of the application before modification and the screen information of the application after modification, causing the AI ​​21 to output the difference (i.e., the difference between the screen information of the application before modification and the screen information of the application after modification), and inputs a prompt instructing the AI ​​21 to modify the test code for the application before modification based on the difference (i.e., the difference between the screen information of the application before modification and the screen information of the application after modification) or the difference modified by the user 30 to that difference (the difference or the difference modified by the user 30 to that difference may also be input), causing the AI ​​21 to output the test code for the application after modification.

[0015] [Test code for the application] Here, we will explain the test code for the application before the fix and the test code for the application after the fix.

[0016] The test code for the unmodified application is test code used in a test for verifying whether the unmodified application operates correctly. It is assumed that the test code for the unmodified application is generated by any method (for example, it may be a test code generated by inputting a prompt instructing generation of a test code into a generative AI, or it may be a test code coded by a person).

[0017] The test code for the modified application is test code used in a test for verifying whether the modified application operates correctly.

[0018] [Difference between screen information of unmodified application and screen information of modified application] Here, the difference between the screen information of the unmodified application and the screen information of the modified application will be described. The difference indicates changed parts, added parts, and deleted parts from the screen information of the unmodified application to the screen information of the modified application, such as A being changed to B, C being added, D being deleted, and the like.

[0019] <<Generative AI providing device>> The generative AI providing device 20 is a device (for example, a server) that provides a service enabling use of the generative AI 21. The generative AI providing device 20 is configured from one or more computers.

[0020] <Processing method> FIG. 2 is a sequence diagram of test code modification according to an embodiment of the present invention.

[0021] In step 1 (S1), a user 30 operating the test code modifying device 10 inputs, to the test code modifying device 10: the test code for the unmodified application; the screen information of the unmodified application; the screen information of the modified application; and a prompt instructing detection of the difference between the screen information of the unmodified application and the screen information of the modified application.

[0022] In step 2 (S2), the test code modification device 10 sends the test code for the application before modification, the screen information of the application before modification, the screen information of the application after modification, and a prompt instructing the device to detect the difference between the screen information of the application before modification and the screen information of the application after modification, which were input in S1, to the generation AI providing device 20. The generation AI providing device 20 receives the test code for the application before modification, the screen information of the application before modification, the screen information of the application after modification, and a prompt instructing the device to detect the difference between the screen information of the application before modification and the screen information of the application after modification from the test code modification device 10.

[0023] In step 3 (S3), the generating AI provider 20 inputs the test code for the application before modification, the screen information of the application before modification, the screen information of the application after modification, and a prompt instructing the generating AI 21 to detect the difference between the screen information of the application before modification and the screen information of the application after modification, which were received in S2, and causes the AI ​​to output the difference (i.e., the difference between the screen information of the application before modification and the screen information of the application after modification).

[0024] In step 4 (S4), the generation AI provider 20 sends the difference between the screen information of the application before modification and the screen information of the application after modification, which was output from the generation AI 21 in S3, to the test code modification device 10. The test code modification device 10 receives the difference between the screen information of the application before modification and the screen information of the application after modification from the generation AI provider 20.

[0025] In step 5 (S5), the test code correction device 10 displays the difference between the screen information of the application before correction and the screen information of the application after correction, which was received in S4, on the test code correction device 10 or a display connected to the test code correction device 10.

[0026] Afterward, user 30 checks the differences displayed in S5.

[0027] In step 6 (S6), the user 30 operating the test code modification device 10 inputs the difference between the screen information of the application before modification and the screen information of the application after modification, and a prompt instructing the device 10 to modify the test code for the application before modification.

[0028] The difference between the screen information of the application before modification and the screen information of the application after modification may be the exact difference sent from the AI ​​generation device 20 to the test code modification device 10 in S4, or it may be the difference sent from the AI ​​generation device 20 to the test code modification device 10 in S4 with modifications made by the user 30.

[0029] In step 7 (S7), the test code modification device 10 sends to the generation AI provider device 20 the difference between the screen information of the application before modification and the screen information of the application after modification, which was input in S6, and a prompt instructing it to modify the test code for the application before modification. The generation AI provider device 20 receives the difference between the screen information of the application before modification and the screen information of the application after modification, and a prompt instructing it to modify the test code for the application before modification, from the test code modification device 10.

[0030] If the difference between the screen information of the application before modification and the screen information of the application after modification is the same as the difference sent from the AI ​​generation device 20 to the test code modification device 10 in S4, then in S7, the test code modification device 10 may send only a prompt to the AI ​​generation device 20 instructing it to modify the test code for the application before modification (i.e., it does not send the difference between the screen information of the application before modification and the screen information of the application after modification, and notifies that there has been no modification by the user 30).

[0031] In step 8 (S8), the generation AI providing device 20 inputs the difference between the screen information of the application before modification and the screen information of the application after modification, which was received in S7, and a prompt instructing the generation AI 21 to modify the test code for the application before modification, causing it to output the test code for the application after modification.

[0032] If the difference between the screen information of the application before modification and the screen information of the application after modification is the same as the difference sent from the AI ​​generation device 20 to the test code modification device 10, then the difference may or may not be input to the AI ​​generation. On the other hand, if the difference between the screen information of the application before modification and the screen information of the application after modification is the difference that the user 30 has modified from the difference sent from the AI ​​generation device 20 to the test code modification device 10, then the difference is input to the AI ​​generation.

[0033] In addition, in S8, the generation AI providing device 20 may input the difference between the screen information of the application before modification and the screen information of the application after modification, which was received in S7, a prompt instructing the system to modify the test code for the application before modification, and the test code before modification into the generation AI 21, causing it to output the test code for the application after modification.

[0034] In step 9 (S9), the generation AI provider 20 sends the test code for the modified application, which was output from the generation AI 21 in S8, to the test code modification device 10. The test code modification device 10 receives the test code for the modified application from the generation AI provider 20.

[0035] In step 10 (S10), the test code correction device 10 displays the corrected test code for the application, which was received in S9, on the test code correction device 10 or on a display connected to the test code correction device 10.

[0036] <Function Block> Figure 3 is a functional block diagram of a test code correction device 10 according to one embodiment of the present invention. The test code correction device 10 may include an acquisition unit 101, a difference detection unit 102, a test code correction unit 103, and a display unit 104. Furthermore, by executing a program, the test code correction device 10 can function as the acquisition unit 101, the difference detection unit 102, the test code correction unit 103, and the display unit 104. Each of these will be described below.

[0037] The acquisition unit 101 acquires the test code for the application before modification, the screen information of the application before modification, the screen information of the application after modification, and a prompt instructing the system to detect the difference between the screen information of the application before modification and the screen information of the application after modification.

[0038] For example, the acquisition unit 101 acquires the test code for the application before modification, the screen information of the application before modification, the screen information of the application after modification, and a prompt instructing the user 30 to detect the difference between the screen information of the application before modification and the screen information of the application after modification, all of which are input by the user 30 to the test code modification device 10.

[0039] The acquisition unit 101 acquires the difference between the screen information of the application before modification and the screen information of the application after modification, and a prompt instructing the user to modify the test code for the application before modification.

[0040] For example, the acquisition unit 101 acquires the difference between the screen information of the application before modification and the screen information of the application after modification, which are input by the user 30 to the test code modification device 10, and a prompt instructing the user to modify the test code for the application before modification.

[0041] The difference detection unit 102 inputs the test code for the application before modification, the screen information of the application before modification, the screen information of the application after modification, and a prompt instructing the generation AI 21 to detect the difference between the screen information of the application before modification and the screen information of the application after modification, causing it to output the difference between the screen information of the application before modification and the screen information of the application after modification.

[0042] For example, the difference detection unit 102 sends the test code for the application before modification, the screen information of the application before modification, the screen information of the application after modification, and a prompt instructing the AI ​​generation device 20 to detect the difference between the screen information of the application before modification and the screen information of the application after modification. The difference detection unit 102 also receives the difference between the screen information of the application before modification and the screen information of the application after modification from the AI ​​generation device 20.

[0043] The test code modification unit 103 inputs a prompt to the generating AI instructing it to modify the test code for the application before modification based on the difference between the screen information of the application before modification and the screen information of the application after modification, or the difference to which the user 30 has made modifications (the difference, or the difference to which the user 30 has made modifications, may also be input), and outputs the test code for the application after modification.

[0044] For example, the test code modification unit 103 sends a prompt to the generation AI provider 20 instructing it to modify the test code for the application before modification based on the difference between the screen information of the application before modification and the screen information of the application after modification, or the difference to which the user 30 has made modifications (the difference, or the difference to which the user 30 has made modifications, may also be sent). The test code modification unit 103 also receives the test code for the application after modification from the generation AI provider 20.

[0045] The display unit 104 displays the difference between the screen information of the application before modification and the screen information of the application after modification. The display unit 104 also displays the test code for the modified application.

[0046] [Prompt for difference detection] The following is an example of a prompt that instructs the system to detect the differences between the screen information of the application before modification and the screen information of the application after modification.

[0047] "A certain system has been updated." Please input the following two pieces of information and read the difference. Please output only the difference results in a table format. The table should consist of three columns: "No," "Title," and "Difference Result." When describing the difference results, please include information about the changes that were made. For example, the level of detail would be something like, "A password input field has been added." -Screenshot of the system before the change: DOM:DOM_Trading Screen (Trading Input) - The modified system screen DOM:DOM_02-05_Trading screen (trading input) Please note that the differences you read should be related to the following pre-correction test code. ##[Previous test code] ... (Paste the pre-correction test code) ... ##[DOM of the system screen before the change] ... (Paste the DOM of the screen before the changes) ... ##[DOM of the modified system screen] ... (Paste the DOM of the modified screen) ..."

[0048] Thus, in one embodiment of the present invention, the test code for the application before modification, the screen information for the application before modification, and the screen information for the application after modification are pasted onto a prompt that instructs the system to detect the difference between the screen information of the application before modification and the screen information of the application after modification. The prompt then instructs the system to detect the difference related to the test code for the application before modification (i.e., the difference between the screen information of the application before modification and the screen information of the application after modification).

[0049] [Prompt for test code modification] The following is an example of a prompt that instructs you to modify the test code for the application before the changes were made.

[0050] "Please modify the provided test code based on the differences detected so far." Please provide only the test code output as your response. Please do not change any parts that do not require correction. Please generate the entire code, including any parts that haven't been changed, without omitting any.

[0051] Furthermore, if the difference between the screen information of the application before modification and the screen information of the application after modification is the exact same difference sent from the AI ​​generation device 20 to the test code modification device 10, then the difference may or may not be pasted into the test code modification prompt. On the other hand, if the difference between the screen information of the application before modification and the screen information of the application after modification is the difference that the user 30 has modified from the difference sent from the AI ​​generation device 20 to the test code modification device 10, then the difference will be pasted into the test code modification prompt.

[0052] Thus, in one embodiment of the present invention, test code for the modified application is generated by leaving the parts of the test code for the original application that do not need modification unchanged, and modifying the parts that do need modification.

[0053] <Effects> In one embodiment of the present invention, test code for a modified application can be easily generated by utilizing the test code for the application before modification, thereby reducing the effort required compared to manually coding the test code.

[0054] In one embodiment of the present invention, by inputting the test code for the application before modification into the generating AI, it is possible to correctly detect the differences between the screen information of the application before modification and the screen information of the application after modification. Furthermore, in one embodiment of the present invention, by limiting the information to only what is written in the body tag of the DOM (i.e., excluding the information written in the header tag (such as styles), thereby reducing the size of the DOM file), the accuracy of detecting the differences between the screen information of the application before modification and the screen information of the application after modification can be improved.

[0055] In one embodiment of the present invention, by splitting the prompt into two parts, unnecessary differences (differences between the screen information of the application before modification and the screen information of the application after modification) can be excluded by a human, thereby preventing unnecessary modifications to the test code.

[0056] <Hardware Configuration> Figure 4 is a hardware configuration diagram of a test code modification device 10 according to one embodiment of the present invention. The same applies to the generation AI providing device 20.

[0057] The test code modification device 10 may include a control unit 1001, a main memory unit 1002, an auxiliary memory unit 1003, an input unit 1004, an output unit 1005, and an interface unit 1006. Each of these will be described below.

[0058] The control unit 1001 is a processor (for example, a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), etc.) that executes various programs installed in the auxiliary storage unit 1003.

[0059] The main memory unit 1002 includes non-volatile memory (ROM (Read Only Memory)) and volatile memory (RAM (Random Access Memory)). The ROM stores various programs, data, etc., necessary for the control unit 1001 to execute various programs installed in the auxiliary memory unit 1003. The RAM provides a work area that is expanded when the various programs installed in the auxiliary memory unit 1003 are executed by the control unit 1001.

[0060] The auxiliary storage unit 1003 is an auxiliary storage device that stores various programs and information used when various programs are executed.

[0061] The input unit 1004 is an input device in which the operator of the test code correction device 10 inputs various instructions to the test code correction device 10.

[0062] The output unit 1005 is an output device that outputs the internal status of the test code correction device 10, etc.

[0063] The interface unit 1006 is a communication device for connecting to a network and communicating with other devices.

[0064] It should be noted that the present invention is not limited to the configurations shown in the above embodiments, including combinations with other elements. These aspects can be modified without departing from the spirit of the present invention and can be appropriately determined according to their application. [Explanation of Symbols]

[0065] 10 Test Code Correction Device 20 Generation AI provision device 21 Generation AI 30 users 101 Acquisition Department 102 Difference detection unit 103 Test Code Modification Section 104 Display section 1001 Control Unit 1002 Main memory 1003 Auxiliary storage unit 1004 Input section 1005 Output section 1006 Interface section

Claims

1. How to modify the test code of an application, The AI ​​is given the following inputs: test code for the application before modification, screen information for the application before modification, screen information for the application after modification, and a prompt instructing it to detect the difference between the screen information for the application before modification and the screen information for the application after modification. The AI ​​is then made to output the difference. The generating AI is prompted to modify the test code for the application before modification based on the aforementioned difference or the difference modified by the user, and is then prompted to output the test code for the application after modification. method.

2. The method according to claim 1, wherein when outputting test code for the modified application, the difference or the difference modified by the user is input to the generating AI.

3. The method according to claim 1, wherein the test is a test of screen transitions of the application.

4. The method according to claim 1 or 2, wherein the screen information is information of the DOM (Document Object Model) of the screen included in the application.

5. The method according to claim 4, wherein the screen information is only the information described in the body tag of the DOM.

6. A test code modification device for modifying the test code of an application, A difference detection unit inputs the following to a generating AI: test code for the application before modification, screen information for the application before modification, screen information for the application after modification, and a prompt instructing the AI ​​to detect the difference between the screen information for the application before modification and the screen information for the application after modification, and outputs the difference. A test code modification unit inputs a prompt to the generating AI instructing it to modify the test code for the application before modification based on the aforementioned difference or the difference modified by the user, and outputs the test code for the application after modification. A test code modification device equipped with the following features.

Citation Information

Patent Citations

  • Test script processing program

    JP2007102654A