JP2012230512A - System for displaying correspondence table between change frequency in each function in source code and complexity - Google Patents

System for displaying correspondence table between change frequency in each function in source code and complexity Download PDF

Info

Publication number
JP2012230512A
JP2012230512A JP2011097774A JP2011097774A JP2012230512A JP 2012230512 A JP2012230512 A JP 2012230512A JP 2011097774 A JP2011097774 A JP 2011097774A JP 2011097774 A JP2011097774 A JP 2011097774A JP 2012230512 A JP2012230512 A JP 2012230512A
Authority
JP
Japan
Prior art keywords
row
function
column
stored
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2011097774A
Other languages
Japanese (ja)
Inventor
Fumio Tanaka
史生 田中
Tsuneo Kikuchi
恒男 菊池
Yasushi Kono
安志 河野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2011097774A priority Critical patent/JP2012230512A/en
Publication of JP2012230512A publication Critical patent/JP2012230512A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To solve such problems that in a source code managed by a source code configuration management system already adopted has no means for confirming which function in a source file is changed, and since complexity of static analysis information is information in each function, and a program developer cannot simultaneously view change information and complexity information when grasping a source code to be improved and cannot grasp the source code to be preferentially improved.SOLUTION: A source file of each revision is acquired from the source code configuration management system and the contents of the source file are divided into functions. Information of the contents of a row in which differential information of the revision is changed, deleted or added and the information of a row number are acquired from the source code configuration management system to grasp which function is changed. Change information of each function is created and the change information is displayed in combination with the complexity of the static analysis information of each function.

Description

本発明は、C言語のソースコードにおける関数ごとの複雑度と変更情報を表示するシステムに関するものである。   The present invention relates to a system for displaying complexity and change information for each function in C language source code.

ソースコード構成管理システムは、ソースコードをファイルごとに管理し、ファイルごとの変更履歴を確認することができる。例えば、1ソースファイルについて2つのリビジョン間における変更・削除・追加された行を取得できる。過去に変更回数が多いソースファイルは、今後も変更が多い可能性が高い。   The source code configuration management system can manage the source code for each file and check the change history for each file. For example, a changed / deleted / added line between two revisions can be acquired for one source file. Source files that have been modified frequently in the past are likely to be modified in the future.

関数の複雑度は、ソースコード内の各関数についてのプログラム構造の複雑度である。複雑度が高いソースコードは、そのソースコードを継続管理していく上で変更が発生した場合に、作業時間がかかる可能性が高い。   The function complexity is the complexity of the program structure for each function in the source code. A source code with a high degree of complexity is likely to take work time if a change occurs in the continuous management of the source code.

複雑度は改善すべき関数を決定する指針の1つであり、プログラム開発者は、複雑度が高い関数に対してプログラム構造を見直すが、変更を行う可能性が高いソースコード部分を優先して見直していく必要がある。   Complexity is one of the guidelines for determining the functions to be improved, and the program developer reviews the program structure for functions with high complexity, but gives priority to the source code part that is likely to be changed. It is necessary to review.

特開2008−0212442号公報(特許文献1)に開示された、ソースコード修正優先度付けシステムおよびその優先度付け方法では、ソースコード修正の優先度付けがされるが、ソースコード構成管理システムに独自の構成管理データベースを持つ方式のため、既に使用されているソースコード構成管理システムで管理しているソースコードに対して適用できないという問題がある。   In the source code modification prioritization system and the prioritization method disclosed in Japanese Patent Laid-Open No. 2008-0212442 (Patent Document 1), prioritization of source code modification is performed. Since the system has its own configuration management database, there is a problem that it cannot be applied to source code managed by a source code configuration management system that has already been used.

特開2008−0212442号公報JP 2008-0212442 A

既に使用されているソースコード構成管理システムで管理しているソースコードでは、ソースコード構成管理システムから取得できる変更履歴はソースファイル単位のため、ソースファイル内のどの関数が変更されたのかを確認する手段がない。   In the source code managed by the source code configuration management system that is already used, the change history that can be obtained from the source code configuration management system is the source file unit, so check which function in the source file has been changed. There is no means.

本発明が解決する課題は、既存のソースコード構成管理システムのソースファイルの変更履歴情報と、関数ごとの情報である静的解析情報の複雑度とから、関数ごとの変更情報と複雑度を結合して表示することにより、プログラム開発者が見直すべきソースコードを把握することができることである。   The problem to be solved by the present invention is to combine the change information and complexity for each function from the change history information of the source file of the existing source code configuration management system and the complexity of the static analysis information that is information for each function. This means that the program developer can grasp the source code that should be reviewed.

本発明のシステムは、ソースコード構成管理システムを持つ。ソースコード構成管理システムに作成・変更したソースファイルを登録すると、登録時にリビジョンが付加される。ソースコード構成管理システムは、各リビジョンのソースファイルを出力することができる。また、1ソースファイルの2つのリビジョン間の差分情報を出力することができる。差分情報には、リビジョン間で変更・削除・追加された行の内容および行番号を含む。   The system of the present invention has a source code configuration management system. When a created / changed source file is registered in the source code configuration management system, a revision is added at the time of registration. The source code configuration management system can output a source file of each revision. Also, difference information between two revisions of one source file can be output. The difference information includes the contents and line numbers of the lines changed / deleted / added between revisions.

各リビジョンのソースファイルをソースコード構成管理システムから取得し、ソースファイル内を関数に分割する。次にそのリビジョンの差分情報の変更・削除・追加された行の内容および行番号の情報をソースコード構成管理システムから取得し、どの関数が変更されたかを把握する。   The source file of each revision is acquired from the source code configuration management system, and the source file is divided into functions. Next, information on the contents and line numbers of changed / deleted / added difference information of the revision is acquired from the source code configuration management system, and it is understood which function has been changed.

関数ごとの変更情報を作成することにより、関数ごとの静的解析情報の複雑度と結合して表示することが出来る。   By creating change information for each function, it can be displayed in combination with the complexity of static analysis information for each function.

本発明のシステムにより、関数ごとの変更情報と複雑度を結合して表示することで、プログラム開発者は見直すべきソースコードを把握することができる。   By combining and displaying change information and complexity for each function by the system of the present invention, the program developer can grasp the source code to be reviewed.

表示システムの構成図。The block diagram of a display system. 差分情報の例。An example of difference information. テーブル1の例。Example of Table 1. テーブル2の例。Example of Table 2. テーブル3の例。Example of Table 3. テーブル4の例。Example of Table 4. テーブル5の例。Example of Table 5. テーブル6の例。Example of table 6. テーブル7の例。Example of Table 7. テーブル8の例。Example of table 8. テーブル9の例。Example of table 9. 関数の変更回数と複雑度の一覧を表示する処理の処理フロー図。The processing flow figure of the process which displays the list of function change frequency and complexity. 差分情報から変更前後のリビジョンについて変更範囲を解析する処理の処理フロー図。The processing flowchart of the process which analyzes the change range about the revision before and behind change from difference information. リビジョン間の変更範囲の情報をテーブル3に格納する処理の処理フロー図。FIG. 10 is a processing flow diagram of processing for storing information on the range of change between revisions in Table 3. ソースコードを字句解析してテーブル4に格納する処理の処理フロー図。FIG. 6 is a processing flow diagram of processing for lexical analysis of source code and storing in table 4. 字句解析して得られたトークンから関数の開始行番号を解析する処理の処理フロー図。The processing flow figure of the process which analyzes the starting line number of a function from the token obtained by lexical analysis. 字句解析して得られたトークンから関数の終了行番号を解析する処理の処理フロー図。The processing flow figure of the process which analyzes the end line number of a function from the token obtained by lexical analysis. テーブル3の各行について変更開始行番号列と変更終了行番号列の値を取り出す処理の処理フロー図。The processing flow figure of the process which takes out the value of a change start line number column and a change end line number column about each line of Table 3. FIG. リビジョン間で変更のあった関数を解析する処理の処理フロー図。The processing flowchart of the process which analyzes the function which changed between revisions. 変更のあった関数の変更回数をテーブル7に格納する処理の処理フロー図。FIG. 10 is a process flow diagram of a process for storing the number of changes of a function that has been changed in a table. ソースコードを字句解析してテーブル4に格納する処理の処理フロー図。FIG. 6 is a processing flow diagram of processing for lexical analysis of source code and storing in table 4. 関数の変更回数と複雑度を結合する処理の処理フロー図。The processing flow figure of the process which combines the frequency | count of function change and complexity. 関数の変更回数と複雑度を表示する処理の処理フロー図。The processing flowchart of the process which displays the frequency | count of a function change and complexity. 関数の変更回数と複雑度の表示例。Display example of function change count and complexity. テーブル10の例。An example of table 10. テーブル11の例。An example of the table 11. テーブル12の例。An example of the table 12. リビジョン間で変更のあった関数の変更行数をテーブル10に格納する処理の処理フロー図。The processing flow figure of the process which stores the change line number of the function changed between revisions in the table 10. FIG. 変更のあった関数の変更回数と変更行数をテーブル11に格納する処理の処理フロー図。FIG. 6 is a processing flow diagram of processing for storing the number of changes and the number of changed rows of a function that has been changed in a table 11. 関数の変更回数と変更行数と、複雑度を結合する処理の処理フロー図。The processing flow figure of the process which combines the frequency | count of a function change, the number of change lines, and complexity. 関数の変更回数と変更行数と、複雑度の表示例。Example of displaying the number of function changes, the number of changed lines, and the complexity. テーブル13の例。An example of the table 13. 変更回数と複雑度から優先度評価を求めてテーブル13に格納する処理の処理フロー図。The processing flow figure of the process which calculates | requires priority evaluation from the frequency | count of change and complexity, and stores it in the table 13. 関数の変更回数と複雑度を優先度評価列で降順に並び替えてから表示する処理の処理フロー図。The processing flow figure of the process which displays after changing the change frequency and complexity of a function in descending order by a priority evaluation column. 関数の変更回数と複雑度を優先度評価列で降順に並び替えた表示例。Display example of function change count and complexity sorted in descending order by priority evaluation column. ユーザから指定された複雑度の閾値により優先度評価を行う処理の処理フロー図。The processing flow figure of a process which performs priority evaluation with the threshold value of the complexity designated by the user.

