JP2019139268A - Program analysis method, program analysis apparatus and program analysis program - Google Patents
Program analysis method, program analysis apparatus and program analysis program Download PDFInfo
- Publication number
- JP2019139268A JP2019139268A JP2018018847A JP2018018847A JP2019139268A JP 2019139268 A JP2019139268 A JP 2019139268A JP 2018018847 A JP2018018847 A JP 2018018847A JP 2018018847 A JP2018018847 A JP 2018018847A JP 2019139268 A JP2019139268 A JP 2019139268A
- Authority
- JP
- Japan
- Prior art keywords
- business
- condition
- program
- input
- output
- 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.)
- Granted
Links
Images
Abstract
Description
本発明はプログラム解析方法、プログラム解析装置およびプログラム解析プログラムに関する。 The present invention relates to a program analysis method, a program analysis apparatus, and a program analysis program.
情報処理システムでは、種々の機能を実現するソフトウェアが利用されている。ソフトウェアのプログラムは、機能追加や修正などに伴って更新されることがある。そこで、プログラムの更新を支援する技術が考えられている。 In an information processing system, software that realizes various functions is used. Software programs may be updated as functions are added or modified. Therefore, a technique for supporting program update is considered.
例えば、ソースプログラムから日常の保守作業において修正対象となり易い部分と、システム更新時に主な修正対象となるOS(Operating System)に依存する部分とを自動的に分離・抽出し、システム再構築作業の負荷を軽減する業務仕様解析装置の提案がある。 For example, a part that is likely to be corrected in daily maintenance work from a source program and a part that depends on the OS (Operating System) that is the main correction target at the time of system update are automatically separated / extracted to reconstruct the system. There is a proposal for a business specification analyzer that reduces the load.
なお、利用者により作成された単一条件式および単一条件式が結合した条件式を表示画面中の条件一覧表示域でそれぞれ一つの項として取扱い、利用者による二つの項の論理結合関係の設定の繰返しのみでデータベースの検索条件を作成する作成装置の提案がある。 Note that a single conditional expression created by the user and a conditional expression combined with a single conditional expression are handled as one term in the condition list display area on the display screen, and the logical connection relationship between the two terms by the user There is a proposal of a creation device that creates a database search condition only by repeated setting.
長期に亘って運用保守された情報処理システムでは、プログラムが部分的に修正されていることが少なくない。ここで、プログラムに対して、開発時に作成された設計文書が存在し得る。ところが、プログラムの修正時に、当該プログラムの設計文書が十分に修正されないことがある。この場合、プログラムの改修内容が設計文書に反映されず、プログラムと設計文書との間に齟齬が生じ得る。例えば、あるデータ項目と当該データ項目を用いたロジックがプログラムに追加されているにも拘わらず、追加されたデータ項目やロジックに関する内容が業務用語や業務ルールなどを記述した文書から漏れるおそれがある。このため、ユーザが現行の情報処理システムの保守や再構築などを行う場合に、既存の設計文書からプログラムの現状を正しく把握できないことがある。 In an information processing system that has been operated and maintained for a long period of time, the program is often partially modified. Here, there can be a design document created during development for the program. However, when the program is modified, the design document of the program may not be sufficiently modified. In this case, the modification content of the program is not reflected in the design document, and a flaw may occur between the program and the design document. For example, despite the fact that a data item and logic using the data item have been added to the program, the added data item and logic may leak from a document that describes business terms, business rules, etc. . For this reason, when the user performs maintenance or reconstruction of the current information processing system, the current state of the program may not be correctly grasped from the existing design document.
1つの側面では、本発明は、修正後のプログラムに対して業務ルールを適切に作成可能にすることを目的とする。 In one aspect, an object of the present invention is to make it possible to appropriately create business rules for a modified program.
1つの態様では、プログラム解析方法が提供される。このプログラム解析方法では、コンピュータが、第1のプログラムの修正後の第2のプログラムであって、第1のプログラムに対応する第1の業務ルール表との齟齬が発生している第2のプログラムを取得し、第2のプログラムにおける条件文に関する分岐条件と分岐条件に応じた出力とを示す入出力表を作成するとともに、業務用語の定義ルールを示す情報に基づいて、入出力表に含まれる条件文の組み合わせに対する業務用語を定義し、定義された業務用語と入出力表とを用いて、第2のプログラムに対応する第2の業務ルール表を作成する。 In one aspect, a program analysis method is provided. In this program analysis method, the computer is the second program after the modification of the first program, and the second program in which a conflict with the first business rule table corresponding to the first program has occurred Is created and an input / output table indicating the branch condition related to the conditional statement in the second program and the output corresponding to the branch condition is created and included in the input / output table based on the information indicating the definition rule of the business term A business term for the combination of conditional statements is defined, and a second business rule table corresponding to the second program is created using the defined business term and the input / output table.
1つの側面では、修正後のプログラムに対して業務ルールを適切に作成できる。 In one aspect, business rules can be appropriately created for the modified program.
以下、本実施の形態について図面を参照して説明する。
[第1の実施の形態]
図1は、第1の実施の形態のプログラム解析装置を示す図である。プログラム解析装置10は、プログラムの修正に応じた設計文書の改版を支援する。ここで、プログラム解析装置10は、設計文書を電子データとして管理する。設計文書として、システム開発のV字モデルにおける要件定義書や基本設計書が挙げられる。例えば、要件定義書は、業務ルール表を含む。業務ルール表は、業務における特定のデータ項目に対する処理のルール(業務ルール)を示す情報である。また、要件定義書や基本設計書は、業務用語表を含む。業務用語表は、業務ルールで用いられる用語の定義を示す情報である。
Hereinafter, the present embodiment will be described with reference to the drawings.
[First Embodiment]
FIG. 1 is a diagram illustrating a program analysis apparatus according to the first embodiment. The
プログラム解析装置10は、記憶部11および処理部12を有する。記憶部11は、RAM(Random Access Memory)などの揮発性の半導体メモリでもよいし、HDD(Hard Disk Drive)やフラッシュメモリなどの不揮発性のストレージでもよい。処理部12は、例えば、CPU(Central Processing Unit)やDSP(Digital Signal Processor)などのプロセッサである。ただし、処理部12は、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの特定用途の電子回路を含んでもよい。プロセッサは、RAMなどのメモリ(記憶部11でもよい)に記憶されたプログラムを実行する。複数のプロセッサの集合を「マルチプロセッサ」または単に「プロセッサ」と言うこともある。
The
記憶部11は、第1のプログラムP1の修正後の第2のプログラムP2を記憶する。記憶部11は、第1のプログラムP1に対応する第1の業務ルール表T1を記憶する。また、記憶部11は、業務用語の定義ルールR1を示す情報を記憶する。
The
ここで、第1のプログラムP1が修正されたにも拘わらず、第1の業務ルール表T1は、修正されていない。第2のプログラムP2は、例えば、第1のプログラムP1に対してデータ項目や当該データ項目に対するロジックが追加されたものである。このため、第2のプログラムP2は、第1の業務ルール表T1と齟齬がある(すなわち、両者の内容が整合していない)。ここで、図1の例における第1のプログラムP1および第2のプログラムP2の左側の番号は、便宜的に付した行番号である。 Here, although the first program P1 is modified, the first business rule table T1 is not modified. For example, the second program P2 is obtained by adding data items and logic for the data items to the first program P1. For this reason, the second program P2 has a conflict with the first business rule table T1 (that is, the contents of both do not match). Here, the numbers on the left side of the first program P1 and the second program P2 in the example of FIG. 1 are line numbers assigned for convenience.
図1の例では、第2のプログラムP2において、その4行目に定数C2の定義が追加され、その6行目に変数“コード”に関する定数C2を用いた条件判定が追加されている点が第1のプログラムP1と異なる。なお、図1では、第2のプログラムP2の第1のプログラムP1に対する追加部分には強調のために下線を付している。このため、例えば、第1の業務ルール表T1の変数“コード”に関する業務ルールにおいて、第2のプログラムP2に追加された定数C2の内容が反映されていない点で、第1の業務ルール表T1と第2のプログラムP2との対応関係に齟齬が発生しているといえる。 In the example of FIG. 1, in the second program P2, the definition of the constant C2 is added to the fourth line, and the condition determination using the constant C2 regarding the variable “code” is added to the sixth line. Different from the first program P1. In FIG. 1, an additional portion of the second program P2 with respect to the first program P1 is underlined for emphasis. For this reason, for example, the first business rule table T1 is that the content of the constant C2 added to the second program P2 is not reflected in the business rules related to the variable “code” in the first business rule table T1. It can be said that there is a wrinkle in the correspondence between the program and the second program P2.
処理部12は、記憶部11に記憶された第2のプログラムP2における条件文に関する分岐条件(分岐毎の入力変数に対する入力値の組)と分岐条件に応じた出力とを示す入出力表T2を作成する。例えば、入出力表T2は、項番、出力および条件(分岐条件)の項目を含む。処理部12は、第2のプログラムP2のシンボリック実行の結果に基づいて、入出力表T2を作成してもよい。シンボリック実行とは、入力変数に記号値を設定してプログラムを模擬的に実行することによりプログラムのロジックを分析する技術である。シンボリック実行の結果は、プログラムに含まれる条件分岐によるパス毎の変数の条件と、出力とを含む。処理部12は、この結果を整理することで、入出力表T2を得る。入出力表T2は、第2のプログラムP2に対応する入出力表である。処理部12は、作成した入出力表T2を示す情報を記憶部11に格納する。
The
処理部12は、定義ルールR1を示す情報に基づいて、入出力表T2に含まれる条件文の組み合わせ(複合条件)に対する業務用語を定義する。例えば、定義ルールR1には、条件文の組み合わせの書式に対応する業務用語が予め設定されている。例えば、入出力表T2の項番“1”の分岐条件には第2のプログラムP2の3〜4行目および6〜7行目のIF文に対応する条件文“コード = 1”、“コード = 2”、“0 < 範囲”および“範囲 < 10”が含まれる。
Based on the information indicating the definition rule R1, the
第1の例では、定義ルールR1は、「条件“(下限値 < 変数)AND(変数 < 上限値)”にマッチしたら、“変数内”と命名する」というルールを含む。当該ルールにおける“変数”、“下限値”および“上限値”の文字列は、入出力表T2の条件に含まれる具体的な文字列に置換される。本例では、入出力表T2の項番“1”のレコードに含まれる“範囲”を“変数”に、“0”を“下限値”に、“10”を“上限値”にそれぞれ当てはめることができる。したがって、処理部12は、入出力表T2の項番“1”に含まれる複合条件“(0 < 範囲)AND(範囲 < 10)”を業務用語“範囲内”と命名する。なお、処理部12は、入出力表T2に含まれる複合条件のうち、入出力表T2中に、当該複合条件の否定条件が含まれるものに対して業務用語を定義する。否定条件が含まれない条件は、プログラムのパスに影響せず、業務ルールに関与しないと考えられるためである。例えば、入出力表T2の項番“1”の条件“(0 < 範囲)AND(範囲 < 10)”に対しては、同項番“2”の条件“(0 NOT < 範囲)OR(範囲 NOT < 10)”が否定条件となっている。
In the first example, the definition rule R1 includes a rule that “when the condition“ (lower limit value <variable) AND (variable <upper limit value) ”is matched, it is named“ within variable ””. The character strings “variable”, “lower limit value” and “upper limit value” in the rule are replaced with specific character strings included in the conditions of the input / output table T2. In this example, “range” included in the record of item number “1” in the input / output table T2 is applied to “variable”, “0” to “lower limit value”, and “10” to “upper limit value”. Can do. Therefore, the
第2の例では、定義ルールR1は、「条件“(変数 =定数1)[OR(変数 = 定数2)]+”にマッチしたら、“有効変数”と命名する」というルールを含む。当該ルールの“[OR(変数 = 定数2)]+”の部分は、2つ目以降の定数に関する条件がORで結合され得ることを示す。また、当該ルールにおける“変数”、“定数1”および“定数2”の文字列は、入出力表T2の条件に含まれる具体的な文字列に置換される。本例では、入出力表T2の項番“1”、“2”のレコードに含まれる“コード”を“変数”に、“1”を“定数1”に、“2”を“定数2”にそれぞれ当てはめることができる。したがって、処理部12は、入出力表T2の項番“1”、“2”に含まれる複合条件“(コード = 1)OR(コード = 2)”を業務用語“有効コード”と命名する。なお、入出力表T2の項番“3”の条件“(コード NOT = 1)AND(コード NOT = 2)”は、条件“(コード = 1)OR(コード = 2)”の否定条件となっている。
In the second example, the definition rule R1 includes a rule “name it as an“ effective variable ”when it matches the condition“ (variable = constant 1) [OR (variable = constant 2)] + ””. The “[OR (variable = constant 2)] +” part of the rule indicates that the conditions for the second and subsequent constants can be combined with OR. In addition, the character strings “variable”, “constant 1”, and “constant 2” in the rule are replaced with specific character strings included in the conditions of the input / output table T2. In this example, the “code” included in the record of the item numbers “1” and “2” in the input / output table T2 is “variable”, “1” is “constant 1”, and “2” is “constant 2”. Can be applied to each. Therefore, the
処理部12は、定義された業務用語を含む業務用語表T3を示す情報を記憶部11に格納する。なお、業務用語表T3では、業務用語に対して正条件が対応付けられる。正条件とは、互いに否定の関係にある2つの条件のうち、否定演算子の少ない方の条件である。
The
処理部12は、定義された業務用語と入出力表T2とを用いて、第2のプログラムP2に対応する第2の業務ルール表T4を作成する。例えば、処理部12は、業務用語表T3に基づいて、入出力表T2の項番“1”の条件における“(コード = 1)OR(コード = 2)”の部分を、“有効コード=True”に置換する。ここで、“True”は、業務用語表T3に定義された業務用語の条件に対する正条件であることを示す。同様に、処理部12は、業務用語表T3に基づいて、入出力表T2の項番“1”の条件における“(0 < 範囲)AND(範囲 < 10)”の部分を、“範囲内 = True”に置換する。すると、入出力表T2の項番“1”の条件は、“(有効コード = True)AND(範囲内 = True)”と表される。
The
また、処理部12は、業務用語表T3に基づいて、入出力表T2の項番“2”の条件を、“(有効コード = True)AND(範囲内 = False)”と表す。“範囲内 = False”となる理由は、入出力表T2の項番“2”の条件の“(0 NOT < 範囲)OR(範囲 NOT < 10)”の部分は、業務用語“範囲内”の条件に対する否定条件だからである。
Further, based on the business term table T3, the
更に、処理部12は、業務用語表T3に基づいて、入出力表T2の項番“3”の条件を“(有効コード = False)”と表す。“有効コード = False”となる理由は、入出力表T2の項番“3”の条件の“(コード NOT = 1)AND(コード NOT = 2)”は、業務用語“有効コード”の条件に対する否定条件だからである。
Further, the
処理部12は、作成した第2の業務ルール表T4を記憶部11に格納する。また、処理部12は、業務用語表T3および第2の業務ルール表T4を、第2のプログラムP2に対応付ける。
The
こうして新たに作成された業務用語表T3および第2の業務ルール表T4は、第2のプログラムP2に対する修正を反映した内容となる。例えば、第2の業務ルール表T4における“有効コード”に関する条件の記述は、業務用語表T3によれば、新たに追加された定数C2に関する条件が適切に反映されている。このようにして、プログラム解析装置10によれば、修正後のプログラムに対して、業務ルールを適切に作成することができる。
The business term table T3 and the second business rule table T4 newly created in this way have contents reflecting corrections to the second program P2. For example, the description of the condition relating to “valid code” in the second business rule table T4 appropriately reflects the condition related to the newly added constant C2 according to the business term table T3. In this way, according to the
以下では、プログラム解析装置10として用いられるサーバコンピュータ(解析サーバ)を例示して、プログラム解析の機能を更に詳細に説明する。
[第2の実施の形態]
図2は、第2の実施の形態の解析サーバのハードウェア例を示す図である。解析サーバ100は、CPU101、RAM102、HDD103、画像信号処理部104、入力信号処理部105、媒体リーダ106およびNIC(Network Interface Card)107を有する。各ハードウェアは解析サーバ100のバスに接続されている。
Hereinafter, a server computer (analysis server) used as the
[Second Embodiment]
FIG. 2 is a diagram illustrating a hardware example of the analysis server according to the second embodiment. The
ここで、解析サーバ100は、第1の実施の形態のプログラム解析装置10の一例である。また、CPU101は、第1の実施の形態の処理部12の一例である。RAM102またはHDD103は、第1の実施の形態の記憶部11の一例である。
Here, the
CPU101は、解析サーバ100の情報処理を制御するハードウェアである。CPU101は、マルチプロセッサであってもよい。CPU101は、例えばCPU、DSP、ASICまたはFPGAなどである。CPU101は、CPU、DSP、ASIC、FPGAなどのうちの2以上の要素の組み合わせであってもよい。
The
RAM102は、解析サーバ100の主記憶装置である。RAM102は、CPU101に実行させるOSのプログラムやアプリケーションプログラムの少なくとも一部を一時的に記憶する。また、RAM102は、CPU101による処理に用いる各種データを記憶する。
The
HDD103は、解析サーバ100の補助記憶装置である。HDD103は、内蔵した磁気ディスクに対して、磁気的にデータの書き込みおよび読み出しを行う。HDD103は、OSのプログラム、アプリケーションプログラム、および各種データを記憶する。解析サーバ100は、フラッシュメモリやSSD(Solid State Drive)などの他の種類の補助記憶装置を備えてもよく、複数の補助記憶装置を備えてもよい。
The
画像信号処理部104は、CPU101からの命令に従って、解析サーバ100に接続されたディスプレイ21に画像を出力する。ディスプレイ21として、CRT(Cathode Ray Tube)ディスプレイや液晶ディスプレイなどを用いることができる。
The image
入力信号処理部105は、解析サーバ100に接続された入力デバイス22から入力信号を取得し、CPU101に出力する。入力デバイス22として、例えば、マウスやタッチパネルなどのポインティングデバイス、キーボードなどを用いることができる。
The input
媒体リーダ106は、記録媒体23に記録されたプログラムやデータを読み取る装置である。記録媒体23として、例えば、フレキシブルディスク(FD:Flexible Disk)やHDDなどの磁気ディスク、CD(Compact Disc)やDVD(Digital Versatile Disc)などの光ディスク、光磁気ディスク(MO:Magneto-Optical disk)を使用できる。また、記録媒体23として、例えば、フラッシュメモリカードなどの不揮発性の半導体メモリを使用することもできる。媒体リーダ106は、例えば、CPU101からの命令に従って、記録媒体23から読み取ったプログラムやデータをRAM102またはHDD103に格納する。
The
NIC107は、ネットワーク24を介して他の装置と通信を行う。NIC107は、有線通信インタフェースでもよいし、無線通信インタフェースでもよい。
図3は、V字モデルの例を示す図である。システム開発の現場では、V字モデルに従って開発工程の計画や、開発作業が行われる。V字モデルは、最初に要件定義を行う。要件定義では、ユーザの要求する要件を明確化する。次いで、要件定義で明確化された要件を実現するための設計を、基本設計および詳細設計の工程により段階的に詳細化し、その後、プログラムの製造の工程を行う。ここまでがV字の左上から下へ向かう開発作業の流れである。プログラムの製造が行われると、V字の下から右上に向かって、各工程の設計とテスト(単体テスト、結合テストおよびシステムテスト)とを対応付けて品質の確認が行われる。
The
FIG. 3 is a diagram illustrating an example of a V-shaped model. In the field of system development, development process planning and development work are performed according to the V-shaped model. In the V-shaped model, the requirement definition is first performed. In the requirement definition, the requirements required by users are clarified. Next, the design for realizing the requirements clarified in the requirement definition is refined step by step through the basic design and detailed design processes, and then the program manufacturing process is performed. This is the flow of development work from the upper left to the lower of the V-shape. When the program is manufactured, the quality is confirmed by associating the design of each process with the test (unit test, integration test, and system test) from the bottom to the top right of the V shape.
ここで、V字モデルの各段階において成果物が作成される。成果物には次の文書がある。
要件定義の成果物は、要件定義書D1である。要件定義書D1は、開発対象のシステムで実現すべき要件や機能を、システムの発注者とシステムの開発者との間で明確化する目的で作成される。要件定義書D1は、システムの開発に詳しくない発注者でも容易に理解できるように、システム開発の用語よりも業務用語などを用いて記述されることがある。
Here, a product is created at each stage of the V-shaped model. The deliverables include the following documents:
The product of the requirement definition is a requirement definition document D1. The requirement definition document D1 is created for the purpose of clarifying requirements and functions to be realized in the development target system between the system orderer and the system developer. The requirement definition document D1 may be described using business terms rather than system development terms so that even an orderer who is not familiar with system development can easily understand.
基本設計の成果物は、基本設計書D2である。基本設計書D2は、要件定義書の要件を実現するための基本的な設計事項を記述する。基本設計書D2は、基本的で概要的な設計書であり、コンピュータで実行可能なレベルまでは記述せずに、業務用語や基本設計用の用語を用いて記述される。 The product of the basic design is the basic design document D2. The basic design document D2 describes basic design items for realizing the requirements of the requirement definition document. The basic design document D2 is a basic and general design document, and is described by using business terms and basic design terms without describing a level that can be executed by a computer.
詳細設計の成果物は、詳細設計書D3である。詳細設計書D3は、基本設計書D2の設計内容をプログラムに実装可能なレベルに詳細化した設計を記述する。プログラム変数に該当するレベルの用語を用いて記述される。 The product of the detailed design is a detailed design document D3. The detailed design document D3 describes a design in which the design contents of the basic design document D2 are refined to a level that can be implemented in a program. It is described using terms at the level corresponding to the program variable.
製造の成果物は、プログラムD4である。プログラムD4は、詳細設計書D3の設計内容をコンピュータで実行するためのソースプログラムであり、プログラム言語を用いて記述される。 The product of manufacture is program D4. The program D4 is a source program for executing the design contents of the detailed design document D3 by a computer, and is described using a program language.
上記の各成果物は、開発工程の進展に伴い、要件定義書D1からプログラムD4へ向かう順に、記述内容の一貫性を維持して詳細化される。
図4は、文書化された情報範囲と理解の難度の例を示す図である。文書は、要件定義書D1からプログラムD4へと詳細化されるに従って、文書化された情報の範囲が増加し、文書化されていない情報が減少する。文書化されていない情報とは、発注者や開発者の間で常識的あるいは暗黙的に共有される業務知識などである。開発初期に作成される要件定義書D1では、発注者や開発者などの関係者が常識的に業務知識を共有する。このため、要件定義書D1が厳密に定義されない業務用語などの業務知識を用いて記述されていても発注者や開発者などは内容を理解可能である。一方、業務用語を用いた記述の方が簡易な記述となり、発注者と開発者との間で共通理解を形成しやすいという一面もある。
Each product is detailed while maintaining the consistency of the description contents in the order from the requirement definition document D1 to the program D4 as the development process progresses.
FIG. 4 is a diagram showing examples of documented information ranges and difficulty levels of understanding. As documents are refined from requirement definition D1 to program D4, the range of documented information increases and undocumented information decreases. The undocumented information includes business knowledge that is commonly or implicitly shared between the orderer and the developer. In the requirement definition document D1 created at the initial stage of development, related parties such as the orderer and the developer commonly share business knowledge. For this reason, even if the requirement definition document D1 is described using business knowledge such as business terms that are not strictly defined, the orderer or developer can understand the contents. On the other hand, a description using business terms becomes a simple description, and there is one aspect that it is easy to form a common understanding between the orderer and the developer.
コンピュータを用いて実行可能なシステムを構築するためには、業務知識の意味を厳密に定義することが求められる。このため、コンピュータで実行可能なプログラムを開発するためには、当該システムに関する情報のプログラムD4への記述を要する。その結果、詳細設計書D3やプログラムD4のように、開発後半の文章の記述は詳細となり、また、記述内容の量が多くなる。以上の結果、詳細設計書D3やプログラムD4は、一般に、理解の困難性が高くなる。 In order to build a system that can be executed using a computer, it is necessary to strictly define the meaning of business knowledge. For this reason, in order to develop a program executable by a computer, it is necessary to describe information related to the system in the program D4. As a result, as in the detailed design document D3 and the program D4, the description of the text in the latter half of the development becomes detailed, and the amount of description content increases. As a result, the detailed design document D3 and the program D4 are generally more difficult to understand.
図5は、V字モデルにおける文書の例(その1)を示す図である。業務ルールD11は、要件定義書D1に記述される。業務ルールD11は、システムの機能に関連する業務上の特定の判断基準を示す。要件定義書D1は、発注者と開発者との間で開発要件を明確化することが目的であるため、例えば、「有効コード」や「期間内」といった業務用語を用いて記述される。図5の業務ルールD11の例では、可読性や一覧性などを高めるために、決定表(表形式)で記述する場合を示したが、例えば、「有効コードで、かつ、期間内ならば、結果は1とする」のように自然言語で記述されてもよい。 FIG. 5 is a diagram showing an example (part 1) of a document in the V-shaped model. The business rule D11 is described in the requirement definition document D1. The business rule D11 indicates a specific business criterion related to the function of the system. Since the purpose of the requirement definition document D1 is to clarify development requirements between the orderer and the developer, for example, the requirement definition document D1 is described using business terms such as “valid code” and “within period”. In the example of the business rule D11 in FIG. 5, the case where it is described in a decision table (table format) in order to improve readability, listability, etc. is shown. May be described in a natural language such as “1”.
業務用語D12は、要件定義書D1や基本設計書D2において、業務ルールD11の「有効コード」や「期間内」の意味を定義する。例えば、「期間内」は、「2017年8月1日から2017年8月31日の間」を意味する。このように自然言語で記述することもあるし、業務用語D12のように条件式を用いて「(20170801 < 期間)AND(期間 < 20170831)」のように記述することもある。なお、業務ルールD11と業務用語D12とが一体となって、業務ルールに関する知識を形成しているともいえる。当初の設計文書では、業務用語D12の内容が業務ルールD11に組み込まれていることもある。 The business term D12 defines the meaning of “effective code” and “within period” of the business rule D11 in the requirement definition document D1 and the basic design document D2. For example, “within period” means “between August 1, 2017 and August 31, 2017”. In this way, it may be described in a natural language, or may be described as “(20110801 <period) AND (period <20110831)” using a conditional expression like the business term D12. It can be said that the business rule D11 and the business term D12 are integrated to form knowledge about the business rule. In the original design document, the contents of the business term D12 may be incorporated in the business rule D11.
詳細化された業務ルールD13は、基本設計書D2に記述される。業務ルールD13は、業務ルールD11をプログラム言語で記述することを可能にするため、業務用語D12を条件式に展開して記述したものである。 The detailed business rule D13 is described in the basic design document D2. The business rule D13 is obtained by developing the business term D12 into a conditional expression so that the business rule D11 can be described in a program language.
図6は、V字モデルにおける文書の例(その2)を示す図である。プログラムD14は、プログラムD4の一部であり、詳細化された業務ルールD13をコンピュータにより実行できるようにプログラム言語で記述したものである。プログラムD14では、プログラム言語の一例として、COBOLを用いた記述を示している。 FIG. 6 is a diagram illustrating an example (part 2) of the document in the V-shaped model. The program D14 is a part of the program D4, and is described in a program language so that the detailed business rule D13 can be executed by a computer. In the program D14, description using COBOL is shown as an example of a program language.
ここで、長期間に亘り運用保守されるシステムでは、不具合の修理や業務内容の変化などに対応するために、機能の変更や追加などの部分的な改修が断続的に行われる。この部分改修を行う際に、開発者により全ての文書とプログラムの一貫性が維持されることが望ましい。しかし、改修のコストや開発期間などの制限のために、開発者が全ての文書とプログラムとを一貫性を維持しながら適切に更新することは容易ではない。 Here, in a system that is operated and maintained for a long period of time, partial modifications such as change or addition of functions are intermittently performed in order to cope with repair of defects or changes in business contents. When making this partial modification, it is desirable that the developer maintain consistency of all documents and programs. However, it is not easy for a developer to properly update all documents and programs while maintaining consistency, due to limitations such as renovation costs and development periods.
このような状況のため、システムの機能に直接関係するプログラムが改修されても、機能には直接関係しない文書は十分に改修されない事態となり、文書の内容に不備が生じる。すなわち、プログラムの改修内容が設計文書に反映されず、プログラムと設計文書との間に齟齬が生じる。このように、プログラムと設計文書との間に齟齬があると、その後のプログラムの改修の際などに、設計文書に記載の情報を利用することができない。 In such a situation, even if a program directly related to the function of the system is modified, a document that is not directly related to the function is not sufficiently modified, and the content of the document is deficient. That is, the contents of the program modification are not reflected in the design document, and a flaw occurs between the program and the design document. As described above, if there is a flaw between the program and the design document, the information described in the design document cannot be used when the program is subsequently modified.
そこで、解析サーバ100は、プログラムの修正に応じて、業務ルールなどの設計文書を適切に再作成する機能を提供する。
図7は、解析サーバの機能例を示す図である。解析サーバ100は、プログラム記憶部110、解析情報記憶部120、命名ルール記憶部130、解析結果記憶部140および解析部150を有する。
Therefore, the
FIG. 7 is a diagram illustrating an example of functions of the analysis server. The
プログラム記憶部110、解析情報記憶部120、命名ルール記憶部130および解析結果記憶部140は、RAM102やHDD103の記憶領域を用いて実現される。解析部150は、CPU101がRAM102に記憶されたプログラムを実行することで実現される。
The
プログラム記憶部110は、解析対象のプログラム111を記憶する。プログラム111は、あるプログラムの修正後のプログラムである。このため、修正前のプログラムに対して作成された既存の設計文書の業務用語の定義内容や業務ルールの内容は、プログラム111に整合していない。
The
解析情報記憶部120は、解析部150の処理に用いられる各種の情報を記憶する。例えば、解析情報記憶部120は、シンボリック実行結果121、入出力表122、業務条件候補表123および業務条件選定結果124を記憶する。これらの情報は、テーブル形式のデータでもよい。
The analysis
シンボリック実行結果121は、解析部150によるプログラム111のシンボリック実行の結果を示す情報である。シンボリック実行結果121は、シンボリック実行により抽出されたプログラムの処理パスの情報を含む。
The
入出力表122は、解析部150によりシンボリック実行結果121から抽出されたプログラム111における入力と出力との関係を示す情報である。
業務条件候補表123は、解析部150により入出力表122から抽出された業務条件候補を示す情報である。
The input / output table 122 is information indicating the relationship between input and output in the
The business condition candidate table 123 is information indicating business condition candidates extracted from the input / output table 122 by the
業務条件選定結果124は、解析部150により業務条件候補表123から選定された業務条件を示す情報である。
命名ルール記憶部130は、命名ルール表131を記憶する。命名ルール表131は、業務条件に対する条件名の命名ルールを示す情報である。
The business
The naming
解析結果記憶部140は、解析部150により作成された業務用語表141および業務ルール表142を記憶する。業務用語表141は、業務用語の定義を示す情報である。業務ルール表142は、業務ルールの内容を示す情報である。
The analysis
解析部150は、解析対象のプログラム111が入力されると、プログラム111を解析し、業務用語表141および業務ルール表142を出力する。解析部150は、シンボリック実行部151、入出力表生成部152、業務条件候補生成部153、業務条件選定部154、業務条件命名部155および入出力表書換部156を有する。
When the
シンボリック実行部151は、解析対象のプログラム111をシンボリック実行することにより、プログラム111の処理パスを抽出し、シンボリック実行結果121を生成する。シンボリック実行部151は、シンボリック実行結果121を解析情報記憶部120に格納する。
The
入出力表生成部152は、シンボリック実行結果121を集計し、整理することで、プログラム111の入力と出力との関係を示す入出力表122を生成し、解析情報記憶部120に入出力表122を格納する。
The input / output
業務条件候補生成部153は、入出力表122に含まれる条件から業務条件の候補を生成し、業務条件候補表123に登録する。業務条件候補生成部153は、業務条件候補表123を解析情報記憶部120に格納する。ここで、業務条件とは、プログラム111のうち、ユーザの業務との関連性が比較的強い(例えば、頻繁に更新されるなど)と推定される条件群である。業務条件候補は、複数の条件の組み合わせである複合条件である。したがって、業務条件も複合条件である。複合条件を業務条件の候補とすることで、ユーザにより更新された条件の変更(例えば、変数に対する条件の追加など)を適切に検出可能にする。例えば、新規機能の追加などに応じて、プログラマなどによって、複合的な条件にコードが変更されるケースが多いため、複合条件を検出することで、コードの更新内容を適切に検出できる可能性が高まる。
The business condition
業務条件選定部154は、業務条件候補表123に登録された業務条件の複数の候補のうち、着目する候補について、当該候補の否定条件が当該複数の候補の中に存在するものを業務条件として選定し、業務条件選定結果124を生成する。業務条件選定部154は、業務条件選定結果124を解析情報記憶部120に格納する。
The business
業務条件命名部155は、業務条件選定結果124に含まれる業務条件に対して、命名ルール表131における命名ルールに基づいて条件名を命名し、命名結果を示す業務用語表141を生成する。業務条件命名部155は、解析結果記憶部140に業務用語表141を格納する。
The business
入出力表書換部156は、業務条件命名部155により命名された業務条件により、入出力表122に含まれる条件の記述を置き換えることで、業務ルール表142を生成する。入出力表書換部156は、解析結果記憶部140に業務ルール表142を格納する。
The input / output
図8は、シンボリック実行の例を示す図である。プログラムの分析方法の1つに、シンボリック実行(記号実行)がある。シンボリック実行では、プログラムへの入力値を格納する変数に、具体的な数値や具体的な文字に代えて定数を示すシンボル(記号値)を設定して、プログラムの実行可能なパスを抽出することによって、プログラムを分析する技術である。シンボリック実行に関して、例えば、次の文献を参考にすることができる。 FIG. 8 is a diagram illustrating an example of symbolic execution. One of the program analysis methods is symbolic execution (symbol execution). In symbolic execution, a variable that stores an input value to a program is set with a symbol (symbol value) indicating a constant instead of a specific numerical value or a specific character, and the executable path of the program is extracted. This is a technique for analyzing programs. Regarding symbolic execution, for example, the following documents can be referred to.
(文献)玉井哲雄、福永光一著、「シンボリック実行システム」、情報処理、pp.18−28、1982年1月15日
次に、シンボリック実行によるプログラムの分析例を説明する。
(Reference) Tetsuo Tamai, Koichi Fukunaga, “Symbolic Execution System”, Information Processing, pp. 18-28, January 15, 1982 Next, a program analysis example by symbolic execution will be described.
プログラムE1は、分析対象のプログラムの一例である。ただし、図8では、ロジックがわかり易いように、プログラム言語による記述ではなく、フローチャートの形式でプログラムE1を図示している。 The program E1 is an example of a program to be analyzed. However, in FIG. 8, the program E1 is illustrated in the form of a flowchart instead of a description in a program language so that the logic can be easily understood.
プログラムE1は、変数「性別」の値として2文字の文字列を受け取り、変数「結果」の値として1文字を出力する。プログラムE1は、2つの条件分岐を含む。1つ目の条件分岐では、変数「性別」の値が「男性」であるか判定される。変数「性別」の値が「男性」である場合には変数「結果」の値が「M」に更新され、そうでない場合には変数「結果」の値が「 」(空白)に更新される。また、2つ目の条件分岐では、変数「性別」の値が「女性」であるか判定される。変数「性別」の値が「女性」である場合には変数「結果」の値が「F」に更新され、そうでない場合には変数「結果」の値は変化しない。そして、プログラムE1が終了する。 The program E1 receives a two-character string as the value of the variable “gender” and outputs one character as the value of the variable “result”. The program E1 includes two conditional branches. In the first conditional branch, it is determined whether the value of the variable “gender” is “male”. If the value of the variable “gender” is “male”, the value of the variable “result” is updated to “M”; otherwise, the value of the variable “result” is updated to “” (blank). . In the second conditional branch, it is determined whether the value of the variable “gender” is “female”. If the value of the variable “gender” is “female”, the value of the variable “result” is updated to “F”; otherwise, the value of the variable “result” does not change. Then, the program E1 ends.
プログラムE1には3つのパスA,B,Cが存在する。変数「性別」の値に応じて、これら3つのパスのうちの何れか1つが実行される。パスAでは、変数「性別」の値が「男性」の場合である。この場合、1つ目の分岐条件はYESと判定され、2つ目の分岐条件はNOと判定される。パスAでは、変数「結果」の値は「M」になる。 The program E1 has three paths A, B, and C. Any one of these three passes is executed according to the value of the variable “gender”. In path A, the value of the variable “gender” is “male”. In this case, the first branch condition is determined as YES, and the second branch condition is determined as NO. In the path A, the value of the variable “result” is “M”.
パスBは、変数「性別」の値が「女性」の場合である。パスBでは、1つ目の分岐条件はNOと判定され、2つ目の分岐条件はYESと判定される。パスBでは、変数「結果」の値は「F」になる。 Path B is a case where the value of the variable “gender” is “female”. In path B, the first branch condition is determined as NO, and the second branch condition is determined as YES. In the path B, the value of the variable “result” is “F”.
パスCは、変数「性別」の値が「男性」でも「女性」でもない場合である。パスCでは、1つ目の分岐条件と2つ目の分岐条件の両方がNOと判定される。この実行パスでは、変数「結果」の値は「 」(空白)になる。 Path C is a case where the value of the variable “gender” is neither “male” nor “female”. In path C, it is determined that both the first branch condition and the second branch condition are NO. In this execution path, the value of the variable “result” is “” (blank).
プログラムE1は直列の2つの条件分岐文を含むため、分岐条件の内容を無視すれば、実行パスの候補は4つ存在する。しかし、変数「性別」の値が「男性」であることと変数「性別」の値が「女性」であることは矛盾するため、2つの分岐条件の両方がYESと判定されることはない。よって、4つの実行パスの候補のうち、実行される可能性のある有効な実行パスは3つである。 Since the program E1 includes two serial conditional branch statements, there are four execution path candidates if the contents of the branch condition are ignored. However, since the value of the variable “gender” is “male” and the value of the variable “sex” is “female”, both of the two branch conditions are not determined to be YES. Therefore, of the four execution path candidates, there are three effective execution paths that may be executed.
条件分岐文において、ある分岐方向(YES方向またはNO方向)に進むための条件を満たす変数の値が少なくとも1つ存在するとき、その分岐方向は「充足可能である」と言うことがある。一方、ある分岐方向に進むための条件を満たす変数の値が存在しないとき、その分岐方向は「充足可能でない」と言うことがある。 In a conditional branch sentence, when there is at least one variable value that satisfies a condition for proceeding in a certain branch direction (YES direction or NO direction), the branch direction may be said to be “satisfiable”. On the other hand, when there is no value of a variable that satisfies the condition for proceeding in a certain branch direction, the branch direction may be said to be “not satisfiable”.
プログラムE1において、1つ目の条件分岐では変数「性別」の値は制約されていないため、2つの分岐方向は共に充足可能である。一方、2つ目の条件分岐における充足可能性は、1つ目の条件分岐で選択した分岐方向に依存する。1つ目の条件分岐でYES方向を選択した場合、2つ目の条件分岐のYES方向は充足可能でなくなりNO方向のみ充足可能となる。1つ目の条件分岐でNO方向を選択した場合、2つ目の条件分岐の分岐方向は共に充足可能である。よって、有効な実行パスは3つであると判断できる。 In the program E1, since the value of the variable “gender” is not restricted in the first conditional branch, both the two branch directions can be satisfied. On the other hand, the satisfiability in the second conditional branch depends on the branch direction selected in the first conditional branch. When the YES direction is selected in the first conditional branch, the YES direction of the second conditional branch is no longer satisfactory and only the NO direction can be satisfied. When the NO direction is selected in the first conditional branch, both the branch directions of the second conditional branch can be satisfied. Therefore, it can be determined that there are three effective execution paths.
ここで、プログラムE1をシンボリック実行する例を説明する。シンボリック実行部151は、プログラムE1に対する入力を示す変数「性別」に、具体的な文字ではなく任意の定数を示す抽象的なシンボル(記号値)を割り当てる。ここでは、変数名と同じ「性別」をシンボルとして用いる。シンボリック実行部151は、シンボルを用いてプログラムE1の命令を擬似的に実行していく。
Here, an example in which the program E1 is symbolically executed will be described. The
プログラムE1の始点から1つ目の条件分岐の前までは、パスの分岐は存在しない。1つ目の条件分岐について、この時点ではそのパスが選択される条件(パス条件)は存在せず、2つの分岐方向は共に充足可能である。よって、シンボリック実行部151は、1つ目の条件分岐においてパスを分割し、一方のパスを選択する。ここでは、シンボリック実行部151は、YES方向のパスを選択したとする。
There is no path branch from the start point of the program E1 to before the first conditional branch. For the first conditional branch, there is no condition (path condition) for selecting the path at this point, and both the two branch directions can be satisfied. Therefore, the
次に、2つ目の条件分岐について、この時点におけるパス条件はシンボル「性別」が「男性」であることであるため、YES方向は充足可能でなくNO方向は充足可能である。よって、シンボリック実行部151はNO方向を選択する。その後、この1番目のパス(パスA)は終了する。シンボリック実行部151は、1番目のパスのパス条件を、シンボル「性別」が「男性」でありかつシンボル「性別」が「女性」でないと判定する。また、シンボリック実行部151は、1番目のパスの処理結果(パス出力)を、変数「結果」の値が「M」であると判定する。シンボリック実行部151は、これらの判定結果を、シンボリック実行結果E2に登録する(項番“1”のレコードに相当)。
Next, for the second conditional branch, since the path condition at this point is that the symbol “sex” is “male”, the YES direction cannot be satisfied, and the NO direction can be satisfied. Therefore, the
1番目のパスが終了すると、シンボリック実行部151は、当該パスの直近の分割点まで戻り、未選択のパスを選択する。ここでは、シンボリック実行部151は、1つ目の条件分岐まで戻ってNO方向のパスを選択する。
When the first path ends, the
2つ目の条件分岐について、この時点におけるパス条件はシンボル「性別」が「男性」でないことであるため、YES方向とNO方向の何れも充足可能である。よって、シンボリック実行部151は、2つ目の条件分岐においてパスを更に分割し、一方のパスを選択する。ここでは、シンボリック実行部151は、YES方向の実行パスを選択したとする。その後、この2番目のパス(パスB)は終了する。シンボリック実行部151は、2番目のパスのパス条件を、シンボル「性別」が「男性」でなくかつシンボル「性別」が「女性」であると判定する。また、シンボリック実行部151は、2番目のパスのパス出力を、変数「結果」の値が「F」であると判定する。シンボリック実行部151は、これらの判定結果を、シンボリック実行結果E2に登録する(項番“2”のレコードに相当)。
Regarding the second conditional branch, the path condition at this point is that the symbol “sex” is not “male”, so that both the YES direction and the NO direction can be satisfied. Therefore, the
2番目のパスが終了すると、シンボリック実行部151は、2つ目の条件分岐まで戻ってNO方向の実行パスを選択する。その後、この3番目のパス(パスC)は終了する。シンボリック実行部151は、3番目のパスのパス条件を、シンボル「性別」が「男性」でなくかつシンボル「性別」が「女性」でないと判定する。また、シンボリック実行部151は、3番目のパスのパス出力を、変数「結果」の値が「 」(空白)であると判定する。シンボリック実行部151は、これらの判定結果を、シンボリック実行結果E2に登録する(項番“3”のレコードに相当)。そして、未選択の実行パスが存在しないためシンボリック実行が終了する。
When the second path ends, the
なお、シンボリック実行部151は、パスの分割点において、その時点のパス条件と各変数の値とを保存しておく。シンボリック実行部151は、1つのパスが終了して分割点までバックトラックしたとき、保存しておいたパス条件と各変数の値とを引き継いで、未選択の分岐方向に対応する他のパスの探索を続ける。
The
ここで、1番目のパスのパス条件は、「性別が男性である」かつ「性別が女性でない」ことである。これは、「性別が男性である」という条件に簡約化できる。2番目の実行パスのパス条件は、「性別が男性でない」かつ「性別が女性である」ことである。これは、「性別が女性である」という条件に簡約化できる。3番目のパスのパス条件は、「性別が男性でない」かつ「性別が女性でない」ことである。このように、入出力表生成部152は、シンボリック実行結果E2に対する簡約化などを行って整理することで、プログラムE1に関する入出力表E3を生成する。入出力表E3は、プログラムE1に関する入力に応じた条件と出力との対応関係を示す情報である。
Here, the pass condition of the first pass is “gender is male” and “gender is not female”. This can be simplified to the condition “gender is male”. The pass condition of the second execution pass is “gender is not male” and “gender is female”. This can be simplified to the condition that “sex is female”. The pass condition of the third pass is “gender is not male” and “gender is not female”. In this manner, the input / output
なお、条件分岐文における充足可能性の判断やパス条件の簡約化には、既存の数式処理技術を利用することができる。例えば、シンボリック実行部151は、充足可能性の判断に、SMT(Satisfiability Modulo Theories)ソルバやSAT(Satisfiability)ソルバなどを用いることができる。また、入出力表生成部152は、パス条件の簡約化に、クワイン・マクラスキー(QM:Quine-McCluskey)法などを用いることができる。QM法によれば、例えば、論理式A,B,Cに対して、(A∧B∧C)∨(A∧B∧¬C)=A∧Bのように、論理式を簡約化することができる。あるいは、入出力表生成部152は、次のような手順によりパス条件を簡約化することもできる。
It should be noted that existing mathematical expression processing techniques can be used to determine satisfiability in conditional branch sentences and to simplify path conditions. For example, the
(手順1)パス条件の条件式を選言標準形(DNF:Disjunctive Normal Form)に展開する(元々DNFであれば展開不要)。展開後の条件式は、連言節(DNF項と称する)の選言である。すなわち、「条件式=DNF項(1)∨DNF項(2)∨・・・」の形式である。具体的な例として、条件式を「((X>1)∧(Y<0))∨((X>1)∧(Y>10))∨((X>1)∧(Y NOT<0)∧(Y NOT>10))」とする。この場合、DNF項は、((X>1)∧(Y<0))、((X>1)∧(Y>10))、((X>1)∧(Y NOT<0)∧(Y NOT>10))である。 (Procedure 1) The conditional expression of the path condition is expanded to a disjunctive normal form (DNF: Disjunctive Normal Form). The expanded conditional expression is a disjunction of a conjunctive clause (referred to as a DNF term). That is, the format is “conditional expression = DNF term (1) (DNF term (2) ∨. As a specific example, the conditional expression is “((X> 1) ∧ (Y <0)) ∨ ((X> 1) ∧ (Y> 10)) ∨ ((X> 1) ∧ (Y NOT <0 ) ∧ (Y NOT> 10)) ”. In this case, the DNF terms are ((X> 1) ∧ (Y <0)), ((X> 1) ∧ (Y> 10)), ((X> 1) ∧ (Y NOT <0) ∧ ( Y NOT> 10)).
(手順2)条件式から、NOT(否定演算子)をもたない比較演算子だけの比較条件式を、原子比較条件式として抽出する。上記の条件式に対して抽出される原子比較条件式は、(X>1)、(Y<0)、(Y>10)である。 (Procedure 2) From the conditional expression, a comparison conditional expression having only a comparison operator having no NOT (negative operator) is extracted as an atomic comparison conditional expression. The atomic comparison conditional expressions extracted for the above conditional expressions are (X> 1), (Y <0), and (Y> 10).
(手順3)DNF項の選言の組み合わせで、原子比較条件式とその否定の連言を因数条件の候補として因数分解する。(X>1)を因数条件として、上記の条件式を因数分解すると、条件式「(X>1)∧((Y<0)∨(Y>10)∨((Y NOT<0)∧(Y NOT>10)))」となる。 (Procedure 3) With the combination of disjunctions in the DNF term, the atomic comparison conditional expression and its negative conjunction are factored as factor condition candidates. When the above conditional expression is factored with (X> 1) as a factor condition, the conditional expression “(X> 1) ∧ ((Y <0) ∨ (Y> 10) ∨ ((Y NOT <0) ∧ ( Y NOT> 10))) ”.
(手順4)上記因数条件と連言される他の因数条件が恒真か判定し、恒真であれば、他の因数条件が恒真である旨を代入することで、当該DNF項の選言を簡約化する。(手順3)の例に対して、因数条件(X>1)と連言される他の因数条件は「(Y<0)∨(Y>10)∨((Y NOT<0)∧(Y NOT>10))=TRUE」であり、当該他の因数条件は恒真(Yの値に依らずに常に真)である。よって、(手順3)で得た条件式に、(手順4)の結果を代入することで、(手順1)で示した条件式は、(X>1)のように簡約化される。 (Procedure 4) It is determined whether another factor condition that is said to be the above factor condition is true, and if it is true, the fact that the other factor condition is true is substituted to select the DNF term. Simplify the word. For the example of (Procedure 3), the other factor condition that is referred to as the factor condition (X> 1) is “(Y <0) ∨ (Y> 10) ∨ ((Y NOT <0) ∧ (Y NOT> 10)) = TRUE ”, and the other factor conditions are true (always true regardless of the value of Y). Therefore, by substituting the result of (Procedure 4) into the conditional expression obtained in (Procedure 3), the conditional expression shown in (Procedure 1) is simplified as (X> 1).
図9は、解析対象のプログラムの例を示す図である。プログラム111は、前述のプログラムD14に対する修正後のプログラムの一例である。ここで、プログラム111に含まれる各行を、プログラム111の左側に便宜的に付した行番号により指し示す。また、図9では、図6のプログラムD14に対する修正箇所を強調のために矩形で囲っている。
FIG. 9 is a diagram illustrating an example of a program to be analyzed. The
例えば、プログラム111の12行目には、定数C2の定義が追加されている。また、プログラム111の26行目〜34行目には、定数C2を用いた変数“コード”に関する条件判定および条件判定に応じた処理が追加されている。
For example, the definition of the constant C2 is added to the 12th line of the
図10は、シンボリック実行結果の例を示す図である。シンボリック実行結果121は、プログラム111のシンボリック実行の結果である。シンボリック実行結果121は、項番、パス出力およびパス条件の項目を含む。
FIG. 10 is a diagram illustrating an example of a symbolic execution result. The
項番の項目には、レコードの識別番号が登録される。パス出力の項目には、該当のパスでの出力が登録される。パス条件の項目には、該当のパスが実行されるときの条件が登録される。 In the item number item, a record identification number is registered. In the path output item, output at the corresponding path is registered. In the path condition item, a condition for executing the corresponding path is registered.
例えば、シンボリック実行結果121には、項番が“1”、パス出力が“結果 = 1”、パス条件が“((コード = 11) AND (20170801 < 期間) AND (期間 < 20170831))”というレコードが登録される。このレコードは、“コード=11”、かつ、“20170801<期間”、かつ、“期間<20170831”の条件を満たす場合に、プログラム111の出力が“結果=1”であることを示す。
For example, in the
シンボリック実行結果121には、プログラム111に含まれる条件分岐の分岐先の組み合わせに応じたパス毎に、パス出力とパス条件とが登録される。
図11は、入出力表の例を示す図である。入出力表122は、項番、出力および条件の項目を含む。項番の項目には、レコードの識別番号が登録される。出力の項目には、シンボリック実行結果121におけるパス出力の値が登録される。ただし、入出力表122では、シンボリック実行結果121においてパス出力の値が同じであるレコードが複数の場合、当該複数のレコードに含まれる複数の条件が1つに集約される。条件の項目には、シンボリック実行結果121におけるパス出力毎のパス条件を乗法標準形(CNF:Conjunctive Normal Form)に変形した結果が登録される。CNFでは、条件式を選言節の連言の形式で表す。入出力表生成部152は、シンボリック実行結果121のパス条件を同じ値であるパス出力毎にまとめて簡約化し、簡約化した結果をCNFに変形することで、入出力表122における条件の内容を求める。CNFへの変形には、既存の方法(例えば、ドモルガンの法則、分配法則、および、Tseitin変換など)を用いることができる。
In the
FIG. 11 is a diagram illustrating an example of an input / output table. The input / output table 122 includes items of item number, output, and condition. In the item number item, a record identification number is registered. In the output item, a path output value in the
例えば、入出力表122には、項番が“1”、出力が“結果 = 1”、条件が“((コード = 11) OR (コード = 22)) AND ((20170801 < 期間) AND (期間 < 20170831))”というレコードが登録される。このレコードは、“コード”が“11”または“22”であり、かつ、“20170801<期間”、かつ、“期間<20170831”の条件を満たす場合に、プログラム111の出力が“結果=1”であることを示す。
For example, in the input / output table 122, the item number is “1”, the output is “result = 1”, and the condition is “((code = 11) OR (code = 22)) AND ((2011081 <period) AND (period <20110831)) "is registered. In this record, when the “code” is “11” or “22”, the condition of “20110801 <period” and “period <20110831” is satisfied, the output of the
入出力表122には、シンボリック実行結果121における出力“結果 = 2”および“結果 = 3”に対応する各レコードも登録される。入出力表122の当該条件に含まれる“コード = 11”、“コード = 22”、“20170801 < 期間”および“期間 < 20170831”などを、条件文と言うことができる。
In the input / output table 122, records corresponding to the outputs “result = 2” and “result = 3” in the
図12は、業務条件候補抽出用の中間データの例を示す図である。中間データ122aは、業務条件候補の抽出を行うための中間的なデータである。中間データ122aは、入出力表122に基づいて、業務条件候補生成部153により生成され、解析情報記憶部120に格納される。中間データ122aは、条件番号、候補条件、否定関係および正条件の項目を含む。
FIG. 12 is a diagram illustrating an example of intermediate data for extracting business condition candidates. The
条件番号の項目には、業務条件候補の抽出元となる条件(候補条件と言う)の識別番号が登録される。候補条件の項目には、候補条件の内容が登録される。候補条件の内容は、入出力表122に基づいて、業務条件候補生成部153により所定の演算を用いて生成される。否定関係の項目には、該当のレコードの候補条件と否定関係にある他の候補条件の条件番号が登録される。否定関係にある他の候補条件が存在しない場合、否定関係の項目は設定なしとなる。ここで、設定なしをハイフン記号“−”で示す。正条件の項目には、否定関係にある他の候補条件がある場合に、正条件に該当するか否かを示す識別情報が登録される。該当する場合、正条件の項目には“該当”が登録される。該当しない場合(否定関係をもたない場合や正条件でない場合)、正条件の項目は設定なし(“−”)となる。ここで、正条件は、互いに否定関係をもつ2つの候補条件のうち、否定演算子の数が少ない方の候補条件である。否定関係にある他の候補条件がない場合、正条件の項目は常に設定なしとなる。
In the condition number item, an identification number of a condition (referred to as a candidate condition) from which a business condition candidate is extracted is registered. The content of the candidate condition is registered in the item of candidate condition. The contents of the candidate conditions are generated by the business condition
例えば、中間データ122aには、条件番号が“条件1”、候補条件が“((コード = 11) OR (コード = 22)) AND (20170801 < 期間) AND (期間 < 20170831)”、否定関係が“−”、正条件が“−”というレコードが登録される。このレコードは、条件番号“条件1”の候補条件の内容を示しており、当該候補条件には否定関係にある他の候補条件がないことを示す。
For example, in the
中間データ122aの例では、条件番号“条件2”、“条件3”、“条件6”の候補条件も同様に否定関係にある他の候補条件をもたない。
また、中間データ122aには、条件番号が“条件4”、候補条件が“((20170801 < 期間) AND (期間< 20170831))”、否定関係が“条件7”、正条件が“該当”というレコードが登録される。このレコードは、条件番号“条件4”の候補条件の内容を示す。また、このレコードは、条件番号“条件4”の候補条件には、否定関係にある条件番号“条件7”の他の候補条件があること、条件番号“条件4”および“条件7”の候補条件のうち、条件番号“条件4”の候補条件が正条件に該当することを示す。
In the example of the
Further, in the
中間データ122aの例では、条件番号“条件5”および“条件8”の2つの候補条件も互いに否定関係にあり、このうち、条件番号“条件5”の候補条件が正条件である。
図13は、業務条件候補表の例を示す図である。業務条件候補表123は、中間データ122aに基づいて、業務条件候補生成部153により生成される。業務条件候補生成部153は、中間データ122aの候補条件における条件の長い順(節の多い順)、かつ、否定演算子の少ない順に各レコードをソートする。このソートの結果が、業務条件候補表123である(業務条件候補表123における候補条件を、業務条件候補と称する)。業務条件候補表123は、項番、条件番号、業務条件候補、否定関係および正条件の項目を含む。
In the example of the
FIG. 13 is a diagram illustrating an example of the business condition candidate table. The business condition candidate table 123 is generated by the business condition
項番の項目には、レコードの識別番号が登録される。条件番号の項目には、候補条件の識別番号が登録される。業務条件候補の項目には、業務条件候補の内容が登録される。否定関係の項目には、該当のレコードの業務条件候補と否定関係にある他の業務条件候補の条件番号が登録される。否定関係の項目の設定ルールは、中間データ122aと同様である。正条件の項目には、否定関係にある他の業務条件候補がある場合に、正条件に該当するか否かを示す識別情報が登録される。正条件の項目の設定ルールは、中間データ122aと同様である。
In the item number item, a record identification number is registered. In the condition number item, an identification number of a candidate condition is registered. In the business condition candidate item, the contents of the business condition candidate are registered. In the item of negative relation, the condition numbers of other business condition candidates having a negative relation with the business condition candidate of the corresponding record are registered. The setting rule for the negative relationship item is the same as that of the
業務条件候補生成部153は、前述のように、中間データ122aのソート結果である。このため、各項目の具体的な設定内容は、中間データ122aと同様である。ただし、項番の項目には、ソート後に、各レコードの上位から下位へ向かって昇順に番号が設定される。
The business condition
図14は、業務条件選定用の中間データの例を示す図である。中間データ123aは、業務条件の選定を行うための中間的なデータである。中間データ123aは、業務条件候補表123に基づいて、業務条件選定部154により生成され、解析情報記憶部120に格納される。中間データ123aは、項番、正条件の入出力表項番、否定の入出力表項番および業務条件判定の項目を含む。
FIG. 14 is a diagram illustrating an example of intermediate data for selecting business conditions. The intermediate data 123a is intermediate data for selecting business conditions. The intermediate data 123 a is generated by the business
項番の項目には、レコードの識別番号が登録される。正条件の入出力表項番の項目には、業務条件候補表123の該当の項番に対応する業務条件候補の、入出力表122における存在場所(入出力表122におけるレコードの項番、または、当該項番と条件における位置との組)を示す情報が登録される。正条件は、業務条件候補と同じ条件を示す。該当の業務条件候補が入出力表122のあるレコードの条件の一部に一致する場合、入出力表122の項番と、当該項番に対応する条件のうち該当の業務条件候補と一致する位置を示す情報とが、正条件の入出力表項番の項目に登録される。 In the item number item, a record identification number is registered. The item of the input / output table item number of the normal condition includes the location of the job condition candidate corresponding to the corresponding item number of the job condition candidate table 123 in the input / output table 122 (the record item number in the input / output table 122, or , Information indicating the combination of the item number and the position in the condition) is registered. The positive condition indicates the same condition as the business condition candidate. When the corresponding business condition candidate matches a part of the condition of a record in the input / output table 122, the item number in the input / output table 122 and the position corresponding to the corresponding business condition candidate among the conditions corresponding to the item number Is registered in the item of the input / output table item number of the positive condition.
否定の入出力表項番の項目には、業務条件候補表123の該当の項番に対応する業務条件候補の否定(すなわち、業務条件候補の否定を示す否定条件)の入出力表122における存在場所を示す情報が登録される。該当の業務条件候補の否定が入出力表122のあるレコードの条件の一部に一致する場合、入出力表122の項番と、当該項番に対応する条件のうち該当の業務条件候補の否定と一致する位置を示す情報とが、否定の入出力表項番の項目に登録される。 The item of the negative input / output table item number exists in the input / output table 122 of the negative of the business condition candidate corresponding to the corresponding item number of the business condition candidate table 123 (that is, the negative condition indicating the negative of the business condition candidate). Information indicating the location is registered. If the denial of the relevant business condition candidate matches a part of the condition of a record in the input / output table 122, the relevant business condition candidate is negated from the item number of the input / output table 122 and the condition corresponding to the item number. And the information indicating the position that matches are registered in the negative I / O table item number item.
業務条件判定の項目には、業務条件として選定されたか否かを示す識別情報が登録される。業務条件として選定された場合、業務条件判定の項目には“true”が設定される。業務条件として選定されなかった場合、業務条件判定の項目には“false”が設定される。ここで、互いに否定関係となっている2つの業務条件候補のうち、正条件である方が業務条件として選定される。このため、中間データ123aの項番“6”や項番“8”に対応する業務条件候補は、業務条件の選定の対象外となる。したがって、項番“6”および項番“8”に対応する業務条件候補のレコードには、項番以外の情報が設定されていない(項番以外は設定なし“−”である)。 In the business condition determination item, identification information indicating whether or not the business condition is selected is registered. When the business condition is selected, “true” is set in the business condition determination item. If it is not selected as the business condition, “false” is set in the business condition determination item. Here, of the two business condition candidates that are in a negative relationship with each other, the positive condition is selected as the business condition. For this reason, business condition candidates corresponding to the item numbers “6” and “8” of the intermediate data 123a are excluded from the selection of business conditions. Therefore, information other than the item number is not set in the business condition candidate records corresponding to the item numbers “6” and “8” (other than the item number, “−” is not set).
なお、正条件の入出力表項番および否定の入出力項番の項目は、業務条件判定が“true”の場合に設定値の登録が行われ、業務条件判定が“false”の場合に設定なしとなる。 Note that the input / output table item number of the positive condition and the negative input / output item number are set when the business condition determination is “true” and the set value is registered, and when the business condition determination is “false”. None.
例えば、中間データ123aには、項番が“1”、正条件の入出力表項番および否定の入出力表項番が設定なし“−”、業務条件判定が“false”というレコードが登録される。このレコードは、業務条件候補表123の項番“1”の業務条件候補が、業務条件として選定されなかったことを示す(項番“2”〜“4”のレコードも同様)。 For example, a record in which the item number is “1”, the positive input / output table item number and the negative input / output table item number are not set “−”, and the business condition determination is “false” is registered in the intermediate data 123a. The This record indicates that the business condition candidate of item number “1” in the business condition candidate table 123 has not been selected as the business condition (the same applies to records of item numbers “2” to “4”).
また、中間データ123aには、項番が“5”、正条件の入出力表項番が“1の右端”、否定の入出力表項番が“2の右端”、業務条件判定が“true”というレコードが登録される。このレコードは、業務条件候補表123の項番“5”の業務条件候補と同じ条件が、入出力表122の項番“1”の条件の右端の節にあることを示す。また、当該項番“5”の業務条件候補の否定を示す条件が入出力表122の項番“2”の条件の右端の節であることを示す。更に、当該項番“5”の業務条件候補は、業務条件として選定されたことを示す。 In the intermediate data 123a, the item number is “5”, the positive input / output table item number is “1 right end”, the negative input / output table item number is “2 right end”, and the business condition determination is “true”. "Is registered. This record indicates that the same condition as the job condition candidate of item number “5” in the job condition candidate table 123 is in the rightmost node of the condition of item number “1” in the input / output table 122. Further, the condition indicating that the business condition candidate of the item number “5” is negative is the rightmost node of the condition of the item number “2” in the input / output table 122. Further, it indicates that the business condition candidate of the item number “5” is selected as the business condition.
更に、中間データ123aには、項番が“7”、正条件の入出力表項番が“1の左端、2の左端”、否定の入出力表項番が“3”、業務条件判定が“true”というレコードが登録される。このレコードは、業務条件候補表123の項番“7”の業務条件候補と同じ条件が、入出力表122の項番“1”の左端の節、および、入出力表122の項番“2”の左端の節にあることを示す。また、当該項番“7”の業務条件候補の否定を示す条件が入出力表122の項番“3”の条件であることを示す。更に、当該項番“7”の業務条件候補は、業務条件として選定されたことを示す。 Further, in the intermediate data 123a, the item number is “7”, the input / output table item number of the positive condition is “left end of 1, 2 left end”, the input / output table item number of negative is “3”, and the business condition determination is performed. A record “true” is registered. This record has the same condition as the job condition candidate of item number “7” in the job condition candidate table 123, the leftmost clause of the item number “1” in the input / output table 122, and the item number “2” in the input / output table 122. Indicates that it is in the leftmost node. In addition, the condition indicating that the business condition candidate of the item number “7” is negative is the condition of the item number “3” in the input / output table 122. Further, it indicates that the business condition candidate of the item number “7” is selected as the business condition.
図15は、業務条件選定結果の例を示す図である。業務条件選定結果124は、業務条件選定部154により中間データ123aに基づいて生成される。業務条件選定結果124は、項番、業務条件、正条件の出現場所および否定条件の出現場所の項目を含む。
FIG. 15 is a diagram illustrating an example of a business condition selection result. The business
項番の項目には、レコードの識別番号が登録される。業務条件の項目には、業務条件の内容が登録される。正条件の出現場所の項目には、業務条件が出現する入出力表122の位置(レコードの項番と、当該レコードの条件内の位置を示す情報)が登録される。否定条件の出現場所の項目には、業務条件の否定が出現する入出力表122の位置(レコードの項番と、当該レコードの条件内の位置を示す情報)が登録される。 In the item number item, a record identification number is registered. The contents of the business condition are registered in the business condition item. In the item of the appearance location of the normal condition, the position (information indicating the item number of the record and the position within the condition of the record) of the input / output table 122 where the business condition appears is registered. In the item of the appearance condition of the negative condition, the position (information indicating the item number of the record and the position within the condition of the record) of the input / output table 122 where the negative of the business condition appears is registered.
例えば、業務条件選定結果124には、項番が“1”、業務条件が“((20170801 < 期間) AND (期間 < 20170831))”、正条件の出現場所が“1)入出力表条件1の右端”、否定条件の出現場所が“1)入出力表条件2の右端”というレコードが登録される。このレコードは、項番“1”の業務条件を示しており、当該業務条件が入出力表122の項番“1”の条件の右端の節に相当することを示す。また、当該業務条件の否定を示す条件が入出力表122の項番“2”の条件の右端の節に相当することを示す。
For example, in the business
また、業務条件選定結果124には、項番が“2”、業務条件が“((コード = 11) OR (コード = 22)”、正条件の出現場所が“1)入出力表条件1の左端、2)入出力表条件2の左端”、否定条件の出現場所が“1)入出力表条件3”というレコードが登録される。このレコードは、項番“2”の業務条件を示しており、当該業務条件が入出力表122の項番“1”の条件の左端の節に出現することを示す。また、当該業務条件が入出力表122の項番“2”の条件の左端の節に出現することを示す。また、当該業務条件の否定を示す条件が入出力表122の項番“3”の条件に相当することを示す。
In the business
図16は、命名ルール表の例を示す図である。命名ルール表131は、項番および命名ルールの項目を含む。項番の項目には、レコードの識別番号が登録される。命名ルールの項目には、業務条件に対する業務用語の命名ルールが登録される。 FIG. 16 is a diagram illustrating an example of a naming rule table. The naming rule table 131 includes items of item numbers and naming rules. In the item number item, a record identification number is registered. In the naming rule item, a business term naming rule for business conditions is registered.
例えば、命名ルール表131には、項番が“1”、命名ルールが“業務条件が「(下限 < 変数) AND (変数 < 上限)」にマッチしたら、「変数内」と命名する。”というレコードが登録される。このレコードは、“変数”に関する業務条件の書式が項番“1”の命名ルールの書式に一致する場合に、当該業務条件を、「変数内」と定義することを示す。ここで、「変数内」の文字列のうち、“変数”の箇所は、実際の変数名が挿入される。 For example, in the naming rule table 131, when the item number is “1” and the naming rule is “business condition matches“ (lower limit <variable) AND (variable <upper limit) ”, it is named“ inside variable ”. This record defines the business condition as “in variable” when the format of the business condition related to “variable” matches the format of the naming rule of item number “1”. Indicates. Here, the actual variable name is inserted into the “variable” portion of the character string “inside variable”.
また、命名ルール表131には、項番が“2”、命名ルールが“業務条件が「(変数 = 定数1)[OR (変数 = 定数2)]+」にマッチしたら、「有効変数」と命名する。”というレコードが登録される。このレコードは、“変数”に関する業務条件の書式が項番“2”の命名ルールの書式に一致する場合に、当該業務条件を、「有効変数」と定義することを示す。当該命名ルールの“[OR(変数 = 定数2)]+”の部分は、2つ目以降の定数に関する条件がORで結合され得ることを示す。ここで、「有効変数」の文字列のうち、“変数”の箇所は、実際の変数名が挿入される。 In the naming rule table 131, if the item number matches “2” and the naming rule “business condition is“ (variable = constant 1) [OR (variable = constant 2)] + ””, “effective variable” is indicated. Naming. This record defines the business condition as “valid variable” when the format of the business condition related to “variable” matches the format of the naming rule of item number “2”. Indicates. The “[OR (variable = constant 2)] +” part of the naming rule indicates that the conditions for the second and subsequent constants can be combined with OR. Here, the actual variable name is inserted in the “variable” portion of the character string “valid variable”.
図17は、業務用語表の例を示す図である。業務用語表141は、業務条件選定結果124および命名ルール表131に基づいて、業務条件命名部155により生成される。業務用語表141は、項番、業務用語および条件の項目を含む。
FIG. 17 is a diagram illustrating an example of a business term table. The business term table 141 is generated by the business
項番の項目には、レコードの識別番号が登録される。業務用語の項目には、命名された業務用語が登録される。条件の項目には、業務用語に対応する条件(業務条件)が登録される。 In the item number item, a record identification number is registered. Named business terms are registered in the business term field. In the condition item, a condition (business condition) corresponding to the business term is registered.
例えば、業務用語表141には、項番が“1”、業務用語が“期間内”、条件が“(20170801 < 期間) AND (期間 < 20170831)”というレコードが登録される。このレコードは、項番“1”の条件に対して、業務用語“期間内”が命名されたことを示す。業務用語“期間内”は、項番“1”の条件に対して、命名ルール表131の項番“1”の命名ルールが適用された結果である。 For example, in the business term table 141, a record is registered in which the item number is “1”, the business term is “within period”, and the condition is “(20110801 <period) AND (period <20110831)”. This record indicates that the business term “within period” is named for the condition of item number “1”. The business term “within period” is a result of applying the naming rule of item number “1” in the naming rule table 131 to the condition of item number “1”.
また、業務用語表141には、項番が“2”、業務用語が“有効コード”、条件が“(コード = 11) OR (コード =22)”というレコードが登録される。このレコードは、項番“2”の条件に対して、業務用語“有効コード”が命名されたことを示す。業務用語“有効コード”は、項番“2”の条件に対して、命名ルール表131の項番“2”の命名ルールが適用された結果である。 In the business term table 141, a record with an item number “2”, a business term “valid code”, and a condition “(code = 11) OR (code = 22)” is registered. This record indicates that the business term “valid code” is named for the condition of item number “2”. The business term “valid code” is a result of applying the naming rule of item number “2” in the naming rule table 131 to the condition of item number “2”.
図18は、業務ルール表の例を示す図である。図18(A)は、第1の形式の業務ルール表142を示す。図18(B)は、第2の形式の業務ルール表143を示す。
業務ルール表142は、入出力表122の条件の内容を、業務用語表141で定義されている業務用語に置換したものである。具体的には、入出力表122の条件に含まれる各節を業務条件の正形式および否定形式で置換する。正形式の場合、“業務用語 = True”という書式であり、否定形式の場合、“業務用語 = False”という書式である。
FIG. 18 is a diagram illustrating an example of a business rule table. FIG. 18A shows the business rule table 142 in the first format. FIG. 18B shows a business rule table 143 in the second format.
The business rule table 142 is obtained by replacing the contents of the conditions in the input / output table 122 with business terms defined in the business term table 141. Specifically, each section included in the condition of the input / output table 122 is replaced with the positive form and negative form of the business condition. In the normal format, the format is “business term = True”, and in the negative format, the format is “business term = False”.
業務ルール表143は、業務ルール表142の条件の内容を、決定表と呼ばれる形式に変換したものである。業務ルール表143では、業務ルール表142における条件のカラムが業務用語毎のカラムに分割され、業務ルール表142における“業務用語 = True”の箇所が“T”に、“業務用語 = False”の箇所が“F”に、それぞれ置き換えられている。 The business rule table 143 is obtained by converting the contents of the conditions of the business rule table 142 into a format called a decision table. In the business rule table 143, the condition column in the business rule table 142 is divided into columns for each business term, where “business term = True” in the business rule table 142 is “T” and “business term = False”. Each part is replaced with “F”.
入出力表書換部156は、入出力表122に基づいて、業務ルール表142および業務ルール表143を生成し、解析結果記憶部140に格納する。
次に、解析サーバ100による処理手順を説明する。
The input / output
Next, a processing procedure by the
図19は、解析サーバの処理例を示すフローチャートである。解析部150は、ユーザによるプログラム111の解析開始の入力を受け付けると、下記の手順を実行する。
(S1)シンボリック実行部151は、プログラム記憶部110に記憶された解析対象のプログラム111をシンボリック実行することで、プログラム111の処理パスを抽出し、シンボリック実行結果121を生成する。シンボリック実行部151は、シンボリック実行結果121を解析情報記憶部120に格納する。
FIG. 19 is a flowchart illustrating a processing example of the analysis server. When the
(S1) The
(S2)入出力表生成部152は、解析情報記憶部120に記憶されたシンボリック実行結果121に基づいて、入出力表122を生成する。入出力表生成部152は、入出力表122を解析情報記憶部120に格納する。
(S2) The input / output
(S3)業務条件候補生成部153は、解析情報記憶部120に記憶された入出力表122に基づいて、中間データ122aを生成する。業務条件候補生成部153は、中間データ122aを解析情報記憶部120に格納する。業務条件候補生成部153は、解析情報記憶部120に記憶された中間データ122aに基づいて業務条件候補表123を生成する。業務条件候補生成部153は、業務条件候補表123を解析情報記憶部120に格納する。
(S3) The business condition
(S4)業務条件選定部154は、解析情報記憶部120に記憶された業務条件候補表123に基づいて、中間データ123aを生成する。業務条件選定部154は、中間データ123aを解析情報記憶部120に格納する。業務条件選定部154は、解析情報記憶部120に記憶された入出力表122と中間データ123aとに基づいて、業務条件選定結果124を生成する。業務条件選定部154は、業務条件選定結果124を解析情報記憶部120に格納する。
(S4) The business
(S5)業務条件命名部155は、解析情報記憶部120に記憶された業務条件選定結果124と、命名ルール記憶部130に記憶された命名ルール表131とに基づいて、業務用語表141を生成する。業務条件命名部155は、業務用語表141を解析結果記憶部140に格納する。
(S5) The business
(S6)入出力表書換部156は、解析情報記憶部120に記憶された入出力表122と解析結果記憶部140に記憶された業務用語表141とに基づいて、業務ルール表142,143を生成する。入出力表書換部156は、業務ルール表142,143を解析結果記憶部140に格納する。そして、解析サーバ100の処理が終了する。
(S6) The input / output
次に、ステップS1〜S6それぞれの手順を説明する。
図20は、シンボリック実行の処理例を示すフローチャートである。シンボリック実行の処理は、図19のステップS1で実行される。
Next, the procedures of steps S1 to S6 will be described.
FIG. 20 is a flowchart illustrating a processing example of symbolic execution. The symbolic execution process is executed in step S1 of FIG.
(S10)シンボリック実行部151は、プログラム記憶部110に記憶された解析対象のプログラム111を取得する。
(S11)シンボリック実行部151は、プログラム111のシンボリック実行を行う。シンボリック実行部151は、図8で例示したように、プログラム111の入力変数にシンボル値を設定して、プログラム111の実行可能な処理パスを抽出することで、プログラム111におけるパス出力とパス条件との関係を取得する。
(S10) The
(S11) The
(S12)シンボリック実行部151は、各処理パスの終点において、該当の処理パスのパス条件とパス出力とを、シンボリック実行結果121に記録する。シンボリック実行部151は、シンボリック実行結果121を解析情報記憶部120に格納する。そして、シンボリック実行が終了する。
(S12) The
図21は、入出力表生成の処理例を示すフローチャートである。入出力表生成の処理は、図19のステップS2で実行される。
(S20)入出力表生成部152は、シンボリック実行結果121からN(Nはシンボリック実行結果121の全レコード数)個の処理パスのパス出力とパス条件との組(Outn,Cndn)(n=1,・・・,N)を取得する。
FIG. 21 is a flowchart illustrating a processing example of input / output table generation. The input / output table generation process is executed in step S2 of FIG.
(S20) The input / output
(S21)入出力表生成部152は、nに1を代入する(n=1)。
(S22)入出力表生成部152は、nがN以下であるか否か(n≦Nであるか否か)を判定する。nがN以下である場合、ステップS23に処理が進む。nがNよりも大きい場合、ステップS25に処理が進む。
(S21) The input / output
(S22) The input /
(S23)入出力表生成部152は、(Outn,Cndn)を取り出し、Outnの値毎にCndnをOR(論理和)で結合する。
(S24)入出力表生成部152は、nに1を加算する(n=n+1)。そして、ステップS22に処理が進む。
(S23) The input / output
(S24) The input /
(S25)入出力表生成部152は、出力値毎の条件を簡約化する。図8で例示したように、入出力表生成部152は、既存の技術を用いて、条件の簡約化を行える。
(S26)入出力表生成部152は、ステップS25による簡約化後の出力値毎の条件をCNFに変形することで、入出力表122を生成する。CNFへの変形には既存の技術を利用することができる。例えば、CNFへの変形には、ドモルガンの法則、分配法則、および、Tseitin変換などを利用する方法が知られている。
(S25) The input /
(S26) The input /
(S27)入出力表生成部152は、生成した入出力表122を出力する。入出力表生成部152は、入出力表122を解析情報記憶部120に格納する。そして、入出力表生成が終了する。
(S27) The input /
ここで、図10で例示したシンボリック実行結果121に対するステップS23の結果を具体的に説明する。シンボリック実行結果121に対してステップS23が繰り返し実行されることで、パス出力“結果=1”に対応する2つのパス条件がORで結合される。より具体的には、入出力表生成部152は、“結果=1”に対して“((20170801 < 期間) AND (コード = 11) AND (期間 < 20170831)) OR ((20170801 < 期間) AND (コード = 22) AND (期間 < 20170831))”を得る。
Here, the result of step S23 with respect to the
同様に、パス出力“結果=2”に対応する4つのパス条件がORで結合される。より具体的には、入出力表生成部152は、“結果=2”に対して“((20170801 NOT < 期間) AND (コード = 11)) OR ((20170801 NOT < 期間) AND (コード = 22)) OR ((コード = 11) AND (期間 NOT < 20170831)) OR ((コード = 22) AND (期間 NOT < 20170831))”を得る。
Similarly, four path conditions corresponding to the path output “result = 2” are combined by OR. More specifically, the input / output
同様に、パス出力“結果=3”に対応する1つのパス条件がORで結合される。より具体的には、入出力表生成部152は、“結果=3”に対して“(コード NOT = 11) AND (コード NOT = 22)”を得る。
Similarly, one path condition corresponding to the path output “result = 3” is combined by OR. More specifically, the input / output
この例の場合、出力値毎のパス条件のOR結合結果は、何れも既に簡単であるため、ステップS25において簡約化を施しても元の条件と変わらない。
上記のように、入出力表生成部152は、プログラム111のシンボリック実行の結果に基づいて、入出力表122を作成する。シンボリック実行の結果は、プログラム111による複数の出力(パス出力)それぞれについて、入力変数に関する複数の条件(パス条件)を含む。シンボリック実行結果121の例では、パス出力“結果 = 1”に対して、2つのパス条件が存在し、パス出力“結果 = 2”に対して、4つのパス条件が存在する。入出力表生成部152は、1つの出力に対する複数の条件を1つの分岐条件(入出力表122における条件)に変換する処理を、出力毎に実行することで、入出力表122を作成する。入出力表122の例では、“結果 = 1”に対する2つのパス条件が1つの条件(分岐条件)に変換されている。同様に、“結果 = 2”に対する4つのパス条件が1つの条件(分岐条件)に変換されている。“結果 = 3”については、1つのパス条件しかなかったので、そのまま入出力表122に登録されている。
In the case of this example, the OR combination results of the path conditions for each output value are already simple, so even if simplification is performed in step S25, the original conditions are not changed.
As described above, the input / output
図22は、業務条件候補生成の処理例を示すフローチャートである。業務条件候補生成の処理は、図19のステップS3で実行される。
(S30)業務条件候補生成部153は、入出力表122から出力と条件との組(Outn,Cndn)(n=1,・・・,N)を取得する(Nは入出力表122の全レコード数)。
FIG. 22 is a flowchart illustrating a processing example for generating business condition candidates. The business condition candidate generation process is executed in step S3 of FIG.
(S30) The business condition
(S31)業務条件候補生成部153は、nに1を代入する(n=1)。
(S32)業務条件候補生成部153は、nがN以下であるか否か(n≦Nであるか否か)を判定する。nがN以下である場合、ステップS33に処理が進む。nがNよりも大きい場合、ステップS41に処理が進む。
(S31) The business condition
(S32) The business condition
(S33)業務条件候補生成部153は、入出力表122におけるCNFで表された条件の選言節の組み合わせを連言した条件(候補条件)を生成する。入出力表122に対する具体例を後述する。
(S33) The business condition
(S34)業務条件候補生成部153は、nに対して生成した未処理の候補条件を1つ選択する。
(S35)業務条件候補生成部153は、業務条件候補リスト(すなわち、中間データ122a)に、ステップS34で選択した候補条件が存在しないか否かを判定する。存在しない場合、ステップS36に処理が進む。存在する場合、ステップS39に処理が進む。
(S34) The business condition
(S35) The business condition
(S36)業務条件候補生成部153は、業務条件候補リスト(中間データ122a)に、ステップS34で選択した候補条件を追加する。
(S37)業務条件候補生成部153は、ステップS36で追加した候補条件が、既存の候補条件の否定であるか否かを判定する。追加した候補条件が、既存の候補条件の否定である場合、ステップS38に処理が進む。追加した候補条件が、既存の候補条件の否定でない場合、ステップS39に処理が進む。
(S36) The business condition
(S37) The business condition
(S38)業務条件候補生成部153は、ステップS36で追加した候補条件と当該候補条件と否定関係にある他の候補条件に関して、否定関係を記録する。すなわち、業務条件候補生成部153は、業務条件候補リスト(中間データ122a)において、今回追加した候補条件に対して他の候補条件の識別情報を設定し、また、他の候補条件に対して今回追加した候補条件の識別情報を設定する。
(S38) The business condition
(S39)業務条件候補生成部153は、nに対してステップS33で生成した候補条件を全て処理済であるか否かを判定する。全て処理済である場合、ステップS40に処理が進む。全て処理済でない場合、ステップS34に処理が進む。
(S39) The business condition
(S40)業務条件候補生成部153は、nに1を加算する(n=n+1)。そして、ステップS32に処理が進む。
(S41)業務条件候補生成部153は、業務条件候補リスト(中間データ122a)を参照して、否定関係のある2つの候補条件のうち、否定演算子の少ない方に正条件を示す識別子を設定する。
(S40) The business condition
(S41) The business condition
(S42)業務条件候補生成部153は、業務条件候補リスト(中間データ122a)における候補条件をソートして業務条件候補表123とし、業務条件候補表123を出力する。業務条件候補生成部153は、業務条件候補表123を解析情報記憶部120に格納する。業務条件候補生成部153は、候補条件のソートを所定の規則によって行う。例えば、業務条件候補生成部153は、候補条件に含まれる条件の長い順、および、否定条件の少ない順にソートする。そして、業務条件候補生成が終了する。
(S42) The business condition
ここで、図11で例示した入出力表122に対するステップS33〜S39の結果を具体的に説明する。入出力表122に対してステップS33が実行されることで、出力“結果=1”に対して次の候補条件が生成される。出力“結果=1”に関するCNFの選言節の集合は、{((コード = 11) OR (コード = 22)),(20170801 < 期間),(期間 < 20170831)}である。これらCNFの選言節の組み合わせ(連言による組み合わせ)で生成される候補条件は、次の5つである。 Here, the results of steps S33 to S39 for the input / output table 122 illustrated in FIG. 11 will be specifically described. By executing step S33 for the input / output table 122, the next candidate condition is generated for the output “result = 1”. The set of CNF disjunctive clauses for the output “result = 1” is {((code = 11) OR (code = 22)), (20110801 <period), (period <20110831)}. There are the following five candidate conditions generated by combinations of these CNF disjunctive clauses (combinations by conjunction).
(条件1)((コード = 11) OR (コード = 22)) AND (20170801 < 期間) AND (期間 < 20170831)
(条件2)((コード = 11) OR (コード = 22)) AND (20170801 < 期間)
(条件3)((コード = 11) OR (コード = 22)) AND (期間 < 20170831)
(条件4)((20170801 < 期間) AND (期間 < 20170831))
(条件5)((コード = 11) OR (コード = 22))
ステップS36で上記の条件1〜5は、既存の条件ではないので、中間データ122aに追加される。また、ステップS38で条件1〜5は、既存の否定ではないので、出力“結果=1”の条件の処理は終了する。
(Condition 1) ((Code = 11) OR (Code = 22)) AND (20110801 <period) AND (period <20110831)
(Condition 2) ((Code = 11) OR (Code = 22)) AND (20110801 <Period)
(Condition 3) ((Code = 11) OR (Code = 22)) AND (Period <20110831)
(Condition 4) ((20110801 <period) AND (period <20110831))
(Condition 5) ((Code = 11) OR (Code = 22))
In step S36, since the
また、入出力表122によれば、出力“結果=2”に関するCNFの選言節の集合は、{((コード = 11) OR (コード = 22))、((20170801 NOT < 期間) OR (期間 NOT < 20170831))}である。これらCNFの選言節の組み合わせで生成される候補条件は、次の3つである。 Also, according to the input / output table 122, the set of CNF disjunctive clauses for the output “result = 2” is {((code = 11) OR (code = 22)), ((20110801 NOT <period) OR ( Period NOT <20110831))}. There are the following three candidate conditions generated by a combination of these CNF disjunctive clauses.
(条件6)((コード = 11) OR (コード = 22)) AND (20170801 NOT < 期間) OR (期間 NOT < 20170831)
(条件7)((20170801 NOT < 期間) OR (期間 NOT < 20170831))
(条件X)((コード = 11) OR (コード = 22))
ステップS36で条件6,7は既存の条件ではないので、中間データ122aに追加される。しかし、条件Xは、既存(条件5に一致)なので、中間データ122aに追加されない。また、ステップS38で、条件7は条件4の否定なので、互いに否定関係にあることを示す識別情報(相手の条件の識別情報)を、中間データ122aに設定する。そして、出力“結果=2”の条件の処理は終了する。
(Condition 6) ((Code = 11) OR (Code = 22)) AND (20110801 NOT <Period) OR (Period NOT <20110831)
(Condition 7) ((20110801 NOT <period) OR (period NOT <20110831))
(Condition X) ((Code = 11) OR (Code = 22))
In Step S36, the
更に、入出力表122によれば、出力“結果=3”に関する条件は、{((コード NOT = 11) AND (コード NOT = 22))}の1つのみである。したがって、ステップS33で生成される候補条件は、次の1つである。 Furthermore, according to the input / output table 122, the condition relating to the output “result = 3” is only one of {((code NOT = 11) AND (code NOT = 22))}. Accordingly, the candidate condition generated in step S33 is one of the following.
(条件8)((コード NOT = 11) AND (コード NOT = 22))
ステップS36で条件8は既存の条件ではないので、中間データ122aに追加される。また、ステップS38で、条件8は条件5の否定なので、互いに否定関係にあることを示す識別情報(相手の条件の識別情報)を、中間データ122aに設定する。そして、出力“結果=3”の条件の処理は終了する。
(Condition 8) ((Code NOT = 11) AND (Code NOT = 22))
In step S36,
なお、以上により入出力表122における全ての出力の条件を処理したので、業務条件候補生成部153は、ステップS41を実行する。そして、業務条件候補生成部153は、条件4と条件7とを比較して条件4に正条件を示す識別子を設定し、条件5と条件8とを比較して条件5に正条件を示す識別子を設定する。そして、業務条件候補生成部153は、ステップS42により中間データ122aをソートすることで、業務条件候補表123を得る。
Since all the output conditions in the input / output table 122 have been processed as described above, the business condition
図23は、業務条件選定の処理例を示すフローチャートである。業務条件選定の処理は、図19のステップS4で実行される。
(S50)業務条件選定部154は、入出力表122の出力と条件との組(Outm,Cndm)(m=1,・・・,M)を取得する(Mは入出力表122の全レコード数)。mは、入出力表122の項番に相当する。
FIG. 23 is a flowchart illustrating an example of processing for selecting business conditions. The business condition selection process is executed in step S4 of FIG.
(S50) The business
(S51)業務条件選定部154は、業務条件候補表123の条件BzCndn、n=1,・・・,N(Nは業務条件候補表123の全レコード数)を取得する。nは、業務条件候補表123の項番に相当する。業務条件選定部154は、業務条件候補表123に基づいて、中間データ123aを生成する(この段階では、業務条件候補表123の各項番のレコードに対応する項番の値のみが設定されたレコードが中間データ123aに登録される)。
(S51) The business
(S52)業務条件選定部154は、nに1を代入する(n=1)。
(S53)業務条件選定部154は、nがN以下であるか否か(n≦Nであるか否か)を判定する。nがN以下である場合、ステップS54に処理が進む。nがNよりも大きい場合、ステップS65に処理が進む。
(S52) The business
(S53) The business
(S54)業務条件選定部154は、BzCndnが処理済でないか否かを判定する。処理済でない場合、ステップS55に処理が進む。処理済の場合、ステップS58に処理が進む。
(S54) The business
(S55)業務条件選定部154は、業務条件候補表123に基づいて、BzCndnに否定関係があるか否かを判定する。否定関係がある場合、ステップS56に処理が進む。否定関係がない場合、ステップS58に処理が進む。否定関係がない場合、業務条件選定部154は、中間データ123aの項番nのレコードの業務条件判定の項目に“false”を設定する(当該レコードは処理済となる)。
(S55) The business
(S56)業務条件選定部154は、業務条件候補表123に基づいて、BzCndnが正条件であるか否かを判定する。正条件である場合、ステップS59に処理が進む。正条件でない場合、ステップS57に処理が進む。
(S56) Based on the business condition candidate table 123, the business
(S57)業務条件選定部154は、BzCndnを処理済に設定する。そして、ステップS58に処理が進む。
(S58)業務条件選定部154は、nに1を加算する(n=n+1)。そして、ステップS53に処理が進む。
(S57) The business
(S58) The business
(S59)業務条件選定部154は、BzCndnを業務条件に選定する。業務条件選定部154は、中間データ123aの項番nのレコードの業務条件判定の項目に“true”を設定する(当該レコードは処理済となる)。
(S59) The business
(S60)業務条件選定部154は、mに1を代入する(m=1)。
(S61)業務条件選定部154は、mがM以下であるか否か(m≦Mであるか否か)を判定する。mがM以下である場合、ステップS62に処理が進む。mがMよりも大きい場合、ステップS58に処理が進む。
(S60) The business
(S61) The business
(S62)業務条件選定部154は、BzCndnまたはBzCndnの否定がCndmに存在するか否かを判定する。BzCndnまたはBzCndnの否定がCndmに存在する場合、ステップS63に処理が進む。BzCndnまたはBzCndnの否定がCndmに存在しない場合、ステップS64に処理が進む。
(S62) The business
(S63)業務条件選定部154は、BzCndnまたはBzCndnの否定のCndmにおける出現場所を記録する。具体的には、業務条件選定部154は、BzCndnのCndmにおける出現場所(入出力表122におけるレコードの項番mやCndmのうちBzCndnに一致する箇所を示す情報)を中間データ123aの項番nのレコードに登録する。あるいは、業務条件選定部154は、BzCndnの否定のCndmにおける出現場所(入出力表122におけるレコードの項番mやCndmのうちBzCndnに一致する箇所を示す情報)を中間データ123aの項番nのレコードに登録する。
(S63) The business
(S64)業務条件選定部154は、mに1を加算する(m=m+1)。そして、ステップS61に処理が進む。
(S65)業務条件選定部154は、中間データ123aに基づいて、業務条件選定結果124を生成し、出力する。業務条件選定部154は、業務条件選定結果124を解析情報記憶部120に格納する。そして、業務条件選定が終了する。
(S64) The business
(S65) The business
ここで、ステップS62の判定およびステップS63における「出現場所の記録」では、業務条件選定部154は、それぞれの条件を木構造で表現し、業務条件BzCndnの木構造がCndmの木構造の一部にあるかを調査する。また、否定条件の存在の確認では、業務条件選定部154は、BzCndnの否定条件をドモルガンの法則に基づいて生成し、当該否定条件を木構造で表現することで、上記と同様に出現場所を判定する。
Here, in the determination in step S62 and the “record of appearance location” in step S63, the business
図24は、業務用語表出力の処理例を示すフローチャートである。業務用語表出力の処理は、図19のステップS5で実行される。
(S70)業務条件命名部155は、業務条件BzCndn、n=1,・・・,Nを業務条件選定結果124から取得する。ここで、Nは業務条件選定結果124の全レコード数である。
FIG. 24 is a flowchart illustrating an example of a business term table output process. The business term table output process is executed in step S5 of FIG.
(S70) The business
(S71)業務条件命名部155は、命名ルール記憶部130から命名ルール表131を取得する。
(S72)業務条件命名部155は、nに1を代入する(n=1)。
(S71) The business
(S72) The business
(S73)業務条件命名部155は、nがN以下であるか否か(n≦Nであるか否か)を判定する。nがN以下である場合、ステップS74に処理が進む。nがNよりも大きい場合、ステップS77に処理が進む。
(S73) The business
(S74)業務条件命名部155は、BzCndnの書式が、命名ルール表131における何れかの命名ルールで示される書式に合致するか否かを判定する。BzCndnの書式が命名ルールで示される何れかの書式に合致する場合、ステップS75に処理が進む。BzCndnの書式が命名ルールで示される何れの書式にも合致しない場合、ステップS76に処理が進む。
(S74) The business
(S75)業務条件命名部155は、命名ルールに従って、業務条件を命名する。業務条件と当該業務条件に対して命名した業務用語とを業務用語表141に登録する。
(S76)業務条件命名部155は、nに1を加算する(n=n+1)。そして、ステップS73に処理が進む。
(S75) The business
(S76) The business
(S77)業務条件命名部155は、ディスプレイ21に業務用語表141の内容を表示させる。
(S78)業務条件命名部155は、業務用語を編集するか否かを判定する。業務用語を編集する場合、ステップS79に処理が進む。業務用語を編集しない場合、ステップS80に処理が進む。例えば、ユーザは、ディスプレイ21に表示された業務用語表141の業務用語と業務条件とを参照して、業務条件命名部155により命名された業務用語を編集するか否かを決定することができる。業務条件命名部155は、ユーザによる業務用語の編集指示の入力を受け付けると、業務用語を編集すると判定する。一方、業務条件命名部155は、ユーザによる業務用語の編集を行わない旨の入力を受け付けると、業務用語を編集しないと判定する。
(S77) The business
(S78) The business
(S79)業務条件命名部155は、ユーザによる業務用語の編集を受け付け、編集内容に応じて、業務用語表141に登録された業務用語を更新する。
(S80)業務条件命名部155は、業務用語表141を出力する。業務条件命名部155は、業務用語表141を解析結果記憶部140に格納する。そして、業務用語表出力が終了する。
(S79) The business
(S80) The business
ここで、図21で示されるように、入出力表122における条件(分岐条件)は、CNF(乗法標準形)で表される。入出力表122における各条件は、図22の説明で述べたように、プログラム111の条件文または当該条件文の否定に対応する複数の選言節を含む。業務用語の定義では、まず、業務条件候補生成部153により、業務条件候補表123が生成される。すなわち、業務条件候補生成部153は、入出力表122の条件(分岐条件)に含まれる複数の選言節それぞれを組み合わせることで、条件文の組み合わせの複数の候補(業務条件候補)を生成する。そして、業務条件選定部154は、図23の手順により、当該複数の業務条件候補の中から業務用語の定義対象(すなわち、業務条件)を選択する。
Here, as shown in FIG. 21, the condition (branch condition) in the input / output table 122 is represented by CNF (multiplicative standard form). Each condition in the input / output table 122 includes a plurality of disjunct clauses corresponding to the conditional sentence of the
具体的には、業務条件選定部154は、複数の業務条件候補のうちの第1の候補に対する否定の条件が当該複数の業務条件候補に含まれるか否かの判定に応じて、第1の候補に対応する条件文の組み合わせを業務用語の定義対象とするか否かを決定する。
Specifically, the business
更に、業務条件選定部154は、第1の候補に対する否定を示す第2の候補が複数の候補に含まれる場合に、第1の候補が正条件であるか否かの判定に応じて、第1の候補に対応する条件文の組み合わせを業務用語の定義対象とするか否かを決定する。
Furthermore, when the second candidate indicating negative to the first candidate is included in the plurality of candidates, the business
第1の候補に対する否定条件が業務条件候補表123に存在するか否かを判定する理由は、プログラム111のパスに影響を与える複合条件を適切に抽出するためである。
業務条件命名部155は、こうして決定された業務用語の定義対象(すなわち、業務条件)に対して、図24の手順により、業務用語の命名を行う。これにより、業務条件を適切に選択して、業務条件に対する業務用語の命名を行える。
The reason for determining whether or not a negative condition for the first candidate exists in the business condition candidate table 123 is to appropriately extract a composite condition that affects the path of the
The business
図25は、業務ルール表出力の処理例を示すフローチャートである。業務ルール表出力の処理は、図19のステップS6で実行される。
(S90)入出力表書換部156は、業務条件BzCndn、n=1,・・・,Nを業務条件選定結果124から取得する。ここで、Nは業務条件選定結果124の全レコード数である。
FIG. 25 is a flowchart illustrating a processing example of a business rule table output. The business rule table output process is executed in step S6 of FIG.
(S90) The input / output
(S91)入出力表書換部156は、nに1を代入する(n=1)。
(S92)入出力表書換部156は、nがN以下であるか否か(n≦Nであるか否か)を判定する。nがN以下である場合、ステップS93に処理が進む。nがNよりも大きい場合、ステップS96に処理が進む。
(S91) The input / output
(S92) The input / output
(S93)入出力表書換部156は、入出力表122におけるBzCndnの正条件の出現場所を業務用語表141に基づいて、業務用語を用いた記述に置換する。
(S94)入出力表書換部156は、入出力表122におけるBzCndnの否定条件の出現場所を業務用語表141に基づいて、業務用語を用いた記述に置換する。
(S93) The input / output
(S94) The input / output
(S95)入出力表書換部156は、nに1を加算する(n=n+1)。そして、ステップS92に処理が進む。
(S96)入出力表書換部156は、書換後(置換後)の入出力表の形式を変更するか否かを判定する。形式を変更する場合、ステップS97に処理が進む。形式を変更しない場合、ステップS98に処理が進む。
(S95) The input / output
(S96) The input / output
(S97)入出力表書換部156は、書換後の入出力表の形式を決定表の形式に変更する。
(S98)入出力表書換部156は、書換後の入出力表を業務ルール表142(ステップS97で決定表に変更した場合は業務ルール表143)として出力する。入出力表書換部156は、業務ルール表142(または、業務ルール表143)を解析結果記憶部140に格納する。そして、業務ルール表出力が終了する。
(S97) The input / output
(S98) The input / output
このように、入出力表書換部156は、入出力表122における条件(分岐条件)の中での条件文の組み合わせ(業務条件に相当)の出現場所を検索する。そして、入出力表書換部156は、入出力表122の当該出現場所の記述を当該条件文の組み合わせ(業務条件)に対応する業務用語に置換することで、業務ルール表142,143を生成する。
In this way, the input / output
図26は、解析サーバの入出力の例を示す図である。第2の実施の形態で説明したように、解析サーバ100は、プログラム111の入力に対して、プログラム111の解析を行い、業務用語表141および業務ルール表143(または、業務ルール表142)を出力する。
FIG. 26 is a diagram illustrating an example of input / output of the analysis server. As described in the second embodiment, the
ここで、プログラム111は、図9で例示したように、図6のプログラムD14に対して、定数C2の定義や、定数C2を用いた処理の記述が含まれている。こうしたプログラムD14の部分改修が行われると、プログラムD14に対応する業務ルールD11および業務用語D12の内容と、改修後のプログラム111の内容とが整合しなくなる。例えば、業務用語D12には、定数C2(=22)に関連する有効コードの定義がないし、そのため、業務ルールD11の有効コードの条件も、定数C2(=22)が考慮されていない。すなわち、既存の業務ルールD11および業務用語D12と、改修後のプログラム111との間に齟齬がある。
Here, as illustrated in FIG. 9, the
そこで、解析サーバ100は、プログラム111を入力として、プログラム111に対応する業務用語表141および業務ルール表143(または、業務ルール表142)を出力する。業務用語表141の例では、部分改修により追加された定数C2(=22)に関連づけて有効コードが定義されており、そのため、業務ルール表143の有効コードに対する条件も、定数C2(=22)が考慮された内容となる。したがって、業務用語表141および業務ルール表143と、プログラム111の内容とは整合しており、齟齬がない。このように、解析サーバ100は、修正後のプログラム111に対し、業務用語表141および業務ルール表143(または、業務ルール表142)を適切に作成できる。
Therefore, the
図27は、解析対象のプログラムの他の例を示す図である。プログラム112は、図6のプログラムD14が部分改修されて得られた部分改修後のプログラムである。図27では、次の2回の機能追加があった場合を例示する。
FIG. 27 is a diagram illustrating another example of a program to be analyzed. The
(追加1)有効コードに“22”を追加して、有効コードを“11”または“22”とする。
(追加2)有効コードに“33”を追加して、有効コードを“11”または“22”または“33”とする。
(Addition 1) “22” is added to the valid code, and the valid code is set to “11” or “22”.
(Addition 2) “33” is added to the valid code, and the valid code is set to “11”, “22”, or “33”.
これらの機能追加に対応するため、主に、次の2回の部分改修がプログラムD14に対して行われたとする。
(改修1)改修後のプログラム112の18行目のIF文条件において、元々は“コード=C1”であった条件に、“コード=C2”を追加して、“(コード=C1)OR(コード=C2)”とする。ここで、C2は、定数であり、プログラム112の12行目に定義が追加される。
Assume that the following two partial modifications are mainly made to the program D14 in order to cope with these function additions.
(Modification 1) In the IF statement condition on the 18th line of the
(改修2)改修後のプログラム112の24行目〜29行目において、ELSE IFブロックを追加する。ここで、C3は、定数であり、プログラム112の13行目に定義が追加される。
(Renovation 2) The ELSE IF block is added to the 24th to 29th lines of the
また、プログラム112の例では、図6のプログラムD14の17,18行目の記述が、プログラム112の19行目の記述にまとめられる改修も行われている。
図27で例示されるように、プログラムD14に対して複数回の改修が行われることもあり、改修の方法も唯一ではない。例えば、改修2は、ELSE IFブロックを追加する代わりに、改修1のようにIF文の条件を改修する方法でも対応可能である。しかしながら、長年の保守の間に、当該プログラムD14の担当プログラマが交代している場合などもあり、様々な記述方法で改修が行われ得る。
Further, in the example of the
As illustrated in FIG. 27, the program D14 may be modified a plurality of times, and the modification method is not unique. For example, the
図28は、解析サーバの入出力の他の例を示す図である。解析サーバ100は、プログラム112の入力に対して、プログラム112の解析を行い、業務用語表141aおよび業務ルール表143aを出力する。ただし、解析サーバ100は、業務ルール表143aを決定表形式に変更した業務ルール表を出力することもできる。
FIG. 28 is a diagram illustrating another example of input / output of the analysis server. The
業務用語表141aによれば、部分改修により追加された定数C2(=22)および定数C3(=33)に関連づけて有効コードが定義されている。そのため、業務ルール表143aの有効コードに対する条件も、定数C2(=22)および定数C3(=33)が考慮された内容となる。したがって、業務用語表141aおよび業務ルール表143aと、プログラム112の内容とは整合しており、齟齬がない。このように、解析サーバ100は、修正後のプログラム112に対しても、業務用語表141aおよび業務ルール表143a(または、業務ルール表143aを決定表形式に変更した業務ルール表)を適切に作成できる。
According to the business term table 141a, the valid code is defined in association with the constant C2 (= 22) and the constant C3 (= 33) added by the partial modification. Therefore, the condition for the valid code in the business rule table 143a also takes into account the constant C2 (= 22) and the constant C3 (= 33). Therefore, the business term table 141a and the business rule table 143a are consistent with the contents of the
ところで、情報処理システムの保守や再構築の活動では、情報処理システムの現状を把握し、理解するために、当該情報処理システムが扱う業務の知識と当該情報処理システムの実装方法に関する情報(業務用語表や業務ルール表など)が利用される。このような情報は、本来、文書に記述されているものであるが、上記のように当初作成された文書が適切に更新されていないという不備があると、システム開発者は文書を信頼して参照することができない。また、当該情報処理システムの当初の開発担当者などの有識者は、長年の運用期間の間に散逸して不在となる事態も発生するため、有識者に問い合わせることも難しいことが少なくない。 By the way, in the activities of information processing system maintenance and restructuring, in order to understand and understand the current state of the information processing system, knowledge of the business handled by the information processing system and information on how to implement the information processing system (business terminology) Table and business rule table). Such information is originally described in the document, but if there is a deficiency that the originally created document has not been properly updated, the system developer must trust the document. I can't refer to it. In addition, it is often difficult for an expert such as an initial developer in charge of the information processing system to make an inquiry to an expert because it is dissipated during a long operation period.
このような文書の不備や有識者の不在などにより、保守や再構築の作業のための情報が不足する場合に、不足する情報を補うために、情報処理システムの実装実態である現状のプログラムの解析によって、当該情報の復元を試みることがある。 Analysis of the current program that is the actual state of information processing system implementation to compensate for the lack of information for maintenance and reconstruction work due to such lack of documents and the absence of experts. May attempt to restore the information.
しかし、上記のように、長年に亘る部分的な改修を経たプログラムでは業務情報が整然と記述されておらず、プログラム(例えば、プログラム111やプログラム112のように)の所々に分散した形式で記述されることがある。この場合、プログラムの記述をそのまま用いて業務情報を獲得することが難しい。また、設計文書と現状のプログラムとの間に齟齬があり、設計文書に記述された情報を利用できないことがある。
However, as described above, in a program that has undergone partial modification over many years, business information is not neatly described, and is described in a distributed form throughout the program (for example,
このように、現状のプログラムから業務情報を得ることが難しかった場合でも、解析サーバ100によれば、現状のプログラムから適切に業務知識(業務用語表や業務ルール表)を作成できる。例えば、解析サーバ100は、作成した業務用語表や業務ルール表をディスプレイ21を用いて表示し、システム開発者に提示する。システム開発者は、解析サーバ100により表示された業務用語表や業務ルール表により、情報処理システムの現状を適切に把握し、理解でき、当該情報処理システムの保守や再構築の活動を効率的に進められるようになる。こうして、解析サーバ100は、ユーザによる既存のソフトウェア資産の適切な把握を支援できる。
As described above, even when it is difficult to obtain business information from the current program, the
なお、第1の実施の形態の情報処理は、処理部12にプログラムを実行させることで実現できる。また、第2の実施の形態の情報処理は、CPU101にプログラムを実行させることで実現できる。プログラムは、コンピュータ読み取り可能な記録媒体23に記録できる。
The information processing according to the first embodiment can be realized by causing the
例えば、プログラムを記録した記録媒体23を配布することで、プログラムを流通させることができる。また、プログラムを他のコンピュータに格納しておき、ネットワーク経由でプログラムを配布してもよい。コンピュータは、例えば、記録媒体23に記録されたプログラムまたは他のコンピュータから受信したプログラムを、RAM102やHDD103などの記憶装置に格納し(インストールし)、当該記憶装置からプログラムを読み込んで実行してもよい。
For example, the program can be distributed by distributing the
10 プログラム解析装置
11 記憶部
12 処理部
P1 第1のプログラム
P2 第2のプログラム
R1 定義ルール
T1 第1の業務ルール表
T2 入出力表
T3 業務用語表
T4 第2の業務ルール表
DESCRIPTION OF
Claims (9)
第1のプログラムの修正後の第2のプログラムであって、前記第1のプログラムに対応する第1の業務ルール表との齟齬が発生している前記第2のプログラムを取得し、
前記第2のプログラムにおける条件文に関する分岐条件と前記分岐条件に応じた出力とを示す入出力表を作成するとともに、業務用語の定義ルールを示す情報に基づいて、前記入出力表に含まれる前記条件文の組み合わせに対する前記業務用語を定義し、
定義された前記業務用語と前記入出力表とを用いて、前記第2のプログラムに対応する第2の業務ルール表を作成する、
プログラム解析方法。 Computer
A second program after correction of the first program, wherein the second program has a conflict with the first business rule table corresponding to the first program;
An input / output table indicating a branch condition related to a conditional statement in the second program and an output corresponding to the branch condition is created, and the information included in the input / output table is based on information indicating a definition rule for a business term. Define the business terms for the combination of conditional statements,
Creating a second business rule table corresponding to the second program using the defined business terms and the input / output table;
Program analysis method.
前記入出力表の生成では、1つの出力に対する前記複数の条件を1つの前記分岐条件に変換する処理を、出力毎に実行する、
請求項2記載のプログラム解析方法。 The result of the symbolic execution includes a plurality of conditions related to input variables for each of a plurality of outputs by the second program,
In the generation of the input / output table, a process of converting the plurality of conditions for one output into one branch condition is executed for each output.
The program analysis method according to claim 2.
前記業務用語の定義では、前記分岐条件に含まれる複数の選言節それぞれを組み合わせることで、前記条件文の組み合わせの複数の候補を生成し、前記複数の候補の中から前記業務用語の定義対象を選択する、
請求項1乃至3の何れか1項に記載のプログラム解析方法。 The branch condition is a multiplicative standard form,
In the definition of the business term, a plurality of candidates for the combination of the conditional sentences are generated by combining each of a plurality of disjunct clauses included in the branch condition, and the business term is defined from the plurality of candidates Select
The program analysis method according to any one of claims 1 to 3.
前記第2のプログラムにおける条件文に関する分岐条件と前記分岐条件に応じた出力とを示す入出力表を作成するとともに、前記定義ルールを示す情報に基づいて、前記入出力表に含まれる前記条件文の組み合わせに対する前記業務用語を定義し、定義された前記業務用語と前記入出力表とを用いて、前記第2のプログラムに対応する第2の業務ルール表を作成する処理部と、
を有するプログラム解析装置。 The second program after the modification of the first program, the second program in which there is a conflict with the first business rule table corresponding to the first program, and business term definition rules A storage unit for storing information indicating
An input / output table indicating a branch condition related to a conditional statement in the second program and an output corresponding to the branch condition is created, and the conditional statement included in the input / output table based on information indicating the definition rule A processing unit that defines the business terms for a combination of the first and second business rule tables corresponding to the second program using the business terms and the input / output table defined;
A program analysis apparatus.
前記第2のプログラムにおける条件文に関する分岐条件と前記分岐条件に応じた出力とを示す入出力表を作成するとともに、業務用語の定義ルールを示す情報に基づいて、前記入出力表に含まれる前記条件文の組み合わせに対する前記業務用語を定義し、
定義された前記業務用語と前記入出力表とを用いて、前記第2のプログラムに対応する第2の業務ルール表を作成する、
処理をコンピュータに実行させるプログラム解析プログラム。 A second program after correction of the first program, wherein the second program has a conflict with the first business rule table corresponding to the first program;
An input / output table indicating a branch condition related to a conditional statement in the second program and an output corresponding to the branch condition is created, and the information included in the input / output table is based on information indicating a definition rule for a business term. Define the business terms for the combination of conditional statements,
Creating a second business rule table corresponding to the second program using the defined business terms and the input / output table;
A program analysis program that causes a computer to execute processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018018847A JP6993573B2 (en) | 2018-02-06 | 2018-02-06 | Program analysis method, program analysis device and program analysis program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018018847A JP6993573B2 (en) | 2018-02-06 | 2018-02-06 | Program analysis method, program analysis device and program analysis program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2019139268A true JP2019139268A (en) | 2019-08-22 |
JP6993573B2 JP6993573B2 (en) | 2022-01-13 |
Family
ID=67693958
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018018847A Active JP6993573B2 (en) | 2018-02-06 | 2018-02-06 | Program analysis method, program analysis device and program analysis program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6993573B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112416800A (en) * | 2020-12-03 | 2021-02-26 | 网易(杭州)网络有限公司 | Intelligent contract testing method, device, equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07104994A (en) * | 1993-09-30 | 1995-04-21 | Fujitsu Ltd | Job specification analysis device of source program |
JP2006252201A (en) * | 2005-03-10 | 2006-09-21 | Fujitsu Ltd | Source code analysis program |
JP2015005031A (en) * | 2013-06-19 | 2015-01-08 | 株式会社エヌ・ティ・ティ・データ | Source code analyzing device, source code analyzing method, and program |
JP2017204164A (en) * | 2016-05-12 | 2017-11-16 | 富士通株式会社 | Program analysis method, program analysis device and analysis program |
-
2018
- 2018-02-06 JP JP2018018847A patent/JP6993573B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07104994A (en) * | 1993-09-30 | 1995-04-21 | Fujitsu Ltd | Job specification analysis device of source program |
JP2006252201A (en) * | 2005-03-10 | 2006-09-21 | Fujitsu Ltd | Source code analysis program |
JP2015005031A (en) * | 2013-06-19 | 2015-01-08 | 株式会社エヌ・ティ・ティ・データ | Source code analyzing device, source code analyzing method, and program |
JP2017204164A (en) * | 2016-05-12 | 2017-11-16 | 富士通株式会社 | Program analysis method, program analysis device and analysis program |
Non-Patent Citations (1)
Title |
---|
前田 芳晴ほか: "業務システムのモダナイゼーション支援技術", FUJITSU, vol. 68, no. 5, JPN6021044270, 1 September 2017 (2017-09-01), pages 78 - 84, ISSN: 0004634493 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112416800A (en) * | 2020-12-03 | 2021-02-26 | 网易(杭州)网络有限公司 | Intelligent contract testing method, device, equipment and storage medium |
CN112416800B (en) * | 2020-12-03 | 2023-09-15 | 网易(杭州)网络有限公司 | Intelligent contract testing method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
JP6993573B2 (en) | 2022-01-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7937251B2 (en) | Method and system for designing and modeling a product in a knowledge based engineering environment | |
JP3765949B2 (en) | Object-oriented software development support apparatus and development support method | |
JP5005510B2 (en) | Software design support method, design support apparatus, and design support program | |
US7676777B2 (en) | Method and apparatus for supporting verification, and computer product | |
JPH08234975A (en) | Program generation device and method | |
US8527254B2 (en) | Simulator engine development system and simulator engine development method | |
JP3871832B2 (en) | Data processing program automatic generation system and method, and computer-readable recording medium | |
US7490312B1 (en) | Partition-based incremental implementation flow for use with a programmable logic device | |
JP2002279005A (en) | Method, device and program for generating three- dimensional analytic model and its recording medium | |
JP5747698B2 (en) | Requirements management support device | |
JP6993573B2 (en) | Program analysis method, program analysis device and program analysis program | |
JP2008225898A (en) | Conversion device, conversion program, and conversion method | |
JP7073756B2 (en) | Merge method, merge device, and merge program | |
US5533179A (en) | Apparatus and method of modifying hardware description language statements | |
JP6775740B1 (en) | Design support device, design support method and design support program | |
JP2000172739A (en) | Design supporting device | |
JP4906424B2 (en) | Web service design method and apparatus | |
JP5600826B1 (en) | Unstructured data processing system, unstructured data processing method and program | |
JP7469999B2 (en) | Search device, search method, and search program | |
JP6062735B2 (en) | Software development support device, software development support method, software development support program | |
JP6511793B2 (en) | Test case generation program, test case generation method and test case generation apparatus | |
WO2021161428A1 (en) | Program generation device, program generation method, and program | |
JP2010165205A (en) | Template automatic generation system, method and program for model | |
JP3245635B2 (en) | Standardization and analysis of software products | |
KR100656559B1 (en) | Program Automatic Generating Tools |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20201110 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20201126 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20201126 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20211013 |
|
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: 20211109 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20211122 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6993573 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |