Apparatus and method for supporting source code modification

The source code modification support device addresses inefficiencies in detecting and correcting software defects by generating evaluation code templates and drivers for comprehensive automated testing, ensuring accurate and timely defect resolution.

JP7557431B2Active Publication Date: 2024-09-27HITACHI LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
JP2021101977
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-06-18
Publication Date
2024-09-27
Estimated Expiration
2041-06-18

AI Technical Summary

Technical Problem

Existing methods for detecting software defects in complex software with many input parameters are inefficient, leading to delayed defect corrections and potential system outages due to missed errors in manual bug fixes and ineffective test code reviews.

Method used

A source code modification support device and method that generates evaluation code templates and drivers to automatically execute and test modified source code, ensuring comprehensive evaluation by independent evaluators to avoid errors and omissions.

Benefits of technology

Efficiently evaluates modified source code, reducing the likelihood of errors and omissions in corrections, and shortens the time required for code modifications by integrating automated testing and independent evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007557431000017
    Figure 0007557431000017
  • Figure 0007557431000004
    Figure 0007557431000004
  • Figure 0007557431000010
    Figure 0007557431000010
Patent Text Reader

Abstract

To provide a source code correction support device and method that appropriately evaluate corrected source codes and efficiently avoid correction omissions, errors, or the like.SOLUTION: In a source code correction support system in which a source code correction support device is communicatively connected to a developer terminal and an evaluator terminal via a network, the source code correction support device 100 includes: an external storage device 101 that holds an updated source code; and a computation device 104 that generates a template containing a conditional branch statement for each case of success or failure of an input condition as an evaluation code template for the updated source code, notifies the evaluator terminal of a request to create an evaluation code based on the template, controls access to the updated source code by an evaluator, receives an edit by the evaluator for the conditional branch statement in the template, generates a list of input values for executing all control paths of the edited evaluation code, and generates an evaluation code driver that automatically executes the evaluation code with the input values as an input.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a source code modification support device and a source code modification support method. [Background technology]

[0002] Testing is a common method for detecting software defects. However, when a software has a large number of input parameters and each parameter has a wide range of possible values, it is difficult to comprehensively test all possible combinations of input values. This situation corresponds to the so-called combinatorial explosion.

[0003] Therefore, if a defect that occurs under rare conditions is built into the software, it may not be detected in pre-operation testing and may manifest itself after the software goes live. When a defect occurs after the software goes live, it is often the case that sufficient information that can serve as a clue for analyzing the cause cannot be obtained. In such cases, it may take a long time to identify the conditions under which the defect occurs.

[0004] As a result, there is a risk that defect corrections will be delayed, leading to long system outages and large-scale recalls.

[0005] As a conventional technique for dealing with such problems, for example, a technique for reducing the cost of testing after a program is modified by utilizing test assets before the program is modified (see Patent Document 1).

[0006] This technology shows a method for presenting the input conditions under which a defect occurs and the execution path under those conditions when a defect is detected from a log. This allows software developers to recognize the location and conditions under which the defect occurred and consider a correction policy. It is also said that this can reduce the time it takes to correct the defect.

[0007] Additionally, an information processing device that aims to improve the efficiency of detecting test results that are suspected to be erroneous (see Patent Document 2) has also been proposed.

[0008] This information processing device has a first acquisition unit that acquires a first symbolic execution result including a path condition indicating a sequence of conditional expressions for a first execution path when an input value for which an expected value is returned from both a first program and a second program obtained by modifying the first program is given to the first program, and a mathematical expression indicating a return value for the first execution path; a second acquisition unit that acquires a second symbolic execution result including a path condition indicating a sequence of conditional expressions for a second execution path when the input value is given to the second program, and a mathematical expression indicating a return value for the second execution path; a determination unit that determines a reliability that is an index of the reliability of a test result of the second program using the input value, based on whether or not a path condition in the first symbolic execution result acquired by the first acquisition unit includes a path condition in the second symbolic execution result acquired by the second acquisition unit, or whether or not the mathematical expressions in the first and second symbolic execution results match; and an output unit that outputs the reliability determined by the determination unit.

[0009] Also, a technique for providing a test data generation device, a test data generation method, and a program capable of reducing the man-hours required for testing a Web application (see Patent Document 3) has been proposed.