以下、実施例を図面を用いて説明する。   Hereinafter, examples will be described with reference to the drawings.

図1は本発明を実施するシステムの構成図である。本システムは、関数の変更回数と複雑度対応付け機能(101)、関数の変更回数測定機能(102)、複雑度測定機能(103)、ソースコード構成管理システム(104)を持つサーバ装置(105)と、入力装置(106)、出力装置(107)から構成される。ソースコード構成管理システムは構成管理情報の格納された構成情報管理DB(108)を持ち、検出機能からの問い合わせに対して構成管理情報を返す。例えば、ソースコード構成管理システムとしてはSubverionというOSS(Open Source Software)がある。本システムが持つソースコード構成管理システムはソースファイル名と2つのリビジョン番号を指定することにより、リビジョン間の差分情報を出力する機能を持つ。   FIG. 1 is a block diagram of a system for implementing the present invention. This system includes a server device (105) having a function change count and complexity association function (101), a function change count measurement function (102), a complexity measurement function (103), and a source code configuration management system (104). ), An input device (106), and an output device (107). The source code configuration management system has a configuration information management DB (108) in which configuration management information is stored, and returns configuration management information in response to an inquiry from the detection function. For example, as a source code configuration management system, there is an OSS (Open Source Software) called Subversion. The source code configuration management system of this system has a function of outputting difference information between revisions by designating a source file name and two revision numbers.

図2は差分情報の一例を示した図である。差分情報(201)は、ユニファイド形式である。ユニファイド形式の差分情報の構造は、先頭にファイル名を示す行、その後にファイルについて2つのリビジョン間で何行目に変更があるかを示す行番号の行が続き、さらにその後に削除行を示す行、挿入行を示す行、非変更行を示す行が続く。ファイル名を示す行は、3つの−記号で始まる行と、3つの+記号で始まる行である。変更のあった行番号を示す行は2つの@記号で始まり2つの@記号で終わる行である。削除行を示す行は−記号で始まる行である。挿入行を示す行は+記号で始まる行である。非変更行を示す行は半角スペース記号で始まる行である。行番号の行の−記号から始まる「−5,10」の部分が変更前のソースコードについて表示されている差分情報の表示開始行と表示範囲行を示し、+記号から始まる「+5,10」が変更後のソースコードについて表示されている差分情報の表示開始行と表示範囲行を示す。   FIG. 2 is a diagram showing an example of difference information. The difference information (201) is in a unified format. The structure of unified difference information consists of a line that shows the file name at the beginning, followed by a line with the line number indicating the number of changes between the two revisions of the file, and then a deleted line. Followed by a line indicating an inserted line, a line indicating an unchanged line. Lines indicating file names are lines starting with three − symbols and lines starting with three + symbols. The line indicating the changed line number is a line that starts with two @ symbols and ends with two @ symbols. A line indicating a deleted line is a line starting with a-symbol. A line indicating an insertion line is a line starting with a + sign. A line indicating an unchanged line is a line starting with a space symbol. “−5, 10” part starting from the − symbol of the line of the line number indicates the display start line and display range line of the difference information displayed for the source code before the change, and “+5, 10” starting from the + sign. Indicates the display start line and display range line of the difference information displayed for the source code after the change.

図3は2つのリビジョン間で変更のあったファイルのファイル名をソースコード構成管理システムから取得して格納するテーブル1を示した図である。テーブル1はファイル名列(301)を持ち、ファイル名列の各行にはファイル名が1つずつ格納される。   FIG. 3 is a diagram showing a table 1 for acquiring and storing file names of files that have changed between two revisions from the source code configuration management system. Table 1 has a file name column (301), and one file name is stored in each row of the file name column.

図4はテーブル1に格納されたファイル名のファイルについて、その差分情報をソースコード構成管理システムから取得して格納するテーブル2を示した図である。テーブル2は差分情報列(401)を持ち、差分情報列の各行には差分情報が1行ずつ格納される。   FIG. 4 is a diagram showing a table 2 in which the difference information is acquired from the source code configuration management system and stored for the file having the file name stored in the table 1. The table 2 has a difference information string (401), and one line of difference information is stored in each line of the difference information string.

図5はテーブル2に格納された差分情報をもとに、変更前後のリビジョンの変更開始行と変更終了行を格納するテーブル3を示した図である。テーブル3はリビジョン列(501)、変更開始行番号列(502)、変更終了行番号列(503)を持つ。リビジョン列の各行には、変更範囲が変更前後のリビジョンのどちらであるかを識別するためにリビジョン番号が格納される。変更開始行番号列の各行には、変更範囲の開始行番号が格納される。変更終了行番号列の各行には、変更範囲の終了行番号が格納される。   FIG. 5 is a diagram showing the table 3 that stores the change start line and the change end line of revisions before and after the change based on the difference information stored in the table 2. Table 3 has a revision column (501), a change start row number column (502), and a change end row number column (503). Each row of the revision column stores a revision number for identifying whether the change range is the revision before or after the change. Each row of the change start row number column stores the start row number of the change range. Each line of the change end line number column stores the end line number of the change range.

図6はテーブル1に格納されたファイル名のファイルについて、字句解析して得られたトークンを格納するテーブル4を示した図である。字句解析は、ソースコードを構成する文字の並びを、意味を持つ最小単位ごとに分割する。意味を持つ最小単位をトークンという。C言語のトークンは、ISO/IEC 9899で定められている。テーブル4はID列(601)、値列(602)、種別列(603)、行番号列(604)を持つ。ID列の各行には、トークンを識別するためにトークンの出現する順に数値が1ずつ加算して格納される。値列の各行にはトークンが格納される。種別列の各行にはトークンの種別が格納される。行番号列の各行にはトークンの出現する行の行番号が格納される。トークンの種別は「identifier」を「識別子」、「(」記号を「開き丸括弧」、「)」記号を「閉じ丸括弧」、「{」記号を「開き波括弧」、「}」記号を「閉じ波括弧」、「;」記号を「セミコロン」、「,」記号を「コンマ」、その他のトークンを「その他」とする。   FIG. 6 is a diagram showing a table 4 for storing tokens obtained by lexical analysis of files having file names stored in the table 1. Lexical analysis divides the sequence of characters that make up the source code into the smallest meaningful units. The smallest unit that has meaning is called a token. The C language token is defined by ISO / IEC 9899. The table 4 has an ID column (601), a value column (602), a type column (603), and a row number column (604). In each row of the ID column, a numerical value is added and stored in order of appearance of tokens to identify the tokens. A token is stored in each row of the value column. Each row of the type column stores a token type. Each line of the line number column stores the line number of the line in which the token appears. The token type is “identifier” as “identifier”, “(” symbol as “open parenthesis”, “)” symbol as “closed parenthesis”, “{” symbol as “open curly bracket”, “}” symbol as “Closed brace”, “;” symbol is “semicolon”, “,” symbol is “comma”, and other tokens are “other”.

図7はテーブル4に格納されたトークン情報をもとに、関数定義の開始行と終了行を格納するテーブル5を示した図である。テーブル5はID列(701)、関数名列(702)、開始行番号列(703)、終了行番号列(704)を持つ。ID列の各行には、関数名を表すトークンのIDが格納される。関数名列の各行には、関数名を表すトークンの値が格納される。開始行番号列の各行には、関数名を表すトークンの出現する行の行番号が格納される。終了行番号列には、関数の終了を表すトークンの出現する行の行番号が格納される。   FIG. 7 is a diagram showing the table 5 that stores the start line and the end line of the function definition based on the token information stored in the table 4. Table 5 has an ID column (701), a function name column (702), a start row number column (703), and an end row number column (704). Each row of the ID column stores a token ID representing a function name. Each row of the function name column stores a token value representing the function name. Each line of the start line number column stores the line number of the line in which the token representing the function name appears. The end line number column stores the line number of the line in which the token indicating the end of the function appears.

