Software generation assistance system, software generation assistance method, and computer program

JP2024046514A5Pending Publication Date: 2025-03-21HITACHI LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2022151948
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2022-09-22
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

Existing software production methods become less efficient as the number of registered modification patterns increases, leading to decreased productivity due to the need for system engineers to manually select and test multiple correction patterns on new source code.

Method used

A software generation support system that extracts correction patterns from existing source code with bugs, utilizing both structural similarity and test execution information to automatically select appropriate patterns for new code, thereby reducing the number of patterns considered and improving efficiency.

Benefits of technology

The system enhances software productivity by efficiently selecting and applying correction patterns based on structural and test information, reducing the time required for bug fixing and improving overall production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

To assist efficient production of software.SOLUTION: A software production assistance system 1 executes: a correction pattern extraction step (S1) which extracts correction pattern information generated on the basis of test execution information before bug correction that includes an existing source code that contains bugs, a corrected existing source code that is a bug-corrected existing source code, and the result of a test having been executed regarding the existing source code that contains bugs, and test execution information after bug correction that includes the result of a test having been executed regarding the corrected existing source code; and a correction pattern selection step (S2) which acquires test execution information including the source code to be processed and the result of a test having been executed regarding the source code to be processed, and selects the correction pattern information to be applied to the source code to be processed from among the extracted correction pattern information, on the basis of the structure of the source code and the test execution information.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a software production support system, a software production support method, and a computer program. [Background technology]

[0002] As described in Patent Document 1, there is a demand for efficient production of new software by effectively utilizing software assets created in the past. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] JP 2021-124852 A Summary of the Invention [Problem to be solved by the invention]

[0004] Patent Document 1 provides a method for correcting a software program by data-driven synthesis of correction patterns. However, Patent Document 1 detects a correction pattern capable of dealing with a defect in a new source code based only on the similarity of the source code at the location where the defect occurs. Therefore, the more correction patterns registered, the more correction patterns that can be applied to the new source code. A system engineer who creates new source code selects several correction patterns from many correction patterns, generates a patch from the selected multiple correction patterns, and tries it on the new source code under development. For this reason, the more software assets are accumulated, that is, the more correction patterns are registered, the more software productivity may decrease.

[0005] The present invention has been made in consideration of the above-mentioned problems, and has an object to provide a software production support system, a software production support method, and a computer program that are capable of supporting the efficient production of software. [Means for solving the problem]

[0006] In order to solve the above-mentioned problems, a software production support system according to one aspect of the present invention is a software production support system that has a processor and a memory and supports software production, in which the processor executes a modification pattern extraction step of extracting modification pattern information generated based on existing source code containing a bug, modified existing source code which is the existing source code in which the bug has been corrected, pre-bug fix test execution information including results of tests executed on the existing source code containing the bug, and post-bug fix test execution information including results of tests executed on the modified existing source code, and a modification pattern selection step of acquiring a source code to be processed and test execution information including results of tests executed on the source code to be processed, and selecting, from the extracted modification pattern information, modification pattern information to be applied to the source code to be processed, based on the structure of the source code and the test execution information. Effect of the Invention

[0007] According to the present invention, modification pattern information to be applied to the source code to be processed can be selected from modification pattern information extracted from the existing source code, based on the structure of the source code and test execution information. [Brief description of the drawings]

[0008] [Figure 1] FIG. 1 is a diagram showing the overall configuration of a software generation support system. [Diagram 2] FIG. 2 is a logical configuration diagram of the software generation support system. [Diagram 3] FIG. 3 is an example of test execution information. [Figure 4] FIG. 4 is a flowchart showing the process of extracting a correction pattern. [Diagram 5] FIG. 5 shows an example of a method for calculating the similarity between modified existing source codes (modified instances). [Figure 6] FIG. 6 is a flowchart showing a process for extracting a correction pattern for each cluster of correction instances. [Figure 7] FIG. 7 is an explanatory diagram illustrating an example of a modified instance. [Figure 8] FIG. 8 shows an example of correction patterns extracted for each cluster. [Figure 9] FIG. 9 is a flowchart showing a process of selecting a modification pattern to be used for fixing a bug in a target source code from among the extracted modification patterns. [Figure 10] 1 is an example of a method for calculating the similarity between a bug and a fix pattern. [Figure 11] Figure 11 shows an example of source code containing a bug. [Figure 12] FIG. 12 shows an example of the test execution results. [Figure 13] FIG. 13 shows an example of a modification pattern used for a target source code. [Figure 14] FIG. 14 is a flowchart showing a process for extracting patches having a rank equal to or higher than a predetermined value from among patch proposals generated based on a selected correction pattern. [Figure 15] FIG. 15 is an example of a modification pattern used to generate a patch proposal. [Figure 16] FIG. 16 is an example of a patch proposal. [Figure 17] FIG. 17 shows another example of a patch proposal. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0009] Hereinafter, an embodiment of the present invention will be described with reference to the drawings. The software production support system 1 of this embodiment efficiently selects a modification pattern to be used to eliminate a bug, and improves software production efficiency. In this embodiment, when selecting a modification pattern, not only is the structure of the source code around the bug compared with the structure of the corresponding part of the modified existing source code (also called a modification instance), but information including the execution results of the test used to detect the bug is also used.