[0010] This technology is a test data generation device that generates test data for testing screen transitions provided by a Web application, comprising: a selection receiving means for receiving a selection of one or more screen transitions from among the screen transitions; an extraction means for analyzing source code of the Web application using a description specification of constraints stipulated or defined in a framework of the Web application, and extracting constraints from the source code; and a generation means for generating a plurality of test data that satisfy test viewpoints of equivalence partitioning and boundary value analysis using the constraints of an input form included in a screen that is the source of the selected screen transition.

[0011] The present invention relates to a test data generating device having the following. [Prior art documents] [Patent documents]

[0012] [Patent Document 1] JP 2014-21686 A [Patent Document 2] JP 2013-196350 A [Patent Document 3] JP 2020-67859 A Summary of the Invention [Problem to be solved by the invention]

[0013] By applying the above-mentioned prior art, it becomes possible to efficiently identify defects that occur during production operation. However, since the defect correction is done manually, there is a possibility of errors or omissions in the correction, or regressions.

[0014] In order to prevent these correction errors, it is important to test the corrected software. However, considering that the problem was not detected in the pre-operational test, the existing test code is not effective.

[0015] Therefore, new test code must be created. On the other hand, if the developer who modified the source code is also in charge of creating the test code, there is a high possibility that the same errors as in the source code will be embedded in the test code.

[0016] For this reason, source code reviews are usually performed by evaluators. However, since the evaluators review source code that already contains errors, they may fall into the same mindset as the developers and overlook errors.

[0017] In particular, when the software specifications are complex or ambiguous and there are multiple possible ways to implement the specifications, developers may modify the structure of the entire source code, rather than just the parts that are directly related to the defect, in order to improve the execution speed or readability of the source code.

[0018] As a result, there are cases where the corrected source code is configured with a control flow that branches under conditions different from the "input condition under which the defect occurs" (which can be identified by the technology of Patent Document 1). In such cases, the evaluator cannot correctly check whether the processing related to the "input condition under which the defect occurs" has been corrected without any omissions or additions, and there is a possibility that an error will be overlooked.

[0019] In addition, in the past, after a developer created test code, an evaluator would review the code, which meant it took a long time for source code modifications to be completed.

[0020] SUMMARY OF THE PRESENT EMBODIMENT An object of the present invention is to provide a technique for appropriately evaluating modified source code and efficiently avoiding oversights, errors, and the like in modifications. [Means for solving the problem]

[0021] The source code modification support device of the present invention that solves the above-mentioned problem is characterized by including: a storage device that stores updated source code updated by a developer based on input conditions that cause a malfunction; a process for generating a template including conditional branch statements for each case of success or failure of the input conditions as a template for evaluation code for evaluating the updated source code; a process for notifying a terminal of a specified evaluator of a request to create the evaluation code based on the template; a process for controlling access to the updated source code by the evaluator in response to the creation request; a process for accepting edits by the evaluator to the body of the conditional branch statements in the template; and a calculation device that executes processes of generating a list of input values ​​that execute all control paths of the evaluation code that has undergone the edits, and generating an evaluation code driver that automatically executes the evaluation code using the input values ​​as input.

[0022] In addition, the source code modification support method of the present invention is characterized in that an information processing device has a storage device for storing updated source code updated by a developer based on an input condition that causes a malfunction, and executes the following processes: generating a template including conditional branch statements for each case of success or failure of the input condition as a template for evaluation code for evaluating the updated source code; notifying a terminal of a specified evaluator of a request to create the evaluation code based on the template; controlling access to the updated source code by the evaluator in response to the creation request; accepting edits by the evaluator to the body of the conditional branch statements in the template; generating a list of input values ​​that execute all control paths of the evaluation code that has undergone the edits, and generating an evaluation code driver that automatically executes the evaluation code using the input values ​​as input. Effect of the Invention

[0023] According to the present invention, it is possible to appropriately evaluate the modified source code and efficiently avoid oversights, errors, and the like in the modifications. [Brief description of the drawings]