図8はテーブル3に格納された変更開始行番号(502)と変更終了行番号(503)と、テーブル5に格納された関数定義範囲の情報をもとに、変更のあった関数の関数名を格納するテーブル6を示した図である。テーブル6はファイル名列(801)、関数名列(802)を持つ。ファイル名列の各行には、関数定義が記述されているファイルのファイル名が格納される。関数名列の各行には、関数名が格納される。   FIG. 8 shows the function name of the function that has been changed based on the change start line number (502) and change end line number (503) stored in Table 3 and the function definition range information stored in Table 5. It is the figure which showed the table 6 which stores. The table 6 has a file name string (801) and a function name string (802). Each line of the file name column stores the file name of the file in which the function definition is described. A function name is stored in each row of the function name column.

図9はテーブル6に格納されたファイル名と関数名をもとに、関数の変更回数を格納するテーブル7を示した図である。テーブル7はファイル名列(901)、関数名列(902)、変更回数列(903)を持つ。ファイル名列の各行には、関数定義が記述されているファイルのファイル名が格納される。関数名列の各行には、関数名が格納される。変更回数列の各行には、関数の変更回数が格納される。   FIG. 9 is a diagram showing a table 7 for storing the number of function changes based on the file name and function name stored in the table 6. The table 7 has a file name column (901), a function name column (902), and a change count column (903). Each line of the file name column stores the file name of the file in which the function definition is described. A function name is stored in each row of the function name column. Each row of the change count column stores the number of function changes.

図10は複雑度測定機能により得られた関数の複雑度を格納するテーブル8を示した図である。テーブル8はファイル名列(1001)、関数名列(1002)、複雑度列(1003)を持つ。ファイル名列の各行には、関数定義が記述されているファイルのファイル名が格納される。関数名列の各行には、関数名が格納される。複雑度列の各行には、関数の複雑度が格納される。   FIG. 10 is a diagram showing a table 8 for storing the complexity of the function obtained by the complexity measurement function. The table 8 has a file name column (1001), a function name column (1002), and a complexity column (1003). Each line of the file name column stores the file name of the file in which the function definition is described. A function name is stored in each row of the function name column. Each row of the complexity column stores the complexity of the function.

図11はテーブル7に格納された変更回数とテーブル8に格納された複雑度を結合して格納するテーブル9を示した図である。テーブル9はファイル名列(1101)、関数名列(1102)、変更回数列(1103)、複雑度列(1104)を持つ。ファイル名列の各行には、関数定義が記述されているファイルのファイル名が格納される。関数名列の各行には、関数名が格納される。変更回数列の各行には、関数の変更回数が格納される。複雑度列の各行には、関数の複雑度が格納される。   FIG. 11 is a diagram showing a table 9 that stores the number of changes stored in the table 7 and the complexity stored in the table 8 in combination. The table 9 has a file name column (1101), a function name column (1102), a change count column (1103), and a complexity column (1104). Each line of the file name column stores the file name of the file in which the function definition is described. A function name is stored in each row of the function name column. Each row of the change count column stores the number of function changes. Each row of the complexity column stores the complexity of the function.

図12は関数の変更回数と複雑度の一覧を表示するまでの一実施例を示した処理フロー図である。まず、構成情報管理DBから最新のリビジョン番号を取得し、変数rev1に格納する(1201)。rev1の値が2以上であるか、1以下であるかを確認する(1202)。rev1の値が2以上の場合(1203)、rev1から1引いた値を変数rev2に格納する(1204)。rev2とrev1の間で変更された全ファイルのファイル名を構成情報管理DBから取得し、テーブル1に格納する(1205)。テーブル1の先頭の行に移動する(1206)。行が存在するか確認する(1207)。行が存在する場合(1208)、ファイル名列の値を変数fileに格納する(1209)。構成情報管理DBからファイル名がfileであるファイルについて、rev2とrev1の間の差分情報を取得する(1210)。取得した差分情報を行単位に分割し、テーブル2に格納する(1211)。その後に図13のコネクタAへ処理を進める(1212)。テーブル1の先頭の行に移動したときに行が存在するか確認し、行が存在しない場合(1213)、rev2の値をrev1に格納し(1214)、rev1の値を確認し、値が1以下の場合(1215)、図22のコネクタPに処理を進める(1216)。   FIG. 12 is a process flow diagram showing one embodiment until a list of function changes and complexity is displayed. First, the latest revision number is acquired from the configuration information management DB and stored in the variable rev1 (1201). It is confirmed whether the value of rev1 is 2 or more or 1 or less (1202). When the value of rev1 is 2 or more (1203), a value obtained by subtracting 1 from rev1 is stored in the variable rev2 (1204). The file names of all files changed between rev2 and rev1 are acquired from the configuration information management DB and stored in the table 1 (1205). Move to the first row of table 1 (1206). It is confirmed whether a line exists (1207). If there is a row (1208), the value of the file name column is stored in the variable file (1209). The difference information between rev2 and rev1 is acquired for the file whose file name is file from the configuration information management DB (1210). The obtained difference information is divided into line units and stored in the table 2 (1211). Thereafter, the process proceeds to connector A in FIG. 13 (1212). When moving to the first row of the table 1, it is confirmed whether a row exists. If no row exists (1213), the value of rev2 is stored in rev1 (1214), the value of rev1 is confirmed, and the value is 1 In the following case (1215), the process proceeds to the connector P in FIG. 22 (1216).

図13はテーブル2に格納した差分情報から変更前後のリビジョンについて変更範囲を解析する処理を示した処理フロー図である。処理はコネクタAから開始される(1301)。テーブル2の先頭の行に移動する(1302)。行の先頭の文字が@記号かその他かを確認する(1303)。その他の場合(1304)、テーブル2の1つ後の行に移動する(1305)。行が存在するか確認し、存在する場合(1306)、行の先頭の文字が@記号かその他かを確認する。@記号の場合(1307)、この行の、+記号の直後に出現する数値を変数start1に格納し(1308)、−記号の直後に出現する数値を変数start2に格納する(1309)。変数cnt1に0を、変数cnt2に0を格納する(1310)。変数rng1に−1を、変数rng2に−1を格納する(1311)。テーブル2の1つ後の行に移動する(1312)。行が存在するか確認し、行が存在する場合(1313)、行の先頭の文字が@記号かその他かを確認する(1314)。@記号の場合(1315)、処理1308に進む。その他の場合(1316)、行の先頭の文字が+記号か−記号かその他かを確認する(1317)。+記号の場合(1318)、rng1の値に1加算する(1319)。−記号の場合(1320)、rng2の値に1加算する(1321)。その後、コネクタB(1322)を経由して(1323)、テーブル2の1つ後ろの行の処理に進む。その他の場合(1324)、図14のコネクタCに処理を進める(1325)。図14の処理からの復帰を示すコネクタD(1326)からは、cnt1にrng1に2を加算した値を、cnt2にrng2に2を加算した値を格納し(1327)、処理1311に進む。テーブル2の1つ後の行に移動して行が存在するか確認し、存在しない場合(1328)(1329)、図15のコネクタEへ処理を進める(1330)(1331)。   FIG. 13 is a process flow diagram showing a process of analyzing the change range for the revisions before and after the change from the difference information stored in Table 2. The process starts from connector A (1301). Move to the top row of table 2 (1302). It is checked whether the first character of the line is an @ symbol or other (1303). In other cases (1304), the table is moved to the next row in table 2 (1305). It is confirmed whether or not a line exists, and if it exists (1306), it is confirmed whether the first character of the line is an @ symbol or other. In the case of the @ symbol (1307), the numerical value appearing immediately after the + symbol in this line is stored in the variable start1 (1308), and the numerical value appearing immediately after the − symbol is stored in the variable start2 (1309). 0 is stored in the variable cnt1, and 0 is stored in the variable cnt2 (1310). −1 is stored in the variable rng1 and −1 is stored in the variable rng2 (1311). Move to the next row in table 2 (1312). It is confirmed whether a line exists. If a line exists (1313), it is confirmed whether the first character of the line is an @ symbol or others (1314). In the case of the @ symbol (1315), the process proceeds to processing 1308. In other cases (1316), it is confirmed whether the first character of the line is a + symbol or a-symbol (1317). In the case of the + symbol (1318), 1 is added to the value of rng1 (1319). In the case of a symbol (1320), 1 is added to the value of rng2 (1321). Thereafter, the processing proceeds to the processing of the next row in the table 2 via the connector B (1322) (1323). In other cases (1324), the process proceeds to connector C in FIG. 14 (1325). From the connector D (1326) indicating the return from the processing of FIG. 14, the value obtained by adding 2 to rng1 is stored in cnt1, the value obtained by adding 2 to rng2 is stored in cnt2 (1327), and the processing proceeds to processing 1311. It moves to the next row of the table 2 to check whether or not the row exists, and if it does not exist (1328) (1329), the processing proceeds to the connector E in FIG. 15 (1330) (1331).