[0010] Therefore, in this embodiment, an appropriate modification pattern that corresponds to a bug in the target source code can be extracted from among many modification patterns, thereby shortening the time required for bug fixing and improving software productivity.

[0011] Furthermore, in this embodiment, even if the number of modification patterns increases, a modification pattern suitable for bug fixing can be selected. Therefore, in this embodiment, while many modification patterns can be automatically registered and made available, the modification patterns actually used can be narrowed down to a small number, which can contribute to improving software production efficiency while improving usability and reliability.

[0012] Furthermore, in this embodiment, patch proposals with low validity are excluded from among the patch proposals generated from the selected correction pattern, so that an appropriate patch proposal can be selected and used to resolve the bug.

[0013] In this embodiment, a system, method, or computer program having the following configuration is disclosed.

[0014] (Configuration 1) A software production support system comprising a processor and a memory and supporting production of software, wherein the processor executes a modification pattern extraction step of extracting modification pattern information generated based on existing source code containing a bug, modified existing source code which is the existing source code in which the bug has been corrected, pre-bug fix test execution information including results of tests executed on the existing source code containing the bug, and post-bug fix test execution information including results of tests executed on the modified existing source code; and a modification pattern selection step of acquiring a source code to be processed and test execution information including results of tests executed on the source code to be processed, and selecting, from the extracted modification pattern information, modification pattern information to be applied to the source code to be processed, based on a structure of the source code and the test execution information.

[0015] (Configuration 2) The software production support system according to configuration 1, wherein the processor uses the selected modification pattern information to generate at least one patch for modifying a bug in the source code to be processed.

[0016] (Configuration 3) The software generation support system according to configuration 1 or 2, wherein the processor selects a patch to be applied to the source code to be processed from among the generated patches.

[0017] (Configuration 4) A software generation support system according to any one of configurations 1 to 4, wherein the processor corrects bugs in the source code to be processed by applying the selected patch to the source code to be processed.

[0018] (Configuration 5) The software production support system according to configuration 1, wherein the modification pattern information includes code structure information including the existing source code, the modified existing source code, and elements of a location where the bug occurs, a method of modifying the bug, test execution information including a result of the test executed on the existing source code, and test execution information indicating a result of the test executed on the modified existing source code.

[0019] (Configuration 6) The software production support system according to any one of Configurations 1 to 5, wherein in the modification pattern selection step, modification pattern information to be applied to the source code to be processed is selected from the extracted modification pattern information based on a similarity between the source code to be processed and the existing source code, and a similarity between the test execution information for the source code to be processed and the test execution information for the existing source code.

[0020] (Configuration 7) The software generation support system according to any one of configurations 1 to 6, in which, in the modification pattern extraction step, a plurality of pre-stored existing source codes are grouped based on whether structures of existing source codes including bugs are similar, whether structures of modified existing source codes after the bugs have been corrected are similar, whether test execution information for the existing source codes is similar, and whether test execution information for the modified existing source codes is similar, extracts the modification pattern information for each group.

[0021] (Configuration 8) The software generation support system according to any one of configurations 1 to 7, wherein a weight is set for the extracted modification pattern information according to the number of existing source code groups, and in the modification pattern selection step, modification pattern information to be applied to the source code to be processed is selected further taking into consideration the weight.

[0022] (Configuration 9) A software generation support system described in any one of configurations 1-8, wherein the test execution information includes information indicating the type of exception when the test fails and information on the path on which the test was executed.