[0024] [Figure 1] 1 is a diagram illustrating a network configuration including a source code modification assistance device according to an embodiment of the present invention. [Diagram 2] FIG. 2 is a diagram illustrating an example of a hardware configuration of the source code modification support device according to the present embodiment. [Diagram 3] 1 is a diagram illustrating an example of a block configuration of a source code modification support device according to an embodiment of the present invention. [Figure 4] FIG. 2 is a conceptual diagram showing a flow of source code correction and evaluation in this embodiment. [Diagram 5] FIG. 2 is a diagram illustrating an example of a flow of a source code modification support method according to the present embodiment. [Figure 6] FIG. 2 is a diagram showing an example of the configuration of an evaluator address in this embodiment. [Figure 7] FIG. 2 is a diagram illustrating an example of a flow of a source code modification support method according to the present embodiment. [Figure 8] FIG. 13 is a diagram illustrating an example of source code in which a defect occurs in the present embodiment. [Figure 9] FIG. 10 is a diagram illustrating an example of updated source code in the present embodiment. [Figure 10] 11A and 11B are diagrams illustrating examples of input conditions that cause a malfunction in the present embodiment. [Figure 11] 1A and 1B are diagrams illustrating an example of a concept of source code before and after an update in this embodiment. [Figure 12] FIG. 13 is a diagram showing the significance of an evaluation code template in the present embodiment. [Figure 13] FIG. 4 is a diagram showing an example of an evaluation code template in the present embodiment. [Figure 14] FIG. 2 is a diagram illustrating an example of a flow of a source code modification support method according to the present embodiment. [Figure 15] FIG. 4 is a diagram illustrating an example of an evaluation code driver in the present embodiment. [Figure 16] FIG. 2 is a diagram illustrating an example of a flow of a source code modification support method according to the present embodiment. [Figure 17] FIG. 13 is a diagram showing an example of addition to an evaluation code template in the present embodiment. [Figure 18] FIG. 13 is a diagram showing an example of a branch condition combination review in the present embodiment. [Figure 19] FIG. 13 is a diagram showing an example of a branch condition combination review in the present embodiment. [Figure 20] FIG. 13 is a diagram showing an example of a branch condition combination review in the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0025] <System configuration> Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings. Fig. 1 is a diagram showing an example of a network configuration including a source code modification assistance device 100 according to the present embodiment. The source code modification assistance device 100 shown in Fig. 1 is a computer that appropriately evaluates source code after modification, and efficiently avoids omissions, errors, and the like in modifications.

[0026] 1, the source code modification assistance device 100 of this embodiment is communicably connected to a developer terminal 200 and an evaluator terminal 300 via a network 1. Therefore, these may be collectively referred to as a source code modification assistance system 10.

[0027] The developer terminal 200 is a terminal operated by a software developer. Specifically, it may be a smartphone, a tablet terminal, a personal computer, or the like. This developer corrects the input conditions that cause the problem, and also updates the source code in areas other than the corrected areas. The source code updated by the developer terminal 200, i.e., the updated source code, is provided to the source code correction support device 100 via the network 1.

[0028] The evaluator terminal 300 is a terminal operated by an evaluator in response to a request from the source code modification support device 100 of this embodiment. This request is a request to create an evaluation code based on a template of an evaluation code for evaluating the updated source code described above. The evaluator is a person different from the developer described above. The evaluator operates the evaluator terminal 300 and executes editing on the body of the conditional branch statement in the template described above. The evaluator terminal 300 provides the content of the editing by the evaluator to the source code modification support device 100.

[0029] <Hardware configuration> 2 shows the hardware configuration of the source code modification support device 100 according to this embodiment. That is, the source code modification support device 100 includes an external storage device 101, a memory 103, a CPU 104, an input device 105, a display device 106, a communication device 107, and an external media input / output device 108.

[0030] Of these, the external storage device 101 is configured with an appropriate non-volatile storage element such as an SSD (Solid State Drive) or a hard disk drive.

[0031] The memory 103 is composed of a volatile storage element such as a RAM.

[0032] The CPU 104 is a calculation device that reads out the program 102 held in the external storage device 101 into the memory 103 and executes the program, controls the device itself, and performs various types of judgment, calculation, and control processing.

[0033] The input device 105 is assumed to be a keyboard, mouse, microphone, or the like that accepts key input or voice input from the user.

[0034] The display device 106 is assumed to be a display that displays data processed by the CPU 104.

[0035] The communication device 107 is assumed to be a network interface card or the like that is connected to the network 1 and handles communication processing with the developer terminal 200 and the evaluator terminal 300 .