図14は図13で解析した変更範囲の情報をテーブル3に格納する処理を示した処理フロー図である。処理はコネクタC(1401)から開始される。rng1の値が−1か確認する(1402)。−1以外の場合(1403)、変数sl1にstart1とcnt1の和を格納し(1404)、変数el1にsl1とrng1の和を格納する(1405)。テーブル3に行を追加し、追加した行のリビジョン列にrev1の値、開始行番号列にsl1の値、終了行番号列にel1の値を格納する(1406)。rng1の値が−1か確認し、−1の場合(1407)、rng2の値が−1か確認する(1408)。−1以外の場合(1409)、変数sl2にstart2とcnt2の和を格納し(1410)、変数el2にsl2とrng2の和を格納する(1411)。テーブル3に行を追加し、追加行のリビジョン列にrev2の値、開始行番号列にsl2の値、終了行番号列にel2の値を格納する(1412)。格納後、図13のコネクタDへ処理を進める(1413)。rng2の値が−1か確認し、−1の場合(1414)、図13のコネクタDへ処理を進める(1415)。   FIG. 14 is a process flow diagram showing a process for storing the information of the change range analyzed in FIG. Processing starts from connector C (1401). It is confirmed whether the value of rng1 is -1 (1402). If it is not −1 (1403), the sum of start1 and cnt1 is stored in the variable sl1 (1404), and the sum of sl1 and rng1 is stored in the variable el1 (1405). A row is added to the table 3, and the value of rev1 is stored in the revision column of the added row, the value of sl1 is stored in the start row number column, and the value of el1 is stored in the end row number column (1406). It is confirmed whether the value of rng1 is -1, and if it is -1 (1407), it is confirmed whether the value of rng2 is -1 (1408). If it is not −1 (1409), the sum of start2 and cnt2 is stored in the variable sl2 (1410), and the sum of sl2 and rng2 is stored in the variable el2 (1411). A row is added to the table 3, and the value of rev2 is stored in the revision column of the added row, the value of sl2 is stored in the start row number column, and the value of el2 is stored in the end row number column (1412). After storing, the process proceeds to connector D in FIG. 13 (1413). It is confirmed whether the value of rng2 is -1. If it is -1 (1414), the process proceeds to connector D in FIG. 13 (1415).

図15はファイル名がfileのファイルについて、リビジョンがrev1のときのソースコードを字句解析してテーブル4に格納する処理を示した処理フロー図である。処理はコネクタE(1501)から開始される。変数revにrev1の値を格納する(1502)。構成情報管理DBからファイル名がfileのファイルについて、リビジョンがrevのときのソースコードを取得する(1503)。ソースコードを字句解析してトークンに分割し、出現する順に1ずつ加算したID、トークン、種別、出現する行の行番号を、テーブル4に格納する(1504)。その後、図16のコネクタFへ処理を進める(1505)。   FIG. 15 is a process flow diagram showing a process of lexically analyzing the source code when the revision is rev1 and storing it in the table 4 for the file whose file name is file. Processing starts from connector E (1501). The value of rev1 is stored in the variable rev (1502). For the file whose file name is file, the source code when the revision is rev is acquired from the configuration information management DB (1503). The source code is lexically analyzed and divided into tokens, and the ID, token, type, and line number of the appearing line are added to the table 4 in the order of appearance (1504). Thereafter, the process proceeds to the connector F in FIG. 16 (1505).

図16はテーブル4に格納されたトークンから関数の開始行番号を解析する処理を示した処理フロー図である。処理はコネクタF(1601)から開始される。テーブル4の先頭の行に移動する(1602)。行が存在するか確認する(1603)。行が存在する場合(1604)、種別列の値を確認する(1605)。種別列の値が「識別子」以外の場合(1606)、テーブル4の1つ後の行に移動する(1607)。種別列の値が「識別子」の場合(1608)、変数idにID列の値を、変数valueに値列の値を、変数lineに行番号列の値を格納する(1609)。テーブル4の1つ後の行に移動する(1610)。行が存在するか確認する(1611)。行が存在する場合(1612)、種別列の値を確認する(1613)。種別列の値が「開き丸括弧」以外の場合(1614)、コネクタGへ処理を進める(1615)。種別列の値が「開き丸括弧」の場合(1616)、テーブル4の1つ後の行に移動する(1617)。行が存在するか確認する(1618)。行が存在する場合(1619)、種別列の値を確認する(1620)。種別列の値が「閉じ丸括弧」以外の場合(1621)、処理1617へ処理を進める。種別列の値が「閉じ丸括弧」の場合(1622)、テーブル4の1つ後の行に移動する(1623)。行が存在するか確認する(1624)。行が存在する場合(1625)、種別列の値を確認する(1626)。種別列の値が「開き波括弧」以外の場合(1627)、コネクタGへ処理を進める(1628)。種別列の値が「開き波括弧」の場合(1629)、テーブル5に行を追加し、追加した行のID列にidの値を、関数名列にvalueの値を、開始行番号列にlineの値を格納する(1630)。格納後、コネクタGへ処理を進める(1628)。コネクタG(1631)からは、テーブル4の1つ後の行に移動し、処理を進める。行が存在するか確認したときに、行が存在しない場合(1632)(1633)(1634)(1635)、図17のコネクタHへ処理を進める(1636)(1637)(1638)(1639)。   FIG. 16 is a process flow diagram illustrating a process of analyzing the function start line number from the tokens stored in the table 4. The process starts from the connector F (1601). Move to the top row of table 4 (1602). It is checked whether a line exists (1603). If there is a row (1604), the value of the type column is confirmed (1605). If the value of the type column is other than “identifier” (1606), the process moves to the next row of the table 4 (1607). When the value of the type column is “identifier” (1608), the value of the ID column is stored in the variable id, the value of the value column is stored in the variable value, and the value of the row number column is stored in the variable line (1609). Move to the next row in table 4 (1610). It is confirmed whether or not a line exists (1611). If there is a row (1612), the value of the type column is confirmed (1613). If the value in the type column is other than “open parenthesis” (1614), the process proceeds to connector G (1615). If the value of the type column is “open parenthesis” (1616), the process moves to the next row of the table 4 (1617). A check is made to see if a row exists (1618). If there is a row (1619), the value of the type column is confirmed (1620). If the value of the type column is other than “closed parenthesis” (1621), the process proceeds to process 1617. When the value of the type column is “closed parenthesis” (1622), it moves to the next row of the table 4 (1623). A check is made to see if a row exists (1624). If there is a row (1625), the value of the type column is confirmed (1626). If the value in the type column is other than “open curly brace” (1627), the process proceeds to connector G (1628). When the value of the type column is “open curly brace” (1629), a row is added to the table 5, the id value is added to the ID column of the added row, the value value is set to the function name column, and the start row number column is set. The value of line is stored (1630). After storing, the process proceeds to connector G (1628). From the connector G (1631), it moves to the next row of the table 4 and proceeds with the process. When it is confirmed whether or not a line exists, if there is no line (1632) (1633) (1634) (1635), the processing proceeds to the connector H in FIG. 17 (1636) (1637) (1638) (1639).

図17はテーブル4に格納されたトークンから関数の終了行番号を解析する処理を示した処理フロー図である。処理はコネクタH(1701)から開始される。テーブル4の末尾の行に移動する(1702)。行が存在するか確認する(1703)。行が存在しない場合(1704)、図18のコネクタJへ処理を進める(1705)。行が存在する場合(1706)、種別列の値が「閉じ波括弧」か確認する(1707)。種別列の値が「閉じ波括弧」以外の場合(1708)、テーブル4の1つ前の行に移動し(1709)、処理を進める。種別列の値が「閉じ波括弧」の場合(1710)、変数id1にID列の値を、変数valueに値列の値を、変数lineに行番号列の値を格納する(1711)。テーブル4の1つ後の行を確認する(1712)。行が存在する場合(1713)、種別列の値が「識別子」か確認する(1714)。種別列の値が「識別子」の場合(1715)、テーブル4の1つ後の行を確認する(1716)。行が存在する場合(1717)か、処理1714で種別列の値が「識別子」以外の場合(1718)、種別列の値が「コンマ」か「セミコロン」か確認する(1719)。種別列の値が「コンマ」か「セミコロン」の場合(1720)か、処理1716で行が存在しない場合(1721)、コネクタIへ処理を進める(1722)。コネクタI(1723)からは、テーブル4の1つ前の行に移動し、処理を進める。種別列の値が「コンマ」でも「セミコロン」でもない場合(1724)か、処理1712で行が存在しない場合(1725)、テーブル5からID列の値がid1の次に小さい行を探す(1726)。行が存在しない場合(1727)、図18のコネクタJへ処理を進める(1728)。行が存在する場合(1729)、この行の終了行番号の列にlineの値を格納する(1730)。この行のID列の値を変数id2に格納する(1731)。テーブル4のID列の値がid2の行へ移動し(1732)、処理を進める。   FIG. 17 is a process flow diagram showing a process for analyzing the end line number of the function from the tokens stored in the table 4. The process starts from the connector H (1701). Move to the last line of the table 4 (1702). It is confirmed whether a line exists (1703). If there is no row (1704), the process proceeds to connector J in FIG. 18 (1705). If there is a row (1706), it is checked whether the value of the type column is “closed brace” (1707). When the value of the type column is other than “closed curly brace” (1708), it moves to the previous row of the table 4 (1709) and proceeds with the process. When the value of the type column is “closed brace” (1710), the value of the ID column is stored in the variable id1, the value of the value column is stored in the variable value, and the value of the row number column is stored in the variable line (1711). The next row of the table 4 is confirmed (1712). If there is a row (1713), it is checked whether the value of the type column is “identifier” (1714). When the value of the type column is “identifier” (1715), the next row of the table 4 is confirmed (1716). If there is a row (1717) or if the value of the type column is other than “identifier” in processing 1714 (1718), it is checked whether the value of the type column is “comma” or “semicolon” (1719). When the value of the type column is “comma” or “semi-colon” (1720), or when there is no row in the process 1716 (1721), the process proceeds to the connector I (1722). From the connector I (1723), the process moves to the previous row in the table 4 and the process proceeds. When the value of the type column is neither “comma” nor “semicolon” (1724), or when there is no row in the processing 1712 (1725), the table 5 is searched for the next row whose ID column value is id1 (1726). ). If there is no row (1727), the processing proceeds to connector J in FIG. 18 (1728). If there is a row (1729), the line value is stored in the end row number column of this row (1730). The value of the ID column of this row is stored in the variable id2 (1731). The value of the ID column in Table 4 moves to the row with id2 (1732), and the process proceeds.