[0023] (Configuration 10) A software production support method using at least one computer as a software generation support system for supporting software production, the computer executing a modification pattern extraction step of extracting modification pattern information generated based on existing source code containing a bug, modified existing source code which is the existing source code in which the bug has been corrected, pre-bug fix test execution information including results of tests executed on the existing source code containing the bug, and post-bug fix test execution information including results of tests executed on the modified existing source code; and a modification pattern selection step of acquiring a source code to be processed and test execution information including results of tests executed on the source code to be processed, and selecting from the extracted modification pattern information modification pattern information modification pattern information to be applied to the source code to be processed.

[0024] (Configuration 11) A computer program for using a computer as a software production support system for supporting software production, the computer executing: a modification pattern extraction step of extracting modification pattern information generated based on existing source code containing a bug, modified existing source code which is existing source code in which the bug has been corrected, pre-bug fix test execution information including results of tests executed on the existing source code containing the bug, and post-bug fix test execution information including results of tests executed on the modified existing source code; and a modification pattern selection step of acquiring source code to be processed and test execution information including results of tests executed on the source code to be processed, and selecting from the extracted modification pattern information modification pattern information modification pattern information to be applied to the source code to be processed.

[0025] Configurations 10 and 11 may also include the features described in configurations 1-9.

[0026] The system, method, or computer program disclosed in the present embodiment can also be expressed as follows.

[0027] (Representation 1) A system, method, or computer program comprising: a correction pattern extraction unit that clusters correction instances based on the similarity between correction information of bug correction instances accumulated in a development repository and test execution information including test exception information, and extracts, for each cluster, a correction pattern including information that abstracts the test execution information; and a correction pattern matching unit that searches for a correction pattern based on the similarity between new source code having a bug, new test information, and the correction pattern.

[0028] (Representation 2) The system, method or computer program according to Representation 1, further comprising a filtering unit configured to filter out patch proposals with low priority that have passed patch verification.

[0029] (Representation 3) The system, method or computer program according to Representation 1 or 2, further comprising a source code modification unit that modifies the new source code using any one or more patch proposals.

[0030] (Representation 4) A system according to any one of Representations 1-3, wherein the correction pattern extraction unit calculates the similarity of the correction information including the similarity of the test execution information.

[0031] (Representation 5) A system, method, or computer program according to any one of Representations 1-4, in which the modification pattern matching unit detects a matching modification pattern based on a match between a source code having a bug and its test information, and a source code before the modification of the modification pattern and its test execution information, and assigns a priority to the detected matching modification pattern.

[0032] (Representation 6) The system, method, or computer program of any one of Representations 1-5, wherein the patch proposal filtering unit sets priorities for patch proposals that pass patch verification based on a match between the patch proposals and a matching modification pattern, and filters out patch proposals with low priorities. EXAMPLES

[0033] A first embodiment will be described with reference to Figures 1 to 16. Figure 1 is an overall configuration diagram of a software generation support system 1. In this embodiment, an example is given of software being created in JAVA (registered trademark) language, but any type of programming language can be used.

[0034] The software production support system 1 supports the automatic or semi-automatic production of software. The software production support system 1 extracts a modification pattern for eliminating a bug based on the existing source code (the source code before modification and the source code after modification) and test execution information including the results of tests executed on the existing source code. Furthermore, the software production support system 1 selects a modification pattern to be applied to the source code to be processed from the multiple extracted modification patterns. Furthermore, the software production support system 1 excludes patch proposals with low validity from among the patch proposals generated based on the selected modification pattern, and applies only the more appropriate patch proposals to the source code to be processed.

[0035] The software production support system 1 can be provided on a computer including, for example, a processor 2, a storage device 3, a user interface (UI in the figure) device 4, a communication device 5, and the like.

[0036] The communication device 5 of the software production support system 1 is communicatively connected to at least one computer terminal 6 via a communication network CN. A user such as a system engineer can use the software production support service provided by the software production support system 1 via the computer terminal 6 to fix bugs in the source code being created (the source code to be processed).

[0037] The software production support system 1 may be communicatively connected to a storage system 7 as an example of an external device. A user may store source code being created in the storage system 7. The information storage unit 31 of the software production support system 1 may store the substance of a file in the storage system 2, which is an external device. Instead of the storage system 7, another information processing device such as a file server may be used.