[0036] The external medium input / output device 108 is assumed to be an interface that connects to an external storage medium such as a DVD or a USB memory so as to be able to send and receive data.

[0037] The external storage device 101 also stores at least an evaluator address 125 (described later) in addition to a program 102 for implementing functions required for the source code modification assistance device of this embodiment. The external storage device 104 and memory 103 also temporarily hold a defect occurrence condition 126, an updated source code 127, a pre-update source code 128, and an evaluation code 129 at least according to the time required for processing.

[0038] <Functional configuration> Next, a description will be given of the configuration of the source code modification support device 100 of this embodiment. Fig. 3 is a diagram showing an example of a block configuration of the source code modification support device 100 of this embodiment. Fig. 4 is a conceptual diagram showing a flow of source code modification and evaluation in this embodiment.

[0039] The source code modification support device 100 of this embodiment includes an evaluation request function 110, an updated source code access control function 111, an evaluation code template generation function 112, an evaluation code editing function 113, an evaluation code editing support function 114, and an evaluation code driver generation function 115. Each of these functions is implemented by the CPU 104 executing the program 102.

[0040] In addition, in conjunction with the processing of each of the above-mentioned functions, the source code modification support device 100 stores each of the data items, such as an evaluator address 125, a defect occurrence input condition 126, an updated source code 127, a pre-update source code 128, and an evaluation code 129, in the external storage device 101 or the memory 103.

[0041] Among these, the evaluation request function 110 notifies the evaluator terminal 300 of the evaluator identified based on the evaluator address 125 of a request to create evaluation code 129 based on a template. This template is a template of evaluation code for evaluating updated source code 127. The updated source code 127 is source code that has been corrected and updated by the developer based on input conditions 126 that cause a defect.

[0042] The updated source code 127 is the result of corrections made by the developer to eliminate the defect based on the defect location and the input conditions of the defective source code, i.e., the source code before the update. This updated source code 127 is registered in the source code correction support device 100 from the developer terminal 200.

[0043] Among the functions of the source code modification support device 100, the updated source code access control function 111 controls the persons who can access the updated source code 127 to only the developer. This control can be assumed to be performed based on, for example, identification information of the developer stored in advance.

[0044] Moreover, the evaluation code template generating function 112 generates a template including conditional branch statements for each case of success or failure of the above-mentioned input condition 126 as a template of an evaluation code for evaluating the updated source code 127 .

[0045] Furthermore, the evaluation code editing function 113 accepts edits by the evaluator to the text of the conditional branch statements in the above-mentioned template.

[0046] In addition, the evaluation code editing support function 114 responds to the above-mentioned evaluator's judgment that a specific conditional branch statement based on a variable boundary value is unnecessary, taking into account the clauses constituting the path constraint condition obtained for the updated source code 127 and the conditional branch statements based on the variable boundary values ​​constituting the clauses, accepts an input to combine the conditional branch statements, and displays the result of combining the conditional branch statements on a screen. In addition, the evaluation code editing support function 114 accepts editing by the evaluator on the main text of the conditional branch statements on this screen display, and reflects the result of the editing in the above-mentioned template.

[0047] The evaluation code driver generation function 115 also generates a list of input values ​​that execute all control paths of the evaluation code edited by the evaluator, and generates an evaluation code driver that automatically executes the evaluation code using the input values ​​as input. The evaluation code driver generation function 115 also determines whether the branch conditions of the conditional branch statements created for the above-mentioned templates can be satisfied, and if the branch conditions cannot be satisfied, deletes the branch conditions.

[0048] <Flow example: Evaluation request function> The actual procedure of the source code modification support method in this embodiment will be described below with reference to the drawings. The various operations corresponding to the source code modification support method described below are realized by a program that is read into a memory or the like and executed by the source code modification support device 100. This program is composed of codes for performing the various operations described below.

[0049] 5 is a diagram showing an example of a flow of the revision support method according to this embodiment. In this case, the evaluation request function 110 of the revision support device 100 receives and detects the transmission of the updated source code 127 from the developer terminal 200 (s1).

[0050] Next, the evaluation request function 110 obtains the pre-update source code 128 corresponding to the updated source code 127, and the defect occurrence input condition 126 (s2).