図18はテーブル3の各行について変更開始行番号列と変更終了行番号列の値を取り出す処理を示した処理フロー図である。処理はコネクタJ(1801)から開始される。テーブル3の先頭の行に移動する(1802)。行が存在するか確認する(1803)。行が存在しない場合(1804)、図20のコネクタMへ処理を進める(1805)。行が存在する場合(1806)、リビジョン列の値を確認する(1807)。リビジョン列の値がrevと等しくない場合(1808)、テーブル3の1つ後の1行を確認する(1809)。リビジョン列の値がrevと等しい場合(1810)、変数msに変更開始行番号列の値を、変数meに変更終了行番号列の値を格納する(1811)。格納後、図19のコネクタKへ処理を進める(1812)。図19の処理からの復帰を示すコネクタL(1813)からは、テーブル3の1つ後の1行を確認する(1809)。   FIG. 18 is a process flow diagram illustrating a process of extracting the values of the change start line number column and the change end line number column for each row of the table 3. Processing starts from connector J (1801). Move to the top row of table 3 (1802). It is confirmed whether a line exists (1803). If there is no row (1804), the process proceeds to the connector M in FIG. 20 (1805). If there is a row (1806), the revision column value is confirmed (1807). If the value of the revision column is not equal to rev (1808), the next row in the table 3 is confirmed (1809). When the value of the revision column is equal to rev (1810), the value of the change start row number column is stored in the variable ms, and the value of the change end row number column is stored in the variable me (1811). After the storage, the process proceeds to connector K in FIG. 19 (1812). From the connector L (1813) indicating the return from the processing of FIG. 19, the next row of the table 3 is confirmed (1809).

図19はms、meとテーブル5の関数の開始行番号と終了行番号から、変更のあった関数を解析する処理を示した処理フロー図である。処理はコネクタK(1901)から開始される。テーブル5の先頭の1行を確認する(1902)。行が存在するか確認する(1903)。行が存在しない場合(1904)、図18のコネクタLへ処理を進める(1905)。行が存在する場合(1906)、開始行番号列の値がme以下であり、かつ、終了行番号列の値がms以上であることを満たすか確認する(1907)。満たさない場合(1908)、テーブル5の1つ後の1行を確認し(1909)、次の処理を進める。満たす場合(1910)、変数funcに関数名列の値を格納する(1911)。テーブル6から、ファイル名列の値がfileと等しく、関数名列の値がfuncと等しい行を探す(1912)。行が存在する場合(1913)、テーブル5の1つ後の1行を確認し(1909)、次の処理を進める。行が存在しない場合(1914)、テーブル6に行を追加し、追加した行のファイル名列にfileを、関数名列にfuncを格納する(1915)。テーブル5の1つ後の1行を確認し(1909)、次の処理を進める。   FIG. 19 is a process flow diagram showing a process for analyzing a changed function from ms, me and the start line number and end line number of the function in Table 5. Processing starts from connector K (1901). The first line of the table 5 is confirmed (1902). It is confirmed whether a line exists (1903). If there is no row (1904), the process proceeds to the connector L in FIG. 18 (1905). If there is a row (1906), it is checked whether the value of the start row number column is not more than me and the value of the end row number column is not less than ms (1907). If not satisfied (1908), the next row of the table 5 is confirmed (1909), and the next processing is advanced. When it is satisfied (1910), the value of the function name string is stored in the variable func (1911). The table 6 is searched for a row in which the value of the file name column is equal to file and the value of the function name column is equal to func (1912). If there is a row (1913), the next row in the table 5 is confirmed (1909), and the next processing proceeds. If there is no row (1914), a row is added to the table 6, file is stored in the file name column of the added row, and func is stored in the function name column (1915). The next row of the table 5 is confirmed (1909), and the next processing is advanced.

図20はテーブル6に格納されたファイル名と関数名から、変更のあった関数の変更回数をテーブル7に格納する処理を示した処理フロー図である。処理はコネクタM(2001)から開始される。テーブル6の先頭の行に移動する(2002)。行が存在するか確認する(2003)。行が存在しない場合(2004)、revの値を確認する(2005)。revの値がrev1と等しい場合(2006)、図21のコネクタNへ処理を進める(2007)。revの値がrev2と等しい場合(2008)、図12のコネクタOへ処理を進める(2009)。行が存在する場合(2010)、変数mfileにファイル名を、変数mfuncに関数名を格納する(2011)。テーブル7から、ファイル名列の値がmfileと等しく、関数名列の値がmfuncと等しい行を探す(2012)。行が存在する場合(2013)、この行の変更回数列の値に1加算する(2014)。行が存在しない場合(2015)、テーブル7に行を追加し、追加した行のファイル名列にmfileを、関数名列にmfuncを、変更回数列に1を格納する(2016)。テーブル5の1つ後の1行を確認し(2017)、次の処理を進める。   FIG. 20 is a process flow diagram showing a process of storing the number of changes of a changed function in the table 7 from the file name and the function name stored in the table 6. The process starts from the connector M (2001). Move to the top row of the table 6 (2002). It is confirmed whether a row exists (2003). If no row exists (2004), the value of rev is confirmed (2005). When the value of rev is equal to rev1 (2006), the process proceeds to the connector N in FIG. 21 (2007). When the value of rev is equal to rev2 (2008), the process proceeds to the connector O in FIG. 12 (2009). If there is a line (2010), the file name is stored in the variable mfile, and the function name is stored in the variable mfunc (2011). The table 7 is searched for a row in which the value of the file name column is equal to mfile and the value of the function name column is equal to mfunc (2012). If there is a row (2013), 1 is added to the value of the change count column of this row (2014). When there is no row (2015), a row is added to the table 7, mfile is stored in the file name column of the added row, mfunc is stored in the function name column, and 1 is stored in the change count column (2016). The next row of the table 5 is confirmed (2017), and the next processing is advanced.

図21はファイル名がfileのファイルについて、リビジョンがrev2のときのソースコードを字句解析してテーブル4に格納する処理を示した処理フロー図である。処理はコネクタN(2101)から開始される。変数revにrev2の値を格納する(2102)。構成情報管理DBからファイル名がfileのファイルについて、リビジョンがrevのときのソースコードを取得する(2103)。ソースコードを字句解析してトークンに分割し、出現する順に1ずつ加算したID、トークン、種別、出現する行の行番号を、テーブル4に格納する(2104)。その後、図16のコネクタFへ処理を進める(2105)。   FIG. 21 is a processing flow diagram showing processing for lexical analysis of the source code when the revision is rev2 and storing it in the table 4 for the file whose file name is file. Processing starts from connector N (2101). The value of rev2 is stored in the variable rev (2102). For the file whose file name is file, the source code when the revision is rev is acquired from the configuration information management DB (2103). The source code is lexically analyzed and divided into tokens, and the ID, token, type, and line number of the appearing line are added to the table 4 in order of appearance (2104). Thereafter, the process proceeds to the connector F in FIG. 16 (2105).

図22は複雑度測定機能により取得された複雑度とテーブル6の関数の変更回数を結合する処理を示した処理フロー図である。処理はコネクタP(2201)から開始される。構成情報管理DBから最新のリビジョンの全ソースコードを取得する(2202)。全ソースコードについて複雑度測定機能により取得された複雑度をテーブル8に格納する(2203)。テーブル7の先頭の行に移動する(2204)。行が存在するか確認する(2205)。行が存在しない場合(2206)、図23のコネクタQへ処理を進める(2207)。行が存在する場合(2208)、変数fileにファイル名列の値を、変数funcに関数名列の値を、変数mcに変更回数列の値を格納する(2209)。テーブル8からファイル名列の値がfileと等しく、関数名列の値がfuncと等しい行を探す(2210)。行が存在しない場合(2211)、テーブル7の1つ後の行に移動し(2212)、次の処理を進める。行が存在する場合(2213)、変数ccに複雑度列の値を格納する(2214)。テーブル9に行を追加し、追加した行のファイル名列にfileを、関数名列にfuncを、変更回数列にmcを、複雑度列にccを格納する(2215)。その後、テーブル7の1つ後の行に移動し(2212)、次の処理を進める。   FIG. 22 is a process flow diagram showing a process of combining the complexity acquired by the complexity measurement function and the number of times the function of the table 6 is changed. The process starts from the connector P (2201). All source codes of the latest revision are acquired from the configuration information management DB (2202). The complexity acquired by the complexity measurement function for all source codes is stored in the table 8 (2203). Move to the top row of the table 7 (2204). It is confirmed whether a line exists (2205). If there is no row (2206), the process proceeds to the connector Q in FIG. 23 (2207). If there is a row (2208), the file name column value is stored in the variable file, the function name column value is stored in the variable func, and the change count column value is stored in the variable mc (2209). The table 8 is searched for a row in which the value of the file name column is equal to file and the value of the function name column is equal to func (2210). If there is no row (2211), the next row of the table 7 is moved (2212), and the next processing is advanced. If there is a row (2213), the value of the complexity column is stored in the variable cc (2214). A row is added to the table 9, file is stored in the file name column of the added row, func is stored in the function name column, mc is stored in the change count column, and cc is stored in the complexity column (2215). Thereafter, the next row of the table 7 is moved (2212), and the next processing is advanced.

