The present application claims priority from Japanese application P2004-302532 filed on Oct. 18, 2004, the content of which is hereby incorporated by reference into this application.
The present invention relates to a technique of supporting program development.
As a technique of supporting understanding of a program, there is a technique called re-engineering for visualizing program structure of a source program. For example, in the case of re-engineering described in Japanese Non-examined Laid-Open No. 5-313870 (hereinafter, referred to as Patent Document 1), a source program is analyzed to generate program instruction analysis information and comment part analysis information. Then, from the generated program instruction analysis information and comment part analysis information, is generated program structure element information that specifies program structure elements. Further, from the program structure element information, is generated a program structure diagram on which comments in the source program are reflected appropriately. Thus, it is possible to express an outline and meaning of the source program without directly expressing individual instructions of the source program in detail, and the source program becomes more understandable.
Further, there is a technique called knowledge management for sharing information (knowledge) required for work. For example, knowledge management described in Japanese Non-examined Laid-Open No. 2004-62707 (hereinafter, referred to as Patent Document 2) generates a common template and a differential template. The common template defines common items in working such as working procedures, programs, know-how and the like, while the differential template is generated as information that is not defined in the common template. Knowledge is accumulated by accumulating new information in the work carried out using the common template in the differential template. It is also possible to generate failure information that indicates countermeasures used against similar past failures accumulated as the knowledge. By presenting failure information to a program developer, it is possible to support devising of program failure prevention measures.
Generally speaking, a computer program has a different use frequency and complexity at each part of the program. However, the above-described re-engineering and knowledge management do not consider this fact. Accordingly, when these techniques are used for supporting program development, a program developer spends the same man-hours for performing analysis, changes, verification and the like of a more important part (i.e., parts that have a high probability of failure occurrence or that are greatly affected by modification) of a program as a less important part. Thus, this results in man-hour shortage for developing a more important part and man-hour excess for developing a less important part. Further, in the case where there exist a plurality of countermeasures against a certain failure in a program under development and each countermeasure means a modification of a different part of the program, it is possible that a developer of the program modifies a more important part of the program and, as a result, man-hours needed for future development or maintenance becomes larger.
The present invention has been made taking the above-described circumstances into consideration, and an object of the present invention is to support program development, by presenting importance of each part of a program.
To solve the above problem, the present invention analyzes a source program to generate, for each part of the program, metrics information that indicates influence of that part on other parts. Further, program's failure report document data are analyzed to generate, for each failure, failure information that indicates a corrected part of the program to cope with the failure and influence of the failure on a user of the program. Then, for each part of the program, importance that indicates a size of program development man-hours to be allocated to that part is determined based on the metrics information of the part in question and the failure information of a failure against which the part in question is corrected.
For example, the present invention provides a program development support system, which supports development of a program, comprising: a metrics information storing means that stores metrics information for each part of the program, the metrics information indicating complexity of the part in relation to other parts of the program; a failure information storing means that stores failure information for each failure occurring in the program, the failure information indicating a corrected part of the program to cope with the failure and influence of the failure on a program user; an operation means that determines importance of each part of the program, using the complexity indicated by the metrics information of the part in question and the influence indicated by the failure information of each failure against which the part in question is to be corrected as a countermeasure, the importance indicating a size of program development man-hours to be allocated to the part in question; and an importance output means that outputs the importance determined by the operation means for each part of the program.
According to the present invention, for each part of a program, importance indicating a size of program development man-hours to be allocated is determined. Even then a program developer designs a program with the same total development man-hours in comparison with the conventional methods, it is possible to reduce failures that have large effects by using more man-hours for more important parts in the program. Accordingly, a high quality program can be developed. Further, it is possible to select a failure countermeasure that corrects less important parts of a program, and as a result, it is possible to reduce the probability of future increase of development and maintenance man-hours.
Now, will be described embodiments of the present invention.
The program development support system of the present embodiment receives, as its input, a source program and failure report document data that indicates failures of the source program generated from its development process, and outputs a piece of knowledge, namely, importance of (i.e., a size of program development man-hours to be allocated to) each of functions constituting the program. As shown in the figure, the program development support system comprises an input/output part 1, an operation part 2, and a storage part 3.
The input/output part 1 receives, as its input, various pieces of information including the source program and the failure report document data, and instructions of a user (a program developer), and outputs the knowledge including the importance of each function as a constituent of the program and other information.
The storage part 3 comprises a source program storage part 31, a metrics information storage part 32, a failure report document storage part 33, a failure information storage part 34, a failure correction difficulty information storage part 35, and a knowledge information storage part 36.
The source program storage part 31 stores the source program inputted into the input/output part 1.
In the example of the source program shown in
The metrics information storage part 32 stores metrics information for each part of the source program. The metrics information indicates influence of the part in question on other parts. The metrics information storage part 32 has a function metrics information table 321 and a table metrics information table 322.
The failure report document storage part 33 stores failure report document data inputted into the input/output part 1.
The example of failure report document data shown in
The failure information storage part 34 has a failure information table 341.
As shown in the figure, the failure information table 341 registers, for each failure of the program, a record 3410 of failure information that includes a program content corrected to cope with the failure and influence (a degree of influence on the customer) of the failure. Each record 3410 includes a field 3411 which registers a failure number uniquely given to each failure, a field 3412 which registers names of functions corrected to cope with the failure, a field 3413 which registers the number of the functions corrected to cope with the failure, a field 3414 which registers names of tables corrected to cope with the failure, a field 3415 which registers the number of tables corrected to cope with the failure, and a field 3416 which registers influence of the failure.
The failure correction difficulty information storage part 35 has a failure correction difficulty information table 351.
As shown in the figure, the failure correction difficulty information table 351 registers, for each failure of the program, a record 3510 of failure correction difficulty information that includes difficulty of failure correction and influence (a degree of influence on the customer) of the failure. Each record 3510 includes a field 3511 which registers a failure number, a field 3512 which registers difficulty of failure correction, and a field 3513 which registers influence of the failure concerned.
The knowledge information storage part 36 has a function importance table 361.
As shown in the figure, the function importance table 361 registers, for each function described in the program, a record 3610 of function importance information that includes importance of (i.e., a size of program development man-hours to be allocated to) the function. Each record 3610 includes a field 3611 which registers a name of a function, a field 3612 which registers importance of the function, a field 3613 which registers a general level to which the function's importance belongs, and a field 3614 which registers the order of man-hours to be allocated to the function.
Now,
The program development support system having the above-described configuration can be realized on an ordinary computer system comprising, for example as shown in
Next, will be described operation of the program development support system having the above configuration.
First, the input/output part 1 examines whether the source program storage part 31 stores a source program (S10). In the case where the source program storage part 31 does not store a source program, the input/output part 1 requests the user to input a source program. The inputted source program is stored into the source program storage part 31 (S11). Further, the input/output part 1 examines whether the failure report document storage part 33 stores at least one piece of failure report document data (S12). In the case where the failure report document storage part 33 does not store failure report document data, the input/output part 1 requests the user to input at least one piece of failure report document data. The inputted failure report document data is stored into the failure report document storage part 33 (S13).
Now, in the case where the source program storage part 31 stores the source program and the failure report document storage part 33 stores at least one piece of failure report document data, the source analysis part 21 performs source program analysis processing. Namely, the source analysis part 21 analyzes the source program to generate a function metrics information table 321 and a table metrics information table 322, and stores these tables 321 and 322 into the metrics information storage part 32 (S14).
First, the source analysis part 21 reads the source program from the source program storage part 31. Then, the source analysis part 21 detects a function declaration part that has not been noticed yet, from the source program, and determines the detected part as a noticed function declaration part (S1401). For example, in the case of the source program shown in
Next, the source analysis part 21 searches the source program for call initiation functions that call the function declared in the noticed function declaration part (S1403). In detail, the source analysis part 21 identifies all the function declaration parts of the source program, except the noticed function declaration part. Then, for each identified function declaration part, it is examined whether the identified function declaration part in question calls the function declared in the noticed function declaration part. For example, in the case where the source program is one shown in
Further, the source analysis part 21 searches the noticed function declaration part for call destination functions, read reference tables and write reference tables (S1404). For example, in the case where the source program is one shown in
Next, the source analysis part 21 registers the number of the call initiation functions, the number of the call destination functions, the number of the read reference tables and the number of the write reference tables searched for in S1403 and S1404 into the fields 3212-3215 of the record 3210 of function metrics information added in S1402 (S1405).
Then, the source analysis part 21 examines whether the source program has a function declaration part that has not been noticed yet (S1406). In the case where there exists a function declaration part that has not been noticed yet, the flow returns to S1401. Otherwise, the flow proceeds to S1407.
According to the processing of S1401-S1406, a record 3210 of function metrics information is generated for each function declaration part of the source program. As a result, the metrics information storage part 32 stores the function metrics information table 321 as shown in
Next, in S1407, the source program analysis part 21 detects a table declaration part that has not been noticed yet, from the source program, and determines the detected part as a noticed table declaration part. For example, in the case of the source program shown in
Next, the source analysis part 21 adds a record 3220 to the table metrics information table 322 (the number of records is 0 in the initialized state), and registers the name of the table declared in the noticed table declaration part into the field 3221 of this record 3220 (S1408).
Next, the source analysis part 21 searches the source program for read reference functions for which the table declared in the noticed table declaration part becomes an object of Read Reference and write reference functions for which the table in question becomes an object of Write Reference (S1409). In detail, the source analysis part 21 identifies all the function declaration parts of the source program, and then, for each function declaration part, examines whether the function declaration part in question refers to the table declared in the noticed table declaration part. For example, in the case where the source program is one shown in
Next, the source analysis part 21 registers the numbers of the read reference functions and write reference functions retrieved in S1409 respectively into the fields 3222 and 3223 of the record 3220 of table metrics information added in S1408 (S1410).
Then, the source analysis part 21 examines whether the source program has a table declaration part that has not been noticed yet (S1411). In the case where there exists a table declaration part that has not been noticed yet, the flow returns to S1407. Otherwise, the flow is ended. According to the processing of S1407-S1411, a record 3220 of table metrics information is generated for each table declaration part of the source program. As a result, the metrics information storage part 321 stores the table metrics information table 322 as shown in
Now,
First, the document analysis part 22 reads one piece of failure report document data that have not been noticed yet from the failure report document storage part 33, and determines the read data as a noticed document (S1501). Next, the document analysis part 22 adds a record 3410 to the failure information table 341 (the number of records is 0 in the initialized state), and registers a unique failure number (for example, a serial number) into the field 3411 of this record 3410 (S1502).
Next, the document analysis part 22 extracts “influence”, “names of functions corrected”, “number of the functions corrected”, “names of tables corrected” and “number of the tables corrected” registered in the fields 3308-3312 of the noticed document (S1503). For example, in the case where the noticed document is one shown in
Next, the document analysis part 22 registers “names of functions corrected”, “number of the functions corrected”, “names of tables corrected” and “number of the tables corrected” into the fields 3412-3416 of the record 3410 of failure information added in S1502 (S1504).
Then, the document analysis part 22 examines whether the failure report document storage part 33 stores failure document data that have not been noticed yet (S1505). In the case where the failure report document storage part 33 stores such data, the flow returns to S1501. Otherwise, this flow is ended. According to the above processing, a record 3410 of failure information is generated for each piece of failure report document data stored in the failure report document storage part 33. As a result, the failure information storage part 34 stores the failure information table 341 as shown in
Now,
First, the failure correction difficulty analysis part 23 detects a failure information record 3410 that has not been noticed yet, from the failure information table 341 stored in the failure information storage part 34, and determines the detected record as a noticed record (S1601). Next, the failure correction difficulty analysis part 23 initializes a parent-child function number that indicates the number of functions in parent-child relationship with the functions corrected to cope with the failure corresponding to the noticed record 3410, whereby the parent-child function number is set to zero (S1602). Next, from the field 3412 of the noticed record 3410, the failure correction difficulty analysis part 23 extracts one “name of the function corrected” that has not been extracted yet (S1603). For example, in the case where the record 3410 having the failure number “2” shown in
Then, the failure correction difficulty analysis part 23 examines whether there exists a “name of a function corrected” that has not been extracted yet in the field 3412 of the noticed record 3410 (S1606). In the case where there exists such a function name, the flow returns to S1603. Otherwise, the flow proceeds to S1607.
In S1607, the failure correction difficulty analysis part 23 initializes a table reference function number that indicates the number of functions referring to the tables corrected to cope with the failure corresponding to the noticed record 3410, whereby the table reference function number is set to zero. Next, from the field 3414 of the noticed record 3410, the failure correction difficulty analysis part 23 extracts one “name of the table corrected” that has not been extracted yet (S1608). For example, in the case where the record 3410 having the failure number “2” shown in
Now, the failure correction difficulty analysis part 23 examines whether there exists a “name of a table corrected” that has not been extracted in the field 3414 of the noticed record 3410 (S1611). In the case where there exists such a table name, the flow returns to S1608. Otherwise, the flow proceeds to S1612.
In S1612, the failure correction difficulty analysis part 23 calculates the sum of the parent-child function number and the table reference function number obtained according to the above processing, and determines the obtained sum as failure correction difficulty for indicating difficulty in coping with the failure corresponding to the noticed record 3410. Then, the failure correction difficulty analysis part 23 adds a record 3510 to the failure correction difficulty information table 351, and registers the failure number registered in the field 3411 of the noticed record 3410 into the field 3511, the failure correction difficulty calculated in S1612 into the field 3512, and the influence registered in the field 3416 of the noticed record into the field 3513 (S1613).
Then, the failure correction difficulty analysis part 23 examines whether there exists a failure information record that has not been noticed yet in the failure information table 341 (S1614). In the case where there exists a record that has not been noticed yet, the flow returns to S1601. Otherwise, this flow is ended. As a result, the failure correction difficulty information storage part 35 stores the failure correction difficulty information table 351 as shown in
Here,
First, the importance determination part 24 detects a function metrics information record 3210 that has not been noticed yet from the function metrics information table 321 stored in the metrics information storage part 32, and determines the detected record as a noticed record (S1701). Next, the importance determination part 24 calculates the sum of “the number of the call initiation functions”, “the number of the call destination functions”, “the number of the read reference tables” and “the number of write reference tables” registered in the fields 3212-3215 of the noticed record 3210, and determines this sum as static complexity that indicates intensity of the relationship of the function of the noticed record with other functions and tables (S1702). For example, in the case where the notice record is the record 3210 having the function name “func1” shown in
Next, the importance determination part 24 initializes actual failure quality that indicates influence of the failure against which the function of the noticed record 3210 has been corrected as a countermeasure and difficulty of that countermeasure, whereby the actual failure quality is set to zero (S1703). Then, from the failure information table 341 stored in the failure information storage part 34, the importance determination part 24 extracts one failure information record 3410 that has the field 3412 registering, as the “name of the function corrected”, the “function name” registered in the field 3211 of the noticed record 3210 and that has not been extracted yet (S1704). For example, in the case where the noticed record is the record 3210 having the function name “func1” shown in
Then, the importance determination part 24 detects the failure correction difficulty information record 3510 whose field 3511 registers the failure number registered in the field 3411 of the extracted failure information record 3410, and determines the detected record 3510 as a noticed difficulty record (S1705). For example, in the case where the record 3410 having the failure number “1” shown in
Next, the importance determination part 24 calculates the product of the failure correction difficulty and the influence registered respectively in the fields 3512 and 3513 of the noticed difficulty record, and adds the calculated product to the actual failure quality (S1706). For example, in the case where the noticed difficulty record is the record 3510 having the failure number “1” shown in
Then, the importance determination part 24 examines whether there exists a failure information record 3410 that has the field 3412 registering, as the “name of the function corrected”, the “function name” registered in the field 3211 of the noticed record and that has not been extracted yet (S1707). In the case where there exists such a record 3410, the flow returns to S1704. Otherwise, the flow proceeds to S1708. In S1708, the importance determination part 24 calculates the product of the actual failure quality and the static complexity obtained in S1702, and determines the calculated product as function importance of the function of the noticed record 3210. The function importance indicates the size of program development man-hours to be allocated to the function concerned. Next, the importance determination part 24 adds a record 3610 to the function importance table 361 (the number of records is 0 in the initialized state), and registers the function name of the noticed record into the field 3611 of this record 3610, and the function importance calculated in S1708 into the field 3612 (S1709).
Then, the importance determination part 24 examines whether there exists a function metrics information record 3210 that has not been noticed yet in the function metrics information table 321 (S1710). In the case where there exists such a record, the flow returns to S1701. Otherwise, the flow proceeds to S1711.
In S1711, the importance determination part 24 sorts the records 3610 in the function importance table 361 in the descending order of the function importance registered in the field 3612 of each record 3610, and registers the order into the field 3614 of each record 3610. Further, the importance determination part 24 registers a level into the field 3613 of each record, according to a certain rule. For example, the records 3610 of the function importance table 361 are classified into five levels (levels A, B, C, D and E, with A being the most important level and E the least important level) according to the magnitude of the function importance, and the level of each record is registered. Thereafter, the flow is ended.
As described above, the function importance table 361 as shown in
The description will be continued referring to
For example, for each function whose record 3610 is registered in the function importance table 361, the function importance is shown on a display.
The above-mentioned function call relation diagram is a graph showing static function call relationships between functions. Further, the simplified function specification is a table showing information such as a function name, operation of the function, names of arguments, meanings of the arguments, and the like obtained from the source program and its comments. Information required for generating the function call relation diagram and the simplified function specifications may be detected when the source analysis part 21 analyzes the source program, and stored, for each function, into the metrics information storage part 32.
Hereinafter, one embodiment of the present invention has been described.
According to the above embodiment, function importance of each function of a program is outputted. Thus, a user (a program developer) can refer to the function importance, and design a program by allocating more man-hours to more important parts of the program (i.e., parts that have higher error frequencies or that largely affect other parts when they are modified) in comparison with less important parts. As a result, it is possible with the same man-hours to decrease failures that has large influence, in comparison with the conventional techniques. As a result, it is possible to develop a high quality program. Further, in the case where there are two or more methods of correcting a failure and each method corrects a different part of the program, it is possible to select a method that corrects less important part. As a result, it is possible to previously reduce a probability of failure occurrence of an important failure. As a result, the total man-hours of development and maintenance can be reduced.
Having described the preferred embodiment of the invention with reference to the accompanying drawings, it is to be understood that the invention is not limited to the above embodiment and that various changes and modifications could be effected therein by one skilled in the art without departing from the spirit or scope of the invention as defined in the appended claims. For example, in S1612 of the failure correction difficulty analysis processing shown in
Number | Date | Country | Kind |
---|---|---|---|
2004-302532 | Oct 2004 | JP | national |