[0051] For this process, the source code modification support device 100 is assumed to store an updated source code 127 and a pre-transmission source code 128 in association with each other in the external storage device 101. Also, the fault occurrence input condition 126 is assumed to be obtained by symbolic execution, which will be described later.

[0052] Next, the evaluation request function 110 acquires the evaluator address 125 from the external storage device 101 (s3). As shown in Fig. 6, the evaluator address 125 is a collection of records that link the address of the evaluator with an ID that uniquely identifies the evaluator as a key. In this case, the address is assumed to be an email address or an IP address assigned to the evaluator terminal 300.

[0053] Moreover, the evaluation request function 110 acquires an evaluation code template (s4) by executing an evaluation code template generation function 112. The process of the evaluation code template generation function 112 will be described in detail later.

[0054] Furthermore, the evaluation request function 110 transmits the pre-update source code 128, the defect occurrence input condition 126, and the evaluation code template obtained in s4 to the evaluator terminal 300 (s5), and ends the process.

[0055] <Flow example: Evaluation code template generation function> Next, a process flow in the evaluation code template generation function 112 will be described with reference to FIGS. 7 to 13. In this case, the evaluation code template of the source code modification support device 100 is The pattern generating function 112 generates a conditional branch statement based on whether the fault occurrence input condition 126 is satisfied (s10).

[0056] Moreover, the evaluation code template generating function 112 acquires boundary conditions of variables included in the fault occurrence input condition 126, the branch condition of the pre-update source code 128, or the branch condition of the updated source code 127 (s11).

[0057] A specific example of the above-mentioned pre-update source code 128 is shown in Fig. 8. This pre-update source code 128 is source code in which a defect has occurred. In the example shown in Fig. 8, when x=0 and y=0, the source code has a defect (specification inconsistency) in which "low" is obtained instead of "high" which should be the case.

[0058] A specific example of the updated source code 127 is shown in FIG. 9. This updated source code 127 is a source code that has been updated by the developer after correcting the relevant parts regarding the above-mentioned defects and reviewing the whole code in consideration of readability, etc. The error when dy==0 was corrected by the developer, but when (x<0 and y==0) or (x>0 and y==0), a so-called division by zero occurs. In other words, a new bug is inherent.

[0059] In this case, the evaluation code template generating function 112 executes symbolic execution on the updated source code 127 and obtains the input condition under which the defect occurs, that is, the defect occurrence input condition 126 (see FIG. 10).

[0060] FIG. 11 shows the defects in the source codes before and after the update shown in FIG. 8 to FIG. 10 by area on the xy coordinate plane. As already mentioned, the defect occurrence input condition 126 in the source code before the update 128 is the case of x=0, y=0, and the point on the origin coordinates corresponds to this defect. On the other hand, the defect occurrence input condition 126 in the updated source code 127 is the case of (x<0 and y==0) or (x>0 and y==0). and corresponds to the line segment domain other than x=0 on the y-axis.

[0061] The significance of generating an evaluation code template is shown in Fig. 12. As shown in Fig. 12, suppose that the defect occurrence input conditions 126 obtained by symbolically executing the pre-update source code 128 are "path constraint α", "path constraint β", and "path constraint γ".

[0062] When a developer modifies or updates the source code to eliminate this bug-causing input condition 126, the boundary of the bug-causing input condition 126 becomes hidden in the updated source code. Therefore, if only the updated source code 127 is reviewed, there is a high possibility that errors in the developer's modifications or updates will be overlooked. Therefore, it is significant to use an evaluation code template to reduce the overlooking of such modification errors.

[0063] Furthermore, the evaluation code template generation function 112 creates (s12) a relational expression between any two variables that constitute the fault occurrence input condition 126. In the example of the evaluation code template shown in Fig. 13, the relationship between variables x and y (x==y) is adopted as a branching condition.

[0064] In addition to the specific example of the relational equation between two variables, the example of evaluation code template shown in FIG. 13 also shows the generated and described state of branch conditions that specify branching at the fault occurrence input condition 126, the branch conditions that are specified by the boundary condition for the variable x, the branch conditions that are specified by the boundary condition for the variable y, the branch conditions that are specified by the boundary condition of the pre-update source code 128, and the like, for each case of whether the fault occurrence input condition is satisfied or not.

[0065] Next, the evaluation code template generating function 112 determines whether or not there is a branch condition for which the above-mentioned relational expression has not been created among the conditional branch statements created in the above-mentioned s10 (s13).