[0038] The software production support system 1 can be connected to a storage medium MM. The storage medium MM is configured as, for example, a memory device, a hard disk device, an optical disk device, a magneto-optical disk device, a magnetic tape device, or the like, and non-temporarily stores computer programs and data. The storage medium MM can transfer computer programs and data to the storage device 3 of the software production support system 1 and store them therein. Computer programs and data can also be transferred from the storage device 3 to the storage medium MM and stored therein. A computer program that realizes the functions of the software production support system 1 is stored in the storage medium MM, the storage medium MM is connected to another computer, and the computer program stored in the storage medium MM is installed in the other computer, thereby making the other computer function as the software production support system 1.

[0039] The communication network CN may be a public communication network such as the Internet, or a private communication network. The communication network CN may be either a wireless communication network or a wired communication network, or may be a combination of a wireless communication network and a wired communication network.

[0040] The functional configuration of the software generation support system 1 will be described. The storage device 3 of the software generation support system 1 is a device including a main storage device and an auxiliary storage device. The storage device 3 stores, for example, computer programs and data for implementing an information storage unit 31, a modification pattern extraction unit 32, a modification pattern selection unit 33, a patch selection unit 34, and a source code modification unit 35. As described below, the software generation support system 1 can execute a step (S1) of extracting modification patterns from existing software assets, a step (S2) of selecting at least one modification pattern from the extracted modification patterns, a step (S3) of selecting at least one patch from patches created based on the selected modification pattern, and a step (S4) of modifying the source code to be processed using the selected patch.

[0041] The processor 2 executes a computer program stored in the storage device 3, thereby realizing the functions of the software generation support system 1. The processor 2 is not limited to a CPU (Central Processing Unit), and may include a GPU (Graphics Processing Unit) or an ASIC (Application Specific Integrated Circuit), etc.

[0042] The information storage unit 31 stores information about the developed software assets. The software assets include information about existing source code. The information about the existing source code includes, for example, the existing source code before modification, the existing source code after modification, the test code (the test pattern used for the test), and the test results. The test results include, for example, information indicating the type of exception when the test fails, and information about the path on which the test was executed. The information about the existing software assets managed by the information storage unit 31 may be stored in the storage device 3 or in the external storage system 7.

[0043] The correction pattern extraction unit 32 has a function of extracting a correction pattern used to correct a bug from the past software assets stored in the information storage unit 31, that is, from information on existing source codes.

[0044] The modification pattern selection unit 33 has a function of selecting at least one modification pattern to be applied to the source code to be processed from a group of modification patterns extracted from existing software assets. As described later, the modification pattern selection unit 33 selects a modification pattern to be applied to the source code to be processed based on the similarity of the source code structure before and after the bug fix and the similarity of the test execution information before and after the bug fix.

[0045] The patch selection unit 34 has a function of selecting at least one patch to be used to fix a bug in the source code to be processed from among a plurality of patches (patch proposals) generated based on the selected fix pattern.

[0046] The source code correction unit 35 has a function of correcting bugs in the source code to be processed by using the selected patch plan. Information on the source code in which the bug has been corrected by the source code correction unit 35 is automatically added to the information storage unit 31 as a new software asset.

[0047] The software generation support system 1 does not need to include all of the above-mentioned functions 31 to 35. For example, the software generation support system 1 may include a modification pattern extraction unit 32. For example, the software generation support system 1 may include a modification pattern extraction unit 32 and a modification pattern selection unit 33. For example, the software generation support system 1 may include the modification pattern extraction unit 32, the modification pattern selection unit 33, and a patch selection unit 34. The software generation support system 1 may include the modification pattern extraction unit 32, the modification pattern selection unit 33, the patch selection unit 34, and a source code modification unit 35.

[0048] The software generation support system 1 can also be realized by linking a plurality of computers. For example, the software generation support system 1 can be configured by communicatively connecting a computer realizing the information storage unit 31, a computer realizing the modification pattern extraction unit 32, a computer realizing the modification pattern selection unit 33, a computer realizing the patch selection unit 34, and a computer realizing the source code modification unit 35.

[0049] The user interface device 4 is a device used by an administrator who manages the software generation support system 1, or a user who uses the services provided by the software generation support system 1. The user interface device 4 includes an information input device that inputs information to the software generation support system 1, and an information output device that provides information from the software generation support system 1 to the administrator or the user (neither of which is shown).

[0050] The information input device is, for example, a keyboard, a pointing device, a touch panel, a voice instruction device, etc. The information output device is, for example, a monitor display, a printer, a voice synthesizer, etc. The user interface device 4 can also use AR (Augmented Reality) or VR (Virtual Reality), etc.