図23はテーブル9に格納された関数の変更回数と複雑度を表示する処理を示した処理フロー図である。処理はコネクタQ(2301)から開始される。テーブル9に格納された関数の変更回数と複雑度を表示し(2302)、処理を終了する。   FIG. 23 is a processing flow diagram showing processing for displaying the number of changes and complexity of the function stored in the table 9. Processing starts from connector Q (2301). The number of changes and complexity of the function stored in the table 9 are displayed (2302), and the process is terminated.

図24はテーブル9に格納された関数の変更回数と複雑度の表示例である。テーブル9の各行に行番号を付与してNo.列(2401)として表示する。   FIG. 24 is a display example of the number of changes and complexity of functions stored in the table 9. A row number is assigned to each row of the table 9, and No. Displayed as a column (2401).

本実施例では、関数の変更回数に加えて変更行数を表示することができる例を説明する。   In this embodiment, an example in which the number of changed lines can be displayed in addition to the number of function changes will be described.

図25はテーブル3に格納された変更開始行番号(502)と変更終了行番号(503)と、テーブル5に格納された関数定義範囲の情報をもとに、変更のあった関数の関数名と変更行数を格納するテーブル10を示した図である。テーブル10はファイル名列(2501)、関数名列(2502)、変更行数列(2503)を持つ。ファイル名列の各行には、関数定義が記述されているファイルのファイル名が格納される。関数名列の各行には、関数名が格納される。変更行数列の各行には、関数の変更行数が格納される。   FIG. 25 shows the function name of the function that has been changed based on the change start line number (502) and change end line number (503) stored in Table 3 and the function definition range information stored in Table 5. It is the figure which showed the table 10 which stores the change line number. The table 10 has a file name column (2501), a function name column (2502), and a changed row number column (2503). Each line of the file name column stores the file name of the file in which the function definition is described. A function name is stored in each row of the function name column. In each row of the changed row number column, the changed row number of the function is stored.

図26はテーブル10に格納されたファイル名と関数名、変更行数から、変更のあった関数の変更回数と変更行数を格納するテーブル11を示した図である。テーブル11はファイル名列(2601)、関数名列(2602)、変更回数列(2603)、変更行数列(2604)を持つ。ファイル名列の各行には、関数定義が記述されているファイルのファイル名が格納される。関数名列の各行には、関数名が格納される。変更回数列の各行には、関数の変更回数が格納される。変更行数列の各行には、関数の変更行数が格納される。   FIG. 26 is a diagram showing the table 11 that stores the number of changes and the number of changed lines of a function that has been changed based on the file name, function name, and number of changed lines stored in the table 10. The table 11 has a file name column (2601), a function name column (2602), a change count column (2603), and a change row count column (2604). Each line of the file name column stores the file name of the file in which the function definition is described. A function name is stored in each row of the function name column. Each row of the change count column stores the number of function changes. In each row of the changed row number column, the changed row number of the function is stored.

図27はテーブル11に格納された変更回数と変更行数と、テーブル8に格納された複雑度を結合して格納するテーブル12を示した図である。テーブル12はファイル名列(2701)、関数名列(2702)、変更回数列(2703)、変更行数列(2704)、複雑度列(2705)を持つ。ファイル名列の各行には、関数定義が記述されているファイルのファイル名が格納される。関数名列の各行には、関数名が格納される。変更回数列の各行には、関数の変更回数が格納される。変更行数列の各行には、関数の変更行数が格納される。複雑度列の各行には、関数の複雑度が格納される。   FIG. 27 is a diagram showing the table 12 for storing the number of changes and the number of changed rows stored in the table 11 and the complexity stored in the table 8. The table 12 has a file name column (2701), a function name column (2702), a change count column (2703), a change row count column (2704), and a complexity column (2705). Each line of the file name column stores the file name of the file in which the function definition is described. A function name is stored in each row of the function name column. Each row of the change count column stores the number of function changes. In each row of the changed row number column, the changed row number of the function is stored. Each row of the complexity column stores the complexity of the function.

図28は実施例1の図19の処理について、変更行数を取得できるように拡張した処理フロー図である。処理はコネクタK(2801)から開始される。テーブル5の先頭の1行を確認する(2802)。行が存在するか確認する(2803)。行が存在しない場合(2804)、図18のコネクタLへ処理を進める(2805)。行が存在する場合(2806)、変数fsに開始行番号列の値を、変数feに終了行番号列の値を格納する(2807)。fsがme以下であり、かつ、feがms以上であることを満たすか確認する(2808)。満たさない場合(2809)、テーブル5の1つ後の1行を確認し(2810)、次の処理を進める。満たす場合(2811)、feの値を確認する(2812)。feの値がme未満の場合(2813)、変数reにfeの値を格納する(2814)。feの値がme以上の場合(2815)、変数reにmeの値を格納する(2816)。続けてfsの値を確認する(2817)。fsの値がms未満の場合(2818)、変数rsにmsの値を格納する(2819)。fsの値がms以上の場合(2820)、変数rsにfsの値を格納する(2821)。変数mrにreからrsを引いて1を加算した値を格納する(2822)。変数funcに関数名列の値を格納する(2823)。テーブル10から、ファイル名列の値がfileと等しく、関数名列の値がfuncと等しい行を探す(2824)。行が存在する場合(2825)、この行の変更行数列の値にmrを加算する(2826)。行が存在しない場合(2827)、テーブル10に行を追加し、追加した行のファイル名列にfileを、関数名列にfuncを、変更行数列にmrを格納する(2828)。テーブル5の1つ後の1行を確認し(2810)、次の処理を進める。   FIG. 28 is a process flow diagram in which the process in FIG. 19 according to the first embodiment is expanded so that the number of changed rows can be acquired. Processing starts from connector K (2801). The first line of the table 5 is confirmed (2802). It is confirmed whether a line exists (2803). If there is no row (2804), the process proceeds to the connector L in FIG. 18 (2805). If there is a row (2806), the value of the start row number column is stored in the variable fs, and the value of the end row number column is stored in the variable fe (2807). It is checked whether fs is equal to or smaller than me and fe is equal to or larger than ms (2808). If not satisfied (2809), the next row of the table 5 is confirmed (2810), and the next processing is advanced. If it satisfies (2811), the value of fe is confirmed (2812). If the value of fe is less than me (2813), the value of fe is stored in the variable re (2814). If the value of fe is greater than or equal to me (2815), the value of me is stored in the variable re (2816). Subsequently, the value of fs is confirmed (2817). If the value of fs is less than ms (2818), the value of ms is stored in the variable rs (2819). When the value of fs is equal to or greater than ms (2820), the value of fs is stored in the variable rs (2821). A value obtained by subtracting rs from re and adding 1 to the variable mr is stored (2822). The value of the function name string is stored in the variable func (2823). The table 10 is searched for a row in which the value of the file name column is equal to file and the value of the function name column is equal to func (2824). If there is a row (2825), mr is added to the value of the changed row number column of this row (2826). If there is no row (2827), a row is added to the table 10, file is stored in the file name column of the added row, func is stored in the function name column, and mr is stored in the changed row number column (2828). The next row of the table 5 is confirmed (2810), and the next processing is advanced.

図29は実施例1の図20について、テーブル10に格納されたファイル名と関数名、変更行数から、変更のあった関数の変更回数と変更行数をテーブル11に格納するように拡張した処理フロー図である。処理はコネクタM(2901)から開始される。テーブル10の先頭の行に移動する(2902)。行が存在するか確認する(2903)。行が存在しない場合(2904)、revの値を確認する(2905)。revの値がrev1と等しい場合(2906)、図21のコネクタNへ処理を進める(2907)。revの値がrev2と等しい場合(2908)、図12のコネクタOへ処理を進める(2909)。行が存在する場合(2910)、変数mfileにファイル名を、変数mfuncに関数名を、変数mlineに変更行数を格納する(2911)。テーブル11から、ファイル名列の値がmfileと等しく、関数名列の値がmfuncと等しい行を探す(2912)。行が存在する場合(2913)、この行の変更回数列の値に1を加算し、変更行数列にmlineを加算する(2914)。行が存在しない場合(2915)、テーブル11に行を追加し、追加した行のファイル名列にmfileを、関数名列にmfuncを、変更回数列に1を、変更行数列にmlineを格納する(2916)。テーブル5の1つ後の1行を確認し(2917)、次の処理を進める。   FIG. 29 is an extension of FIG. 20 of the first embodiment so that the number of changed functions and the number of changed lines are stored in the table 11 from the file name, function name, and number of changed lines stored in the table 10. It is a processing flowchart. The process starts from the connector M (2901). Move to the top row of the table 10 (2902). It is confirmed whether a line exists (2903). If no line exists (2904), the value of rev is confirmed (2905). When the value of rev is equal to rev1 (2906), the process proceeds to the connector N in FIG. 21 (2907). If the value of rev is equal to rev2 (2908), the process proceeds to connector O in FIG. 12 (2909). If there is a line (2910), the file name is stored in the variable mfile, the function name is stored in the variable mfunc, and the number of changed lines is stored in the variable mline (2911). The table 11 is searched for a row in which the value of the file name column is equal to mfile and the value of the function name column is equal to mfunc (2912). If there is a row (2913), 1 is added to the value of the change count column of this row, and mline is added to the changed row count column (2914). If there is no row (2915), a row is added to the table 11, mfile is stored in the file name column of the added row, mfunc is stored in the function name column, 1 is stored in the change count column, and mline is stored in the changed row count column. (2916). The next line in the table 5 is confirmed (2917), and the next processing is advanced.