[0066] As a result of the above-mentioned determination, if there is no branch condition for which a relational expression has not been created (s13: No), the evaluation code template generating function 112 transitions the process to s18.

[0067] On the other hand, if the result of the above-mentioned determination is that there is a branch condition for which a relational expression has not been created (s13: Yes), the evaluation code template generating function 112 creates an arbitrary branch condition using the above-mentioned boundary conditions and relational expressions (s14).

[0068] Next, the evaluation code template generation function 112 judges whether the created branch condition can be satisfied (s15). This judgment may be performed using a known solver.

[0069] Furthermore, if the evaluation code template generating function 112 determines that the created branch condition is not satisfiable (s15: No), it deletes the unsatisfiable branch condition (s16) and transitions the process to s17.

[0070] On the other hand, if the above-mentioned determination result indicates that the created branch condition is satisfiable (s15: Yes),

[0071] The evaluation code template generating function 112 creates a conditional branch statement using the branch condition created in s10 in the body of the conditional branch statement based on the success or failure of the above-mentioned fault occurrence input condition 126 (s17), and returns the process to s13.

[0072] Moreover, the evaluation code template generating function 112 writes a procedure for returning the output result of the pre-update source code 128 into the body of the conditional branch statement in which the above-mentioned defect occurrence input condition 126 is satisfied (s18), and ends the process.

[0073] <Flow example: Evaluation code driver generation function> Next, the process flow of the evaluation code driver generation function 115 will be described with reference to Fig. 14 and Fig. 15. In this case, the evaluation code driver generation function 115 of the source code modification support device 100 executes symbolic execution on the evaluation code (s20). As a result, the evaluation code driver generation function 115 acquires all paths and creates test input values ​​that pass through the paths (Fig. 15).

[0074] Moreover, the evaluation code driver generating function 115 checks the satisfiability of the path constraint conditions obtained by the above-mentioned symbolic execution (FIG. 15: “symbolicExec(spec)”) to obtain a satisfying solution (s21).

[0075] Next, the evaluation code driver generating function 115 judges whether a satisfactory solution has been obtained as a result of s21 (s22).

[0076] As a result of the above-mentioned determination, if a satisfying solution is not obtained (s22: No), the evaluation code driver generation function 115 shifts the process to s24.

[0077] On the other hand, if a satisfying solution is obtained as a result of the above-mentioned judgment (s22: Yes), the evaluation code driver generation function 115 provides the above-mentioned satisfying solution as a test input value (FIG. 15: m) and generates an evaluation code. The source code (Figure 15: “spec”) is sent to the Oracle, and source code that executes the test of the updated source code 127 (Figure 15: main_updated(m[x],m[y])) is created (s23), and the process is terminated. do.

[0078] Next, the evaluation code driver generation function 115 deletes the execution paths that have no satisfying solutions from the evaluation code (s24), and ends the process.

[0079] <Flow example: Evaluation code editing support function> Next, the process flow in the above-mentioned evaluation code editing support function 114 will be described with reference to Fig. 16 to Fig. 20. In this case, the evaluation code editing support function 114 accepts the specification of a plurality of branch conditions from the evaluator terminal 300 on the display screen of the evaluation code (s30). In the view illustrated in Fig. 18, "if y==0" and "else" are specified, and the "Combine" button is pressed.

[0080] Furthermore, the evaluation code edit support function 114 checks the satisfiability of an expression obtained by combining the specified branch conditions with a logical sum in accordance with the above-mentioned designation and combination instruction using a known solver (s31).

[0081] Next, if the combined formula is not satisfiable as a result of the above-mentioned satisfiability check (s32: No), the evaluation code edit support function 114 ends the process.

[0082] On the other hand, if the result of the above judgment is that the condition is satisfiable (s32: Yes), the evaluation code editing support function 114 displays a conditional branch statement combining the specified branch conditions on the display screen of the evaluation code (s33). In the view illustrated in Fig. 19, the branch conditions specified in the above s30 are merged and displayed on the evaluator terminal 300.

[0083] Next, the evaluation code editing support function 114 receives an input of an expected output value from the evaluator for the body of the conditional branch statement (s34). The received output value is, for example, "return "x is high".

