JP5487078B2 - Software asset management method and apparatus - Google Patents

Software asset management method and apparatus Download PDF

Info

Publication number
JP5487078B2
JP5487078B2 JP2010245778A JP2010245778A JP5487078B2 JP 5487078 B2 JP5487078 B2 JP 5487078B2 JP 2010245778 A JP2010245778 A JP 2010245778A JP 2010245778 A JP2010245778 A JP 2010245778A JP 5487078 B2 JP5487078 B2 JP 5487078B2
Authority
JP
Japan
Prior art keywords
source
source block
source code
blocks
block
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.)
Expired - Fee Related
Application number
JP2010245778A
Other languages
Japanese (ja)
Other versions
JP2012098902A (en
Inventor
久典 手島
明俊 志村
隆之 武沢
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 JP2010245778A priority Critical patent/JP5487078B2/en
Publication of JP2012098902A publication Critical patent/JP2012098902A/en
Application granted granted Critical
Publication of JP5487078B2 publication Critical patent/JP5487078B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

大規模システムにおける、既存ソフトウェアの部品化に関する。   It relates to componentization of existing software in large-scale systems.

鉄道運行管理システムのような大規模システムは、一度構築されると十年以上の長期に渡り使用される。このようなシステムは、システムが構築された後も状況に応じて改造・改修を行い、順次機能を拡張していく必要がある。   Large-scale systems such as railway operation management systems, once constructed, are used for a long period of more than 10 years. Such a system needs to be modified and modified in accordance with the situation even after the system is constructed, and the functions must be expanded sequentially.

例えばコンピュータ制御の発展期に構築された鉄道運行管理システムは、高密度輸送への対応や旅客案内の電子化など新たなニーズへの対応を常に迫られてきた。また、他線区からの直通運転など従来は想定されていなかった運行形態も誕生し、運行管理システムは新しい運行形態への対応にも迫られてきた。   For example, railway operation management systems built during the development of computer control have always been forced to respond to new needs such as high-density transportation and electronic passenger guidance. In addition, operation modes that were not previously envisaged, such as direct operation from other areas, were born, and the operation management system has been forced to respond to new operation modes.

システムの改修において、一度作成したソースコードに手を加える場合は、改修の影響が及ぶ範囲について再度テストを実施しなければならない。しかし、不用意に改修を行うと影響範囲が拡大しテスト工数の増大を招く。このような工数の増大は大規模システムでは特に顕著である。このため、既存のソースコードには極力手をつけず、改修場所の直近か末尾に新たなソースコードを付加することにより影響範囲を限定するという方法が一般に用いられている。   When modifying the source code once it has been modified, the test must be performed again for the extent of the impact of the modification. However, inadvertent modification will increase the range of impact and increase the number of test steps. Such an increase in man-hours is particularly noticeable in large-scale systems. For this reason, a method is generally used in which the existing source code is not touched as much as possible, and the range of influence is limited by adding a new source code in the immediate vicinity or at the end of the repair location.

例えばシステムの改修は特定のデータに関連する処理のみを対象として行う場合がほとんどであり、ソースコードの構造もこうした改修を見据えて設計されている。すなわち、例え類似の処理であっても処理対象のデータごとに別個の関数やソースコードが用意されている。このような設計であれば、改修による影響が他のデータに波及し、予期せぬ不具合が発生する可能性を減じることができる。もし改修部分が当初は変更が予期されていなかった場所であり、全データに対する共通処理とされていた場合でも、関連するソースコードを直近か末尾にコピー&ペーストして書き換えることにより、他のデータへの影響を最小限に抑えることができる。   For example, in most cases, system modifications are performed only for processing related to specific data, and the structure of the source code is designed with such modifications in mind. That is, even if the process is similar, a separate function and source code are prepared for each data to be processed. With such a design, it is possible to reduce the possibility that unexpected effects will occur due to the impact of the modification on other data. Even if the refurbishment part was originally a place where the change was not expected, and it was regarded as a common process for all the data, copy and paste the relevant source code to the last or last to rewrite other data. Can be minimized.

しかし、このような改修が繰り返されると、ソースコード規模の増大や不要ソースコードの蓄積、ソースコード構造の変容などが引き起こされ、可読性が大きく低下する。また、一見すると同一の処理に見えるが部分的に異なっているソースコードが多数発生してしまうため、それらの差異に気付かず誤った改修を行ってしまう危険性もある。結果として保守性が悪化し、長期に渡り改修に携わってきた作業者以外には手が出せないといった状況になってしまった。さらに、団塊世代の退職により有識者が大幅に減少しており、保守工数の加速的な増加が進行している。   However, if such modifications are repeated, the source code scale increases, unnecessary source code accumulates, the source code structure changes, and the like, resulting in a significant decrease in readability. In addition, a large number of source codes that appear to be the same processing at first glance but are partially different from each other are generated, and there is a risk that the user may not be aware of the difference and make an incorrect modification. As a result, the maintainability deteriorated, and it was impossible for anyone other than the workers who had been involved in the repair for a long time. Furthermore, due to the retirement of baby boomers, the number of experts has decreased significantly, and the maintenance man-hours are increasing at an accelerated pace.

このような問題の顕在化に加えて、例えば鉄道運行管理システムのように成熟したシステムでは新規機能の追加は回数が減少してきており、改修に適したプログラム構造より保守性の高いプログラム構造が強く求められている。   In addition to the actualization of such problems, the number of times new functions are added has decreased in mature systems such as railway operation management systems, and the program structure with higher maintainability is stronger than the program structure suitable for refurbishment. It has been demanded.

保守性の高いプログラムを製造するために有効な技術として、ソフトウェア製品系列開発が提案されている。ソフトウェア製品系列開発では、複数のソフトウェア製品群に対して製品間の共通性と相違性を定義し、ソフトウェアを共通部品と非共通部品に分けて製造する。製品間の共通性に従って部品を作ることにより、改修時の影響範囲を容易に知ることができ、保守性や再利用性を高めることができる。   Software product line development has been proposed as an effective technique for producing highly maintainable programs. In software product series development, commonality and dissimilarity between products are defined for a plurality of software product groups, and software is divided into common parts and non-common parts for manufacturing. By making parts according to the commonality between products, it is possible to easily know the scope of impact at the time of repair, and to improve maintainability and reusability.

鉄道運行管理システムのような大規模システムでも、処理対象のデータごとに作成されている従来のソースコードをソフトウェア製品群と見做すことができる。従って、ソースコードを処理対象のデータによらない共通処理と処理対象のデータに固有な処理に分類し、それぞれのソースコードを部品化すれば、ソフトウェア製品系列開発の考え方を鉄道運行管理システムのような大規模システムに適用できる。この際、既存のソースコードから共通処理と固有処理を抽出するための技術が必要である。   Even in a large-scale system such as a railway operation management system, the conventional source code created for each data to be processed can be regarded as a software product group. Therefore, if the source code is classified into common processing that does not depend on the data to be processed and processing that is specific to the data to be processed, and each source code is made into parts, the concept of software product line development is like a railway operation management system. It can be applied to large-scale systems. At this time, a technique for extracting common processing and unique processing from existing source code is required.

既存のソースコードを対象に共通処理を分析する技術として、ソースコードの一致部分を重複コードとして検出するものがある。重複コードは構文解析により単語や行といった単位で判別される。さらに、完全一致ではないが類似しているソースコードを検出するための技術として、ソースコード上の位置に基づき周辺の重複コードをグループ化する技術が開示されている(特許文献1)。   As a technique for analyzing a common process for an existing source code, there is a technique for detecting a matching portion of a source code as a duplicate code. Duplicate codes are discriminated in units such as words and lines by syntax analysis. Furthermore, as a technique for detecting similar but not perfect match, a technique for grouping surrounding duplicate codes based on the position on the source code is disclosed (Patent Document 1).

特許第3868859号Japanese Patent No. 3,868,859

特許文献1は対象文字列中の類似部分である類似部分文字列を検出する装置に関する。ソースコード中の類似部分文字列を検出することにより、既存のソースコードに含まれる共通処理を抽出することが出来る。しかし、抽出された共通処理は断片化されており処理の区切りとは必ずしも一致しないため、部品化のためには近傍のソースコードに含まれる処理の区切りを探索する必要がある。しかし、類似部分の中には変数宣言部や偶発的な一致部分などのノイズが多量に含まれるため、これら全てについて判定を行うためには多大な計算資源が必要である。この問題は大規模システムにおいて特に顕著である。また、類似部分文字列の検出はソースコード全体に渡る検索が必要なため、検出条件の変更といったチューニングを行う度に再計算を行う必要がある。さらに、偶発的な一致部分をフィルタリングする方法も実装しなければならない。   Patent Document 1 relates to an apparatus for detecting a similar partial character string that is a similar portion in a target character string. By detecting a similar partial character string in the source code, common processing included in the existing source code can be extracted. However, since the extracted common process is fragmented and does not necessarily match the process delimiter, it is necessary to search for a process delimiter included in the nearby source code for componentization. However, since a similar part includes a large amount of noise such as a variable declaration part and an accidental coincidence part, a large amount of calculation resources are required to make a determination on all of them. This problem is particularly noticeable in large-scale systems. Also, since the similar partial character string needs to be searched over the entire source code, it is necessary to perform recalculation every time tuning is performed such as changing the detection condition. In addition, a method for filtering out accidental matches must be implemented.

そこで、より少ない計算資源で実行可能なソフトウェア資産の整理方法および装置を提供する。   Therefore, a method and apparatus for organizing software assets that can be executed with fewer computational resources is provided.

ソフトウェアのソースコードから、当該ソフトウェアの部品として管理可能なソースブロックを抽出する装置は、ソースコード分割部と、ソースブロック分類部と、グループ化用マーカ抽出部と、ソースブロックグループ化部とを有する。   An apparatus for extracting source blocks that can be managed as software components from software source code includes a source code dividing unit, a source block classifying unit, a grouping marker extracting unit, and a source block grouping unit. .

ソースコード分割部は、ソースコードを所定のソースコード分割条件に基いて複数のソースブロックに分割し、複数のソースブロック各々についてソースブロック内で使用される変数を抽出し、複数のソースブロック間の関係を判別する。   The source code dividing unit divides the source code into a plurality of source blocks based on a predetermined source code dividing condition, extracts variables used in the source block for each of the plurality of source blocks, and Determine the relationship.

ソースブロック分類部は、指定された一以上の変数各々について、変数と所定の対応関係を有する一以上のソースブロックを判定する。   The source block classification unit determines, for each of the specified one or more variables, one or more source blocks having a predetermined correspondence relationship with the variable.

グループ化用マーカ抽出部は、判定結果に基いて、複数のソースブロックを一以上のグループにまとめるためのマーカを抽出する。   The grouping marker extraction unit extracts markers for collecting a plurality of source blocks into one or more groups based on the determination result.

ソースブロックグループ化部は、グループ化用マーカ抽出部が抽出したマーカを用いた所定のグループ化条件に基いて、複数のソースブロックの内二以上のソースブロックを一つのソフトウェア部品として整理可能なソースブロック群としてグループ化する。   The source block grouping unit is a source that can organize two or more source blocks of a plurality of source blocks as one software component based on a predetermined grouping condition using the markers extracted by the grouping marker extraction unit. Group as a block group.

より少ない計算資源でソフトウェア資産の整理が可能であり、チューニングも容易となる。   Software assets can be organized with less computational resources, and tuning is easier.

ソフトウェア資産整理装置が提供する入力画面例である。It is an example of an input screen which a software asset rearrangement apparatus provides. ソフトウェア資産整理装置が提供する出力画面例である。It is an example of an output screen which a software asset rearrangement apparatus provides. ソフトウェア資産整理装置のハードウェア構成例である。It is a hardware structural example of a software asset rearrangement apparatus. ソフトウェア資産整理装置のソフトウェア構成例である。It is a software structural example of a software asset rearrangement apparatus. ソフトウェア資産整理装置の全体処理の一例の概念を示す図である。It is a figure which shows the concept of an example of the whole process of a software asset rearrangement apparatus. ソフトウェア資産整理装置の全体処理の一例を示すフローである。It is a flow which shows an example of the whole process of a software asset rearrangement apparatus. ソースコードの分割処理の一例を示すフローである。It is a flow which shows an example of the division | segmentation process of a source code. 変数とソースブロックを対応付ける処理の一例を示すフローである。It is a flow which shows an example of the process which matches a variable and a source block. ソースブロック間の依存関係を求める処理の一例を示すフローである。It is a flow which shows an example of the process which calculates | requires the dependence relationship between source blocks. ソースブロック分類部の処理の一例を示すフローである。It is a flow which shows an example of a process of a source block classification | category part. ソースブロック分類部の処理の一例を示すフローである。It is a flow which shows an example of a process of a source block classification | category part. ソフトウェア資産整理装置の詳細処理の一例を示すフローである。It is a flow which shows an example of the detailed process of a software asset rearrangement apparatus. ソフトウェア資産整理装置の詳細処理の一例を示すフローである。It is a flow which shows an example of the detailed process of a software asset rearrangement apparatus. ソースコード分割条件リストの一例を示す図である。It is a figure which shows an example of a source code division | segmentation condition list | wrist. 制御構文情報テーブルの一例を示す図である。It is a figure which shows an example of a control syntax information table. ソースコード分割結果テーブルの一例を示す図である。It is a figure which shows an example of a source code division | segmentation result table. 変数情報テーブルの一例を示す図である。It is a figure which shows an example of a variable information table. ソースブロック依存関数テーブルの一例を示す図である。It is a figure which shows an example of a source block dependence function table. 処理対象データ候補テーブルの一例を示す図である。It is a figure which shows an example of a process target data candidate table. 処理対象データテーブルの一例を示す図である。It is a figure which shows an example of a process target data table. ソースブロック分類テーブルの一例を示す図である。It is a figure which shows an example of a source block classification | category table. 共通ソースブロックリストの一例を示す図である。It is a figure which shows an example of a common source block list. ソースブロックグループ化テーブルの一例を示す図である。It is a figure which shows an example of a source block grouping table.

以下、本発明の一実施形態を図1〜図23を参照して詳細に説明する。   Hereinafter, an embodiment of the present invention will be described in detail with reference to FIGS.

図1は開発者が既存のソフトウェア資産を部品化する際に用いる、ソフトウェア資産整理装置100が提供する入力画面の構成例である。ソフトウェア資産整理装置100の入力画面はソースファイル選択窓110と条件設定窓120とソースコードプレビュー窓130と分割実行ボタン140と処理対象変数選択窓150と部品化判定条件設定窓160とグループ化実行ボタン170から構成される。   FIG. 1 is a configuration example of an input screen provided by the software asset rearranging apparatus 100 used when a developer converts an existing software asset into a part. The input screen of the software asset rearranging apparatus 100 includes a source file selection window 110, a condition setting window 120, a source code preview window 130, a division execution button 140, a processing target variable selection window 150, a component determination condition setting window 160, and a grouping execution button. 170.

ソースファイル選択窓110はファイル表示窓111とソースファイル追加ボタン112とソースファイル除去ボタン113とソースファイル決定窓114から構成される。ファイル表示窓111にはファイルシステム内におけるディレクトリ構造が表示されている。図1ではディレクトリrootの下にディレクトリDirectoryA、DirectoryBが表示されている。またDirectoryAの下にはDirectoryA1、DirectoryA2が、DirectoryA1の下にはソースファイルhoge.c、fuga.cが表示されている。開発者はソフトウェア資産整理装置100においてソフトウェア資産整理を行いたいソースファイルをファイル表示窓111から選択した後、ソースファイル追加ボタン112を押下することによりソースファイル決定窓114へと当該ソースファイルを登録することができる。また、ソースファイル決定窓114へ登録されたソースファイルを除去したい場合は、ソースファイル決定窓114において除去したいソースファイルを選択した後、ソースファイル除去ボタン113を押下することにより除去することができる。ソースファイルの追加、除去の際には、ソースコードプレビュー窓130により選択したソースコードの内容を確認することができる。ソースファイル決定窓114では、登録されたソースファイルの中から、ソフトウェア資産整理装置100においてソフトウェア資産部品化の解析対象とするソースファイルをチェックボックスにより選択する。図1ではソフトウェア資産部品化の解析対象とするソースファイルとしてhoge.c、fuga.c、head.hが選択された状態となっている。   The source file selection window 110 includes a file display window 111, a source file addition button 112, a source file removal button 113, and a source file determination window 114. The file display window 111 displays a directory structure in the file system. In FIG. 1, directories DirectoryA and DirectoryB are displayed under the directory root. Further, under the directory A, the directories A1 and A2 are stored. Under the directory A1, the source file hoge. c, fuga. c is displayed. The developer selects a source file for which software asset rearranging is to be performed in the software asset rearranging apparatus 100 from the file display window 111 and then registers the source file in the source file determination window 114 by pressing a source file addition button 112. be able to. Further, when it is desired to remove a source file registered in the source file determination window 114, the source file can be removed by pressing the source file removal button 113 after selecting the source file to be removed in the source file determination window 114. When a source file is added or removed, the contents of the source code selected by the source code preview window 130 can be confirmed. In the source file determination window 114, a source file to be analyzed by the software asset rearranging apparatus 100 is selected from the registered source files using a check box. In FIG. 1, as a source file to be analyzed for software asset componentization, hoge. c, fuga. c, head. h is selected.

条件設定窓120ではソフトウェア資産整理装置100の解析に用いる条件を選択することができる。解析に用いる条件とは、例えば分析対象のソースコードの記述に用いられているプログラミング言語である。解析に用いる条件は変更ボタン121を押下することにより変更することができる。   In the condition setting window 120, a condition used for the analysis of the software asset rearranging apparatus 100 can be selected. The condition used for the analysis is, for example, a programming language used for describing the source code to be analyzed. The conditions used for analysis can be changed by pressing the change button 121.

ソースファイル選択窓110と条件設定窓120の入力が完了した後、分割実行ボタン140を押下されると、ソフトウェア資産整理装置100によりソースコード分割処理が開始される。   When the division execution button 140 is pressed after the input of the source file selection window 110 and the condition setting window 120 is completed, the software asset rearranging apparatus 100 starts the source code division process.

ソースコード分割処理が完了した後、ソフトウェア資産整理装置100により処理対象変数選択窓150に処理対象データ(以下、処理対象変数ともいう。)の候補が表示される。処理対象変数選択窓150は処理対象データ候補表示窓151と処理対象データ追加ボタン152と処理対象データ除去ボタン153と処理対象データ決定窓154から構成される。図1ではrootの下に構造体StructA、StructBが表示されている。またStructAの下にはStructA1、StructA2が、StructA1の下にはデータdataA、dataBが表示されている。開発者はソフトウェア資産整理装置100においてソースコードの分類を行うために用いる処理対象データを処理対象データ候補表示窓151から選択した後、処理対象データ追加ボタン152を押下することにより処理対象データ決定窓154へと当該処理対象データを登録することができる。また、処理対象データ決定窓154へ登録された処理対象データを除去したい場合は、処理対象データ決定窓154において除去したい処理対象データを選択した後、処理対象データ除去ボタン153を押下することにより除去することができる。処理対象データ決定窓154では、登録された処理対象データの中から、ソフトウェア資産整理装置100においてソースコードの分類を行うために用いる処理対象データをチェックボックスにより選択する。図1ではdataA、dataBが選択された状態となっている。   After the source code division processing is completed, candidates for processing target data (hereinafter also referred to as processing target variables) are displayed in the processing target variable selection window 150 by the software asset rearranging apparatus 100. The processing target variable selection window 150 includes a processing target data candidate display window 151, a processing target data addition button 152, a processing target data removal button 153, and a processing target data determination window 154. In FIG. 1, structures StructA and StructB are displayed under the root. In addition, StructA1 and StructA2 are displayed under StructA, and data dataA and dataB are displayed under StructA1. The developer selects processing target data to be used for classifying source code in the software asset rearranging apparatus 100 from the processing target data candidate display window 151, and then presses a processing target data addition button 152 to select a processing target data determination window. The processing target data can be registered in 154. In addition, when it is desired to remove the processing target data registered in the processing target data determination window 154, after selecting the processing target data to be deleted in the processing target data determination window 154, the processing target data determination window 154 is deleted by pressing the processing target data removal button 153. can do. In the processing target data determination window 154, processing target data to be used for classifying the source code in the software asset rearranging apparatus 100 is selected from the registered processing target data using check boxes. In FIG. 1, dataA and dataB are selected.

ここで、処理対象データとは、当該データの生成が対象プログラムの実行目的となっているものであり、ソースコード内においては、プログラムの返り値やテーブルへと格納された変数、当該プログラム内で書き換えが行われた後に他プログラムで入力として利用されている変数などの形で判別することができる。また、仕様書からは、プログラムの出力として明示されているデータとして判別することができる。一例として、鉄道運行管理システムにおける、運行制御用の情報テーブルから旅客案内用の情報を生成するプログラムの場合について説明する。前記プログラムにおいては、目的となる出力は旅客案内用の情報であり、処理対象データは例えば列車の行先や停車駅となる。   Here, the processing target data means that the generation of the data is the purpose of execution of the target program. In the source code, the return value of the program, variables stored in the table, After rewriting, it can be determined in the form of variables used as input in other programs. Further, it can be determined from the specification as data that is clearly shown as the output of the program. As an example, a case of a program for generating information for passenger guidance from an information table for operation control in a railway operation management system will be described. In the program, the target output is information for passenger guidance, and the processing target data is, for example, a train destination or a stop station.

処理対象変数選択窓150の入力が完了した後は、部品化判定条件設定窓160から二つの部品を同一部品と判定するための条件として、例えばソースコード一致率の下限を入力する。その後、グループ化実行ボタン170を押下されると、ソフトウェア資産整理装置100によりソフトウェア資産として部品化可能なソースコード群のグループ化処理が開始する。   After the input of the processing target variable selection window 150 is completed, for example, the lower limit of the source code match rate is input as a condition for determining two components as the same component from the componentization determination condition setting window 160. Thereafter, when the grouping execution button 170 is pressed, the software asset rearranging apparatus 100 starts grouping processing of source code groups that can be converted into parts as software assets.

図2はソフトウェア資産整理装置100が提供する出力画面の構成例である。ソフトウェア資産整理装置100の出力画面はソースブロックグループ化結果表示窓210とソースブロック分類結果表示窓220とソースコード比較結果表示窓230とメトリクス表示窓240と再表示ボタン250から構成される。   FIG. 2 is a configuration example of an output screen provided by the software asset rearranging apparatus 100. The output screen of the software asset rearranging apparatus 100 includes a source block grouping result display window 210, a source block classification result display window 220, a source code comparison result display window 230, a metrics display window 240, and a redisplay button 250.

ソースブロックグループ化結果表示窓210はグループ表示窓211とグループ内のソースブロック表示窓212から構成される。グループ表示窓211には、一つのソフトウェア部品として資産化されるソースブロック群をグループ化したものの一覧が表示される。図2では、グループとしてGroup1、Group2、Group3、Group4が表示されている。また、Group1が選択状態となっている。グループ内のソースブロック表示窓212にはグループ表示窓211において選択中のグループに属するソースブロック群が表示される。図2では、Group1に属するBlock2、Block5、Block9、Block15が表示されている。また、グループ内のソースブロック表示窓212では選択グループ内のソースコード比較結果表示窓230に表示されるソースブロックをチェックボックスにより選択することができる。図2では、Block2、Block5、Block9が選択状態となっている。開発者は、ソースブロックグループ化結果表示窓210、ソースコード比較結果表示窓230の表示結果より、一つのソフトウェア部品として資産化されたソースコード群が何であるかを知ることができる。また、開発者は部品化結果について手動で修正を加えることもできる。   The source block grouping result display window 210 includes a group display window 211 and a source block display window 212 in the group. The group display window 211 displays a list of grouped source blocks grouped as one software component. In FIG. 2, Group1, Group2, Group3, and Group4 are displayed as groups. In addition, Group 1 is in a selected state. In the source block display window 212 in the group, source block groups belonging to the group selected in the group display window 211 are displayed. In FIG. 2, Block2, Block5, Block9, and Block15 belonging to Group1 are displayed. In the source block display window 212 in the group, the source block displayed in the source code comparison result display window 230 in the selected group can be selected by a check box. In FIG. 2, Block 2, Block 5, and Block 9 are selected. From the display results of the source block grouping result display window 210 and the source code comparison result display window 230, the developer can know what source code group is capitalized as one software component. Developers can also manually modify the componentization results.

ソースブロック分類結果表示窓220はソースブロック名表示欄221と処理対象データ表示欄222とソースブロックと処理対象データの対応関係表示欄223から構成される。図2では、ソースブロックと処理対象データの対応関係表示欄223中の黒塗りとなっているセルは、ソースブロック名表示欄221のうち当該セルの左に表示されているソースブロック名が、処理対象データ表示欄222のうち当該セルの上に表示されている処理対象データに対応付けられていることを示している。開発者は、ソースブロック分類結果表示窓220の結果より、ソースコードの部品化作業時に取り扱っているソースブロックがどの処理対象データに影響を与えうるかを確認することができる。   The source block classification result display window 220 includes a source block name display column 221, a processing target data display column 222, and a source block / processing target data correspondence display column 223. In FIG. 2, a black-colored cell in the correspondence display column 223 between the source block and the processing target data indicates that the source block name displayed to the left of the cell in the source block name display column 221 In the target data display field 222, it is shown that it is associated with the processing target data displayed on the cell. From the result of the source block classification result display window 220, the developer can confirm which processing target data can be affected by the source block handled at the time of componentization of the source code.

ソースコード比較結果表示窓230はグループ内のソースブロック表示窓212において選択中のソースブロックのソースコード一致部分と相違部分を表示する。図2では黒塗り部が一致部分、非黒塗り部が相違部分を表す。開発者は、ソースコード比較結果表示窓230の結果より、ソースコードの部品化作業において、重複しているソースコードの除去や、ソースブロック内のソースコード群を統合する際に各々の行を挿入する場所を判別することができる。   The source code comparison result display window 230 displays the source code matching part and the difference part of the source block selected in the source block display window 212 in the group. In FIG. 2, the black painted portion represents a matching portion, and the non-black painted portion represents a different portion. From the result of the source code comparison result display window 230, the developer inserts each line when removing the duplicate source code or integrating the source code group in the source block in the source code componentization work. The place to do can be determined.

メトリクス表示窓240はソフトウェア資産の整理による効果を表示する。ソフトウェア資産の整理による効果とは、例えば部品化により削減可能なソースコード行数やソースコード削減率である。また、ソースブロック総数や部品化後の部品点数、ソースコード総行数などの情報も表示する。図2では、ソースコード削減率として64%が表示されており、これは部品化により削減可能なソースコード行数である18、552行をソースコード総行数である28、988行で除したものである。開発者は、メトリクス表示窓240の結果より、部品化作業の作業規模や部品化に伴うソースコードの削減効果を定量的に評価することができる。   The metrics display window 240 displays the effect of organizing software assets. The effects of organizing software assets include, for example, the number of source code lines and the source code reduction rate that can be reduced by componentization. Information such as the total number of source blocks, the number of parts after conversion into parts, and the total number of source code lines are also displayed. In FIG. 2, 64% is displayed as the source code reduction rate, which is obtained by dividing the number of source code lines 18 and 552 that can be reduced by componentization by the total number of source code lines 28 and 988. Is. From the result of the metrics display window 240, the developer can quantitatively evaluate the work scale of componentization work and the source code reduction effect associated with componentization.

再表示ボタン250は、ソースブロックグループ化結果表示窓210において選択中のグループ、ソースブロックを変更した際に押下することにより、ソースブロック分類結果表示窓220、ソースコード比較結果表示窓230、メトリクス表示窓240を更新するためのボタンである。   The re-display button 250 is pressed when the group or source block selected in the source block grouping result display window 210 is changed, so that a source block classification result display window 220, a source code comparison result display window 230, and a metrics display are displayed. This is a button for updating the window 240.

図3はソフトウェア資産整理装置100のハードウェア構成例である。ソフトウェア資産整理装置100のハードウェアは、中央処理装置310と主記憶装置320と内部バス330とバスインタフェース340と外部バス350と入出力装置360と入出力装置インタフェース361と大容量記憶装置370と大容量記憶装置インタフェース371と通信装置380と通信装置インタフェース381から構成される。   FIG. 3 is a hardware configuration example of the software asset rearranging apparatus 100. The hardware of the software asset management device 100 includes a central processing unit 310, a main storage device 320, an internal bus 330, a bus interface 340, an external bus 350, an input / output device 360, an input / output device interface 361, a mass storage device 370, and a large capacity. A capacity storage device interface 371, a communication device 380, and a communication device interface 381 are included.

中央処理装置310はプログラム実行等の演算を行うためのプロセッサである。主記憶装置320はプログラム実行時にプログラムや演算結果などのデータを一時的に格納するための装置である。中央処理装置310と主記憶装置320は内部バス330により接続されており、内部バス330はバスインタフェース340を介して外部バス350に接続されている。   The central processing unit 310 is a processor for performing operations such as program execution. The main storage device 320 is a device for temporarily storing data such as programs and calculation results during program execution. The central processing unit 310 and the main storage device 320 are connected by an internal bus 330, and the internal bus 330 is connected to an external bus 350 via a bus interface 340.

入出力装置インタフェース361は入出力装置360と接続される。入出力装置360はディスプレイやキーボード、マウスなど、開発者とのインターフェースデバイスである。図1および図2に示す入力画面、出力画面は入出力インタフェース361から提供される。大容量記憶装置インタフェース371は大容量記憶装置370に接続される。大容量記憶装置370は基本プログラムや処理結果などを永続的に記憶するための装置である。通信装置インタフェース381は通信装置380と接続される。通信装置380は外部サーバ装置などと接続するための装置であり、処理対象のソースコードや処理結果をネットワークを通じて外部サーバ装置へと提供することができる。通信装置380を用いることにより、例えばソフトウェア資産整理装置100の機能をネットワークを通じた先に接続されている計算機に対してサービスとして提供することが可能となる。   The input / output device interface 361 is connected to the input / output device 360. The input / output device 360 is an interface device with a developer such as a display, a keyboard, and a mouse. The input screen and output screen shown in FIGS. 1 and 2 are provided from the input / output interface 361. The mass storage device interface 371 is connected to the mass storage device 370. The mass storage device 370 is a device for permanently storing basic programs and processing results. The communication device interface 381 is connected to the communication device 380. The communication device 380 is a device for connecting to an external server device or the like, and can provide a source code to be processed and a processing result to the external server device through a network. By using the communication device 380, for example, the function of the software asset rearranging device 100 can be provided as a service to a computer connected earlier through the network.

図4はソフトウェア資産整理装置100のソフトウェア構成例である。ソフトウェア資産整理装置100のソフトウェアは、ソースコード分割部411とソースブロック分類部412とグループ化用マーカ抽出部413とソースブロックグループ化部414とコントローラ部421と画面管理部431と入力インタフェース441と出力インタフェース451とソースコード分割条件リスト461とインライン展開ソースファイル462と制御構文情報テーブル463とソースコード分割結果テーブル464と変数情報テーブル465とソースブロック依存関係テーブル466と処理対象データ候補テーブル467と処理対象データテーブル471とソースブロック分類テーブル472と共通ソースブロックリスト481とソースブロックグループ化テーブル491から構成される。   FIG. 4 is a software configuration example of the software asset rearranging apparatus 100. The software of the software asset rearranging apparatus 100 includes a source code division unit 411, a source block classification unit 412, a grouping marker extraction unit 413, a source block grouping unit 414, a controller unit 421, a screen management unit 431, an input interface 441, and an output. Interface 451, source code division condition list 461, inline expansion source file 462, control syntax information table 463, source code division result table 464, variable information table 465, source block dependency table 466, processing target data candidate table 467, and processing target A data table 471, a source block classification table 472, a common source block list 481, and a source block grouping table 491 are included.

ソースコード分割部411、ソースブロック分類部412、グループ化用マーカ抽出部413、ソースブロックグループ化部414、コントローラ部421、画面管理部431、入力インタフェース441、出力インタフェース451を実現するプログラムは実行時に大容量記憶装置370から主記憶装置320へと展開され、中央処理装置310により演算が行われる。また、プログラムの実行により生成されたソースコード分割条件リスト461、インライン展開ソースファイル462、制御構文情報テーブル463、ソースコード分割結果テーブル464、変数情報テーブル465、ソースブロック依存関係テーブル466、処理対象データ候補テーブル467、処理対象データテーブル471、ソースブロック分類テーブル472、共通ソースブロックリスト481、ソースブロックグループ化テーブル491は主記憶装置320へと展開される。開発者はキーボードやマウス、ディスプレイなどの入出力装置360を介して入力インタフェース441へと指示を与えることによりプログラムの実行を制御することができる。また、入出力装置360として着脱可能で可搬性のある記憶媒体を用いることによりデータの入出力を行うことができる。通信装置380を通じ、他の装置との間で入出力を行うこともできる。各機能部を実現するプログラムやソースファイル決定窓114で選択できるソースファイルは、予め大容量記憶装置370に格納されていてもよいし、利用可能な媒体を介して他の装置から大容量記憶装置370や主記憶装置320に導入されてもよい。媒体とは、例えば、入出力装置360としては着脱可能な記憶媒体、または、通信装置380としてはネットワーク、ネットワークを伝搬する搬送波やデジタル信号などの通信媒体を指す。   A program for realizing the source code dividing unit 411, the source block classifying unit 412, the grouping marker extracting unit 413, the source block grouping unit 414, the controller unit 421, the screen management unit 431, the input interface 441, and the output interface 451 is executed at the time of execution. The data is expanded from the mass storage device 370 to the main storage device 320, and the central processing unit 310 performs an operation. Also, a source code division condition list 461, an inline expansion source file 462, a control syntax information table 463, a source code division result table 464, a variable information table 465, a source block dependency table 466, processing target data generated by executing the program The candidate table 467, the processing target data table 471, the source block classification table 472, the common source block list 481, and the source block grouping table 491 are expanded into the main storage device 320. The developer can control the execution of the program by giving an instruction to the input interface 441 via the input / output device 360 such as a keyboard, a mouse, and a display. In addition, data can be input and output by using a detachable and portable storage medium as the input / output device 360. Input / output can also be performed with other devices via the communication device 380. A program that realizes each functional unit and a source file that can be selected in the source file determination window 114 may be stored in the mass storage device 370 in advance, or may be stored in a mass storage device from another device via an available medium. It may be installed in 370 or the main storage device 320. The medium refers to, for example, a removable storage medium as the input / output device 360, or a communication medium such as a network, a carrier wave propagating through the network, or a digital signal as the communication device 380.

ソースコード分割部411は既存ソースコードをインライン展開し、制御構文によりソースコードを分割する部分である。その際、ソースブロック間の依存関係導出やソースコード内で利用されているデータの抽出も行う。ソースコード分割部411では、まず条件設定窓120に入力された解析条件を読み込み、ソースコード分割条件リスト461へと格納する。   The source code dividing unit 411 is a part that expands an existing source code inline and divides the source code by a control syntax. At that time, the dependency relationship between the source blocks is derived and the data used in the source code is also extracted. First, the source code division unit 411 reads the analysis conditions input to the condition setting window 120 and stores them in the source code division condition list 461.

ソースコード分割条件リスト461の詳細例を図14に示す。ソースコード分割条件リスト461には、ソースコード言語設定、ソースコード分割条件が格納されている。ソースコード言語設定にはC言語やJAVA(登録商標)など、ソースコードを記述している言語が格納されている。これは、条件分岐の探索や実行順序の判断などの構文解析を行う際に用いる。ソースコード分割条件には、入力ソースコードをソースブロックへと分割する際に用いる条件が格納されている。   A detailed example of the source code division condition list 461 is shown in FIG. The source code division condition list 461 stores source code language settings and source code division conditions. The source code language setting stores a language describing the source code, such as C language or JAVA (registered trademark). This is used when performing syntax analysis such as searching for conditional branches and determining the execution order. The source code division condition stores a condition used when the input source code is divided into source blocks.

次に、ソースコード分割部411はソースファイル決定窓114において選択されたソースファイル名で指定されるソースファイルからソースコードを読み込み、当該ソースコードをインライン展開したものをインライン展開ソースファイル462へと格納する。そしてソースコード分割部411はインライン展開ソースファイル462に対して構文解析処理を行い、抽出された制御構文の詳細を制御構文情報テーブル463へと格納する。ここで、制御構文とは、例えばC言語であれば条件分岐を表すif文や反復処理を表すfor文のことである。制御構文情報テーブル463はソースコード分割の際に用いる。   Next, the source code dividing unit 411 reads the source code from the source file designated by the source file name selected in the source file determination window 114, and stores the source code inline expanded into the inline expanded source file 462. To do. Then, the source code dividing unit 411 performs syntax analysis processing on the inline expansion source file 462 and stores details of the extracted control syntax in the control syntax information table 463. Here, the control syntax is, for example, an if statement representing a conditional branch or a for statement representing an iterative process in C language. The control syntax information table 463 is used for source code division.

制御構文情報テーブル463の詳細例を図15に示す。制御構文情報テーブル463はソースファイル中に出現した制御構文のそれぞれについて、制御構文ID、開始位置、終了位置、制御構文種類、実行条件、親階層制御構文IDが格納されている。制御構文IDには対象の制御構文を一意に識別するためのキーが格納されている。制御構文IDの割り当ては重複がなければ任意で構わない。開始位置には制御構文により制御されるソースコード範囲(以下、制御範囲と記述)のうち、一番初めの行の行番号が格納されている。終了位置には制御範囲の一番最後の行の行番号が格納されている。尚、行番号はインライン展開ソースファイル462におけるものを用いる。制御構文には制御構文の種類が格納されている。実行条件には制御構文が実行される際に満たすべき条件が格納されている。親階層制御構文IDには、制御構文Aが他の制御構文Bの制御範囲に包含されていた場合、BをAの親階層制御構文と定義し、対象としている制御構文の親階層制御構文の制御構文IDが格納されている。ここで、制御構文Aが複数の制御構文B、Cに包含されている場合、すなわち、制御構文Bが制御構文Cにさらに包含されているような場合は、Aの直上の制御構文、すなわち制御構文Bを親階層制御構文とする。   A detailed example of the control syntax information table 463 is shown in FIG. The control syntax information table 463 stores a control syntax ID, a start position, an end position, a control syntax type, an execution condition, and a parent hierarchy control syntax ID for each control syntax that appears in the source file. The control syntax ID stores a key for uniquely identifying the target control syntax. The assignment of the control syntax ID may be arbitrary as long as there is no duplication. In the start position, the line number of the first line in the source code range controlled by the control syntax (hereinafter referred to as control range) is stored. The end position stores the line number of the last line in the control range. The line numbers in the inline expanded source file 462 are used. The control syntax stores the type of control syntax. The execution condition stores a condition to be satisfied when the control syntax is executed. If the control syntax A is included in the control range of another control syntax B, the parent hierarchical control syntax ID defines B as the parent hierarchical control syntax of A, and the parent hierarchical control syntax of the target control syntax Control syntax ID is stored. Here, when the control syntax A is included in a plurality of control syntaxes B and C, that is, when the control syntax B is further included in the control syntax C, the control syntax immediately above A, that is, control. Syntax B is a parent hierarchy control syntax.

制御構文情報テーブル463の作成が終了した後は、ソースコード分割部411はソースコード分割条件リスト461のソースコード分割条件を参照し、条件に該当する制御構文を制御構文情報テーブル463から検索してソースコードを複数のソースブロックに分割する。作成結果はソースコード分割結果テーブル464に格納する。ソースコード分割結果テーブル464はソースコード分割部411における主要な成果物である。   After the creation of the control syntax information table 463 is completed, the source code division unit 411 refers to the source code division condition in the source code division condition list 461 and searches the control syntax information table 463 for a control syntax corresponding to the condition. Divide the source code into multiple source blocks. The creation result is stored in the source code division result table 464. The source code division result table 464 is a main product in the source code division unit 411.

ソースコード分割結果テーブル464の詳細を図16に示す。ソースコード分割結果テーブル464にはソースブロックID、開始位置、終了位置、実行条件、親階層ソースブロックIDが格納されている。ソースブロックIDには対象のソースブロックを一意に識別するためのキーが格納されている。ソースブロックIDの割り当ては重複がなければ任意で構わない。開始位置にはソースブロックの開始行の行番号が格納されている。終了位置にはソースブロックの終了行の行番号が格納されている。尚、行番号はインライン展開ソースファイル462におけるものを用いる。実行条件にはソースブロックが実行される際に満たすべき条件が格納されている。親階層ソースブロックIDには、当該ソースブロックに対応する制御構文について、制御構文情報テーブル463の親階層制御構文IDに値が格納されていた場合、親階層制御構文IDが表す制御構文に対応するソースブロックのソースブロックIDが格納されている。   Details of the source code division result table 464 are shown in FIG. The source code division result table 464 stores a source block ID, a start position, an end position, an execution condition, and a parent hierarchy source block ID. The source block ID stores a key for uniquely identifying the target source block. The assignment of the source block ID may be arbitrary as long as there is no duplication. The starting position stores the line number of the starting line of the source block. At the end position, the line number of the end line of the source block is stored. The line numbers in the inline expanded source file 462 are used. The execution condition stores a condition to be satisfied when the source block is executed. When a value is stored in the parent hierarchy control syntax ID of the control syntax information table 463 for the control syntax corresponding to the source block, the parent hierarchy source block ID corresponds to the control syntax represented by the parent hierarchy control syntax ID. The source block ID of the source block is stored.

インライン展開ソースファイル462からソースコード分割結果テーブル464が生成される様子を概念的に図5に示す。図5では、ソースコード分割部411によって、インライン展開ソースファイル462の1行目がソースブロック1に、2〜5行目がソースブロック2に、6〜9行目がソースブロック3に、10〜13行目がソースブロック4に、14行目がソースブロック5に分割されている。   FIG. 5 conceptually shows how the source code division result table 464 is generated from the inline expansion source file 462. In FIG. 5, the source code dividing unit 411 causes the first line of the inline expanded source file 462 to be the source block 1, the second to fifth lines to the source block 2, the sixth to ninth lines to the source block 3, The 13th line is divided into source blocks 4 and the 14th line is divided into source blocks 5.

ソースコード分割結果テーブル464の作成が終了した後は、ソースコード分割部411は処理対象データの抽出とソースブロック間の関連を導出する。まずソースコード分割部411はインライン展開ソースファイル462から、当該インライン展開ソースファイル462内に出現する変数を抽出し、変数情報テーブル465へと格納する。変数情報テーブル465はソースブロック間の依存関係を判別するために用いられる。   After the creation of the source code division result table 464 is completed, the source code division unit 411 derives the processing target data extraction and the relationship between the source blocks. First, the source code dividing unit 411 extracts variables appearing in the inline expansion source file 462 from the inline expansion source file 462 and stores them in the variable information table 465. The variable information table 465 is used to determine the dependency relationship between source blocks.

変数情報テーブル465の詳細例を図17に示す。変数情報テーブル465には変数ID、変数名、スコープ、変数型、出現位置、対応分割ソースコードID(以下、分割ソースコードをソースブロックとも呼ぶ)、利用種別フラグが格納されている。変数IDには対象の変数を一意に識別するためのキーが格納されている。変数IDの割り当ては重複がなければ任意で構わない。変数名にはインライン展開ソースファイル462内で使用されている変数の名称が格納されている。スコープにはソースコード上において当該変数に読み書きが行える範囲について、インライン展開ソースファイル462における開始行と終了行の行番号が格納されている。ここで、変数情報テーブル465においては同一変数名でもスコープが異なれば別々の変数として扱われる。変数型には対象としている変数の型が格納されている。ここで、変数の型とは、例えばC言語ではintやfloatである。本実施例では、記述の煩雑さを避けるため、出現位置、対応ソースブロックID、利用種別フラグは変数ごとに別表としている。出現位置には、インライン展開ソースファイル462上で変数が出現する行が格納されている。対応ソースブロックIDには、変数の出現行を範囲に含んでいるソースブロックのソースブロックIDが格納されている。利用種別フラグには、当該行で変数に値が書き込まれている場合は”書き込み”が、変数の値を読み込んでいる場合は”読み込み”が格納されている。ここで、当該行で書き込みが行われていない場合は読み込みであると判別している。   A detailed example of the variable information table 465 is shown in FIG. The variable information table 465 stores a variable ID, a variable name, a scope, a variable type, an appearance position, a corresponding divided source code ID (hereinafter, the divided source code is also referred to as a source block), and a usage type flag. The variable ID stores a key for uniquely identifying the target variable. The assignment of the variable ID may be arbitrary as long as there is no duplication. The variable name stores the name of the variable used in the inline expansion source file 462. The scope stores the line numbers of the start line and the end line in the inline expanded source file 462 for the range in which the variable can be read and written on the source code. Here, in the variable information table 465, the same variable name is treated as a separate variable if the scope is different. The variable type stores the type of the target variable. Here, the variable type is, for example, int or float in the C language. In this embodiment, the appearance position, the corresponding source block ID, and the usage type flag are provided separately for each variable in order to avoid complicated description. A line where a variable appears on the inline expanded source file 462 is stored at the appearance position. The corresponding source block ID stores the source block ID of the source block that includes the variable appearance line in the range. The usage type flag stores “write” when a value is written to the variable in the corresponding row, and “read” when the value of the variable is read. Here, when writing is not performed in the row, it is determined that reading is performed.

変数情報テーブル465の作成が終了した後は、ソースコード分割部411は変数情報テーブル465の対応分割ソースブロックID、利用種別フラグからソースブロック間のデータの読み書き関係を判別し、結果をソースブロック依存関係テーブル466に格納する。ソースブロック依存関係テーブル466はソースブロックと処理対象データを関連付ける際に用いる。   After the creation of the variable information table 465 is completed, the source code dividing unit 411 determines the data read / write relationship between the source blocks from the corresponding divided source block ID and the usage type flag in the variable information table 465, and the result depends on the source block. Stored in the relationship table 466. The source block dependency relationship table 466 is used when associating a source block with data to be processed.

ソースブロック依存関係テーブル466の詳細例を図18に示す。ソースブロック依存関係テーブル466には変数ID、読み込み分割ソースコードID、書き込み分割ソースコードID、実行条件依存フラグが格納されている。変数IDは変数情報テーブル465に用いられている変数IDであり、二つのソースブロックで各々読み込み若しくは書き込みが行われている変数の変数IDが格納されている。読み込みソースブロックIDには当該変数を読み込んでいるソースブロックIDが格納されている。書き込みソースブロックIDには当該変数に書き込みが行われているソースブロックIDが格納されている。なお、ソースブロック間のデータの読み書き関係を判別する際に、書き込みソースブロックIDで表されるソースブロックで書き込みが行われた後、読み込みソースブロックIDで表されるソースブロックで読み込みが行われる前に他のソースブロックにおいて必ず上書きが行われるものについては除外してある。実行条件依存フラグには、当該変数を読み込んでいる場所が読み込みソースブロックIDで表されるソースブロックの実行条件部分であった場合に”TRUE”が、それ以外の場合は”FALSE”が格納されている。実行条件依存フラグは、ソースコード分割結果テーブル464の親階層ソースブロックIDに値が格納されている場合に処理対象データとソースブロックの対応付けを正しく行うために用いられる。   A detailed example of the source block dependency relationship table 466 is shown in FIG. The source block dependency relationship table 466 stores a variable ID, a read divided source code ID, a write divided source code ID, and an execution condition dependent flag. The variable ID is a variable ID used in the variable information table 465, and stores variable IDs of variables that are read or written by the two source blocks. The read source block ID stores the source block ID from which the variable is read. The write source block ID stores the source block ID in which the variable is written. When determining the data read / write relationship between the source blocks, after writing is performed in the source block represented by the write source block ID, and before reading is performed in the source block represented by the read source block ID. In addition, those overwritten in other source blocks are excluded. In the execution condition dependency flag, “TRUE” is stored when the location where the variable is read is the execution condition portion of the source block indicated by the read source block ID, and “FALSE” is stored otherwise. ing. The execution condition dependency flag is used to correctly associate the processing target data with the source block when a value is stored in the parent hierarchy source block ID of the source code division result table 464.

ソースブロック依存関係テーブル466の作成が終了した後は、ソースコード分割部411はソースコード内に出現している変数から処理対象データの候補を取り出す。結果は処理対象データ候補テーブル467に格納される。   After the creation of the source block dependency relationship table 466 is completed, the source code dividing unit 411 extracts candidates for processing target data from variables appearing in the source code. The result is stored in the processing target data candidate table 467.

処理対象データ候補テーブル467の詳細例を図19に示す。処理対象データ候補テーブル467には変数ID、ビット数、構造体直下の変数IDが格納されている。変数IDは変数情報テーブル465の変数IDと同一のものであり、変数情報テーブル465への参照に用いられる。ビット数は変数のデータサイズをビットを単位として表したものが格納されている。構造体直下の変数IDには、当該変数が構造体である場合、直下に存在している変数の変数IDが格納されている。ここで、構造体Aが要素として構造体Bを持つ場合、構造体Bは構造体Aの内部に含まれているとし、また、構造体Aの内部に他の構造体Bがあったとき、構造体Aの内部に含まれている変数のうち構造体Bの内部に含まれている変数を除いたものを構造体直下の変数とする。優先順位には処理対象データ候補表示窓151に表示される順番が格納されている。処理対象データ候補テーブル467の作成が終了した後は、ソースコード分割部411は結果を処理対象データ候補表示窓151に出力し、ユーザの応答待ちとなる。   A detailed example of the processing target data candidate table 467 is shown in FIG. The processing target data candidate table 467 stores a variable ID, the number of bits, and a variable ID immediately below the structure. The variable ID is the same as the variable ID in the variable information table 465, and is used for reference to the variable information table 465. The number of bits stores the data size of the variable expressed in bits. If the variable is a structure, the variable ID immediately below the structure stores the variable ID of the variable that exists immediately below the structure. Here, when the structure A has the structure B as an element, the structure B is included in the structure A, and when there is another structure B in the structure A, Of the variables included in the structure A, variables excluding the variables included in the structure B are defined as variables immediately below the structure. The order of display in the processing target data candidate display window 151 is stored in the priority order. After the creation of the processing target data candidate table 467 is completed, the source code dividing unit 411 outputs the result to the processing target data candidate display window 151 and waits for a user response.

ソースブロック分類部412はユーザが入力した処理対象データに従ってソースブロックを分類する部分である。まずは、処理対象データ決定窓154よりユーザが指定した処理対象データを読み込み、処理対象データテーブル471に格納する。   The source block classification unit 412 is a part that classifies the source blocks according to the processing target data input by the user. First, processing target data designated by the user is read from the processing target data determination window 154 and stored in the processing target data table 471.

処理対象データテーブル471の詳細例を図20に示す。処理対象データテーブル471には処理対象データID、変数IDが格納されている。処理対象データIDには対象の変数を一意に識別するためのキーが格納されている。処理対象データIDの割り当ては重複がなければ任意で構わない。変数IDには当該変数に対して変数情報テーブル465内で割り当てられている変数IDが格納されている。   A detailed example of the processing target data table 471 is shown in FIG. The processing target data table 471 stores processing target data IDs and variable IDs. The processing target data ID stores a key for uniquely identifying the target variable. The assignment of the processing target data ID may be arbitrary as long as there is no duplication. The variable ID stores a variable ID assigned to the variable in the variable information table 465.

処理対象データテーブル471の作成が終了した後は、ソースブロック分類部412は処理対象データとソースブロックの対応関係を導く。ここで、処理対象データとソースブロックが対応関係を持つとは、ソースブロックの除去により処理対象データの値が変化する場合が存在することとする。処理対象データとソースブロックの対応関係判別にはソースコード分割結果テーブル464、ソースブロック依存関係テーブル466、処理対象データテーブル471を用いる。結果はソースブロック分類テーブル472に格納する。ソースブロック分類テーブル472はソースブロック分類部412の主要な成果物である。   After the creation of the processing target data table 471 is completed, the source block classification unit 412 derives the correspondence between the processing target data and the source block. Here, the fact that the processing target data and the source block have a correspondence relationship means that there is a case where the value of the processing target data changes due to the removal of the source block. The source code division result table 464, the source block dependency relationship table 466, and the processing target data table 471 are used for determining the correspondence between the processing target data and the source block. The result is stored in the source block classification table 472. The source block classification table 472 is a main product of the source block classification unit 412.

ソースブロック分類テーブル472の詳細例を図21に示す。ソースブロック分類テーブル472は処理対象データごとに用意されるテーブルで、処理対象データごとにソースブロックID、関係処理フラグ、条件処理フラグが格納されている。ソースブロックIDには処理対象データと対応関係を持つソースブロックのソースブロックIDが格納されている。関係処理フラグには、当該ソースブロックに対し関係処理がまだ行われていない場合”未処理”が、関係処理が行われている最中は”処理中”が、関係処理が終了した後には”処理済”が格納されている。ここで、関係処理とは、ソースブロック依存関係テーブル466から依存関係を持つソースブロックを連鎖的に探索していく処理である。条件処理フラグには、当該ソースブロックに対し条件処理がまだ行われていない場合”未処理”が、条件処理が行われている最中は”処理中”が、条件処理が終了した後には”処理済”が格納されている。ここで、条件処理とは、あるソースブロックの実行条件に変数が含まれているとき,当該変数を書き換える別のソースブロックを探索する処理である。条件処理は、ソースコード分割結果テーブル464の当該ソースブロックに対応する行の親階層ソースブロックIDに値が格納されており、かつソースブロック依存関係テーブル466の読み込みソースブロックIDに親階層ソースブロックIDに対応するソースブロックが格納されており、かつ当該行の実行条件フラグが”TRUE”である場合に行われる。   A detailed example of the source block classification table 472 is shown in FIG. The source block classification table 472 is prepared for each processing target data, and stores a source block ID, a relation processing flag, and a condition processing flag for each processing target data. The source block ID stores the source block ID of the source block having a correspondence relationship with the processing target data. The relation processing flag indicates “unprocessed” when the relation processing has not yet been performed on the source block, “in process” while the relation processing is being performed, and “after processing” “Processed” is stored. Here, the relationship processing is processing for searching for source blocks having a dependency relationship from the source block dependency relationship table 466 in a chained manner. The condition processing flag indicates “Unprocessed” if the condition processing has not yet been performed on the source block, “Processing” while the condition processing is being performed, and “After processing is completed” “Processed” is stored. Here, the conditional processing is processing for searching for another source block for rewriting a variable when the execution condition of a certain source block includes a variable. In the condition processing, a value is stored in the parent hierarchy source block ID of the row corresponding to the source block in the source code division result table 464, and the parent hierarchy source block ID is included in the read source block ID in the source block dependency relation table 466. This is performed when the source block corresponding to is stored and the execution condition flag of the row is “TRUE”.

ソースブロック分類部412の処理の概念を図5を用いて説明する。図5では、ソースブロック分類部412によってソースブロック1、2、5は処理対象データdataAと、ソースブロック1、3、5は処理対象データdataBと、ソースブロック1、4、5は処理対象データdataCと対応関係を持っていると判定されている。ソースブロック分類テーブル472の作成が終了した後は、グループ化用マーカ抽出部413が実行される。   The concept of processing of the source block classification unit 412 will be described with reference to FIG. In FIG. 5, the source block classification unit 412 causes the source blocks 1, 2, and 5 to be processed data dataA, the source blocks 1, 3, and 5 are processed data dataB, and the source blocks 1, 4, and 5 are processed data dataC. Is determined to have a corresponding relationship. After the creation of the source block classification table 472 is completed, the grouping marker extraction unit 413 is executed.

グループ化用マーカ抽出部413は、処理対象データとソースブロックの対応関係に基づき、一つのソフトウェア部品として資産化が可能なソースブロック群をグループ化する際に用いるマーカを抽出する部分である。本実施例では、マーカとしてすべての処理対象データと対応関係を持つソースブロック(以下、共通ソースブロックと記述)を用いる。共通ソースブロックの判別にはソースブロック分類テーブル472を用い、結果は共通ソースブロックリスト481に格納される。共通ソースブロックリスト481はグループ化用マーカ抽出部413の主要な成果物である。   The grouping marker extraction unit 413 is a part that extracts a marker used when grouping source block groups that can be capitalized as one software component based on the correspondence relationship between processing target data and source blocks. In this embodiment, a source block (hereinafter referred to as a common source block) having a correspondence relationship with all processing target data is used as a marker. The source block classification table 472 is used to determine the common source block, and the result is stored in the common source block list 481. The common source block list 481 is a main product of the grouping marker extraction unit 413.

共通ソースブロックリスト481の詳細例を図22に示す。共通ソースブロックリスト481には共通ソースブロックと判定されたソースブロックのソースブロックIDが格納されている。グループ化用マーカ抽出部413の処理概念を図5を用いて説明する。図5では、全ての処理対象データ(dataA、dataB、dataC)と対応関係を持つソースブロック1、5が共通ソースブロックと判定されている。共通ソースブロックリスト481の作成が終了した後は、ソースブロックグループ化部414が実行される。   A detailed example of the common source block list 481 is shown in FIG. The common source block list 481 stores source block IDs of source blocks determined as common source blocks. The processing concept of the grouping marker extraction unit 413 will be described with reference to FIG. In FIG. 5, source blocks 1 and 5 having a correspondence relationship with all the processing target data (data A, data B, and data C) are determined to be common source blocks. After the creation of the common source block list 481 is completed, the source block grouping unit 414 is executed.

ソースブロックグループ化部414は、グループ化用マーカ抽出部413で抽出されたマーカを用いて一つのソフトウェア部品として資産化が可能なソースブロック群をグループ化する部分である。また、グループ総数や、グループ内に含まれるソースブロック群のソースコードの一致行数を算出し、部品化による部品点数やソースコード量削減効果などの指標をユーザに提示する。グループの判別には、共通ソースブロックリスト481に格納されている二つの共通ソースブロックの組み合わせを用いる。二つの共通ソースブロックの組み合わせに対し、それらを結ぶプログラム実行経路のうち他の共通ソースブロックを含まないものを判別し、実行経路上に存在するソースブロック群を一つのグループとする。結果はソースブロックグループ化テーブル 491に格納する。ソースブロックグループ化テーブル 491はソースブロックグループ化部414の主要な成果物である。   The source block grouping unit 414 is a part that groups source blocks that can be capitalized as one software component using the markers extracted by the grouping marker extraction unit 413. In addition, the total number of groups and the number of matched lines of source code of the source block group included in the group are calculated, and indicators such as the number of parts and the effect of reducing the amount of source code by componentization are presented to the user. For group discrimination, a combination of two common source blocks stored in the common source block list 481 is used. For a combination of two common source blocks, a program execution path connecting them is discriminated that does not include another common source block, and a group of source blocks existing on the execution path is defined as one group. The result is stored in the source block grouping table 491. The source block grouping table 491 is a main product of the source block grouping unit 414.

ソースブロックグループ化テーブル 491の詳細を図23に示す。ソースブロックグループ化テーブル 491にはグループID、共通ソースブロックID(前)、共通ソースブロックID(後)、グループ内ソースブロックIDが格納されている。グループIDには対象のグループを一意に識別するためのキーが格納されている。グループIDの割り当ては重複がなければ任意で構わない。共通ソースブロックID(前)はグループ化のマーカとなっている二つの共通ソースブロックのうち、プログラム上の実行順序が前であるものの共通ソースブロックIDが格納されている。共通ソースブロックID(後)はグループ化のマーカとなっている二つの共通ソースブロックのうち、プログラム上の実行順序が後であるものの共通ソースブロックIDが格納されている。グループ内ソースブロックIDには、対象グループに属するソースブロックのソースブロックIDが格納されている。   Details of the source block grouping table 491 are shown in FIG. The source block grouping table 491 stores a group ID, a common source block ID (front), a common source block ID (back), and an intra-group source block ID. The group ID stores a key for uniquely identifying the target group. Group ID assignment may be arbitrary as long as there is no duplication. The common source block ID (previous) stores the common source block ID of the two common source blocks that are grouping markers that have the previous execution order on the program. The common source block ID (after) stores the common source block ID of the later execution order on the program among the two common source blocks that are markers for grouping. The intra-group source block ID stores the source block ID of the source block belonging to the target group.

ソースブロックグループ化テーブル 491の作成が終了した後は、ソースブロックグループ化部414はグループ化結果に対する分析処理を行い、結果をメトリクス表示窓240に出力する。分析処理では、例えばソースブロックの総数、グループ数、ソースコードの総行数、部品化により削減可能なソースコード行数、部品化により削減可能なソースコード行数をソースコードの総行数で除したものであるソースコード削減率などを算出する。分析処理の終了後は、ソースブロックグループ化部414が結果を画面管理部431に受け渡し、ユーザの応答待ちとなる。ソースブロックグループ化部414の処理概念図を図5を用いて説明する。図5では、共通ソースブロックであるソースブロック1、5を結ぶプログラム実行経路上にあるソースブロックであるソースブロック2、3、4が一つのグループと判定されている。   After the creation of the source block grouping table 491 is completed, the source block grouping unit 414 performs an analysis process on the grouping result and outputs the result to the metrics display window 240. In the analysis process, for example, the total number of source blocks, the number of groups, the total number of source code lines, the number of source code lines that can be reduced by componentization, and the number of source code lines that can be reduced by componentization are divided by the total number of source code lines. Calculate the source code reduction rate etc. After the analysis process is completed, the source block grouping unit 414 passes the result to the screen management unit 431 and waits for a user response. A processing conceptual diagram of the source block grouping unit 414 will be described with reference to FIG. In FIG. 5, the source blocks 2, 3, and 4 that are source blocks on the program execution path connecting the source blocks 1 and 5 that are common source blocks are determined as one group.

コントローラ部421は画面管理部431からユーザの入力情報を受け取り、ソースコード分割部411、ソースブロック分類部412、グループ化用マーカ抽出部413、ソースブロックグループ化部414を制御する部分である。画面管理部431は入力インタフェース441からユーザの入力情報を受け取り、コントローラ部421へと受け渡す。また、ソースコード分割部411、ソースブロック分類部412、グループ化用マーカ抽出部413、ソースブロックグループ化部414の処理結果を受け取り、画面出力を出力インタフェース451へと受け渡す。入力インタフェース441はユーザからの入力を受け取り、画面管理部431へと受け渡す。出力インタフェース451は画面管理部から受け取った画面出力をディスプレイなどのユーザインタフェースへと出力する。   The controller unit 421 is a part that receives user input information from the screen management unit 431 and controls the source code dividing unit 411, the source block classifying unit 412, the grouping marker extracting unit 413, and the source block grouping unit 414. The screen management unit 431 receives user input information from the input interface 441 and passes it to the controller unit 421. In addition, the processing results of the source code dividing unit 411, the source block classifying unit 412, the grouping marker extracting unit 413, and the source block grouping unit 414 are received, and the screen output is transferred to the output interface 451. The input interface 441 receives input from the user and passes it to the screen management unit 431. The output interface 451 outputs the screen output received from the screen management unit to a user interface such as a display.

図6はソフトウェア資産整理装置100の処理の流れを表している。処理600は分割実行ボタン140の押下をトリガとして開始され、処理700、800、900、1000が実行される。   FIG. 6 shows a process flow of the software asset rearranging apparatus 100. The process 600 is started by pressing the division execution button 140 as a trigger, and the processes 700, 800, 900, and 1000 are executed.

処理700は、対象ソースコードをインライン展開した後、構文解析により制御構文を解析してソースコードの分割を行う処理であり、ソースコード分割部411によって実行される。処理700の詳細な流れを図7に示す。700における成果物はソースコード分割条件リスト461、インライン展開ソースファイル462、制御構文情報テーブル463、ソースコード分割結果テーブル464であり、特に主要な成果物はソースコード分割結果テーブル464である。処理700は入力の読み込み処理である711、712、構文解析処理である721、722、723、724、725、726、ソースコード分割処理である731、732、733、734から構成される。   The process 700 is a process of dividing the source code by inline expansion of the target source code and then analyzing the control syntax by syntax analysis, and is executed by the source code dividing unit 411. A detailed flow of the process 700 is shown in FIG. The deliverables in 700 are a source code division condition list 461, an inline expansion source file 462, a control syntax information table 463, and a source code division result table 464, and particularly main deliverables are a source code division result table 464. The process 700 includes input processes 711 and 712, syntax analysis processes 721, 722, 723, 724, 725, and 726, and source code division processes 731, 732, 733, and 734.

711では、条件設定窓120に入力された解析条件を読み込む。ここで、解析条件とは例えば分析対象のソースコードの記述言語やソースコード分割条件である。ソースコード分割条件は例えば分割時の区切りとして用いる制御構文として与えられる。   In 711, the analysis condition input to the condition setting window 120 is read. Here, the analysis condition is, for example, a description language of a source code to be analyzed or a source code division condition. The source code division condition is given as a control syntax used as a division at the time of division, for example.

712では、711で読み込んだ解析条件をソースコード分割条件リスト461に格納する。   In 712, the analysis conditions read in 711 are stored in the source code division condition list 461.

721では、ユーザによりソースファイル決定窓114に設定されたソースファイルを読み込む。読み込み対象のソースファイルは図1のソースファイル決定窓114においてチェックボックスにレ点が入っているソースファイルである。   In 721, the source file set in the source file determination window 114 by the user is read. The source file to be read is a source file having a check mark in the check box in the source file determination window 114 of FIG.

722では、読み込んだソースファイルをインライン展開し、インライン展開ソースファイル462に格納する。   In 722, the read source file is expanded inline and stored in the inline expanded source file 462.

723では、インライン展開ソースファイル462に対し、ソースコード分割条件リスト461内の記述言語に格納されている情報を用いることでインライン展開ソースファイル462に出現する制御構文を検出する。例えば記述言語がC言語であれば、if文やfor文、while文、switch文などを検出する。検出された制御構文には制御構文IDを割り当てる。制御構文IDの割り当ては重複がなければ任意で構わない。   In 723, the control syntax appearing in the inline expanded source file 462 is detected by using the information stored in the description language in the source code division condition list 461 for the inline expanded source file 462. For example, if the description language is C language, an if sentence, a for sentence, a while sentence, a switch sentence, etc. are detected. A control syntax ID is assigned to the detected control syntax. The assignment of the control syntax ID may be arbitrary as long as there is no duplication.

724では、723で検出された各制御構文について、インライン展開ソースファイル462における位置、制御範囲、実行条件を判定する。ここで、位置とは制御構文のインライン展開ソースファイル462内での出現行である。制御範囲とは、例えばC言語では制御構文後に”{“と”}”が出現する場合、それらに囲まれた範囲のことである。実行条件とは制御範囲内のソースコードがプログラム内で実行されるために必要な条件である。例えばC言語のif文では、直後の”(“と”)”に囲まれた式の値が1となる条件である。   In 724, the position, control range, and execution condition in the inline expansion source file 462 are determined for each control syntax detected in 723. Here, the position is an appearance line in the inline expansion source file 462 of the control syntax. The control range is, for example, a range surrounded by “{” and “}” after the control syntax in C language. The execution condition is a condition necessary for the source code within the control range to be executed in the program. For example, in the C if statement, the condition is that the value of the expression surrounded by "(" and ")" immediately after is 1.

725では、制御構文間の階層関係を判定する。ここで、階層関係とは、制御構文Aの内部に別の制御構文Bが出現する場合、すなわちA⊃Bの場合、BはAを親階層として持つとする。   At 725, the hierarchical relationship between the control syntaxes is determined. Here, the hierarchical relationship means that when another control syntax B appears inside the control syntax A, that is, when A⊃B, B has A as a parent hierarchy.

726では、724、725で判定された結果を制御構文情報テーブル463に格納する。   In 726, the results determined in 724 and 725 are stored in the control syntax information table 463.

731では、制御構文情報テーブル463に格納されている制御構文のうち、ソースコード分割条件リスト461内の分割条件と一致する制御構文を検出する。   In 731, a control syntax that matches the division condition in the source code division condition list 461 is detected from the control syntaxes stored in the control syntax information table 463.

732では、731で検出された制御構文からソースブロックを決定する。検出された制御構文の制御範囲を一つのソースブロックとする。制御構文Aの内部に別の制御構文Bが出現する場合、すなわちA⊃Bの場合、BおよびAからBを除いたもの、すなわちB、A∩¬Bをソースブロックとする。いずれのソースブロックにも属さないソースコード、例えばメイン関数直下に記述されているソースコードは、常に真である実行条件を持つ条件文の内部に存在するとみなし、前後に出現する別のソースブロックを区切りとするソースブロックとする。   At 732, the source block is determined from the control syntax detected at 731. The control range of the detected control syntax is set as one source block. When another control syntax B appears inside the control syntax A, that is, A⊃B, B and A minus B, that is, B and A∩¬B are set as source blocks. Source code that does not belong to any source block, for example, source code written directly under the main function, is considered to exist inside a conditional statement that always has an execution condition that is true, and another source block that appears before and after Use a source block as a delimiter.

733では、732で検出されたソースブロックに識別用のIDとしてソースブロックIDを割り当てる。ソースブロックIDの割り当ては重複がなければ任意で構わない。   At 733, a source block ID is assigned to the source block detected at 732 as an identification ID. The assignment of the source block ID may be arbitrary as long as there is no duplication.

734では、ソースブロックID、ソースブロックの位置、範囲、実行条件をソースコード分割結果テーブル464に格納する。   In step 734, the source block ID, the position, range, and execution condition of the source block are stored in the source code division result table 464.

図6に戻って、処理700が終了した後はソースコード分割部411によって処理800が実行される。処理800はインライン展開ソースファイル462から変数を抽出し、各変数とソースブロックを対応付ける処理である。   Returning to FIG. 6, after the process 700 is completed, the process 800 is executed by the source code dividing unit 411. A process 800 is a process for extracting variables from the inline expansion source file 462 and associating each variable with a source block.

処理800の詳細な流れを図8に示す。処理800の成果物は変数情報テーブル465である。処理800はデータ読み込み処理である811、812、813、変数抽出処理である821、822、変数とソースブロックの対応付け処理である831、832、833、834、835から構成される。処理800ではソースコード中に出現する変数を検出し、各箇所において読み込みと書き込みのどちらが行われているかを判定する。ここで、変数とは構造体も含む。   A detailed flow of the process 800 is shown in FIG. The result of the process 800 is a variable information table 465. The process 800 includes data reading processes 811, 812, and 813, variable extraction processes 821 and 822, and variable and source block association processes 831, 832, 833, 834, and 835. In process 800, a variable appearing in the source code is detected, and it is determined whether reading or writing is performed at each location. Here, the variable includes a structure.

811では、ソースコード分割条件リスト461の記述言語に格納されている情報を読み込む。   In 811, information stored in the description language of the source code division condition list 461 is read.

812では、インライン展開ソースファイル462からインライン展開されたソースコードを読み込む。   In 812, the source code expanded inline from the inline expanded source file 462 is read.

813では、ソースコード分割結果テーブル464の情報を読み込む。   In 813, the information of the source code division result table 464 is read.

821では、インライン展開ソースファイル462に出現するすべての変数を検出する。この際、変数定義を参照することにより変数のスコープも同時に判定する。変数のスコープとは、ソースコード上において当該変数に読み書きが行える範囲である。検出された変数には変数IDを割り当てる。変数IDの割り当ては重複がなければ任意で構わない。   In 821, all variables appearing in the inline expanded source file 462 are detected. At this time, the scope of the variable is simultaneously determined by referring to the variable definition. The scope of a variable is a range where the variable can be read and written on the source code. A variable ID is assigned to the detected variable. The assignment of the variable ID may be arbitrary as long as there is no duplication.

822では、821で検出された変数の変数ID、変数名、スコープ、変数型、出現位置を変数情報テーブル465に格納する。   In 822, the variable ID, variable name, scope, variable type, and appearance position of the variable detected in 821 are stored in the variable information table 465.

831は反復処理であり、変数情報テーブル465に格納されている各変数のすべての出現場所について832、833、834、835、836を実行することを示している。   Reference numeral 831 denotes an iterative process, which indicates that 832, 833, 834, 835, and 836 are executed for all occurrence locations of each variable stored in the variable information table 465.

832では、対象としている出現場所でデータへの書き込みが行われているかを判定する。書き込みが行われていた場合は、833で当該箇所における利用種別フラグを“書き込み”に設定する。書き込みが行われていなかった場合は読み込みと判断し、836で当該箇所における利用種別フラグを“読み込み”に設定する。   In 832, it is determined whether data is being written at the target appearance location. If the data has been written, the usage type flag at that location is set to “write” in 833. If writing has not been performed, it is determined that reading has been performed, and the use type flag at the relevant location is set to “read” in 836.

834では、ソースコード分割結果テーブル464の開始行と終了行を参照することにより、当該出現場所を内部に含むソースブロックを検索し、ソースブロックIDを得る。835では、変数情報テーブル465に出現場所、対応ソースブロックID、利用種別フラグを格納する。   In 834, by referring to the start and end lines of the source code division result table 464, a source block that includes the appearance location is searched, and a source block ID is obtained. In 835, the appearance location, the corresponding source block ID, and the usage type flag are stored in the variable information table 465.

図6に戻って、処理800が終了した後は処理900が実行される。処理900はソースコード分割部411によって実行され、各ソースブロック内部における変数の読み書きに基づいて、ソースブロック間の依存関係を求める処理である。   Returning to FIG. 6, after the process 800 is completed, the process 900 is executed. A process 900 is executed by the source code dividing unit 411 and is a process for obtaining a dependency relationship between source blocks based on reading and writing of variables in each source block.

処理900の詳細な流れを図9に示す。処理900の成果物は処理対象データ候補テーブル467である。処理900は911、912、913、914、915、916、917から構成される。   A detailed flow of the process 900 is shown in FIG. A product of the process 900 is a process target data candidate table 467. The process 900 includes 911, 912, 913, 914, 915, 916, and 917.

911は反復処理であり、ソースコード分割結果テーブル464に格納されている各ソースブロックについて912、913、914、915、916、917、918を実行することを示している。また、912も反復処理であり、ソースブロック内部に出現する変数のうち、利用種別フラグが”読み込み”となる出現位置が存在するものについて913、914、915、916、917、918を実行することを示している。   Reference numeral 911 denotes an iterative process, which indicates that 912, 913, 914, 915, 916, 917, and 918 are executed for each source block stored in the source code division result table 464. 912 is also an iterative process, and 913, 914, 915, 916, 917, and 918 are executed for variables that appear in the source block and that have an appearance position whose usage type flag is “read”. Is shown.

913では、変数情報テーブル465のうち、反復処理912において現在処理対象となっている変数に該当する部分を参照し、利用種別フラグが“書き込み”となっているソースブロックをすべて検出する。   In step 913, a part corresponding to the variable currently processed in the iteration process 912 in the variable information table 465 is referred to, and all source blocks whose usage type flag is “write” are detected.

914では、913で検出されたソースブロックのうち、反復処理911で現在処理対象となっているソースブロックとの間に依存関係があるものを抽出する。依存関係の判定は、反復処理911の処理対象ソースブロックと913で検出されたソースブロックを結ぶプログラムの実行経路を考えることにより行う。すなわち、913で検出されたソースブロックの中から一を選択し、反復処理911で現在処理対象となっているソースブロックと選択された当該一のソースブロックとの間に、913で検出された他のソースブロックが含まれない実行経路が存在した場合にこれら2つのソースブロック間に依存関係ありとする。   In 914, among the source blocks detected in 913, those having a dependency relationship with the source block currently being processed in the iterative process 911 are extracted. The dependency is determined by considering the execution path of the program connecting the processing target source block of the iterative process 911 and the source block detected in 913. In other words, one is selected from the source blocks detected in 913, and the other detected in 913 is between the source block currently processed in the iterative process 911 and the selected one source block. When there is an execution path that does not include the source block, there is a dependency between these two source blocks.

915では、914で依存関係ありと判定された2つのソースブロックについて、ソースブロック依存関係テーブル465に読み込み分割ソースコードID、書き込み分割ソースコードIDと、反復処理912で現在処理対象としている変数を格納する。   In 915, for the two source blocks determined to have a dependency in 914, the read divided source code ID and the write divided source code ID are stored in the source block dependency relationship table 465, and the variable currently being processed in the iterative process 912 is stored. To do.

916では、反復処理912で現在処理対象としている変数が反復処理911で現在処理対象としているソースブロックの実行条件内に出現するかどうかを判定する。ソースブロックの実行条件内に出現していた場合は、917でソースブロック依存関係テーブル465内の当該項目の実行条件依存フラグを”TRUE”とする。そうでない場合は、918で実行条件依存フラグを”FALSE”とする。実行条件依存フラグは、ソースコード分割結果テーブル464の親階層ソースブロックIDに値が格納されている場合に、処理対象データとソースブロックの対応付けを正しく行うために以降の処理で用いる。   In 916, it is determined whether or not the variable currently processed in the iteration 912 appears within the execution condition of the source block currently processed in the iteration 911. If it appears in the execution condition of the source block, the execution condition dependency flag of the item in the source block dependency relationship table 465 is set to “TRUE” in 917. Otherwise, the execution condition dependency flag is set to “FALSE” in 918. The execution condition dependence flag is used in the subsequent processing in order to correctly associate the processing target data with the source block when a value is stored in the parent hierarchy source block ID of the source code division result table 464.

図6に戻って、処理900が終了した後は処理1000が実行される。処理1000はソースコード分割部411によって実行され、ユーザに提示する処理対象データの候補を算出する処理である。   Returning to FIG. 6, after the process 900 is completed, the process 1000 is executed. The process 1000 is a process executed by the source code dividing unit 411 to calculate candidate data to be processed to be presented to the user.

処理1000の詳細な流れを図10に示す。処理1000の成果物は処理対象データ候補テーブル467である。1000は1011、1012、1013、1014、1015から構成される。   A detailed flow of the process 1000 is shown in FIG. A deliverable of the process 1000 is a process target data candidate table 467. 1000 includes 1011, 1012, 1013, 1014, and 1015.

1011では、変数情報テーブル465から変数情報を読込む。   In 1011, variable information is read from the variable information table 465.

1012では、1011で読み込まれた変数から、プログラム全体をスコープに含んでいる変数を抽出する。これにはソースコード内に出現しているグローバル変数も含める。変数情報テーブル465と同様に構造体も一つの変数として扱う。   In 1012, the variables including the entire program in the scope are extracted from the variables read in 1011. This includes global variables that appear in the source code. Similar to the variable information table 465, the structure is handled as one variable.

1013では、1012で抽出された変数について、階層構造、変数間の参照・被参照の関係を解析する。ここで、変数が構造体である場合、構造体Aが要素として構造体Bを持つなら、構造体Bは構造体Aの内部に含まれているとする。また、構造体Aの内部に他の構造体Bがあったとき、構造体Aの内部に含まれている変数のうち構造体Bの内部に含まれている変数を除いたものを構造体直下の変数とする。変数C、Dが構造体Aの直下にあった場合、CとDは並列関係にあるとする。   In 1013, the variable extracted in 1012 is analyzed for the hierarchical structure and the relationship of reference / reference between variables. Here, when the variable is a structure, if the structure A has the structure B as an element, the structure B is included in the structure A. In addition, when there is another structure B inside the structure A, the variables included in the structure A excluding the variables included in the structure B are directly below the structure. Variable. When the variables C and D are immediately below the structure A, it is assumed that C and D are in a parallel relationship.

1014では、1012で抽出された変数のデータサイズをビット数で表したものを算出する。   In 1014, the data size of the variable extracted in 1012 is calculated by the number of bits.

1015では、1012で抽出された変数の優先順位を算出する。優先順位の算出は、例えば並列関係にある変数の数をカウントし、数が多いものから昇順に優先順位を割り当てていくことにより決定する。この際、並列関係にある変数の数が同一であった場合、優先順位も同一とする。ここで、優先順位とは、処理対象データ候補のうち、ユーザに処理対象データとして選択される可能性の高さを表す指標であり、本実施例の方法以外にも、プログラム内における変数の出現回数、構造体のサイズ、プログラム末尾から辿った書き込みが順序などを用いて算出してもよい。   In 1015, the priority order of the variables extracted in 1012 is calculated. The calculation of the priority order is determined, for example, by counting the number of variables in parallel relation and assigning the priority order in ascending order from the largest number. At this time, if the number of variables in parallel relation is the same, the priority order is also the same. Here, the priority is an index representing the high possibility that the user will be selected as the processing target data among the processing target data candidates. In addition to the method of this embodiment, the appearance of variables in the program The number of times, the size of the structure, and the writing traced from the end of the program may be used for calculation.

1016では、1012、1013、1014、1015の結果に基き処理対象データ候補テーブル467に変数ID、ビット数、構造体直下の変数ID、優先順位を格納する。   In 1016, the variable ID, the number of bits, the variable ID immediately below the structure, and the priority order are stored in the processing target data candidate table 467 based on the results of 1012, 1013, 1014, and 1015.

1016の終了後は、処理は一時停止しユーザの入力待ち状態となる。この際、画面管理部431は処理対象データ候補テーブル467の内容をもとに出力インタフェース451を介して処理対象変数候補表示窓151に処理対象変数の候補を表示する。この際、処理対象変数の候補は処理対象データ候補テーブル467の優先順位に従って表示する。   After the end of 1016, the process is paused and the user input is waited for. At this time, the screen management unit 431 displays processing target variable candidates in the processing target variable candidate display window 151 via the output interface 451 based on the contents of the processing target data candidate table 467. At this time, candidates for processing target variables are displayed according to the priority order of the processing target data candidate table 467.

図6に戻って、ユーザによる処理対象変数の選択後、グループ化実行ボタン170の押下をトリガとして処理1100、1200、1300が実行される。処理1100、1200はソースブロック分類部412によって実行され、ユーザが選択した処理対象変数とソースブロックの関係を、ソースブロック依存関係テーブル466を用いて判定する処理である。   Returning to FIG. 6, after the user selects the processing target variable, the processing 1100, 1200, 1300 is executed with the pressing of the grouping execution button 170 as a trigger. Processes 1100 and 1200 are executed by the source block classifying unit 412 to determine the relationship between the processing target variable selected by the user and the source block using the source block dependency table 466.

処理1100、1200の詳細な流れを図11、図12に示す処理。1100、1200の成果物はソースブロック分類テーブル472である。処理1100、1200は、直接処理対象データを書き換えるソースブロックを判定する処理である1111、1112、1113、ソースブロック間の依存関係から処理対象データの書き換えに影響しうるソースブロックを判定する処理である1131、1132、1133、1134、1135、1136、親階層ソースブロックが存在した場合に親階層ソースブロックの実行に影響を与えるソースブロックを検出する処理である1121、1211、1212、1213、1214、1215、1216、1217から構成される。 1111では、処理対象データ決定窓154においてユーザが選択した処理対象変数を読み込み、処理対象変数テーブル471に格納する。   The detailed flow of processes 1100 and 1200 is shown in FIGS. The deliverables 1100 and 1200 are a source block classification table 472. Processes 1100 and 1200 are processes for directly determining the source block for rewriting the processing target data 1111, 1112, and 1113, and are processes for determining the source block that can affect the rewriting of the processing target data from the dependency relationship between the source blocks. 1131, 1211, 1133, 1134, 1135, 1136, 1121, 1211, 1212, 1213, 1214, 1215 is a process for detecting a source block that affects the execution of the parent layer source block when the parent layer source block exists , 1216, 1217. In 1111, the processing target variable selected by the user in the processing target data determination window 154 is read and stored in the processing target variable table 471.

1112では、ソースブロック依存関係テーブル466を参照し、1111で読み込んだ処理対象変数の利用種別フラグが”書き込み”となっているソースブロックを検索する。   In step 1112, the source block dependency relationship table 466 is referenced to search for a source block in which the usage type flag of the processing target variable read in 1111 is “write”.

1113では、1112で検索されたソースブロックについて、ソースブロック分類テーブル472の処理対象データ項に当該処理対象変数を追加し、関係処理フラグを”処理中”にセットする。ここで、関係処理フラグには、当該ソースブロックに対し関係処理がまだ行われていない場合”未処理”が、関係処理が行われている最中は”処理中”が、関係処理が終了した後には”処理済”が格納されている。関係処理とは、ソースブロック依存関係テーブル466から依存関係を持つソースブロックを連鎖的に探索していく処理であり、1131、1132、1133、1134、1135、1136を指す。   In 1113, the processing target variable is added to the processing target data item of the source block classification table 472 for the source block searched in 1112, and the related processing flag is set to “processing”. Here, in the relation processing flag, “unprocessed” is indicated if the relation processing has not yet been performed on the source block, and “processing in progress” is completed while the relation processing is being performed. “Processed” is stored afterwards. The relationship processing is processing for searching for source blocks having dependency relationships from the source block dependency relationship table 466 in a chain manner, and indicates 1311, 1132, 1133, 1134, 1135, 1136.

1121は無限ループであり、1217の条件が満たされるまで反復される。1131も無限ループであり、1136の条件が満たされるまで反復される。   1121 is an infinite loop and is repeated until the condition of 1217 is satisfied. 1131 is also an infinite loop, and is repeated until the condition of 1136 is satisfied.

1132では、ソースブロック分類テーブル472から、関係処理フラグが”処理中”であるソースブロックを検索する。   In 1132, a source block whose relation processing flag is “processing” is searched from the source block classification table 472.

1133では、ソースブロック依存関係テーブル466から、1132で検索されたソースブロックIDを読込みソースブロック項に持っている行を検索し、当該行の書込みソースブロック項にあるソースブロックIDを取り出す。   In 1133, a line having the source block ID retrieved in 1132 in the source block term is retrieved from the source block dependency relationship table 466, and the source block ID in the write source block term of the row is retrieved.

1134では、1133で取り出されたソースブロックIDをソースブロック分類テーブル472に追加し、関係処理フラグを”処理中”にセットする。   In 1134, the source block ID extracted in 1133 is added to the source block classification table 472, and the relation processing flag is set to “processing”.

1135では、1132で検索されたソースブロックの関係処理フラグを”処理済”にセットする。   In 1135, the relation processing flag of the source block searched in 1132 is set to “processed”.

1136では、1132で関係処理フラグが”処理中”であるソースブロックが一つ以上検出されたかを判定する。一つ以上検出されていた場合、1132、1133、1134、1135を再び実行する。一つも検出されたかった場合、処理1200へと処理を進める。   In 1136, it is determined in 1132 whether one or more source blocks whose relation processing flag is “processing” are detected. If one or more are detected, 1132, 1133, 1134, 1135 are executed again. If none is detected, the process proceeds to process 1200.

1211では、ソースブロック分類テーブル472から、関係処理フラグが”処理済”であり、かつ条件処理フラグが”未処理”であるソースブロックを検索する。ここで、条件処理フラグには、当該ソースブロックに対し条件処理がまだ行われていない場合”未処理”が、条件処理が行われている最中は”処理中”が、条件処理が終了した後には”処理済”が格納されている。条件処理とは、ソースコード分割結果テーブル464の当該ソースブロックに対応する行の親階層ソースブロックIDに値が格納されており、かつソースブロック依存関係テーブル466の読み込みソースブロックIDに親階層ソースブロックIDに対応するソースブロックが格納されており、かつ当該行の実行条件フラグが”TRUE”である場合に行われる処理であり、1121、1211、1212、1213、1214、1215、1216、1217を指す。   In step 1211, the source block classification table 472 is searched for a source block whose relation processing flag is “processed” and whose condition processing flag is “unprocessed”. Here, in the condition processing flag, the condition processing is “unprocessed” when the condition processing has not yet been performed on the source block, and “processing in progress” is completed while the condition processing is being performed. “Processed” is stored afterwards. In the condition processing, a value is stored in the parent hierarchy source block ID of the row corresponding to the source block of the source code division result table 464, and the parent hierarchy source block is included in the read source block ID of the source block dependency table 466. This process is performed when the source block corresponding to the ID is stored and the execution condition flag of the row is “TRUE”, and indicates 1121, 1211, 1212, 1213, 1214, 1215, 1216, 1217 .

1212では、ソースコード分割結果テーブル464から1211で検索されたソースブロックを検索する。   In 1212, the source block searched in the source code division result table 464 to 1211 is searched.

1213では、1212で検索されたソースブロックに対し、親階層ソースブロックを判定する。その後、判定された親階層ソースブロックについて、さらにその親階層ソースブロックを判定するという処理を親階層ソースブロックがなくなるまで繰り返す。最後に、それぞれの親階層ソースブロックのソースブロックIDを抽出する。
1214では、ソースブロック依存関係テーブル466を参照し、1213で検索されたソースブロックを読込みソースブロックとして持ち、かつ実行条件依存フラグが”TRUE”である行を検索する。すなわち、1213で検索されたソースブロックの実行条件に影響を及ぼしうるソースブロックを検索する。
In 1213, the parent hierarchy source block is determined for the source block searched in 1212. Thereafter, for the determined parent hierarchy source block, the process of determining the parent hierarchy source block is repeated until there is no parent hierarchy source block. Finally, the source block ID of each parent hierarchy source block is extracted.
In 1214, the source block dependency relationship table 466 is referred to, and the row having the source block searched in 1213 as the read source block and the execution condition dependency flag being “TRUE” is searched. That is, the source block that can affect the execution condition of the source block searched in 1213 is searched.

1215では、1214で検索された行の書込みソースブロック項に格納されているソースブロックIDをソースブロック分類テーブル472に追加し、関係処理フラグを”処理中”にセットする。   In 1215, the source block ID stored in the write source block item of the row searched in 1214 is added to the source block classification table 472, and the relation processing flag is set to “processing”.

1216では、1211で検索されたソースブロックの条件処理フラグを”処理済”にセットする。   In 1216, the condition processing flag of the source block searched in 1211 is set to “processed”.

1217では、1211でソースブロックが一つ以上検出されたかどうかを判定する。一つ以上検出されていた場合、1131の処理を再び実行する。一つも検出されたかった場合、1200を終了する。   In 1217, it is determined whether or not one or more source blocks are detected in 1211. If one or more are detected, the process 1131 is executed again. If none is detected, 1200 is terminated.

図6に戻って、処理1200が終了した後は処理1300が実行される。処理1300はグループ化用マーカ抽出部413とソースブロックグループ化部414によって実行され、グループ化用マーカとして共通ソースブロックを抽出し、共通ソースブロックの位置からソフトウェア部品として資産化可能なソースブロック群をグループ化する処理である。   Returning to FIG. 6, after the process 1200 is completed, the process 1300 is executed. The process 1300 is executed by the grouping marker extraction unit 413 and the source block grouping unit 414, extracts a common source block as a grouping marker, and generates a source block group that can be capitalized as a software component from the position of the common source block. This is a grouping process.

処理1300の詳細な流れを図13に示す。処理1300の成果物は共通ソースブロックリスト481、ソースブロックグループ化テーブル491である。処理1300は共通ソースコードを判別する処理である1311、1312、共通ソースブロックを用いてソースブロックをグループ化する処理である1321、1322、1323、1324、1325、グループに関する統計情報を算出し結果を出力する1331、1332、1333から構成される。   A detailed flow of the process 1300 is shown in FIG. The deliverables of the process 1300 are a common source block list 481 and a source block grouping table 491. The process 1300 is a process for discriminating common source code 1311, 1312, a process for grouping source blocks using a common source block, 1321, 1322, 1323, 1324, 1325; It consists of 1331, 1332, and 1333 to output.

1311では、ソースブロック分類テーブル472から、すべての処理対象変数と対応関係を持っているソースブロックを検索する。   In step 1311, the source block classification table 472 is searched for a source block having a correspondence relationship with all the processing target variables.

1312では、1311で検索されたソースブロックを共通ソースブロックリスト481に追加する。   In 1312, the source block searched in 1311 is added to the common source block list 481.

1321では、共通ソースブロックリスト481から、二つの共通ソースブロックを結ぶプログラムの実行経路として他の共通ソースブロックを経由しないものが存在する組み合わせを検索する。   In 1321, the common source block list 481 is searched for a combination in which there is an execution path of a program connecting two common source blocks that does not pass through another common source block.

1322では、1321で検索された共通ソースブロックの組をソースブロックグループ化テーブル491に追加する。   At 1322, the common source block set searched at 1321 is added to the source block grouping table 491.

1323では、1322で検索された共通ソースブロックの組について、両者を結ぶプログラム実行経路上に存在するソースブロックをすべて抽出する。これらのソースブロック群は一つのソフトウェア部品として資産化をするための候補となる。   In 1323, all the source blocks existing on the program execution path connecting the two common source blocks searched in 1322 are extracted. These source block groups are candidates for capitalization as one software component.

1324では、1323で抽出されたソースブロック間のソースコード比較を行い、一致率が部品化判定条件設定窓160から設定された閾値を上回ったものを同一グループと判定する。一致率は、例えばソースブロックをトークン(語彙素)の列に分割し、2つのソースブロックで一致したトークン数を求めた後、2つのソースブロックの総トークン数のうち小さいもので除すことにより算出する。ここで、一致したトークン数は3つの手順により求める。手順1として、それぞれのソースブロックから生成されたトークン列に対し、任意の位置にあるトークンを除去することにより部分トークン列を作成する。例えば、トークン列[a,b,c]の部分トークン列は[]、[a]、[b]、[c]、[a,b]、[a,c]、[b,c]、[a,b,c]の8個存在する。手順2として、2つのソースブロックのそれぞれから部分トークン列を1つずつ選び、同一位置にあるトークンが一致しているものの数をカウントする。手順3として、すべての部分トークン列の集合に対し手順2を繰り返し、最大の値を一致したトークン数とする。   In 1324, the source code comparison between the source blocks extracted in 1323 is performed, and if the matching rate exceeds the threshold set from the componentization determination condition setting window 160, it is determined as the same group. The match rate is calculated by dividing the source block into a sequence of tokens (lexeme), finding the number of tokens matched by the two source blocks, and dividing by the smaller of the total number of tokens of the two source blocks. calculate. Here, the number of matched tokens is obtained by three procedures. As a procedure 1, a partial token sequence is created by removing tokens at arbitrary positions from the token sequence generated from each source block. For example, the partial token sequences of the token sequence [a, b, c] are [], [a], [b], [c], [a, b], [a, c], [b, c], [ There are 8 a, b, c]. As a procedure 2, one partial token string is selected from each of the two source blocks, and the number of tokens that match at the same position is counted. As procedure 3, procedure 2 is repeated for a set of all partial token strings, and the maximum value is set as the number of matched tokens.

1325では、1324で同一グループと判定されたソースブロック群をソースブロックグループ化テーブル491に格納する。   In 1325, the source block group determined to be the same group in 1324 is stored in the source block grouping table 491.

1331では、ソースブロックグループ化テーブル491より、各グループに属するソースブロック間のソースコード比較を行い、ソースコードの一致部分と相違部分を判定する。   In 1331, the source code comparison between the source blocks belonging to each group is performed from the source block grouping table 491, and the matching part and the difference part of the source code are determined.

1332では、統計情報として、例えばソースコード削減率などの指標を算出する。ソースコード削減率はソースコードの一致部分から重複ソースコードを判定し、重複ソースコードの行数の総和をソースコードの総行数で除したものとして算出できる。   In 1332, for example, an index such as a source code reduction rate is calculated as statistical information. The source code reduction rate can be calculated by determining the duplicate source code from the matching portion of the source code and dividing the total number of lines of the duplicate source code by the total number of lines of the source code.

1333では、ソースブロックグループ化テーブル491から同一グループと判定されたソースブロック群を統合しファイルに出力する。   In 1333, the source block groups determined to be the same group from the source block grouping table 491 are integrated and output to a file.

1333が終了した後は、ソースブロック分類テーブル472、共通ソースブロックリスト 481、ソースブロックグループ化テーブル491を画面管理部431に受け渡し、処理は終了となる。   After 1333 is completed, the source block classification table 472, the common source block list 481, and the source block grouping table 491 are transferred to the screen management unit 431, and the process ends.

以上のような実施例によれば、既存のソフトウェア資産のうち、類似性の高いソースコード群を抽出し部品化することができる。また、ユーザはGUIへの提示情報に基づいて部品化結果の修正を行うことができる。   According to the embodiment as described above, it is possible to extract a source code group having high similarity from existing software assets and convert it into parts. Further, the user can correct the componentization result based on the information presented to the GUI.

、更に本実施形態によれば、あらかじめ処理の区切りに従ってソースコードを分割し、分割により生成されたソースブロックの間で部品化判定を行うため、細かい一致コード断片といったノイズが発生せず、計算資源の浪費を抑えることが出来る。また、ソースコードの分割およびソースブロックの関連付けは、処理対象データや部品化判定の条件を変更しても再実行する必要がないため、条件のチューニングによる再計算のコストを大幅に減らすことが出来る。さらに、制御構文によりソースコードを分割し、処理の実行順序が近いソースブロック間で部品化判定を行うため、プログラムの意味的なまとまりを崩すことなく部品化が可能である。他にも、処理対象のデータに固有な処理を検出できるため、データと処理や機能の関連性分析や、改修による処理対象データ追加時の影響範囲推定といった用途に用いることも出来る。   Furthermore, according to the present embodiment, the source code is divided in advance according to the processing delimiter, and the componentization determination is performed between the source blocks generated by the division, so that noise such as fine matching code fragments does not occur, and the calculation resource Can be saved. In addition, source code splitting and source block association do not need to be re-executed even if the data to be processed or the conditions for componentization determination are changed, so the cost of recalculation by tuning the conditions can be greatly reduced. . Furthermore, since the source code is divided by the control syntax and the componentization determination is performed between the source blocks whose processing execution order is close, the componentization is possible without breaking the semantic unity of the program. In addition, since a process unique to the data to be processed can be detected, it can be used for purposes such as relevance analysis of data and processes and functions, and estimation of an influence range when processing data is added by refurbishing.

鉄道運行管理システムでは、サブシステムである旅客案内システムひとつをとってみても、列車の行先や停車駅、両数など実にさまざまなデータが存在する。また、東京圏の鉄道では一日に数千本といった単位で列車が運行されており、データの種類だけではなく量も膨大である。このようなシステムにおいて、処理対象のデータごとに作成されたソースコードを部品化するためには多大な労力を要するが、本発明によればプログラム実行順序をほとんど崩すことなく部品化が実現でき、かつノイズ判定といった追加工数も発生しないため、極めて効率的に作業を行うことが出来る。   In the railway operation management system, even if you take a passenger information system as a subsystem, there are various data such as train destinations, stop stations, and the number of both. In addition, trains are operated in units of thousands of trains a day in the Tokyo area, and the amount of data is enormous as well as the type of data. In such a system, it takes a lot of labor to convert the source code created for each data to be processed into parts, but according to the present invention, componentization can be realized with almost no disruption to the program execution order, Moreover, since no additional man-hours such as noise determination are generated, the work can be performed very efficiently.

100:ソフトウェア資産整理装置
411:ソースコード分割部
412:ソースブロック分類部
413:グループ化用マーカ抽出部
414:ソースブロックグループ化部
431:画面間理部
100: Software asset rearranging device 411: Source code dividing unit 412: Source block classifying unit 413: Marker extracting unit for grouping 414: Source block grouping unit 431: Inter-screen intermediary unit

Claims (14)

ソフトウェアのソースコードから、当該ソフトウェアの部品として管理可能なソースブロックを抽出する装置であって、
前記ソースコードを所定のソースコード分割条件に基いて複数のソースブロックに分割し、当該複数のソースブロック各々について当該ソースブロック内で使用される変数を抽出し、当該複数のソースブロック間の関係を判別するソースコード分割部と、
指定された一以上の変数各々について、当該変数と所定の対応関係を有する一以上のソースブロックを判定するソースブロック分類部と、
前記ソースブロック分類部の判定結果に基いて、前記複数のソースブロックを一以上のグループにまとめるためのマーカを抽出するグループ化用マーカ抽出部と、
前記グループ化用マーカ抽出部が抽出したマーカを用いた所定のグループ化条件に基いて、前記複数のソースブロックの内二以上のソースブロックを一つのソフトウェア部品として整理可能なソースブロック群としてグループ化するソースブロックグループ化部とを
備えたソフトウェア資整理装置。
An apparatus for extracting source blocks that can be managed as software components from software source code,
The source code is divided into a plurality of source blocks based on a predetermined source code dividing condition, a variable used in the source block is extracted for each of the plurality of source blocks, and a relationship between the plurality of source blocks is determined. A source code dividing unit to be determined;
For each of one or more specified variables, a source block classifying unit that determines one or more source blocks having a predetermined correspondence with the variable;
Based on the determination result of the source block classification unit, a marker extracting unit for grouping that extracts markers for collecting the plurality of source blocks into one or more groups;
Based on a predetermined grouping condition using the markers extracted by the grouping marker extraction unit, grouping two or more source blocks of the plurality of source blocks as a group of source blocks that can be organized as one software component software assets organizer that includes a source block grouping part for.
請求項1記載のソフトウェア資整理装置であって、
前記ソースコード分割条件は、ソースコードの言語に応じて設定される
ことを特徴とする、ソフトウェア資産整理装置。
A software asset organizer according to claim 1,
The software asset rearranging apparatus, wherein the source code division condition is set according to a language of the source code.
請求項1記載のソフトウェア資産整理装置であって、
前記ソースコード分割部は、前記複数のソースブロック各々について、変数の読み出しおよび書き込みが生じるか否かを判別し、判別結果に基いて前記複数のソースブロック間の関係を判別する
ことを特徴とするソフトウェア資産整理装置。
The software asset rearranging device according to claim 1,
The source code dividing unit determines whether or not variables are read and written for each of the plurality of source blocks, and determines a relationship between the plurality of source blocks based on a determination result. Software asset management device.
請求項1記載のソフトウェア資産整理装置であって、
前記ソースブロック分類部は、ソースブロックの除去により前記変数の値が変化し得うる場合に、当該ソースブロックと当該変数とが前記所定の対応関係を有すると判断する
ことを特徴とするソフトウェア資産整理装置。
The software asset rearranging device according to claim 1,
The source block classification unit determines that the source block and the variable have the predetermined correspondence when the value of the variable can be changed by removing the source block. apparatus.
請求項1記載のソフトウェア資産整理装置であって、
前記グループ化用マーカ抽出部は、前記一以上の変数全てと前記所定の対応関係を持つソースブロックを前記マーカとして抽出する
ことを特徴とする、ソフトウェア資産整理装置。
The software asset rearranging device according to claim 1,
The grouping marker extracting unit extracts a source block having the predetermined correspondence with all of the one or more variables as the marker.
請求項1記載のソフトウェア資産整理装置であって、
前記ソースブロックグループ化部はさらに、作成されたソースブロック群の総数と、ソースブロック群に含まれる二以上のソースブロックのソースコードの一致行数とを算出し、当該ソースブロック群の総数および当該ソースコードの一致行数とに基いて、グループ化による効果を示す指標をユーザに提示する
ことを特徴とする、ソフトウェア資産整理装置。
The software asset rearranging device according to claim 1,
The source block grouping unit further calculates the total number of generated source block groups and the number of matching lines of source code of two or more source blocks included in the source block group, An apparatus for organizing software assets, characterized in that an index indicating the effect of grouping is presented to a user based on the number of matching lines of source code.
請求項5記載のソフトウェア資産整理装置であって、前記ソースブロックグループ化部は、二つのマーカを結ぶプログラム実行経路において、他のマーカを含まない前記プログラム実行経路上に存在する複数のソースブロックを、ソースブロック群としてグループ化する
ことを特徴とする、ソフトウェア資産整理装置。
6. The software asset rearranging apparatus according to claim 5, wherein the source block grouping unit includes a plurality of source blocks existing on the program execution path not including another marker in a program execution path connecting two markers. A software asset organizing apparatus, characterized by grouping as a source block group.
ソフトウェアのソースコードから、当該ソフトウェアの部品として管理可能なソースブロックを抽出するソフトウェア資産整理方法であって、
前記ソースコードを所定のソースコード分割条件に基いて複数のソースブロックに分割し、
当該複数のソースブロック各々について当該ソースブロック内で使用される変数を抽出し、
当該複数のソースブロック間の関係を判別し、
指定された一以上の変数各々について、当該変数と所定の対応関係を有する一以上のソースブロックを判定して、当該判定の結果に基いて、前記複数のソースブロックを一以上のグループにまとめるためのマーカを抽出し、
前記マーカを用いた所定のグループ化条件に基いて、前記複数のソースブロックの内二以上のソースブロックを一つのソフトウェア部品として整理可能なソースブロック群としてグループ化する
ことを特徴とするソフトウェア資産整理方法。
A software asset management method for extracting source blocks that can be managed as software components from software source code,
Dividing the source code into a plurality of source blocks based on a predetermined source code dividing condition;
For each of the plurality of source blocks, extract variables used in the source block,
Determine the relationship between the source blocks,
For each of one or more designated variables, determining one or more source blocks having a predetermined correspondence with the variable, and grouping the plurality of source blocks into one or more groups based on the determination result Extract the marker
Software asset organization, wherein two or more source blocks of the plurality of source blocks are grouped as a group of source blocks that can be organized as one software component based on a predetermined grouping condition using the marker Method.
請求項8記載のソフトウェア資整理方法であって、
前記ソースコード分割条件は、ソースコードの言語に応じて設定される
ことを特徴とする、ソフトウェア資産整理方法。
A software asset organizing method of claim 8,
The method of organizing software assets, wherein the source code division condition is set according to a language of the source code.
請求項8記載のソフトウェア資産整理方法であって、
前記ソースブロック間の関係を判別する場合に、前記複数のソースブロック各々について、変数の読み出しおよび書き込みが生じるか否かを判別し、判別結果に基いて前記複数のソースブロック間の関係を判別する
ことを特徴とするソフトウェア資産整理方法。
A software asset rearranging method according to claim 8,
When determining the relationship between the source blocks, for each of the plurality of source blocks, it is determined whether or not variables are read and written, and the relationship between the plurality of source blocks is determined based on the determination result. Software asset management method characterized by the above.
請求項8記載のソフトウェア資産整理方法であって、
ソースブロックの除去により前記変数の値が変化し得うる場合に、当該ソースブロックと当該変数とが前記所定の対応関係を有すると判断する
ことを特徴とするソフトウェア資産整理方法。
A software asset rearranging method according to claim 8,
A software asset rearranging method, wherein when the value of the variable can be changed by removing the source block, it is determined that the source block and the variable have the predetermined correspondence.
請求項8記載のソフトウェア資産整理方法であって、
前記一以上の変数全てと前記所定の対応関係を持つソースブロックを前記マーカとして抽出する
ことを特徴とする、ソフトウェア資産整理方法。
A software asset rearranging method according to claim 8,
A software asset rearranging method, wherein a source block having the predetermined correspondence with all of the one or more variables is extracted as the marker.
請求項8記載のソフトウェア資産整理方法であって、
さらに、作成されたソースブロック群の総数と、ソースブロック群に含まれる二以上のソースブロックのソースコードの一致行数とを算出し、当該ソースブロック群の総数および当該ソースコードの一致行数とに基いて、グループ化による効果を示す指標をユーザに提示する
ことを特徴とする、ソフトウェア資産整理方法。
A software asset rearranging method according to claim 8,
Further, the total number of source block groups created and the number of matching lines of source code of two or more source blocks included in the source block group are calculated, and the total number of source block groups and the number of matching lines of the source code are calculated. A software asset rearranging method characterized in that an index indicating the effect of grouping is presented to a user based on the above.
請求項12記載のソフトウェア資産整理方法であって、
二つのマーカを結ぶプログラム実行経路において、他のマーカを含まない前記プログラム実行経路上に存在する複数のソースブロックを、ソースブロック群としてグループ化する
ことを特徴とする、ソフトウェア資産整理方法。
A software asset rearranging method according to claim 12,
A software asset rearranging method, characterized in that, in a program execution path connecting two markers, a plurality of source blocks existing on the program execution path not including another marker are grouped as a group of source blocks.
JP2010245778A 2010-11-02 2010-11-02 Software asset management method and apparatus Expired - Fee Related JP5487078B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010245778A JP5487078B2 (en) 2010-11-02 2010-11-02 Software asset management method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010245778A JP5487078B2 (en) 2010-11-02 2010-11-02 Software asset management method and apparatus

Publications (2)

Publication Number Publication Date
JP2012098902A JP2012098902A (en) 2012-05-24
JP5487078B2 true JP5487078B2 (en) 2014-05-07

Family

ID=46390737

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010245778A Expired - Fee Related JP5487078B2 (en) 2010-11-02 2010-11-02 Software asset management method and apparatus

Country Status (1)

Country Link
JP (1) JP5487078B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190220778A1 (en) * 2016-10-04 2019-07-18 Mitsubishi Electric Corporation Information processing apparatus, information processing method, and computer readable medium
JP7073431B2 (en) * 2020-03-25 2022-05-23 株式会社日立製作所 Source code analysis system and source code analysis method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09292985A (en) * 1996-04-26 1997-11-11 Hitachi Ltd Program-reusing parts generating method
JP2002041287A (en) * 2000-07-26 2002-02-08 Fujitsu Ltd Reusable part extraction equipment, reusable part extraction method and storage media that store program to make execution of process in computer by the equipment

Also Published As

Publication number Publication date
JP2012098902A (en) 2012-05-24

Similar Documents

Publication Publication Date Title
JP5629239B2 (en) Apparatus and method for testing operation of software
US7949901B2 (en) Program and apparatus for generating system test specifications
US20070006128A1 (en) Method for evaluating dynamic expressions
CN104769586A (en) Profiling data with location information
JP6160259B2 (en) Character string search method, character string search device, and character string search program
US8965797B2 (en) Explosions of bill-of-materials lists
JP6309795B2 (en) Information processing apparatus, information processing method, and program
CN111309586A (en) Command testing method, device and storage medium thereof
JP5780036B2 (en) Extraction program, extraction method and extraction apparatus
JP5487078B2 (en) Software asset management method and apparatus
CN109800887B (en) Generation method and device of prediction process model, storage medium and electronic equipment
CN115345600B (en) RPA flow generation method and device
KR102520305B1 (en) Deep learning document analysis system and method based on keyword frequency and section centrality analysis
JP6123372B2 (en) Information processing system, name identification method and program
CN113919352A (en) Database sensitive data identification method and device
CN113641523A (en) Log processing method and device
KR102655198B1 (en) System and method for generating multi-perspective event logs
KR101829426B1 (en) Apparatus for storing and categorizing unknown softwares based on score of character string and method thereof
JP6361472B2 (en) Correspondence information generation program, correspondence information generation apparatus, and correspondence information generation method
CN109739835A (en) A kind of versions of data store method and device
JP2015153323A (en) Symbolic execution program, symbolic execution method, and symbolic execution device
JP2018181121A (en) Analyzer, analysis program, and analysis method
JP6902513B2 (en) Source code generation support device and source code generation support method
JP6556091B2 (en) System specification verification support apparatus and system specification verification support method
CN115509604A (en) Mixed code annotation generation method based on information retrieval and deep neural network

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20120521

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130206

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131031

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131112

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140109

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140128

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140224

LAPS Cancellation because of no payment of annual fees