図30は実施例1の図22の処理について、テーブル11に格納された関数の変更回数と変更行数と、複雑度を結合するように拡張した処理フロー図である。処理はコネクタP(3001)から開始される。構成情報管理DBから最新のリビジョンの全ソースコードを取得する(3002)。全ソースコードについて複雑度測定機能により取得された複雑度をテーブル8に格納する(3003)。テーブル11の先頭の行に移動する(3004)。行が存在するか確認する(3005)。行が存在しない場合(3006)、図23のコネクタQへ処理を進める(3007)。行が存在する場合(3008)、変数fileにファイル名列の値を、変数funcに関数名列の値を、変数mcに変更回数列の値を、変数mrに変更行数列の値を格納する(3009)。テーブル7からファイル名列の値がfileと等しく、関数名列の値がfuncと等しい行を探す(3010)。行が存在しない場合(3011)、テーブル11の1つ後の行に移動し(3012)、次の処理を進める。行が存在する場合(3013)、変数ccに複雑度列の値を格納する(3014)。テーブル12に行を追加し、追加した行のファイル名列にfileを、関数名列にfuncを、複雑度列にccを、変更回数列にmcを、変更行数列にmrを格納する(3015)。その後、テーブル11の1つ後の行に移動し(3012)、次の処理を進める。   FIG. 30 is a process flow diagram in which the processing shown in FIG. 22 according to the first embodiment is expanded so as to combine the number of changes of the function stored in the table 11, the number of changed rows, and the complexity. The process starts from the connector P (3001). All source codes of the latest revision are acquired from the configuration information management DB (3002). The complexity obtained by the complexity measurement function for all source codes is stored in the table 8 (3003). Move to the top row of the table 11 (3004). It is confirmed whether a row exists (3005). If there is no row (3006), the process proceeds to the connector Q in FIG. 23 (3007). When there is a row (3008), the value of the file name column is stored in the variable file, the value of the function name column is stored in the variable func, the value of the change count column is stored in the variable mc, and the value of the changed row count column is stored in the variable mr. (3009). The table 7 is searched for a row in which the value of the file name column is equal to file and the value of the function name column is equal to func (3010). If there is no row (3011), the next row of the table 11 is moved (3012), and the next processing is advanced. If there is a row (3013), the value of the complexity column is stored in the variable cc (3014). A row is added to the table 12, file is stored in the file name column of the added row, func is stored in the function name column, cc is stored in the complexity column, mc is stored in the change count column, and mr is stored in the changed row column (3015). ). Thereafter, the table 11 is moved to the next row (3012), and the next processing is advanced.

図31はテーブル12に格納された関数の変更回数と変更行数と、複雑度の表示例である。テーブル12の各行に行番号を付与してNo.列(3101)として表示する。   FIG. 31 is a display example of the number of function changes, the number of changed lines, and the complexity stored in the table 12. A row number is assigned to each row of the table 12 and No. Displayed as a column (3101).

本実施例では、優先して改善すべき関数を変更回数と複雑度により並び替えて表示することができる例を説明する。   In this embodiment, an example will be described in which functions to be improved with priority can be rearranged and displayed according to the number of changes and complexity.

図32はテーブル7に格納された変更回数、テーブル8に格納された複雑度、さらに変更回数と複雑度から求めた優先度評価を格納するテーブル13を示した図である。テーブル13はファイル名列(3201)、関数名列(3202)、変更回数列(3203)、複雑度列(3204)、優先度評価列(3205)を持つ。ファイル名列の各行には、関数定義が記述されているファイルのファイル名が格納される。関数名列の各行には、関数名が格納される。変更回数列の各行には、関数の変更回数が格納される。複雑度列の各行には、関数の複雑度が格納される。優先度評価列の各行には、変更回数と複雑度から求めた値が格納される。   FIG. 32 shows the table 13 that stores the number of changes stored in the table 7, the complexity stored in the table 8, and the priority evaluation obtained from the number of changes and the complexity. The table 13 has a file name column (3201), a function name column (3202), a change count column (3203), a complexity column (3204), and a priority evaluation column (3205). Each line of the file name column stores the file name of the file in which the function definition is described. A function name is stored in each row of the function name column. Each row of the change count column stores the number of function changes. Each row of the complexity column stores the complexity of the function. Each row of the priority evaluation column stores a value obtained from the number of changes and the complexity.

図33は実施例1の図22の処理について、テーブル7に格納された変更回数とテーブル8に格納された複雑度から、優先度評価を求めるように拡張した処理を示した処理フロー図である。処理はコネクタP(3301)から開始される。構成情報管理DBから最新のリビジョンの全ソースコードを取得する(3302)。全ソースコードについて複雑度測定機能により取得された複雑度をテーブル8に格納する(3303)。テーブル7の先頭の行に移動する(3304)。行が存在するか確認する(3305)。行が存在しない場合(3306)、図34のコネクタRへ処理を進める(3307)。行が存在する場合(3308)、変数fileにファイル名列の値を、変数funcに関数名列の値を、変数mcに変更回数列の値を格納する(3309)。テーブル8からファイル名列の値がfileと等しく、関数名列の値がfuncと等しい行を探す(3310)。行が存在しない場合(3311)、テーブル7の1つ後の行に移動し(3312)、次の処理を進める。行が存在する場合(3313)、変数ccに複雑度列の値を格納する(3314)。ccの値を確認する(3315)。ccの値が20以下の場合(3316)、変数estにmcを格納する(3317)。ccの値が20より大きい場合(3318)、変数estにccから20を引いた値にmcをかけた値を格納する(3319)。テーブル13に行を追加し、追加した行のファイル名列にfileを、関数名列にfuncを、変更回数列にmcを、複雑度列にccを、優先度評価列にestを格納する(3320)。その後、テーブル7の1つ後の行に移動し(3312)、次の処理を進める。   FIG. 33 is a process flow diagram showing an extended process for obtaining the priority evaluation from the number of changes stored in the table 7 and the complexity stored in the table 8 for the process of FIG. . The process starts from the connector P (3301). All source codes of the latest revision are acquired from the configuration information management DB (3302). The complexity acquired by the complexity measurement function for all source codes is stored in the table 8 (3303). Move to the top row of the table 7 (3304). It is confirmed whether a line exists (3305). If there is no row (3306), the process proceeds to connector R in FIG. 34 (3307). If there is a row (3308), the value of the file name column is stored in the variable file, the value of the function name column is stored in the variable func, and the value of the change count column is stored in the variable mc (3309). The table 8 is searched for a row in which the value of the file name column is equal to file and the value of the function name column is equal to func (3310). When there is no row (3311), it moves to the next row of the table 7 (3312), and the next processing is advanced. If there is a row (3313), the value of the complexity column is stored in the variable cc (3314). The value of cc is confirmed (3315). When the value of cc is 20 or less (3316), mc is stored in the variable est (3317). When the value of cc is larger than 20 (3318), a value obtained by multiplying cc by 20 from cc is stored in variable est (3319). A row is added to the table 13, file is stored in the file name column of the added row, func is stored in the function name column, mc is stored in the change count column, cc is stored in the complexity column, and est is stored in the priority evaluation column ( 3320). Thereafter, the next row of the table 7 is moved (3312), and the next processing is advanced.

図34は、テーブル13の行を優先度評価列で降順に並び替えてから表示する処理を示した処理フロー図である。処理はコネクタR(3401)から開始される。テーブル13の行を優先度評価列で降順に並び替える(3402)。テーブル13に格納された関数の変更回数と複雑度を表示し(3403)、処理を終了する。   FIG. 34 is a process flow diagram showing a process of displaying the rows of the table 13 after rearranging the rows in the priority evaluation column in descending order. Processing starts from connector R (3401). The rows of the table 13 are rearranged in descending order in the priority evaluation column (3402). The number of changes and the complexity of the function stored in the table 13 are displayed (3403), and the process ends.

図35はテーブル13に格納された関数の変更回数と変更行数と、複雑度の表示例である。テーブル13の各行に行番号を付与してNo.列(3501)として表示する。   FIG. 35 is a display example of the number of changes and the number of changed lines and complexity stored in the table 13. A row number is assigned to each row of the table 13 and No. Displayed as a column (3501).