[0084] Furthermore, the evaluation code editing support function 114 adds the expected output value to the body of the conditional branch statement to be merged in the evaluation code (s35), and ends the process. In the view illustrated in Fig. 19, the output value (expected value) input from the evaluator terminal 300, "return "x is high", is added to the above-mentioned merged conditional branch statement. Note that, as shown in Fig. 20, the evaluation code editing support function 114 performs the above-mentioned merging only on the view, and does not perform merging on the actual code.

[0085] Although the best mode for carrying out the present invention has been specifically described above, the present invention is not limited to this, and various modifications are possible without departing from the spirit and scope of the present invention.

[0086] According to this embodiment, a user other than the developer evaluates the corrected source code without preconceptions, so there is a low possibility of overlooking correction errors. In addition, since the logical and numerical boundaries of input conditions that cause defects can be evaluated without omission, there is a low possibility of overlooking correction errors, correction mistakes, and regressions (hereinafter collectively referred to as correction errors). Furthermore, the evaluation work, which was previously performed in two steps, test code creation and code review, can be shortened to one step, evaluation code creation, thereby reducing the time required for source code correction.

[0087] In other words, the modified source code can be appropriately evaluated, and correction omissions, errors, and the like can be efficiently avoided.

[0088] The description of this specification makes at least the following clear: That is, in the source code modification assistance device of this embodiment, the arithmetic device may, when generating the template, describe in the body of the conditional branch statement for when the input condition is not satisfied, a procedure for evaluating whether an output result of the source code before the update and an output result of the updated source code match.

[0089] This makes it possible to efficiently verify the consistency between source code before and after the update from the output value, and ultimately to appropriately evaluate the source code after the update, thereby more efficiently avoiding oversights or errors in the correction.

[0090] In addition, in the source code modification support device of this embodiment, the arithmetic device, when generating the template, may be configured to write, for each case of success or failure of the input condition, clauses constituting path constraint conditions obtained by performing symbolic execution on the source code before the update, and conditional branch statements based on boundary values ​​of variables constituting the clauses.

[0091] This makes it possible to describe conditional branching at the boundary condition of the bug occurrence condition and perform regression testing at the boundary value of the bug occurrence, even if the bug occurrence condition before the update is not satisfied. This in turn makes it possible to appropriately evaluate the source code after the update and to more efficiently avoid missing or making mistakes in the corrections.

[0092] In addition, in the source code modification support device of this embodiment, the arithmetic device may, when generating the template, write, for each case of success or failure of the input condition, a clause constituting a path constraint condition obtained by performing symbolic execution on the updated source code, and a conditional branch statement based on boundary values ​​of variables constituting the clause.

[0093] According to this, it becomes easier to accurately avoid missing corrections, etc. by evaluating the logic boundaries and numerical boundaries of input conditions that cause defects without omissions. Furthermore, it becomes possible to more efficiently avoid missing corrections, errors, etc. by appropriately evaluating the source code after correction.

[0094] In addition, in the source code modification assistance device of this embodiment, the arithmetic device may, when generating the template, write a conditional branch statement based on a relational expression between any two variables constituting the input condition, for each case of whether the input condition is satisfied or not.

[0095] This allows you to write conditional branches that take into account the relationships between variables, making it easier to accurately avoid oversights in corrections, etc. Furthermore, it allows you to appropriately evaluate the source code after correction, making it more efficient to avoid oversights and errors in corrections, etc.

[0096] Furthermore, in the source code modification assistance device of this embodiment, the arithmetic device may be configured to, in response to a judgment by the evaluator that a specific conditional branch statement based on boundary values ​​of variables constituting the clauses that constitute path constraint conditions obtained for the updated source code and a conditional branch statement based on boundary values ​​of the variables constituting the clauses is unnecessary, accept an input to combine the conditional branch statements and display the result of combining the conditional branch statements on a screen, and accept edits by the evaluator to the body of the conditional branch statement on the screen display and reflect the result of the edit in the template.

[0097] This makes it possible to accurately and efficiently delete unnecessary conditional branch statements, and by doing so, it is possible to appropriately evaluate the source code after correction, and to more efficiently avoid oversights or errors in correction.

[0098] In the source code modification support device of this embodiment, the arithmetic unit The possibility of satisfying the branch condition of the conditional branch statement created for the above may be determined, and if the branch condition cannot be satisfied, the branch condition may be deleted.