[0051] Fig. 2 is a logical configuration diagram of the software generation support system. In the center of Fig. 2, information 3100 to 3113 stored in information storage unit 31 is shown. On the left and right of Fig. 2, functional units 32 to 37 that process information are shown.

[0052] The explanation will be made from the top to the bottom of FIG. Buggy source code 3100, corrected code 3101, and test execution information 3103 are part of the existing software assets. Buggy source code 3100 is existing source code that has a bug, i.e., source code before the bug is corrected. Corrected code 3101 is source code after the bug has been corrected. In the drawings, the names of each configuration are abbreviated as appropriate. Below, each configuration may be explained using the abbreviated name shown in FIG. 2. For example, source code that has a bug may be called buggy source code, and corrected source code may be called corrected code.

[0053] Test code 3102 is a test pattern used to test buggy source code 3100 and modified code 3101. Test execution information 3103 is generated by test execution unit 36. Test execution unit 36 ​​has a function of applying test code to source code for testing. Test execution information 3103 includes information including test results when test code 3102 is applied to buggy source code 3100, and information including test results when test code 3102 is applied to modified code 3101.

[0054] The modification pattern extracting section 32 generates a modification pattern 3104 from the buggy source code 3100, the modified code 3101, and the test execution information before and after the modification 3103, and stores the modification pattern in the information storing section 31.

[0055] The correction pattern selection unit 33 selects a correction pattern 3109 to be applied to a source code to be processed (target source code in the drawing) 3105 from among the correction patterns 3104 generated and stored by the correction pattern extraction unit 32.

[0056] The modification pattern selection unit 33 selects a modification pattern 3109 to be applied to the target source code 3105 from among the modification patterns 3104, based on the target source code 3105, test execution information 3107 about the target source code, and a defective part (a part in the source code where a bug occurs) 3108 of the target source code. The selected modification pattern 3109 is stored in the information storage unit 31.

[0057] The modification pattern selection unit 33 selects a modification pattern taking into consideration not only the similarity of the source code structure around the bug, but also the similarity between the test execution information 3103 of the modification pattern and the test execution information 3107 of the target source code 3105. Therefore, compared to the case where a modification pattern is selected based only on the similarity of the source code structure around the bug, it is possible to select a modification pattern that is more suitable for fixing a bug in the target source code 3105. Therefore, in this embodiment, the number of modification patterns used for bug fixing can be reduced.

[0058] The patch generation unit 37 generates a patch candidate (also called a patch proposal) 3110 based on the selected modification pattern 3109, and stores the generated patch candidate 3110 in the information storage unit 31. Furthermore, the patch generation unit 37 applies a test code to the generated patch candidate 3110, and stores a test execution result 3111 including the test result in the information storage unit 31.

[0059] The patch selection unit 34 selects a patch 3112 to be used for fixing a bug in the target source code 3105 from among the patch candidates 3110 based on the test execution results 3111 of the patch candidates.

[0060] The source code correction unit 35 applies the selected patch 3112 to the target source code 3105 to remove the bug from the target source code 3105 and obtain corrected code 3113. The corrected code 3113 is stored as a part of the software assets and is used to produce new target source code.

[0061] 3 is an example of the test execution information 3103, 3107. The test execution information includes, for example, an exception type D11, the number of each exception type D12, the number of successful tests and the number of failed tests D13, and paths executed in the test code D14.

[0062] The exception types D11 include, for example, Null Pointer Exception_D111, ClassCastException_D112, IllegalArgumentException_D113, IndexOutofBoundException_D114, ComparisonFailer_D115, and AssertionFailedError_D116.

[0063] Null Pointer Exception_D111 is thrown when an attempt is made to reference a reference variable when it contains a null value. ClassCastException_D112 is thrown to indicate an attempt to cast an object to a subclass that is not in the inheritance relationship. IllegalArgumentException_D113 is thrown to indicate an illegal or inappropriate argument has been passed to a method. IndexOutofBoundException_D114 is thrown to indicate that an index of some kind (array, string, vector, etc.) is out of range. ComparisonFailer_D115 is thrown when string comparison validation fails. AssertionFailedError_D116 is thrown when validation fails.

[0064] 4 is a flowchart showing the process (S1) of extracting a modification pattern. The modification pattern extraction unit 32 acquires the buggy source code, modified code, and test execution information of each modification instance stored in the information storage unit 31 (S11).

[0065] The modification pattern extraction unit 32 classifies similar modification instances into the same group based on the buggy source code, the modified code, and the test execution information (S12). A group of similar modification instances is also called a cluster.