本実施例では、優先して改善すべき関数を変更回数と複雑度により並び替えて表示することができる例を説明する。   In this embodiment, an example will be described in which functions to be improved with priority can be rearranged and displayed according to the number of changes and complexity.

図36は実施例3の図33について、ユーザから指定された複雑度の閾値により優先度評価を行うように拡張した処理を示した処理フロー図である。処理はコネクタP(3601)から開始される。構成情報管理DBから最新のリビジョンの全ソースコードを取得する(3602)。全ソースコードについて複雑度測定機能により取得された複雑度をテーブル8に格納する(3603)。入力装置106によりユーザから指定された複雑度の閾値を受け取り変数thに格納する(3604)。テーブル7の先頭の行に移動する(3605)。行が存在するか確認する(3607)。行が存在しない場合(3608)、図34のコネクタRへ処理を進める(3609)。行が存在する場合(3610)、変数fileにファイル名列の値を、変数funcに関数名列の値を、変数mcに変更回数列の値を格納する(3611)。テーブル8からファイル名列の値がfileと等しく、関数名列の値がfuncと等しい行を探す(3612)。行が存在しない場合(3613)、テーブル7の1つ後の行に移動し(3614)、次の処理を進める。行が存在する場合(3615)、変数ccに複雑度列の値を格納する(3616)。ccの値を確認する(3617)。ccの値がth以下の場合(3618)、変数estにmcを格納する(3619)。ccの値がthより大きい場合(3620)、変数estにccからthを引いた値にmcをかけた値を格納する(3621)。テーブル13に行を追加し、追加した行のファイル名列にfileを、関数名列にfuncを、変更回数列にmcを、複雑度列にccを、優先度評価列にestを格納する(3622)。その後、テーブル7の1つ後の行に移動し(3614)、次の処理を進める。   FIG. 36 is a process flow diagram illustrating an extended process of FIG. 33 of the third embodiment so that priority evaluation is performed based on a complexity threshold specified by the user. The process starts from the connector P (3601). All source codes of the latest revision are acquired from the configuration information management DB (3602). The complexity obtained by the complexity measurement function for all source codes is stored in the table 8 (3603). The complexity threshold value designated by the user through the input device 106 is received and stored in the variable th (3604). Move to the top row of the table 7 (3605). It is confirmed whether a line exists (3607). If there is no row (3608), the process proceeds to connector R in FIG. 34 (3609). If there is a row (3610), the value of the file name column is stored in the variable file, the value of the function name column is stored in the variable func, and the value of the change count column is stored in the variable mc (3611). The table 8 is searched for a row where the value of the file name column is equal to file and the value of the function name column is equal to func (3612). If there is no row (3613), the next row of the table 7 is moved (3614), and the next processing is advanced. If there is a row (3615), the value of the complexity column is stored in the variable cc (3616). The value of cc is confirmed (3617). When the value of cc is equal to or smaller than th (3618), mc is stored in the variable est (3619). When the value of cc is greater than th (3620), a value obtained by multiplying cc by th by the value obtained by subtracting th from variable cc is stored (3621). A row is added to the table 13, file is stored in the file name column of the added row, func is stored in the function name column, mc is stored in the change count column, cc is stored in the complexity column, and est is stored in the priority evaluation column ( 3622). Thereafter, the next row of the table 7 is moved (3614), and the next processing is advanced.

101…雑度対応付け機能、102…関数の変更回数測定機能、103…複雑度測定機能、104…ソースコード構成管理システム、105…サーバ装置、106…入力装置、107…出力装置、108…構成情報管理DB、201…差分情報、903…関数の変更回数、1003…関数の複雑度。   DESCRIPTION OF SYMBOLS 101 ... Roughness matching function, 102 ... Function change count measurement function, 103 ... Complexity measurement function, 104 ... Source code configuration management system, 105 ... Server device, 106 ... Input device, 107 ... Output device, 108 ... Configuration Information management DB 201: Difference information 903: Function change count, 1003: Function complexity.

Claims (4)

構成管理システムで管理されているソースファイル単位の更新履歴から関数の変更回数を解析し、複雑度と結合して表示する機能を特徴とする関数の変更回数と複雑度を表示するシステム。   A system that displays the number of changes and complexity of a function characterized by the function of analyzing the number of changes of the function from the update history of each source file managed by the configuration management system and combining it with the complexity. 請求項1における関数の変更回数の解析に加えて、関数の変更行数も解析し、関数の変更回数と変更行数と複雑度を結合して表示する機能を特徴とする関数の変更回数と変更行数と複雑度を表示するシステム。   In addition to the analysis of the number of function changes in claim 1, the number of function changes is also analyzed, and the number of function changes characterized by the combined display of the number of function changes, the number of changed lines, and the complexity A system that displays the number and complexity of changed lines. 請求項1における関数の変更回数と複雑度の表示する際に、関数の変更回数と複雑度から改善優先度を評価して表示順序を並び替えて表示する機能を特徴とする関数の変更回数と複雑度を表示するシステム。   The number of function changes characterized by the function of evaluating the improvement priority from the number of function changes and the complexity and rearranging the display order when displaying the number of function changes and the complexity in claim 1. A system that displays complexity. 請求項3における改善優先度を評価する際に、ユーザから指定された値により改善優先度の評価計算を変更する機能を特徴とする関数の変更回数と複雑度を表示するシステム。   A system for displaying the number of changes and the complexity of a function characterized by a function of changing the evaluation calculation of improvement priority according to a value designated by a user when evaluating the improvement priority in claim 3.
JP2011097774A 2011-04-26 2011-04-26 System for displaying correspondence table between change frequency in each function in source code and complexity Withdrawn JP2012230512A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011097774A JP2012230512A (en) 2011-04-26 2011-04-26 System for displaying correspondence table between change frequency in each function in source code and complexity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011097774A JP2012230512A (en) 2011-04-26 2011-04-26 System for displaying correspondence table between change frequency in each function in source code and complexity

Publications (1)

Publication Number Publication Date
JP2012230512A true JP2012230512A (en) 2012-11-22

Family

ID=47432015

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011097774A Withdrawn JP2012230512A (en) 2011-04-26 2011-04-26 System for displaying correspondence table between change frequency in each function in source code and complexity

Country Status (1)

Country Link
JP (1) JP2012230512A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015064808A (en) * 2013-09-26 2015-04-09 株式会社日立ソリューションズ Method-level clone analysis method
JP2016143107A (en) * 2015-01-30 2016-08-08 株式会社日立製作所 Source code evaluation system and method
JP2017045354A (en) * 2015-08-28 2017-03-02 富士通株式会社 Software development support program, software development support apparatus, and software development support method
CN109710306A (en) * 2017-10-25 2019-05-03 歌乐株式会社 Source code resolver, source code analysis method, computer readable recording medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015064808A (en) * 2013-09-26 2015-04-09 株式会社日立ソリューションズ Method-level clone analysis method
JP2016143107A (en) * 2015-01-30 2016-08-08 株式会社日立製作所 Source code evaluation system and method
JP2017045354A (en) * 2015-08-28 2017-03-02 富士通株式会社 Software development support program, software development support apparatus, and software development support method
CN109710306A (en) * 2017-10-25 2019-05-03 歌乐株式会社 Source code resolver, source code analysis method, computer readable recording medium
CN109710306B (en) * 2017-10-25 2022-06-07 株式会社日立制作所 Source code analysis device, source code analysis method, and computer-readable recording medium

Similar Documents

Publication Publication Date Title
US9733901B2 (en) Domain specific language design
US9990389B1 (en) Systems and methods for generating event stream data
US9335978B2 (en) Computer aided visualization of a business object model lifecycle
US8387010B2 (en) Automatic software configuring system
CN111708801A (en) Report generation method and device and electronic equipment
US9286361B2 (en) Extract-transform-load processor controller
US20140298286A1 (en) Systems and Methods for Automatically Associating Software Elements and Automatic Gantt Chart Creation
JP2012230512A (en) System for displaying correspondence table between change frequency in each function in source code and complexity
US8701086B2 (en) Simplifying analysis of software code used in software systems
JP4978432B2 (en) Business specification understanding support system and method
EP2767900B1 (en) Method for programming language dependent merging of program codes
US20170124124A1 (en) System and method for analyzing complex metadata
US8166453B2 (en) Method and system for inconsistency resolution with cycle detection in a model-driven software environment
CN114647735A (en) Relation graph display method, medium and display device
JP4835859B2 (en) State transition diagram creation device and state transition diagram creation method
JP2018181020A (en) Calculation device and influence output system
JP2020201607A (en) Sentence analysis method, sentence analysis program, and sentence analysis system
US11809844B2 (en) Creating an app method and system
US20140164429A1 (en) Persisting instance-level report customizations
US8839114B1 (en) System, method, and computer program for generating a graphical representation of at least a portion of a synchronized network model
US10452592B1 (en) Message bus-based streaming rules engine
CN108021367B (en) UI development system and method based on metadata framework
Garcés et al. Aiming towards modernization: visualization to assist structural understanding of oracle forms applications
JP2007128193A (en) Transplanting man-hour estimation system
JP2013142971A (en) Device and method for processing program

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20140701