[0099] This makes it possible to efficiently maintain the quality of the templates and the evaluation code based on them, and ultimately to efficiently avoid oversights and errors in corrections by appropriately evaluating the modified source code. [Explanation of symbols]

[0100] 1 Network 10. Source Code Modification Support System 100 Source code modification support device 101 External storage device 102 Programs 103 Memory 104 CPU (computing unit) 105 Input Device 106 Display device 107 Communication Equipment 108 External media input / output device 110 Evaluation request function 111 Updated source code access control features 112 Evaluation code template generation function 113 Evaluation code editing function 114 Evaluation code editing support function 115 Evaluation code driver generation function 125 Rater Address 126 Malfunction occurrence input conditions 127 Updated Source Code 128 Source code before update 129 Evaluation Code 200 Developer Terminals 300 Evaluator terminal

Claims

1. A storage device that stores updated source code updated by a developer based on an input condition that causes a defect; a computing device that executes a process of generating a template including conditional branch statements for each case of success or failure of the input conditions as a template of an evaluation code for evaluating the updated source code, a process of notifying a terminal of a predetermined evaluator of a request to create the evaluation code based on the template, a process of controlling access to the updated source code by the evaluator in response to the creation request, a process of accepting edits by the evaluator to the body of the conditional branch statement in the template, and a process of generating a list of input values ​​that execute all control paths of the evaluation code that has undergone the edits, and generating an evaluation code driver that automatically executes the evaluation code using the input values ​​as input; A source code modification support device comprising:

2. The computing device includes: In generating the template, a procedure is described in the body of the conditional branch statement for when the input condition is not satisfied, for evaluating whether an output result of the source code before the update matches an output result of the source code after the update.

2. The source code modification support device according to claim 1.

3. The computing device includes: In generating the template, for each case of success or failure of the input condition, a clause constituting a path constraint condition obtained by performing symbolic execution on the source code before the update and a conditional branch statement based on a boundary value of a variable constituting the clause are described.

2. The source code modification support device according to claim 1.

4. The computing device includes: In generating the template, for each case of success or failure of the input condition, a clause constituting a path constraint condition obtained by performing symbolic execution on the updated source code and a conditional branch statement based on a boundary value of a variable constituting the clause are described.

2. The source code modification support device according to claim 1.

5. The computing device includes: When generating the template, a conditional branch statement based on a relational expression between any two variables constituting the input condition is described for each case of whether the input condition is satisfied or not.

2. The source code modification support device according to claim 1.

6. The computing device includes: a process of accepting an input for combining the conditional branch statements in response to a determination by the evaluator that a specific conditional branch statement based on a boundary value of a variable is unnecessary, based on the clauses constituting a path constraint condition obtained for the updated source code and the conditional branch statements based on the boundary values ​​of the variables constituting the clauses, and displaying a result of combining the conditional branch statements on a screen; accepting edits by the evaluator to the body of the conditional branch statement on the screen display, and executing a process of reflecting the results of the edits in the template.

2. The source code modification support device according to claim 1.

7. The computing device includes: A determination is made as to whether a branch condition of a conditional branch statement created for the template can be satisfied, and if the branch condition cannot be satisfied, the branch condition is deleted.

2. The source code modification support device according to claim 1.

8. An information processing device, A storage device is provided for storing updated source code updated by a developer based on an input condition in which a defect occurs, a process of generating a template including conditional branch statements for each case of success or failure of the input conditions as a template of an evaluation code for evaluating the updated source code, a process of notifying a predetermined evaluator's terminal of a request to create the evaluation code based on the template, a process of controlling access to the updated source code by the evaluator in response to the creation request, a process of accepting edits by the evaluator to the body of the conditional branch statements in the template, a process of generating a list of input values ​​that execute all control paths of the evaluation code that has undergone the edits, and a process of generating an evaluation code driver that automatically executes the evaluation code using the input values ​​as inputs; A source code revision support method comprising the steps of:

Citation Information

Patent Citations

  • Test item preparing device

    JP1993210537A

  • Automatic test execution system

    JP2009217664A

  • Programming language processing method

    JP2010266909A

  • Information processor, information processing method and information processing program

    JP2013196350A

  • Test data generation device, program and method

    JP2014021686A