[0066] The correction pattern extraction unit 32 extracts a correction pattern for each cluster (S13). Details of step S13 will be described later.

[0067] 5 shows an example of a method for calculating the similarity between the modified instances. Using the similarity between the modified instances, the modified pattern extraction unit 32 clusters the modified instances (S12 in FIG. 4).

[0068] Fig. 5 shows an example of calculation of the degree of similarity (similarity) sim(P1,P2) between two modified instances P1 and P2. The similarity sim(P1,P2) can be calculated from the similarity sim(b1,b2) of the buggy source code, the similarity sim(f1,f2) of the modified code (modified source code), and the similarity (t1,t2) of the test execution information. A weight w can be set for each of the similarities sim(b1,b2), sim(f1,f2), and sim(t1,t2). Fig. 5 is an example, and whether modified instances are similar or not may be calculated by other methods.

[0069] 6 is a flowchart showing the process (S13) of extracting a modification pattern for each cluster of modification instances. The modification pattern extraction unit 32 abstracts (generalizes) and merges the source code before modification and the source code after modification for each modification instance belonging to the same cluster (S131).

[0070] The modification pattern extraction unit 32 merges the test execution information for each modification instance in which the source code before modification and the source code after modification are merged (S132). That is, the test execution information of the source code before modification is merged with the test execution information of the source code after modification. Examples of merging source code and merging test execution information will be described later.

[0071] The modification pattern extraction unit 32 generates a modification pattern from the elements of the defective part (the part where the bug occurs), the abstracted source code before and after modification, the test execution information before and after modification, and the content of the modification operation (S133). The modification pattern extraction unit 32 assigns a weight to the extracted modification pattern (S134). For example, the weight value may be determined according to the number of modification instances that are the source of the modification pattern, such as setting the weight of a modification pattern obtained from two modification instances to "2". The weight may be determined in consideration of not only the number of modification instances that contributed to the generation of the modification pattern, but also other parameters such as the creation date and time of the modification instance.

[0072] 7 shows an example of a modified instance stored in the information storage unit 31. The modified instance includes source code before and after the modification, and test execution information including results of tests executed on the source code before and after the modification.

[0073] In the figure, "#1" indicates the first test by the first test code (test pattern). "#2" indicates the second test by the second test code. "#3" indicates the third test by the third test code. "b" in the figure means a test on the source code before modification. "a" means a test on the source code after modification. Therefore, "#1b" means the first test on the source code before modification. "#1a" means the second test on the source code after modification. The same applies below. The black circle in the test execution result indicates the line of the source code that was executed. The test result is set to either "PASS" indicating that the test was successful, or "ERROR" indicating that the test was unsuccessful. The exception type is set to one of the exception types D111 to D116 described in FIG. 3. In the figure, "Null Pointer Exception" is abbreviated to "NPE". Similarly, "Assertion Error" is abbreviated to "AE".

[0074] 8 shows an example of a correction pattern extracted for each cluster. The set of correction patterns 3104 includes, for example, a management number D21, a weight D22, a correction operation D23, a source code structure in the vicinity of a defective portion D24, and test execution information D25.

[0075] The management number D21 is information that uniquely identifies each modification pattern in the software generation support system 1. The weight D22 indicates the weight given to the modification pattern. The larger the weight value, the higher the possibility that the modification pattern will be selected. The modification operation D23 is information that classifies the methods of fixing bugs.

[0076] The source code structure D24 in the vicinity of the defect location indicates the structure of the source code in the vicinity of the occurrence of the bug. The source code structure D24 includes, for example, an element D241 included in the defect location and abstracted source code D242. The element D241 included in the defect location is information obtained by abstracting (generalizing) the element in the location where the bug occurred. The abstracted source code D242 indicates abstracted source code before correction and abstracted source code after correction. The test execution information D25 is information including, for example, a test result, an exception type, and an execution path.

[0077] FIG. 9 shows the process (S2) of selecting a modification pattern to be used for fixing a bug in the target source code from the extracted modification patterns.

[0078] The correction pattern selection unit 33 abstracts the source code of the defective part from the target source code (S21). The correction pattern selection unit 33 calculates the similarity between the source code abstracted in step S21 and each of the extracted correction patterns (S22). The correction pattern selection unit 33 adds correction patterns whose calculated similarity is equal to or greater than a predetermined threshold to correction pattern candidates to be applied to the target source code (S23). The correction pattern selection unit 33 sets priorities to the correction pattern candidates (S24). Methods for setting weights in step S24 include, for example, a method of setting a higher priority as the elements in which bugs appear are more similar, and a method of ranking correction pattern candidates by their weights and giving a higher priority to correction pattern candidates with higher ranks. Methods other than these may also be used.

[0079] Fig. 10 is an example of a method for calculating the similarity between a bug and a modification pattern. Fig. 10 shows an example of the calculation method used in step S22 of Fig. 9. The similarity sim(Pi,Pn) between a target source code Pi having a bug and a source code Pn before modification by a certain modification pattern can be calculated based on the similarity simc between a bug (an element where a bug appears) in the target source code and a bug (an element where a bug appears) in the source code before modification by the modification pattern, and the similarity simt between test execution information for the target source code and test execution information for the source code before modification by the modification pattern.

[0080] Figure 11 shows an example of source code containing a bug. A bug icon is displayed on the line where the bug occurs.

[0081] Figure 12 shows an example of the test execution results. In Figure 12, a total of four tests were executed, and the fourth test failed.

[0082] FIG. 13 shows examples of modification patterns used in the target source code (examples of modification patterns selected as modification pattern candidates).

[0083] 14 is a flowchart showing the process (S3) of selecting a patch to be applied to the target source code from among the patches (patch proposals) generated based on the selected modification pattern. A bug can be modified in multiple ways, not just one way. By rewriting a line containing a bug in multiple ways, multiple patches that pass the test can be generated. On the other hand, the more patches there are, the more costly it becomes to modify the target source code, and the lower the software production efficiency becomes. Therefore, the patch selection unit 34 selects an appropriate patch from among multiple patches.

[0084] The patch selection unit 34 abstracts the buggy source code and the modified source code of each patch plan (S31). The patch selection unit 34 calculates a similarity between each abstracted patch plan and the modification pattern used to generate the patch plan (S32). The patch selection unit 34 ranks each patch plan based on the calculated similarity (S33). The patch selection unit 34 selects patch plans having a rank equal to or greater than a predetermined value for bug fixing (S34).

[0085] Fig. 15 is an example of a correction pattern used to generate a patch proposal. Fig. 16 is an example of a patch proposal. Fig. 17 is another example of a patch proposal. A patch proposal that is similar to the correction pattern selected for patch generation in Fig. 15, either patch proposal 1 shown in Fig. 16 or patch proposal 2 shown in Fig. 17, is selected. The patch proposal that is more similar is selected based on the similarities of the elements at the location where the bug occurs, the test results, the exception type, and the execution path.

[0086] Specifically, Test 1 (#1b, #1a) of Patch Proposal 1 matches Test 2 (#2b, #2a) of the modification pattern. Test 2 (#2b, #2a) of Patch Proposal 1 matches Test 2 (#2b, #2a) of the modification pattern in the execution path, but the test results are different. Test 2 of the modification pattern fails, but Test 2 of Patch Proposal 1 passes. In contrast, Test 1 (#1b, #1a) of Patch Proposal 2 matches Test 2 (#2b, #2a) of the modification pattern, and Test 2 (#2b, #2a) of Patch Proposal 2 matches Test 4 (#4b, #4a) of the modification pattern. Of the multiple patch proposals 1 and 2 obtained from a common modification pattern, Patch Proposal 2 is the most similar to the modification pattern. Therefore, Patch Proposal 2 is given a higher priority than Patch Proposal 1. Then, the patch proposal with the higher priority is applied to the source code to be processed.

[0087] According to this embodiment configured as described above, a modification pattern suitable for fixing a bug can be automatically selected from many modification patterns stored in the past. Therefore, even if modification patterns are automatically stored in the information storage unit 31 every time new source code is developed, a modification pattern can be efficiently selected. In other words, according to the software production support system 1 of this embodiment, it is possible to both store new modification patterns every time they are generated and select useful modification patterns from many stored modification patterns. Therefore, according to this embodiment, it is possible to improve the performance of supporting software production and improve usability.

[0088] In the software generation support system 1 of this embodiment, a correction pattern is selected taking into consideration not only the line of the source code containing the bug but also the test execution information of the source code, so that a correction pattern suitable for eliminating the bug can be selected, which can contribute to improving software productivity.

[0089] In the software generation support system 1 of this embodiment, a patch is selected from multiple patches (patch proposals) obtained based on the selected modification pattern, thereby reducing the time required to fix bugs and improving software production efficiency.

[0090] The present invention is not limited to the above-described embodiment. A person skilled in the art can make various additions and modifications within the scope of the present invention. The above-described embodiment is not limited to the configuration example shown in the attached drawings. The configuration and processing method of the embodiment can be appropriately changed within the scope of achieving the object of the present invention.

[0091] In addition, each component of the present invention can be selected arbitrarily, and the invention having the selected configuration is also included in the present invention. Furthermore, the configurations described in the claims can be combined in combinations other than those explicitly stated in the claims. [Explanation of symbols]

[0092] 1: software generation support system, 6: computer terminal, 31: information storage unit, 32: modification pattern extraction unit, 33: modification pattern selection unit, 34: patch selection unit, 35: source code modification unit

Claims

1. A software production support system that supports software production, comprising a processor and a memory, The processor, a modification pattern extraction step of extracting modification pattern information generated based on an existing source code including a bug, a modified existing source code which is the existing source code in which the bug has been modified, pre-bug-fix test execution information including a result of a test executed on the existing source code including the bug, and post-bug-fix test execution information including a result of a test executed on the modified existing source code; a modification pattern selection step of acquiring a source code to be processed and test execution information including a result of a test executed on the source code to be processed, and selecting, from the extracted modification pattern information, modification pattern information to be applied to the source code to be processed based on a structure of the source code and the test execution information; Run The test execution information includes information indicating the type of exception when the test fails and information on the path on which the test was executed. Software production support system.

2. The processor generates at least one patch for fixing the bug in the source code to be processed using the selected fix pattern information.

2. The software production support system according to claim 1.

3. The processor selects a patch to be applied to the source code to be processed from among the generated patches.

3. The software generation support system according to claim 2.

4. The processor applies the selected patch to the source code to be processed, thereby fixing the bug in the source code to be processed.

4. The software generation support system according to claim 3.

5. The modification pattern information is code structure information including the existing source code, the corrected existing source code, and an element where the bug occurs; A method for fixing the bug; test execution information including results of the tests performed on the existing source code; test execution information indicative of results of the tests performed on the modified existing source code; Includes 2. The software production support system according to claim 1.

6. In the correction pattern selection step, Based on a similarity between the source code to be processed and the existing source code and a similarity between the test execution information for the source code to be processed and the test execution information for the existing source code, modification pattern information to be applied to the source code to be processed is selected from the extracted modification pattern information.

6. The software production support system according to claim 5.

7. In the correction pattern extraction step, A plurality of pre-stored existing source codes are grouped based on whether the structures of the existing source codes including bugs are similar, whether the structures of the corrected existing source codes in which the bugs have been corrected are similar, whether test execution information for the existing source codes is similar, and whether test execution information for the corrected existing source codes is similar, and thereby the correction pattern information is extracted for each group.

7. The software generation support system according to claim 6.

8. A weight is set for the extracted modification pattern information according to the number of grouped existing source codes; In the modification pattern selection step, modification pattern information to be applied to the source code to be processed is selected further taking into consideration the weight.

8. The software generation support system according to claim 7.

9. 1. A software production support method using at least one computer as a software production support system for supporting production of software, comprising: The computer includes: a modification pattern extraction step of extracting modification pattern information generated based on an existing source code including a bug, a modified existing source code which is the existing source code in which the bug has been modified, pre-bug-fix test execution information including a result of a test executed on the existing source code including the bug, and post-bug-fix test execution information including a result of a test executed on the modified existing source code; a modification pattern selection step of acquiring a source code to be processed and test execution information including a result of a test executed on the source code to be processed, and selecting modification pattern information to be applied to the source code to be processed from the extracted modification pattern information; Run The test execution information includes information indicating the type of exception when the test fails and information on the path on which the test was executed. Software production support methods.

10. A computer program for using a computer as a software production support system for supporting the production of software, The computer includes: a modification pattern extraction step of extracting modification pattern information generated based on an existing source code including a bug, a modified existing source code which is the existing source code in which the bug has been modified, pre-bug-fix test execution information including a result of a test executed on the existing source code including the bug, and post-bug-fix test execution information including a result of a test executed on the modified existing source code; a modification pattern selection step of acquiring a source code to be processed and test execution information including a result of a test executed on the source code to be processed, and selecting modification pattern information to be applied to the source code to be processed from the extracted modification pattern information; The test execution information includes information indicating the type of exception when the test fails and information on the path on which the test was executed. Computer program.