JP7493405B2 - Test method and computing device - Google Patents
Test method and computing device Download PDFInfo
- Publication number
- JP7493405B2 JP7493405B2 JP2020124296A JP2020124296A JP7493405B2 JP 7493405 B2 JP7493405 B2 JP 7493405B2 JP 2020124296 A JP2020124296 A JP 2020124296A JP 2020124296 A JP2020124296 A JP 2020124296A JP 7493405 B2 JP7493405 B2 JP 7493405B2
- Authority
- JP
- Japan
- Prior art keywords
- test
- calculation unit
- stack
- program
- test calculation
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Description
本発明は、テスト方法および演算装置に関する。 The present invention relates to a test method and a computing device.
複雑なプログラムは一般に検証が困難である。ソフトウエアへの要求レベルが高い分野では、単体テストレベルで100%のテストカバレッジを取得する必要がある。プログラム内の処理の順番が常に一定である順次プログラムでは、テスト時に相互依存が問題になることはほとんどなく、テストの困難性は限定的である。その一方で、プログラム内の処理の順番が一定ではない非順次プログラムではテストが困難である。 Complex programs are generally difficult to verify. In fields with high software requirements, it is necessary to obtain 100% test coverage at the unit test level. In sequential programs, where the order of operations within a program is always constant, interdependencies rarely become an issue during testing, and the difficulty of testing is limited. On the other hand, testing is difficult for non-sequential programs, where the order of operations within a program is not constant.
プログラムの規模が大きいシステムや高速な処理が必要なシステム、たとえば、自動車の高度運転支援システム(ADAS)や自動運転システム(ADS)などのリアルタイムシステムでは、複数のプロセッサが用いられる。また、従来のシングルコア用システムがマルチコアのハードウエア上に構築された場合には、自動並列化処理により複数のシステムを統合することができる。このどちらの場合にも、プログラム内の処理が実行される順番は膨大なため、安全に統合することは容易ではない。従来のシングルコアソフトウェアに対して自動並列化コンパイラを適用すると、並列化されたコードが元のコードと同じ機能と動作を持っていることを実際に確認できるかどうかという別の問題も発生する。 Systems with large programs or high-speed processing, such as real-time systems such as advanced driver assistance systems (ADAS) and autonomous driving systems (ADS), use multiple processors. When conventional single-core systems are built on multi-core hardware, multiple systems can be integrated using automatic parallelization. In both cases, the number of possible execution orders within a program is huge, making safe integration difficult. When applying an automatic parallelizing compiler to conventional single-core software, another problem arises: can we actually verify that the parallelized code has the same functionality and behavior as the original code?
コンパイラにより正しく実行されたことの確認を行うというアイデアは、特にプログラム言語からアセンブリコードへの変換のレベルで開発された。このレベルでは、プログラム依存グラフという名前で有向非巡回グラフを使用することで、バイナリコードの効率化と自動並列化の向上に大きく貢献している。 The idea of checking correct execution by the compiler was developed especially at the level of translation from a programming language to assembly code, where the use of directed acyclic graphs, known as program dependence graphs, has contributed greatly to improving the efficiency of binary code and automatic parallelization.
特許文献1には、複数のテストノード及び該テストノード間のプロセスを定義したテストシナリオに関する情報を記憶するシナリオ情報記憶手段と、テストノードごとに、次に遷移するべきテストノードを識別する情報を含むテストノードに関する情報、プロセスが分岐する分岐パスを含むか否かに関する情報を記憶するテストノード情報記憶手段と、テストノードごとに前記分岐パスが存在するか否かを判断する第一の判断手段と、該第一の判断手段で前記分岐パスが存在すると判断したテストノードにおいて、スナップショットを取得した場合にテストを完了するまでに要する実行予測時間を算出する実行予測時間算出手段と、スナップショットを取得することなくテストを完了するまでに要する実行時間を算出する実行時間算出手段と、スナップショットを取得したテストノードごとに、実行時間と実行予測時間との差分を短縮時間として算出する短縮時間算出手段と、前記短縮時間が最も大きいテストノードを選択する選択手段と、選択したテストノードを識別する情報を出力する出力手段とを備えるテスト支援装置が開示されている。
特許文献1に記載されている発明では、実行される順番が複数とおり存在し得る複数のマクロタスクを含むプログラムのテストにおいて特定のマクロタスクを対象としたテストが効率的に実行できない。
The invention described in
本発明の第1の態様によるテスト方法は、実行される順番が複数とおり存在し得る複数のマクロタスクを含むプログラムをコンピュータがテストするテスト方法であって、前記複数のマクロタスクのいずれかを注目タスクに設定することと、前記注目タスクに影響を与える前記マクロタスクの集合である先祖リストを特定することと、前記先祖リストに含まれる前記マクロタスクを、並列化に寄与しない非並列群および並列化に寄与する並列寄与群に分別することと、前記並列寄与群についてテストパタンを複数生成することと、前記非並列群に属する前記マクロタスクを実行して得られた結果を用いて、前記複数の前記テストパタンを実行することと、を含む。
本発明の第1の態様による演算装置は、実行される順番が複数とおり存在し得る複数のマクロタスクを含むプログラムを格納する記憶部と、前記複数のマクロタスクのいずれかを注目タスクに設定し、前記注目タスクに影響を与える前記マクロタスクの集合である先祖リストを特定し、前記先祖リストに含まれる前記マクロタスクを、並列化に寄与しない非並列群および並列化に寄与する並列寄与群に分別し、前記並列寄与群についてテストパタンを複数生成するテスト演算部と、前記非並列群に属する前記マクロタスクを実行して得られた結果を用いて、前記複数の前記テストパタンを実行するプログラム実行部と、を含む。
A testing method according to a first aspect of the present invention is a testing method in which a computer tests a program including a plurality of macrotasks that can have a plurality of execution orders, and includes the steps of setting one of the plurality of macrotasks as a focus task, identifying an ancestor list which is a collection of the macrotasks that affect the focus task, classifying the macrotasks included in the ancestor list into a non-parallel group that does not contribute to parallelization and a parallel contribution group that contributes to parallelization, generating a plurality of test patterns for the parallel contribution group, and executing the plurality of test patterns using results obtained by executing the macrotasks belonging to the non-parallel group.
A calculation device according to a first aspect of the present invention includes a memory unit that stores a program including a plurality of macrotasks that can have a plurality of execution orders; a test calculation unit that sets one of the plurality of macrotasks as a focus task, identifies an ancestor list that is a collection of the macrotasks that affect the focus task, separates the macrotasks included in the ancestor list into a non-parallel group that does not contribute to parallelization and a parallel contribution group that contributes to parallelization, and generates a plurality of test patterns for the parallel contribution group; and a program execution unit that executes the plurality of test patterns using results obtained by executing the macrotasks belonging to the non-parallel group.
本発明によれば、実行される順番が複数とおり存在し得る複数のマクロタスクを含むプログラムのテストにおいて、特定のマクロタスクを対象としたテストが効率的に実行できる。 According to the present invention, when testing a program that includes multiple macrotasks that can be executed in multiple different orders, testing of specific macrotasks can be efficiently performed.
―第1の実施の形態―
以下、図1~図13を参照して、演算装置が実行するテスト方法の第1の実施の形態を説明する。
-First embodiment-
A first embodiment of a test method executed by a computing device will be described below with reference to FIGS.
(ハードウエア構成)
図1は、本発明に係るテスト方法を実行する演算装置1のハードウエア構成図である。演算装置1は、中央演算装置であるCPU2と、読み出し専用の記憶装置であるROM3と、読み書き可能な記憶装置であるRAM4と、不揮発性の記憶装置である記憶部5と、外部インタフェース6とを備える。CPU2は、ROM3に格納されるプログラムをRAM4に展開して実行することで後述する複数の機能を実現する。記憶部5はたとえば、ハードディスクドライブやフラッシュメモリなどである。ただし記憶部5が演算装置1の内部に格納されることは必須の構成要件ではなく、演算装置1の外部に設置された記憶部5に対して演算装置1が外部インタフェース6を介してアクセスしてもよい。
(Hardware configuration)
1 is a hardware configuration diagram of a
外部インタフェース6は、演算装置1の外部とのインタフェースであり、対象は人間およびコンピュータのいずれでもよい。たとえば、人間を対象とするマウス、キーボード、ディスプレイ、およびプリンタなどの装置そのものやこれら装置の接続インタフェースでもよい。また他のコンピュータを対象とする通信インタフェース、およびリムーバブルメディアの読み書き装置でもよい。以下では、演算装置1を操作する人間を「オペレータ」と呼ぶ。
The
(機能構成)
図2は、演算装置1が有する機能を機能ブロックとして表した機能構成図である。ただし図2には記憶部5に格納される情報も示している。演算装置1はその機能として、入出力部21と、テスト演算部22と、プログラム実行部23とを備える。記憶部5には、キューQと、第1スタックS1と、第2スタックS2と、確認済リストCLと、処理済リストPLと、エリアテーブルT100と、テスト対象プログラム情報TPとが格納される。
(Functional configuration)
Fig. 2 is a functional configuration diagram showing the functions of the
キューQ、第1スタックS1、第2スタックS2、確認済リストCL、および処理済リストPLは、テスト演算部22が読み書きする対象であり、テスト演算部22が処理の過程で利用するデータの格納場所である。これらの情報は本実施の形態では演算装置1の外部に対して出力されない。キューQは、プログラムの分野で用いられる一般的なキューであり、最初に入力されたデータが最初に出力される性質を有する。第1スタックS1および第2スタックS2は、プログラムの分野で用いられる一般的なスタックであり、最初に入力されたデータが最後に出力される性質を有する。確認済リストCLおよび処理済リストPLは要素の集合であり要素間の順序は存在しない。
The queue Q, the first stack S1, the second stack S2, the confirmed list CL, and the processed list PL are targets that the test calculation unit 22 reads and writes, and are storage locations for data that the test calculation unit 22 uses during the processing. In this embodiment, this information is not output to the outside of the
本実施の形態では、キューQ、第1スタックS1、および第2スタックS2は、入力された順番にその要素を記載する。たとえば第1スタックS1がカラ、すなわち空集合の状態において、最初に「A」、次に「B」、最後に「C」が第1スタックS1に入力、すなわちプッシュされた場合は、第1スタックS1のデータを「A、B、C」と記載する。 In this embodiment, the queue Q, the first stack S1, and the second stack S2 list their elements in the order they were input. For example, when the first stack S1 is empty, i.e., an empty set, and first "A", then "B", and finally "C" are input, i.e., pushed, into the first stack S1, the data in the first stack S1 is listed as "A, B, C".
テスト対象プログラム情報TPは、演算装置1がテストを行う対象のプログラムに関する情報である。以下では、演算装置1がテストを行う対象のプログラムを「プログラムP1」と呼ぶ。テスト対象プログラム情報TPには、少なくともプログラムP1を作成可能な情報、たとえばソースコードやオブジェクトファイルが含まれる。なお後述するように、プログラムP1の動作は非循環有向グラフを用いて表現ができる。プログラムP1の動作を示す非循環有向グラフは、テスト対象プログラム情報TPに含まれてもよいし、逆アセンブルなどの既知の手法を用いて演算装置1が作成してもよい。エリアテーブルT100には、テスト演算部22がプログラムP1を解析して得られた情報が格納される。詳しくは後述する。
The test target program information TP is information about a program that is to be tested by the
入出力部21は、演算装置1の外部から演算に必要な情報、たとえばプログラムP1に関する情報やオペレータの指示を取得し、必要に応じて演算装置1の外部に演算結果を出力する。入出力部21は、CPU2による演算に加えて、外部インタフェース6をあわせて用いることで実現される。
The input/output unit 21 acquires information necessary for the calculation, such as information related to the program P1 and instructions from an operator, from outside the
テスト演算部22は、プログラムP1のテストを行うために必要な様々な演算を行う。以下では主にテスト演算部22の動作を説明する。テスト演算部22は初めに、処理対象であるプログラムP1の構造を解析する構造解析処理を実行する。構造解析処理ではプログラムP1を、並列化に寄与しない非並列群および並列化に寄与する並列寄与群に分別する。ただし厳密には構造解析処理では、プログラムP1を構成するマクロタスクのうち、並列寄与群を特定する第2スタックS2を作成する。すなわちプログラムP1を構成するマクロタスクのうち第2スタックS2により特定されないマクロタスクが非並列群である。 The test calculation unit 22 performs various calculations required to test the program P1. The operation of the test calculation unit 22 will be mainly described below. The test calculation unit 22 first executes a structural analysis process to analyze the structure of the program P1 to be processed. In the structural analysis process, the program P1 is separated into a non-parallel group that does not contribute to parallelization and a parallel contribution group that contributes to parallelization. However, strictly speaking, in the structural analysis process, a second stack S2 is created that identifies the parallel contribution group among the macrotasks that make up the program P1. In other words, the macrotasks that make up the program P1 that are not identified by the second stack S2 are the non-parallel group.
構造解析処理の次にテスト演算部22は、構造解析処理の結果を利用してプログラムP1に含まれる各エリアの情報をエリアテーブルT100にまとめるテーブル作成処理を行う。さらにテスト演算部22は、効率的なテストのためにメモリダンプを取得するメモリダンプ処理を行う。最後にテスト演算部22は、所定のエリアを対象としてプログラムテストを実行する。なおテーブル作成処理とメモリダンプ処理は実行の順番は不問である。 After the structural analysis process, the test calculation unit 22 performs a table creation process that uses the results of the structural analysis process to compile information about each area included in the program P1 into an area table T100. Furthermore, the test calculation unit 22 performs a memory dump process to acquire a memory dump for efficient testing. Finally, the test calculation unit 22 executes a program test targeting a specified area. Note that the order in which the table creation process and the memory dump process are executed does not matter.
プログラム実行部23は、テスト演算部22の動作指令に従い、プログラムP1を実行する。ただしプログラム実行部23は、プログラムP1の全体を実行する場合もあるが、プログラムP1の一部だけを実行する場合もある。さらにプログラム実行部23は、テスト演算部22により指定された位置でプログラムの実行を停止する機能を有する。またプログラム実行部23は、プログラムP1を実行するコンピュータに内蔵されるプロセッサをソフトウエアでエミュレートしてもよいし、CPU2とは異なるプロセッサを演算装置1が有しておりプログラム実行部23はそのプロセッサを利用してもよい。
The program execution unit 23 executes the program P1 according to the operation command of the test calculation unit 22. However, the program execution unit 23 may execute the entire program P1 or may execute only a part of the program P1. Furthermore, the program execution unit 23 has a function to stop the execution of the program at a position specified by the test calculation unit 22. The program execution unit 23 may also emulate, by software, a processor built into the computer that executes the program P1, or the
(プログラムの例示)
プログラムP1は、複数の処理単位に分解可能であり、非巡回有向グラフによりその動作が表される。すなわち演算装置1は、非巡回有向グラフを用いて動作が表現できるプログラムであれば、あらゆるプログラムを分析対象とできる。以下では処理単位のそれぞれを「マクロタスク」と呼ぶ。マクロタスクは、内部に分岐処理を含まない1または複数の処理である。
(Example of a program)
Program P1 can be decomposed into multiple processing units, and its operation is represented by an acyclic directed graph. In other words, the
図3は、本実施の形態において処理対象とするプログラムP1を示す有向グラフである。プログラムP1は、MT6、MT9、MT14、MT16、MT17、MT18、MT19、MT21、MT22、およびMT23の合計10のマクロタスクにより構成される。図3に示すマクロタスクの位置関係は、矢印の向きとも関係があり、いずれの矢印も図示上部から図示下部に向かっており、先祖から子孫に向かうとも言う。すなわち、図示上部に記載されているほど先祖であり、図示下部に記載されているほど子孫である。 Figure 3 is a directed graph showing program P1, which is the processing target in this embodiment. Program P1 is composed of a total of 10 macrotasks: MT6, MT9, MT14, MT16, MT17, MT18, MT19, MT21, MT22, and MT23. The positional relationship of the macrotasks shown in Figure 3 is also related to the direction of the arrows, and all of the arrows point from the top to the bottom of the illustration, and are also said to point from ancestor to descendant. In other words, the higher up the illustration is, the more ancestor it is, and the lower down the illustration is, the more descendant it is.
プログラムP1の処理が開始すると最初の先祖であるMT14の実行が開始され、最後の子孫であるMT23の実行が完了するとプログラムP1が終了する。図3は、MT14が完了すると、順不同でMT16~MT19がそれぞれ実行されることを示している。以下では、所定の範囲における最初の先祖を「ルートノード」とも呼び、所定の範囲における最後の子孫を「末端ノード」と呼ぶ。たとえば図3に示す全体の範囲ではルートノードはMT6であり、末端ノードはMT23である。 When processing of program P1 begins, execution of MT14, the first ancestor, begins, and when execution of MT23, the last descendant, is completed, program P1 ends. Figure 3 shows that when MT14 is completed, MT16 to MT19 are each executed in no particular order. Below, the first ancestor in a given range is also referred to as the "root node," and the last descendant in a given range is referred to as the "terminal node." For example, in the entire range shown in Figure 3, the root node is MT6, and the terminal node is MT23.
図3において矩形で囲むエリアA11は、MT6、MT9、およびMT14を含む。破線で囲むエリアA12は、MT14、MT18、MT19およびMT21を含む。一点鎖線で囲むエリアA13は、MT14、MT17~MT19、MT21、およびMT22を含む。エリアA11において、ルートノードはMT6、末端ノードはMT14である。エリアA12において、ルートノードはMT14、末端ノードはMT21である。 In Figure 3, area A11 surrounded by a rectangle includes MT6, MT9, and MT14. Area A12 surrounded by a dashed line includes MT14, MT18, MT19, and MT21. Area A13 surrounded by a dashed line includes MT14, MT17 to MT19, MT21, and MT22. In area A11, the root node is MT6, and the terminal node is MT14. In area A12, the root node is MT14, and the terminal node is MT21.
(エリアテーブルT100)
図4は、エリアテーブルT100の一例を示す図である。エリアテーブルT100には、テスト演算部22が算出した並列寄与群の情報が記載される。詳しくは後述するが、エリアテーブルT100に算出される並列寄与群は、設定される注目タスクにより異なる。図4に示す例は、図3に示したプログラムP1を対象とし、注目タスクをT22とした場合の例である。なお図4は概念的にエリアテーブルT100を表形式で表現しているにすぎず、表形式で記録しなくてもよいし、表の各セルにはデータの実態へのリンクを記載してもよい。
(Area table T100)
Fig. 4 is a diagram showing an example of the area table T100. The area table T100 describes information on the parallel contribution group calculated by the test calculation unit 22. As will be described in detail later, the parallel contribution group calculated in the area table T100 differs depending on the set attention task. The example shown in Fig. 4 is an example in which the program P1 shown in Fig. 3 is targeted and the attention task is T22. Note that Fig. 4 merely conceptually represents the area table T100 in a table format, and it is not necessary to record in the table format, and a link to the actual data may be described in each cell of the table.
エリアテーブルT100は1または複数のレコードを有し、各レコードはプログラムT101、エリアID T102、並列化済バイナリT103、開始タスクT104、終了タスクT105、開始点ダンプT106、終了点ダンプT107、および有向グラフT108のフィールドを有する。プログラムT101には、解析対象となるプログラムの識別子、たとえばプログラムの名称が格納される。エリアID T102には、エリアの識別子、たとえばエリアの名称が格納される。 The area table T100 has one or more records, and each record has fields for program T101, area ID T102, parallelized binary T103, start task T104, end task T105, start point dump T106, end point dump T107, and directed graph T108. The program T101 stores an identifier for the program to be analyzed, such as the name of the program. The area ID T102 stores an identifier for the area, such as the name of the area.
並列化済バイナリT103には、そのレコードのエリアに含まれる処理を実行するバイナリファイルであって、可能な限り並列化処理が施されたバイナリファイルが格納される。すなわちそのエリアにおいて並列化処理が可能な場合には並列化処理が施されたバイナリファイルが格納され、そのエリアにおいて並列化処理が不可能な場合には並列化されていないバイナリファイルが格納される。 Parallelized binary T103 stores a binary file that executes the process included in the area of that record, and that has been parallelized as much as possible. In other words, if parallelization is possible in that area, a binary file that has been parallelized is stored, and if parallelization is not possible in that area, a non-parallelized binary file is stored.
開始タスクT104には、そのレコードのエリアに含まれる最も先祖のマクロタスクの名称が格納される。終了タスクT105には、そのレコードのエリアに含まれる最も子孫のマクロタスクの名称が格納される。開始点ダンプT106には、開始タスクT104の最後の処理におけるメモリのダンプ情報が格納される。なおメモリのダンプ情報は、「メモリのスナップショット」とも呼ばれる。 The start task T104 stores the name of the most ancestor macrotask contained in the area of that record. The end task T105 stores the name of the most descendant macrotask contained in the area of that record. The start point dump T106 stores memory dump information from the last processing of the start task T104. Note that memory dump information is also called a "memory snapshot."
終了点ダンプT107には、終了タスクT105の最初の処理におけるメモリのダンプ情報が格納される。有向グラフT108には、そのレコードのエリアに含まれるマクロタスクの有向グラフ、たとえば図3に示す有向グラフの情報が格納される。 The end point dump T107 stores memory dump information for the first processing of the end task T105. The directed graph T108 stores information on the directed graph of the macrotask included in the area of that record, for example, the directed graph shown in FIG. 3.
(テストケース)
図5は、図3に示す各エリアに対応するテストケースを示す図である。テストケースは、テスト演算部22により作成される。テストケースは、エリア内に含まれるすべてのマクロタスクを実行順に並べたリストであり、図5に示す例では実現可能なすべての実行順番を列挙している。なお本実施の形態ではエリアA11のテストケースは作成されないが、図5では参考のために記載している。エリアA11は3つのマクロタスクが含まれ、それらは直列に一直線で接続される。すなわちエリアA11ではマクロタスクの実行順番は選択の余地がなくケース「A11-1」の1とおりのみが存在する。エリアA11の各タスクは、順番に実行する必要があるので、並列化に寄与しない非並列群である。
(test case)
FIG. 5 is a diagram showing test cases corresponding to each area shown in FIG. 3. The test cases are created by the test calculation unit 22. The test cases are a list of all macrotasks included in an area in the order of execution, and in the example shown in FIG. 5, all possible execution orders are listed. In this embodiment, a test case for area A11 is not created, but is shown in FIG. 5 for reference. Area A11 includes three macrotasks, which are connected in series in a straight line. In other words, there is no choice of execution order for the macrotasks in area A11, and only one case, case "A11-1", exists. Each task in area A11 must be executed in order, so it is a non-parallel group that does not contribute to parallelization.
エリアA12は4つのマクロタスクが含まれ、MT18とMT19が並列に存在する。そのため、MT18とMT19のいずれが先に実行される場合もありえるため、エリアA12は「A12-1」および「A12-2」の2つのケースが存在する。具体的には、最初に実行されるのはMT14で固定、最後に実行されるのはMT21で固定であり、2番目と3番目に実行されるマクロタスクがMT18およびMT19のいずれかである。 Area A12 contains four macrotasks, with MT18 and MT19 existing in parallel. As a result, either MT18 or MT19 may be executed first, so area A12 has two cases, "A12-1" and "A12-2." Specifically, the first macrotask to be executed is fixed to be MT14, the last to be executed is fixed to be MT21, and the second and third macrotasks to be executed are either MT18 or MT19.
エリアA13は、6つのマクロタスクが含まれ、大きくはMT18、MT19、およびMT21の第1グループと、MT17のみからなる第2のグループが並列に存在する。さらに第1のグループの内部ではMT18とMT19が並列に存在する。並列に存在するマクロタスクは実行順番が不問であり、いずれのタイミングで実行されてもよい。そのためエリアA13では「A13-1」~「A13-8」の8つのケースが存在する。 Area A13 contains six macrotasks, broadly speaking, the first group consisting of MT18, MT19, and MT21, and the second group consisting of only MT17, which exist in parallel. Furthermore, within the first group, MT18 and MT19 exist in parallel. The order of execution of the parallel macrotasks does not matter, and they may be executed at any time. Therefore, there are eight cases in area A13, "A13-1" to "A13-8".
(構造解析処理のフローチャート)
図6~図8は、テスト演算部22による構造解析処理を示すフローチャートである。まずステップS100ではテスト演算部22は、キューQ、第1スタックS1、第2スタックS2、および確認済リストCLを初期化する。具体的には本ステップの初期化処理により、キューQ、第1スタックS1、第2スタックS2、および確認済リストCLがカラ、すなわち空集合に設定される。
(Flowchart of structure analysis process)
6 to 8 are flowcharts showing the structural analysis process by the test calculation unit 22. First, in step S100, the test calculation unit 22 initializes the queue Q, the first stack S1, the second stack S2, and the confirmed list CL. Specifically, the initialization process in this step sets the queue Q, the first stack S1, the second stack S2, and the confirmed list CL to be empty, that is, to an empty set.
続くステップS101ではテスト演算部22は、プログラムP1に関する各種情報を読み込む。続くステップS102ではテスト演算部22は、ステップS101において読み込んだ情報から有向グラフD1を抽出する。本フローチャートにおける動作例の説明において、本ステップにおいて抽出した有向グラフD1は、図3に例示した有効グラフとする。 In the next step S101, the test calculation unit 22 reads various information related to the program P1. In the next step S102, the test calculation unit 22 extracts a directed graph D1 from the information read in step S101. In the explanation of the operation example in this flowchart, the directed graph D1 extracted in this step is the directed graph illustrated in FIG. 3.
続くステップS103ではテスト演算部22は、プログラムP1に含まれるいずれかのマクロタスクMTである注目点Xを決定する。注目点Xは、機械処理によりたとえば直前の実行によりエラーが発見された箇所が自動的に選択されてもよいし、オペレータにより手動で設定されてもよい。本フローチャートにおける動作例の説明において、注目点Xは「MT22」とする。続くステップS104ではテスト演算部22は、注目点Xの先祖リストC1を作成する。有向グラフD1が図3に示すもので、注目点Xが「MT22」の場合に先祖リストC1は「MT6,MT9、MT14、MT17、MT18、M19、MT21」となる。 In the next step S103, the test calculation unit 22 determines a focus point X, which is one of the macrotasks MT included in the program P1. The focus point X may be automatically selected by machine processing, for example, a location where an error was found in the previous execution, or may be manually set by an operator. In the explanation of the operation example in this flowchart, the focus point X is "MT22". In the next step S104, the test calculation unit 22 creates an ancestor list C1 of the focus point X. When the directed graph D1 is as shown in FIG. 3 and the focus point X is "MT22", the ancestor list C1 is "MT6, MT9, MT14, MT17, MT18, MT19, MT21".
続くステップS105ではテスト演算部22は、注目点Xを処理対象Xiに設定する。続くステップS106ではテスト演算部22は、処理対象Xiを確認済みに設定する。具体的にはテスト演算部22は、処理対象Xiである「MT22」を確認済リストCLに追加する。ステップS106の処理が完了するとテスト演算部22は、ステップS106Aに進む。 In the following step S105, the test calculation unit 22 sets the attention point X as the processing object Xi. In the following step S106, the test calculation unit 22 sets the processing object Xi as confirmed. Specifically, the test calculation unit 22 adds "MT22", which is the processing object Xi, to the confirmed list CL. When the processing of step S106 is completed, the test calculation unit 22 proceeds to step S106A.
ステップS106Aではテスト演算部22は、先祖リストC1中に未確認の処理対象Xiの隣接ノードが存在するか否かを判断する。隣接ノードとは、子孫や先祖に関係なく、換言すると上下方向の位置に関係なく、1つだけ離れたノードである。たとえば図3に示す例において、「MT22」の隣接ノードは「MT17、MT21、MT23」である。 In step S106A, the test calculation unit 22 determines whether there is an adjacent node of the unconfirmed processing target Xi in the ancestor list C1. An adjacent node is a node that is one node away, regardless of whether it is a descendant or ancestor, in other words, regardless of its position in the vertical direction. For example, in the example shown in Figure 3, the adjacent nodes of "MT22" are "MT17, MT21, and MT23."
テスト演算部22は、先祖リストC1中に未確認の処理対象Xiの隣接ノードが存在すると判断する場合にはステップS107に進み、先祖リストC1に含まれる処理対象Xiの隣接ノードは全て確認済であると判断する場合にはステップS107Aに進む。具体的にはテスト演算部22は、まず先祖リストC1に含まれる処理対象Xiの隣接ノードを全て挙げ、それらが確認済リストCLに記載されているか否かにより本ステップの判断ができる。 If the test calculation unit 22 determines that there is an unconfirmed adjacent node of the processing target Xi in the ancestor list C1, it proceeds to step S107, and if it determines that all adjacent nodes of the processing target Xi included in the ancestor list C1 have been confirmed, it proceeds to step S107A. Specifically, the test calculation unit 22 first lists all adjacent nodes of the processing target Xi included in the ancestor list C1, and can make the judgment of this step based on whether or not they are listed in the confirmed list CL.
ステップS107ではテスト演算部22は、処理対象Xiの入次数が1より大きいであるか否かを判断する。テスト演算部22は、処理対象Xiの入次数が1より大きいと判断する場合はステップS110に進み、処理対象Xiの入次数が1より大きくない、すなわち1以下であると判断する場合はステップS107Aに進む。 In step S107, the test calculation unit 22 determines whether the in-degree of the processing object Xi is greater than 1. If the test calculation unit 22 determines that the in-degree of the processing object Xi is greater than 1, the process proceeds to step S110, and if the test calculation unit 22 determines that the in-degree of the processing object Xi is not greater than 1, i.e., is equal to or less than 1, the process proceeds to step S107A.
ステップS107Aではテスト演算部22は、先祖リストC1中に確認済の処理対象Xiの隣接ノードが存在するか否かを判断する。本ステップにおける判断をステップS106Aと比較すると、未確認か確認済かが異なる。テスト演算部22は、先祖リストC1中に確認済の処理対象Xiの隣接ノードが存在すると判断する場合にはステップS108に進み、先祖リストC1に含まれる処理対象Xiの隣接ノードは全て未確認であると判断する場合にはステップS109に進む。 In step S107A, the test calculation unit 22 judges whether or not there is an adjacent node of the confirmed processing target Xi in the ancestor list C1. Comparing the judgment in this step with step S106A, the difference is whether it is unconfirmed or confirmed. If the test calculation unit 22 judges that there is an adjacent node of the confirmed processing target Xi in the ancestor list C1, it proceeds to step S108, and if it judges that all adjacent nodes of the processing target Xi included in the ancestor list C1 are unconfirmed, it proceeds to step S109.
ステップS108ではテスト演算部22は、処理対象Xiの出次数が1より大きいか否かを判断する。テスト演算部22は、処理対象Xiの出次数が1より大きいと判断する場合はステップS110に進み、処理対象Xiの出次数が1以下と判断する場合はステップS109に進む。入次数および出次数の具体例を挙げると、図3に示す例においてTM14の入次数は「1」、出次数は「4」である。 In step S108, the test calculation unit 22 determines whether the out-degree of the processing object Xi is greater than 1. If the test calculation unit 22 determines that the out-degree of the processing object Xi is greater than 1, the process proceeds to step S110, and if the test calculation unit 22 determines that the out-degree of the processing object Xi is 1 or less, the process proceeds to step S109. As a specific example of the in-degree and out-degree, in the example shown in FIG. 3, the in-degree of TM14 is "1" and the out-degree is "4".
ステップS109ではテスト演算部22は、処理対象Xiは先祖リストC1におけるソースノードXNに該当するか否かを判断する。テスト演算部22は、処理対象Xiは先祖リストC1におけるソースノードXNに該当すると判断する場合はステップS110に進み、処理対象Xiは先祖リストC1におけるソースノードXNに該当しないと判断する場合はステップS111に進む。ステップS111ではテスト演算部22は、処理対象Xiの近傍ノードを抽出し、隣接グループNを定義する。たとえば図3に示す例において処理対象Xiが「MT22」の場合は隣接グループNは、「MT17、MT21、MT23」である。ステップS111の処理が完了するとテスト演算部22は、丸囲みのAを経由して図7におけるステップS111Aに進む。以上が図6の説明である。 In step S109, the test calculation unit 22 judges whether the processing object Xi corresponds to the source node XN in the ancestor list C1. If the test calculation unit 22 judges that the processing object Xi corresponds to the source node XN in the ancestor list C1, the process proceeds to step S110. If the test calculation unit 22 judges that the processing object Xi does not correspond to the source node XN in the ancestor list C1, the process proceeds to step S111. In step S111, the test calculation unit 22 extracts neighboring nodes of the processing object Xi and defines an adjacent group N. For example, in the example shown in FIG. 3, if the processing object Xi is "MT22", the adjacent group N is "MT17, MT21, MT23". When the process of step S111 is completed, the test calculation unit 22 proceeds to step S111A in FIG. 7 via the circled A. This concludes the explanation of FIG. 6.
図7のステップS111Aではテスト演算部22は、処理済リストPLを初期化する。続くステップS119ではテスト演算部22は、隣接グループNの全要素を処理したか否かを判断し、全要素を処理したと判断する場合はステップS120に進み、未処理の要素が存在すると判断する場合はステップS112に進む。ステップS119ではテスト演算部22は、隣接グループNの要素と、処理済リストPLに記載されたマクロタスクとを比較することでステップS119の判断ができる。 In step S111A of FIG. 7, the test calculation unit 22 initializes the processed list PL. In the following step S119, the test calculation unit 22 judges whether all elements of the adjacent group N have been processed, and proceeds to step S120 if it judges that all elements have been processed, and proceeds to step S112 if it judges that unprocessed elements exist. In step S119, the test calculation unit 22 can make the judgment of step S119 by comparing the elements of the adjacent group N with the macrotasks listed in the processed list PL.
ステップS112ではテスト演算部22は、隣接グループNから未処理のいずれかのマクロタスクを要素Niとして抽出する。続くステップS112Aではテスト演算部22は、ステップS112において抽出した要素Niを処理済リストPLに追加する。換言するとテスト演算部22は、ステップS112において要素Niとして抽出されたマクロタスクの名称を処理済リストPLに追加する。続くステップS113ではテスト演算部22は、要素Niが先祖リストC1に含まれるか否かを判断する。テスト演算部22は、要素Niが先祖リストC1に含まれると判断する場合はステップS114に進み、要素Niが先祖リストC1に含まれないと判断する場合はステップS119に戻る。 In step S112, the test calculation unit 22 extracts any unprocessed macrotask from the adjacent group N as element Ni. In the following step S112A, the test calculation unit 22 adds the element Ni extracted in step S112 to the processed list PL. In other words, the test calculation unit 22 adds the name of the macrotask extracted as element Ni in step S112 to the processed list PL. In the following step S113, the test calculation unit 22 judges whether or not the element Ni is included in the ancestor list C1. If the test calculation unit 22 judges that the element Ni is included in the ancestor list C1, the process proceeds to step S114, and if the test calculation unit 22 judges that the element Ni is not included in the ancestor list C1, the process returns to step S119.
ステップS114ではテスト演算部22は、要素Niは確認済みであるか否か、換言すると要素Niが確認済リストCLに記載されているか否かを判断する。テスト演算部22は、要素Niは確認済みであると判断する場合はステップS115に進み、要素Niは確認済みではないと判断する場合はステップS117に進む。ステップS115ではテスト演算部22は、要素NiはキューQに含まれるか否かを判断する。テスト演算部22は、要素NiはキューQに含まれると判断する場合はステップS116に進み、要素NiはキューQに含まれないと判断する場合はステップS119に戻る。 In step S114, the test calculation unit 22 judges whether or not the element Ni has been confirmed, in other words, whether or not the element Ni is listed in the confirmed list CL. If the test calculation unit 22 judges that the element Ni has been confirmed, the process proceeds to step S115, and if the test calculation unit 22 judges that the element Ni has not been confirmed, the process proceeds to step S117. In step S115, the test calculation unit 22 judges whether or not the element Ni is included in the queue Q. If the test calculation unit 22 judges that the element Ni is included in the queue Q, the process proceeds to step S116, and if the test calculation unit 22 judges that the element Ni is not included in the queue Q, the process returns to step S119.
ステップS117ではテスト演算部22は、キューQの末尾に要素Niを追加する。続くステップS118ではテスト演算部22は、要素Niを確認済みに変更する。具体的にはテスト演算部22は、要素Niとして抽出されたマクロタスクの名称を確認済リストCLに追加する。 In step S117, the test calculation unit 22 adds element Ni to the end of the queue Q. In the following step S118, the test calculation unit 22 changes element Ni to confirmed. Specifically, the test calculation unit 22 adds the name of the macrotask extracted as element Ni to the confirmed list CL.
ステップS119において肯定判断されると実行されるステップS120ではテスト演算部22は、キューQが空集合であるか否かを判断する。テスト演算部22は、キューQが空集合であると判断する場合は丸囲みのCを経由して図8のステップS601に進み、キューQが空集合ではないと判断するとステップS121に進む。なおステップS120において肯定判断される場合とは、ステップS120が実行される前にステップS117が1回も実行されない場合である。ステップS121ではテスト演算部22は、キューQの先頭を取り出して処理対象Xiとし、丸囲みのBを経由して図6におけるステップS106Aに戻る。以上が図7の説明である。 In step S120, which is executed if a positive judgment is made in step S119, the test calculation unit 22 judges whether or not queue Q is an empty set. If the test calculation unit 22 judges that queue Q is an empty set, it proceeds to step S601 in FIG. 8 via circled C, and if it judges that queue Q is not an empty set, it proceeds to step S121. Note that a positive judgment is made in step S120 when step S117 is not executed even once before step S120 is executed. In step S121, the test calculation unit 22 extracts the head of queue Q and sets it as the processing target Xi, and returns to step S106A in FIG. 6 via circled B. This concludes the explanation of FIG. 7.
図8に示す最初の処理であるステップS601ではテスト演算部22は、変数iにゼロを代入してステップS602に進む。ステップS602ではテスト演算部22は、第1スタックS1の長さが「i+1」の値よりも長いか否かを判断する。なお第1スタックS1の長さとは、第1スタックS1に追加されたマクロタスクの数である。テスト演算部22は、第1スタックS1の長さが「i+1」の値よりも長いと判断する場合はステップS603に進み、第1スタックS1の長さが「i+1」の値以下であると判断する場合は図8に示す処理を終了する。 In step S601, which is the first process shown in FIG. 8, the test calculation unit 22 assigns zero to the variable i and proceeds to step S602. In step S602, the test calculation unit 22 determines whether the length of the first stack S1 is longer than the value of "i+1". Note that the length of the first stack S1 is the number of macrotasks added to the first stack S1. If the test calculation unit 22 determines that the length of the first stack S1 is longer than the value of "i+1", the test calculation unit 22 proceeds to step S603, and if the test calculation unit 22 determines that the length of the first stack S1 is equal to or less than the value of "i+1", the test calculation unit 22 ends the process shown in FIG. 8.
ステップS603ではテスト演算部22は、第1スタックS1におけるi+1番目の要素を有向グラフD1から抽出し、抽出したマクロタスクの先祖リストを一時先祖リストA00として作成する。前述のとおり本実施の形態では、第1スタックS1の要素番号は、最後に追加された要素を「0」番目として定義する。仮に第1スタックS1に、「MT22,MT21,MT14」の順番に要素が追加され、変数iの値がゼロの場合には、第1スタックS1の「i+1」番目の要素は「MT21」である。<正しいかをコメントで聞く>この「MT21」の先祖リストが一時先祖リストA00として作成される。この場合の一時先祖リストA00は「MT14、MT18、M19」である。なおステップS603において作成される一時先祖リストA00有効期限は、次にステップS603が実行されるとき、および図8の処理が終了するとき、のいずれか早い方までである。 In step S603, the test calculation unit 22 extracts the i+1th element in the first stack S1 from the directed graph D1, and creates an ancestor list of the extracted macrotask as a temporary ancestor list A00. As described above, in this embodiment, the element number of the first stack S1 is defined as the last added element as "0". If elements are added to the first stack S1 in the order of "MT22, MT21, MT14" and the value of the variable i is zero, the "i+1"th element of the first stack S1 is "MT21". <Ask a comment if this is correct> The ancestor list of this "MT21" is created as the temporary ancestor list A00. In this case, the temporary ancestor list A00 is "MT14, MT18, M19". The validity period of the temporary ancestor list A00 created in step S603 is the next time step S603 is executed or the end of the processing in FIG. 8, whichever is earlier.
続くステップS604ではテスト演算部22は、変数jに変数iの値を代入してステップS605に進む。ステップS605ではテスト演算部22は、変数jの値が「-1」よりも大きいか否かを判断し、変数jが「-1」よりも大きいと判断する場合はステップS606に進み、変数jが「-1」以下であると判断する場合はステップS614に進む。ステップS606ではテスト演算部22は、第1スタックS1におけるj番目の要素であるマクロタスクを特定し、そのマクロタスクの子孫を先祖リストC1から抽出して一時子孫リストD00を作成する。たとえば第1スタックS1におけるj番目の要素が「MT14」であり、先祖リストC1が「MT14、MT17、MT18、M19、MT21」の場合に一時子孫リストD00は「MT17,MT18,MT19,MT21」となる。 In the following step S604, the test calculation unit 22 assigns the value of the variable i to the variable j and proceeds to step S605. In step S605, the test calculation unit 22 judges whether the value of the variable j is greater than "-1", and proceeds to step S606 if it judges that the variable j is greater than "-1", and proceeds to step S614 if it judges that the variable j is less than or equal to "-1". In step S606, the test calculation unit 22 identifies the macrotask that is the jth element in the first stack S1, and extracts the descendants of the macrotask from the ancestor list C1 to create a temporary descendant list D00. For example, if the jth element in the first stack S1 is "MT14" and the ancestor list C1 is "MT14, MT17, MT18, M19, MT21", the temporary descendant list D00 will be "MT17, MT18, MT19, MT21".
続くステップS607ではテスト演算部22は、ステップS606において作成した一時子孫リストD00と、ステップS603において作成した一時先祖リストA00と共通する要素を抽出して重複リストIS00を作成する。たとえば一時子孫リストD00が「MT17,MT18,MT19,MT21」、一時先祖リストA00が「MT14、MT18、M19」の場合に、重複リストIS00は「MT18、M19」である。続くステップS608ではテスト演算部22は、重複リストIS00の各要素において、入次数から出次数を引いた値を算出してその総和をSD00として算出する。 In the following step S607, the test calculation unit 22 extracts elements common to the temporary descendant list D00 created in step S606 and the temporary ancestor list A00 created in step S603 to create a duplicate list IS00. For example, if the temporary descendant list D00 is "MT17, MT18, MT19, MT21" and the temporary ancestor list A00 is "MT14, MT18, M19", the duplicate list IS00 is "MT18, M19". In the following step S608, the test calculation unit 22 calculates the value obtained by subtracting the outdegree from the indegree for each element of the duplicate list IS00, and calculates the sum of these values as SD00.
続くステップS609ではテスト演算部22は、第1スタックS1におけるj番目の要素のマクロタスクにおける出次数をOD00として算出する。続くステップS610ではテスト演算部22は、第1スタックS1におけるj番目の要素のマクロタスクにおける入次数をID00として算出する。続くステップS610ではテスト演算部22は、ステップS608~S610の算出結果を用いて、OD00とSD00の和からID00を引いた値がゼロ以上であるか否かを判断する。テスト演算部22は、ステップS610を肯定判断する場合はステップS611に進み、否定判断する場合はステップS613に進む。 In the following step S609, the test calculation unit 22 calculates the out-degree in the macrotask of the j-th element in the first stack S1 as OD00. In the following step S610, the test calculation unit 22 calculates the in-degree in the macrotask of the j-th element in the first stack S1 as ID00. In the following step S610, the test calculation unit 22 uses the calculation results of steps S608 to S610 to determine whether the value obtained by subtracting ID00 from the sum of OD00 and SD00 is equal to or greater than zero. If the test calculation unit 22 judges step S610 as positive, the process proceeds to step S611, and if the test calculation unit 22 judges step S610 as negative, the process proceeds to step S613.
ステップS611ではテスト演算部22は、第2スタックS2に第1スタックS1のi+1番目の要素を挿入する。続くステップS612ではテスト演算部22は、第2スタックS2に第1スタックS1のj番目の要素を挿入してステップS614に進む。なおステップS611およびS612は、第2スタックS2に対するいわゆるプッシュ操作である。ステップS613ではテスト演算部22は、変数jの値を「1」だけ減少させてステップS605に戻る。ステップS614ではテスト演算部22は、変数iの値を「1」だけ増加させてステップS602に戻る。ステップS613は、いわゆるデクリメント処理であり、ステップS614は、いわゆるインクリメント処理である。以上が図8の説明である。 In step S611, the test calculation unit 22 inserts the i+1th element of the first stack S1 into the second stack S2. In the following step S612, the test calculation unit 22 inserts the jth element of the first stack S1 into the second stack S2 and proceeds to step S614. Note that steps S611 and S612 are so-called push operations on the second stack S2. In step S613, the test calculation unit 22 decreases the value of the variable j by "1" and returns to step S605. In step S614, the test calculation unit 22 increases the value of the variable i by "1" and returns to step S602. Step S613 is so-called decrement processing, and step S614 is so-called increment processing. This concludes the explanation of FIG. 8.
なお図6~図8の処理により生成される第1スタックS1には、分岐を含むエリアを示す情報が含まれる。また第2スタックS2には、第1スタックS1に含まれるエリア内における分岐を含むエリアを示す情報が含まれる。 The first stack S1 generated by the processing of Figures 6 to 8 includes information indicating an area that includes a branch. The second stack S2 includes information indicating an area that includes a branch within the area included in the first stack S1.
(構造解析処理の動作例)
構造解析処理の動作例を説明する。以下に説明する動作例では動作主体の記載を省略するが、動作主体は全てテスト演算部22である。ステップS102において抽出される有向グラフD1が図3に示すものであり、注目点Xが「MT22」の場合の例を説明する。この場合に、ステップS104において生成される先祖リストC1は「MT6,MT9、MT14、MT17、MT18、MT19、MT21」である。ステップS106Aではテスト演算部22は、処理対象Xiである「MT22」の隣接ノードが先祖リストC1に存在し、かつ確認済リストCLには含まれていないので肯定判断する。そしてステップS107では「MT22」の入り次数が2なので、テスト演算部22は肯定判断してステップS110に進み、第1スタックS1が「MT22」に更新される。
(Example of structural analysis processing)
An example of the operation of the structural analysis process will be described. In the example of the operation described below, the description of the subject of the operation will be omitted, but all the subjects of the operation are the test calculation unit 22. An example will be described in which the directed graph D1 extracted in step S102 is that shown in FIG. 3, and the attention point X is "MT22". In this case, the ancestor list C1 generated in step S104 is "MT6, MT9, MT14, MT17, MT18, MT19, MT21". In step S106A, the test calculation unit 22 judges in the affirmative because the adjacent node of "MT22", which is the processing target Xi, exists in the ancestor list C1 and is not included in the confirmed list CL. Then, in step S107, the incoming degree of "MT22" is 2, so the test calculation unit 22 judges in the affirmative and proceeds to step S110, where the first stack S1 is updated to "MT22".
そしてステップS111ではテスト演算部22は、隣接グループNを「MT17、MT21、MT23」と定義する。図7では、隣接グループNの全要素を処理するまでS112~S118のループが回り続けるので、隣接グループNに含まれる全要素を順番に要素NiとしてS113~S118の処理が行われる。 In step S111, the test calculation unit 22 defines adjacent group N as "MT17, MT21, MT23." In FIG. 7, the loop of S112 to S118 continues until all elements in adjacent group N are processed, so that the processes of S113 to S118 are performed on all elements included in adjacent group N in order as element Ni.
要素Niが「MT17」の場合には、ステップS113が肯定判断され、ステップS114が否定判断され、ステップS117およびステップS118が実行されてステップS119に戻る。要素Niが「MT21」の場合には、ステップS113が肯定判断され、ステップS114が否定判断され、ステップS117およびステップS118が実行されてステップS119に戻る。要素Niが「MT23」の場合には、ステップS113が否定判断されてステップS119に戻る。 If element Ni is "MT17", step S113 is judged as positive, step S114 is judged as negative, steps S117 and S118 are executed, and the process returns to step S119. If element Ni is "MT21", step S113 is judged as positive, step S114 is judged as negative, steps S117 and S118 are executed, and the process returns to step S119. If element Ni is "MT23", step S113 is judged as negative, and the process returns to step S119.
したがって、初回にステップS119において肯定判断をする際には、キューQは「MT17、MT21」、確認済リストCLは「MT17、MT21、MT22」、第1スタックS1は「MT22」である。続くステップS120ではテスト演算部22は否定判断をしてステップS121に進み、キューQから先頭の「MT17」を取り出して処理対象Xiとして、丸囲みのBを経由して図6のステップS106Aに戻る。すなわちS106Aに戻った時点でキューQの要素は「MT21」のみとなる。 Therefore, when a positive judgment is made the first time in step S119, queue Q is "MT17, MT21", confirmed list CL is "MT17, MT21, MT22", and first stack S1 is "MT22". In the following step S120, the test calculation unit 22 makes a negative judgment and proceeds to step S121, where it takes out the top "MT17" from queue Q and sets it as processing target Xi, and returns to step S106A in FIG. 6 via circled B. In other words, at the point of returning to S106A, the only element in queue Q is "MT21".
(構造解析処理の動作例|初回にBを経由した後)
処理対象Xiである「MT17」について、ステップS106A、S107Aは肯定判断されるが、「MT17」の入次数および出次数は「1」なのでステップS107,S108は否定判断される。さらに「MT17」は先祖リストC1におけるソースノードではないのでステップS111に進む。ここで「MT17」の近傍である「MT14、MT22」が新たな隣接グループNとして定義されて図7に進む。
(Example of structural analysis process | After passing through B for the first time)
For "MT17", which is the processing target Xi, steps S106A and S107A are judged to be positive, but since the in-degree and out-degree of "MT17" are "1", steps S107 and S108 are judged to be negative. Furthermore, since "MT17" is not a source node in the ancestor list C1, the process proceeds to step S111. Here, "MT14, MT22", which are neighbors of "MT17", are defined as a new adjacent group N, and the process proceeds to FIG. 7.
図7では、まず隣接グループNの要素である「MT14、MT22」を順番に要素NiとしてS113~S118の処理が行われる。要素Niが「MT14」の場合には、ステップS113が肯定判断され、ステップS114が否定判断され、ステップS117およびステップS118が実行されてステップS119に戻る。要素Niが「MT22」の場合には、ステップS113が肯定判断され、ステップS106における処理が理由でステップS114が肯定判断される。「MT22」はキューQには含まれないので否定判断されてステップS119に戻る。 In FIG. 7, first, the processes of S113 to S118 are performed on the elements of adjacent group N, "MT14, MT22," in order as element Ni. If element Ni is "MT14," step S113 is judged as positive, step S114 is judged as negative, steps S117 and S118 are executed, and the process returns to step S119. If element Ni is "MT22," step S113 is judged as positive, and step S114 is judged as positive due to the process in step S106. As "MT22" is not included in queue Q, a negative judgment is made and the process returns to step S119.
すなわちステップS119が2回目に肯定判断をする際には、キューQは「MT21、MT14」、確認済リストCLは「MT17、MT21、MT22、MT14」、第1スタックS1は「MT22」である。ここでもキューQは空集合でないのでステップS120からステップS121に進み、キューQから先頭の「MT21」を取り出して処理対象Xiとして図6のステップS106Aに戻る。すなわちS106Aに戻った時点でキューQの要素は「MT14」のみとなる。 That is, when step S119 makes a positive determination for the second time, queue Q is "MT21, MT14", confirmed list CL is "MT17, MT21, MT22, MT14", and first stack S1 is "MT22". Here again, queue Q is not an empty set, so the process proceeds from step S120 to step S121, where the top element "MT21" is extracted from queue Q and set as processing target Xi, and the process returns to step S106A in FIG. 6. That is, at the point of returning to S106A, the only element in queue Q is "MT14".
(構造解析処理の動作例|2回目にBを経由した後)
処理対象Xiである「MT21」について、ステップS106Aは肯定判断され、「MT21」の入次数が「2」なのでステップS107が肯定判断されてS110に進み第1スタックS1に「MT21」が追加される。すなわち第1スタックS1は「MT22、MT21」となる。続くステップS111では「MT21」の近傍である「MT18、MT19、MT22」が新たな隣接グループNとして定義されて図7に進む。
(Example of structural analysis process | After passing through B for the second time)
For "MT21" which is the processing target Xi, a positive judgment is made in step S106A, and since the in-degree of "MT21" is "2", a positive judgment is made in step S107, and the process proceeds to S110, where "MT21" is added to the first stack S1. That is, the first stack S1 becomes "MT22, MT21". In the following step S111, "MT18, MT19, MT22", which are neighbors of "MT21", are defined as a new adjacent group N, and the process proceeds to FIG. 7.
図7では、まず隣接グループNの要素である「MT18、MT19、MT22」のそれぞれを要素NiとしてS113~S118の処理が行われる。要素Niが「MT18」の場合には、ステップS113が肯定判断され、ステップS114が否定判断され、ステップS117およびステップS118が実行されてステップS119に戻る。 In FIG. 7, first, the processes of S113 to S118 are performed for each of the elements of adjacent group N, "MT18, MT19, MT22," as element Ni. If element Ni is "MT18," step S113 is judged as positive, step S114 is judged as negative, steps S117 and S118 are executed, and the process returns to step S119.
要素Niが「MT19」の場合には、ステップS113が肯定判断され、ステップS114が否定判断され、ステップS117およびステップS118が実行されてステップS119に戻る。要素Niが「MT22」の場合には、ステップS113が肯定判断され、ステップS114が肯定判断され、「MT22」がキューQには含まれないので否定判断されてステップS119に戻る。 If element Ni is "MT19", step S113 is judged as "YES", step S114 is judged as "NO", steps S117 and S118 are executed, and the process returns to step S119. If element Ni is "MT22", step S113 is judged as "YES", step S114 is judged as "YES", and since "MT22" is not included in queue Q, a negative judgment is made, and the process returns to step S119.
すなわちステップS119が3回目に肯定判断をする際には、キューQは「MT14、MT18、MT19」、確認済リストCLは「MT17、MT18、MT19、MT21、MT22、MT14」、第1スタックS1は「MT22、MT21」である。ここでもキューQは空集合でないのでステップS120からステップS121に進み、キューQから先頭の「MT14」を取り出して処理対象Xiとして図6のステップS106Aに戻る。すなわちS106Aに戻った時点でキューQの要素は「MT18、MT19」となる。 That is, when step S119 makes a positive determination for the third time, queue Q is "MT14, MT18, MT19", confirmed list CL is "MT17, MT18, MT19, MT21, MT22, MT14", and first stack S1 is "MT22, MT21". Here again, queue Q is not an empty set, so the process proceeds from step S120 to step S121, where the top element "MT14" is extracted from queue Q and set as processing target Xi, and the process returns to step S106A in FIG. 6. That is, at the point of returning to S106A, the elements of queue Q become "MT18, MT19".
(構造解析処理の動作例|3回目にBを経由した後)
処理対象Xiである「MT14」について、先祖リストC1に含まれる隣接ノードである「MT17、MT18、MT19」は全て確認済リストCLに含まれるのでステップS106Aは否定判断され、S107Aでは肯定判断される。そして「MT14」の出次数が1より大きいのでステップS108が肯定判断されてS110に進み第1スタックS1に「MT14」が追加される。すなわち第1スタックS1は「MT22、MT21、MT14」となる。続くステップS111では「MT14」の近傍である「MT9、MT16、MT17、MT18、MT19」が新たな隣接グループNとして定義されて図7に進む。
(Example of structural analysis process | After passing through B for the third time)
For "MT14", which is the processing target Xi, all of the adjacent nodes "MT17, MT18, MT19" included in the ancestor list C1 are included in the confirmed list CL, so a negative judgment is made in step S106A, and a positive judgment is made in step S107A. And since the out-degree of "MT14" is greater than 1, a positive judgment is made in step S108, and the process proceeds to S110, where "MT14" is added to the first stack S1. That is, the first stack S1 becomes "MT22, MT21, MT14". In the following step S111, "MT9, MT16, MT17, MT18, MT19", which are neighbors of "MT14", are defined as a new adjacent group N, and the process proceeds to FIG. 7.
図7では、まず隣接グループNの要素である「MT9、MT16、MT17、MT18、MT19」のそれぞれを要素NiとしてステップS113~S118の処理が行われる。要素Niが「MT9、MT16」の場合には、先祖リストC1に含まれないのでステップS113が否定判断されてステップS119に戻る。要素Niが「MT17」の場合には、ステップS113が肯定判断され、「MT17」が確認済みなのでステップS114が肯定判断され、「MT17」はキューQに含まれないので否定判断されてステップS119に戻る。 In FIG. 7, steps S113 to S118 are first performed on each of the elements of adjacent group N, "MT9, MT16, MT17, MT18, MT19," as element Ni. If element Ni is "MT9, MT16," it is not included in ancestor list C1, so a negative judgment is made in step S113 and the process returns to step S119. If element Ni is "MT17," it is a positive judgment in step S113, "MT17" has been confirmed so a positive judgment is made in step S114, and "MT17" is not included in queue Q so a negative judgment is made and the process returns to step S119.
要素Niが「MT18、M19」の場合にはいずれも、ステップS113、S114、およびS119が肯定判断され、ステップS116においてキューQの末尾に要素Niが追加される。すなわちこの時点でキューQは「MT18、MT19」、第1スタックS1は「MT22、MT21、MT14」である。ここでもキューQは空集合でないのでステップS120からステップS121に進み、キューQから先頭の「MT18」を取り出して処理対象Xiとして図6のステップS106Aに戻る。すなわちS106Aに戻った時点でキューQの要素は「MT19」となる。 When element Ni is "MT18, M19", steps S113, S114, and S119 are all judged as positive, and element Ni is added to the end of queue Q in step S116. That is, at this point, queue Q is "MT18, MT19", and first stack S1 is "MT22, MT21, MT14". Here too, queue Q is not an empty set, so the process proceeds from step S120 to step S121, where the top element "MT18" is extracted from queue Q and set as processing target Xi, returning to step S106A in FIG. 6. That is, at the point of returning to S106A, the element of queue Q becomes "MT19".
(構造解析処理の動作例|4回目にBを経由した後)
処理対象Xiである「MT18」について、隣接ノードである「MT14、MT21」は全て確認済リストCLに含まれるのでステップS106Aは否定判断され、S107Aでは肯定判断される。ステップS108では、「MT14」の出次数は「1」なので否定判断をしてS109に進み、「MT14」はソースノードではないので否定判断してステップS111に進む。ステップS111では「MT19」の近傍である「MT14、MT21」が新たな隣接グループNとして定義されて図7に進む。
(Example of structural analysis process | After passing through B for the fourth time)
For "MT18" which is the processing target Xi, all of the adjacent nodes "MT14, MT21" are included in the confirmed list CL, so step S106A is judged as negative, and step S107A is judged as positive. In step S108, the outdegree of "MT14" is "1", so a negative judgment is made and the process proceeds to S109, and since "MT14" is not a source node, a negative judgment is made and the process proceeds to step S111. In step S111, "MT14, MT21", which are neighbors of "MT19", are defined as a new adjacent group N, and the process proceeds to FIG. 7.
図7では、まず隣接グループNの要素である「MT14、MT21」のそれぞれを要素NiとしてステップS113~S118の処理が行われる。要素Niが「MT14、MT21」の場合にはいずれも、先祖リストC1に含まれるのでステップS113が肯定判断され、確認済リストCLに含まれるのでステップS114が肯定判断され、キューQに含まれないので否定判断されてステップS119に戻る。そしてステップS119では肯定判断がされる。 In FIG. 7, steps S113 to S118 are first performed with each of the elements "MT14, MT21" of adjacent group N as element Ni. When element Ni is "MT14, MT21", both are included in ancestor list C1, so step S113 is judged as positive, and they are included in confirmed list CL, so step S114 is judged as positive, and they are not included in queue Q, so a negative judgment is made and the process returns to step S119. Then, a positive judgment is made in step S119.
この場合には、キューQには何ら追加がされず、4回目にBを経由した直後の状態である、キューQには「MT19」のみが含まれる状態である。また第1スタックS1は「MT22、MT21、MT14」である。ステップS120では、キューQは空集合でないのでステップS121に進み、キューQから先頭の「MT19」を取り出して処理対象Xiとして図6のステップS106Aに戻る。すなわちS106Aに戻った時点でキューQの要素は空集合となる。 In this case, nothing is added to queue Q, and queue Q contains only "MT19", which is the state immediately after passing through B for the fourth time. Also, the first stack S1 is "MT22, MT21, MT14". In step S120, queue Q is not an empty set, so the process proceeds to step S121, where the top "MT19" is removed from queue Q and set as processing target Xi, and the process returns to step S106A in Figure 6. In other words, the elements of queue Q become an empty set when returning to S106A.
(構造解析処理の動作例|5回目にBを経由した後)
処理対象Xiである「MT19」について、隣接ノードである「MT14、MT21」は全て確認済リストCLに含まれるのでステップS106Aは否定判断され、S107Aでは肯定判断される。ステップS108では、「MT14」の出次数は「1」なので否定判断をしてS109に進み、「MT19」はソースノードではないので否定判断してステップS111に進む。ステップS111では「MT19」の近傍である「MT14、MT21」が新たな隣接グループNとして定義されて図7に進む。
(Example of structural analysis process | After passing through B for the fifth time)
For "MT19" which is the processing target Xi, all of the adjacent nodes "MT14, MT21" are included in the confirmed list CL, so step S106A is judged as negative, and step S107A is judged as positive. In step S108, the outdegree of "MT14" is "1", so a negative judgment is made and the process proceeds to S109, and since "MT19" is not a source node, a negative judgment is made and the process proceeds to step S111. In step S111, "MT14, MT21", which are neighbors of "MT19", are defined as a new adjacent group N, and the process proceeds to FIG. 7.
図7では、まず隣接グループNの要素である「MT14、MT21」のそれぞれを要素NiとしてステップS113~S118の処理が行われる。要素Niが「MT14、MT21」の場合にはいずれも、先祖リストC1に含まれるのでステップS113が肯定判断され、確認済リストCLに含まれるのでステップS114が肯定判断され、キューQに含まれないので否定判断されてステップS119に戻る。そしてステップS119では肯定判断がされる。 In FIG. 7, steps S113 to S118 are first performed with each of the elements "MT14, MT21" of adjacent group N as element Ni. When element Ni is "MT14, MT21", both are included in ancestor list C1, so step S113 is judged as positive, and they are included in confirmed list CL, so step S114 is judged as positive, and they are not included in queue Q, so a negative judgment is made and the process returns to step S119. Then, a positive judgment is made in step S119.
5回目にBを経由した後の処理では、キューQには何ら追加がされないので、5回目にBを経由した直後の状態と同様に、キューQは空集合である。ステップS120では、キューQは空集合なので初めて肯定判断をして、丸囲みのCを経由して図8のステップS601に進む。この時点で、第1スタックS1は「MT22、MT21、MT14」である。 In the process after passing through B for the fifth time, nothing is added to queue Q, so queue Q is an empty set, just like the state immediately after passing through B for the fifth time. In step S120, since queue Q is an empty set, a positive judgment is made for the first time, and the process proceeds to step S601 in Figure 8 via circled C. At this point, the first stack S1 is "MT22, MT21, MT14".
(構造解析処理の動作例|図8の初回処理)
第2スタックS2は、図6の冒頭において初期化されて以後、ここまで一切の操作が行われていないので、図8の処理が開始される時点では空集合のままである。第1スタックは図6~図7の処理において上述するようにいくつかの要素が追加されている。なお本実施の形態では、第1スタックS1に対するポップ操作は行われず、第1スタックS1の長さが短くなることはない。
(Example of structural analysis process | initial process in FIG. 8)
Since no operations have been performed on the second stack S2 since it was initialized at the beginning of Fig. 6, it remains an empty set at the start of the processing in Fig. 8. Some elements have been added to the first stack in the processing in Fig. 6 and Fig. 7 as described above. Note that in this embodiment, no pop operation is performed on the first stack S1, and the length of the first stack S1 does not become shorter.
ステップS601において変数iにゼロを代入する。ステップS602では、第1スタックS1の長さは「3」なので、「i+1」すなわち「1」よりも大きいことから肯定判断がされる。第1スタックS1における「i+1」すなわち「1」番目の要素は「MT21」なので、ステップS603では「MT21」の先祖リストである「MT14、MT18、MT19」を一時先祖リストA00とする。続くS604では変数jに変数iの値であるゼロを代入し、続くステップS605では変数jが「-1」よりも大きいことので肯定判断してステップS606に進む。 In step S601, zero is assigned to the variable i. In step S602, the length of the first stack S1 is "3", which is greater than "i+1", or "1", and so a positive judgment is made. The "i+1", or "1st", element in the first stack S1 is "MT21", and so in step S603, "MT14, MT18, MT19", which is the ancestor list of "MT21", is set as temporary ancestor list A00. In the following step S604, zero, which is the value of variable i, is assigned to variable j, and in the following step S605, variable j is greater than "-1", so a positive judgment is made and the process proceeds to step S606.
ステップS606では、第1スタックS1の「j」番目、すなわち「0」番目の要素である「MT14」の子孫を先祖リストC1から抽出し、「MT18、MT19、MT21」を一時子孫リストD00とする。続くステップS607では、一時子孫リストD00と一時先祖リストA00に共通する「MT18、MT19」を重複リストIS00とする。続くステップS608では、MT18およびMT19の入次数と出次数の差の総和であるゼロをSD00とする。 In step S606, the descendants of "MT14", which is the "j"th element, i.e. the "0"th element, of the first stack S1, are extracted from the ancestor list C1, and "MT18, MT19, MT21" are set as temporary descendant list D00. In the following step S607, "MT18, MT19", which are common to the temporary descendant list D00 and the temporary ancestor list A00, are set as duplicate list IS00. In the following step S608, zero, which is the sum of the differences between the indegrees and outdegrees of MT18 and MT19, is set as SD00.
続くステップS609では、第1スタックS1の「j」番目、すなわち「0」番目の要素である「MT14」の出次数「4」をOD00とする。続くステップS610では、第1スタックS1の「i+1」番目、すなわち「1」番目の要素である「MT21」の入次数「2」をID00とする。続くステップS610Aでは、OD00+SD00-ID00の値を「2」と算出し、これがゼロ以上なので肯定判断してステップS611に進む。 In the following step S609, the outdegree "4" of "MT14", the "j"th, i.e., "0"th element of the first stack S1, is set to OD00. In the following step S610, the indegree "2" of "MT21", the "i+1"th, i.e., "1"th element of the first stack S1, is set to ID00. In the following step S610A, the value of OD00 + SD00 - ID00 is calculated as "2", and since this is greater than or equal to zero, an affirmative judgment is made and the process proceeds to step S611.
ステップS611では、第2スタックS2に第1スタックS1の「i+1」番目、すなわち「1」番目の要素である「MT21」を挿入する。続くステップS612では、第2スタックS2に第1スタックS1の「j」番目、すなわち「0」番目の要素である「MT14」を挿入する。続くステップS614では変数iをインクリメントして「1」としてステップS602に戻る。以上説明した図8の1週目の処理により、第2スタックS2は「MT21、MT14」に更新された。 In step S611, "MT21", which is the "i+1"th element of the first stack S1, i.e. the "1st" element, is inserted into the second stack S2. In the following step S612, "MT14", which is the "j"th element of the first stack S1, i.e. the "0th" element, is inserted into the second stack S2. In the following step S614, the variable i is incremented to "1" and the process returns to step S602. By the above-described processing for the first week in FIG. 8, the second stack S2 has been updated to "MT21, MT14".
(構造解析処理の動作例|図8の2週目)
2回目に実行されるステップS602では、第1スタックS1の長さ「3」が「i+1」すなわち「2」よりも長いので肯定判断してS603に進む。ステップS603では、第1スタックS1の「i+1」番目、すなわち「2」番目の要素である「MT22」の先祖リストである「MT14、MT17、MT18、MT19、MT21」を一時先祖リストA00とする。続くS604では変数jに変数iの値である「1」を代入し、続くステップS605では変数jが「-1」よりも大きいので肯定判断してステップS606に進む。
(Example of structural analysis process | second week in Figure 8)
In step S602, which is executed the second time, the length "3" of the first stack S1 is longer than "i+1", i.e., "2", so an affirmative determination is made and the process proceeds to step S603. In step S603, "MT14, MT17, MT18, MT19, MT21", which is the ancestor list of "MT22", the "i+1"th, i.e., the "2nd", element of the first stack S1, is set as temporary ancestor list A00. In the following step S604, the value of variable i, "1", is substituted for variable j, and in the following step S605, variable j is greater than "-1", so an affirmative determination is made and the process proceeds to step S606.
ステップS606では、第1スタックS1の「j」番目、すなわち「1」番目の要素である「MT21」の子孫は先祖リストC1に存在しないので一時子孫リストD00は空集合となる。そのためステップS607における重複リストIS00も空集合となり、SD00はゼロである。 In step S606, the descendants of "MT21", the "j"th element of the first stack S1, i.e. the "1st" element, do not exist in the ancestor list C1, so the temporary descendant list D00 becomes an empty set. Therefore, the duplicate list IS00 in step S607 also becomes an empty set, and SD00 is zero.
続くステップS609では、第1スタックS1の「j」番目、すなわち「1」番目の要素である「MT21」の出次数「1」をOD00とする。続くステップS610では、第1スタックS1の「i+1」番目、すなわち「2」番目の要素である「MT22」の入次数「2」をID00とする。続くステップS610Aでは、OD00+SD00-ID00の値を「-1」と算出し、これがゼロ未満なので否定判断してステップS613に進む。ステップS613では変数jをデクリメントして「1」から「0」に更新する。そしてステップS605に戻る。以上説明した図8の2週目の処理では、第2スタックS2に変動はない。 In the next step S609, the outdegree "1" of "MT21", the "j"th element, i.e. the "1st" element, of the first stack S1, is set to OD00. In the next step S610, the indegree "2" of "MT22", the "i+1"th element, i.e. the "2nd" element, of the first stack S1 is set to ID00. In the next step S610A, the value of OD00 + SD00 - ID00 is calculated as "-1", which is less than zero, so a negative judgment is made and the process proceeds to step S613. In step S613, the variable j is decremented from "1" to "0". Then the process returns to step S605. In the above-described second week processing of FIG. 8, there is no change in the second stack S2.
(構造解析処理の動作例|図8の3週目)
3回目の実行となるステップS605では、変数jの値がゼロであり「-1」よりも大きいので肯定判断してステップS606に進む。
(Example of structural analysis process |
In step S605, which is the third execution, the value of the variable j is zero and is greater than "-1", so an affirmative determination is made and the process proceeds to step S606.
ステップS606では、第1スタックS1の「j」番目、すなわち「0」番目の要素である「MT14」の子孫を先祖リストC1から抽出し、「MT18、MT19、MT21」を一時子孫リストD00とする。続くステップS607では、一時子孫リストD00と一時先祖リストA00に共通する「MT18、MT19」を重複リストIS00とする。続くステップS608では、MT18およびMT19の入次数と出次数の差の総和であるゼロをSD00とする。 In step S606, the descendants of "MT14", which is the "j"th element, i.e. the "0"th element, of the first stack S1, are extracted from the ancestor list C1, and "MT18, MT19, MT21" are set as temporary descendant list D00. In the following step S607, "MT18, MT19", which are common to the temporary descendant list D00 and the temporary ancestor list A00, are set as duplicate list IS00. In the following step S608, zero, which is the sum of the differences between the indegrees and outdegrees of MT18 and MT19, is set as SD00.
続くステップS609では、第1スタックS1の「j」番目、すなわち「0」番目の要素である「MT14」の出次数「4」をOD00とする。続くステップS610では、第1スタックS1の「i+1」番目、すなわち「2」番目の要素である「MT22」の入次数「2」をID00とする。続くステップS610Aでは、OD00+SD00-ID00の値を「2」と算出し、これがゼロ以上なので肯定判断してステップS611に進む。 In the following step S609, the outdegree "4" of "MT14", the "j"th, i.e., "0"th element of the first stack S1, is set to OD00. In the following step S610, the indegree "2" of "MT22", the "i+1"th, i.e., "2"th element of the first stack S1, is set to ID00. In the following step S610A, the value of OD00 + SD00 - ID00 is calculated as "2", and since this is greater than or equal to zero, an affirmative judgment is made and the process proceeds to step S611.
ステップS611では、第2スタックS2に第1スタックS1の「i+1」番目、すなわち「2」番目の要素である「MT22」を挿入する。続くステップS612では、第2スタックS2に第1スタックS1の「j」番目、すなわち「0」番目の要素である「MT14」を挿入する。続くステップS614では変数iをインクリメントして「2」としてステップS602に戻る。以上説明した図8の3週目の処理により、第2スタックS2は「MT21、MT14、MT22、MT14」に更新された。 In step S611, "MT22", which is the "i+1"th element of the first stack S1, i.e. the "2nd" element, is inserted into the second stack S2. In the following step S612, "MT14", which is the "j"th element of the first stack S1, i.e. the "0th" element, is inserted into the second stack S2. In the following step S614, the variable i is incremented to "2" and the process returns to step S602. As a result of the processing for the third week in Figure 8 described above, the second stack S2 has been updated to "MT21, MT14, MT22, MT14".
ステップS602では、第1スタックS1の長さ「3」が「i+1」すなわち「3」よりも長くないので、否定判断して構造解析処理を終了する。以上説明した処理により、第2スタックS2として「MT21、MT14、MT22、MT14」が得られる。 In step S602, since the length of the first stack S1, "3", is not longer than "i+1", i.e., "3", a negative judgment is made and the structural analysis process is terminated. Through the process described above, "MT21, MT14, MT22, MT14" are obtained as the second stack S2.
(テーブル作成処理のフローチャート)
図9は、テスト演算部22によるテーブル作成処理を示すフローチャートである。テーブル作成処理は、構造解析処理が完了していれば実行可能であり、メモリダンプ処理と実行の前後は不問である。ただしテーブル作成処理は、プログラムテストよりも先に実行が完了している必要がある。
(Flowchart of table creation process)
9 is a flowchart showing the table creation process by the test calculation unit 22. The table creation process can be executed as long as the structural analysis process is completed, regardless of whether it is executed before or after the memory dump process. However, the table creation process must be completed before the program test.
図9ではまずテスト演算部22は、ステップS200において図6~図8に示した構造解析処理により作成された第2スタックS2をコピーする。後述するようにテーブル作成処理では第2スタックS2に対してポップ操作を行い第2スタックS2が変化するので、これがメモリダンプ処理などの他の処理に影響を与えないように、コピーした第2スタックS2を以下の処理では用いる。テスト演算部22は、ステップS200の処理が完了するとステップS201~S203を並列処理する。ただしステップS201~S203は並列に処理することは必須ではなく、3つを順番に処理してもよい。 In FIG. 9, first, in step S200, the test calculation unit 22 copies the second stack S2 created by the structural analysis process shown in FIGS. 6 to 8. As described below, in the table creation process, a pop operation is performed on the second stack S2, causing the second stack S2 to change. Therefore, to prevent this from affecting other processes such as the memory dump process, the copied second stack S2 is used in the following processes. After completing the process of step S200, the test calculation unit 22 processes steps S201 to S203 in parallel. However, it is not essential that steps S201 to S203 be processed in parallel, and the three may be processed in order.
ステップS201ではテスト演算部22は、プログラムP1を読み込む。ステップS202ではテスト演算部22は、プログラムP1の有向グラフD1を取得する。ステップS203ではテスト演算部22は、注目点Xの先祖リストC1を作成する。なおステップS203における注目点Xは、構造解析処理のステップS103において決定された注目点Xである。 In step S201, the test calculation unit 22 reads the program P1. In step S202, the test calculation unit 22 acquires the directed graph D1 of the program P1. In step S203, the test calculation unit 22 creates an ancestor list C1 of the focus point X. Note that the focus point X in step S203 is the focus point X determined in step S103 of the structural analysis process.
テスト演算部22は、ステップS201~S203の全ての実行が完了するとステップS204に進む。ステップS204ではテスト演算部22は、第2スタックS2の長さは2よりも長いか否かを判断する。テスト演算部22は、第2スタックS2の長さが2以上であると判断するとステップS205に進み、第2スタックS2の長さが2未満であると判断すると図9に示す処理を終了する。 When the execution of all steps S201 to S203 is completed, the test calculation unit 22 proceeds to step S204. In step S204, the test calculation unit 22 determines whether the length of the second stack S2 is greater than 2. If the test calculation unit 22 determines that the length of the second stack S2 is greater than or equal to 2, the test calculation unit 22 proceeds to step S205, and if the test calculation unit 22 determines that the length of the second stack S2 is less than 2, the process shown in FIG. 9 is terminated.
ステップS205ではテスト演算部22は、第2スタックS2に対してポップ処理を行い、取得したTMを第1要素Gと名付ける。続くステップS205ではテスト演算部22は、第2スタックS2に対して再度のポップ処理を行い、取得したTMを第2要素Hと名付ける。すなわちステップS205およびS206の処理により第2スタックS2から2つの要素が削除される。続くステップS207ではテスト演算部22は、プログラムP1の第1要素Gから第2要素Hまでを対象にして、並列化アルゴリズムを適用する。本ステップにおいて適用する並列化アルゴリズムに制限はなく、公知の様々なアルゴリズムを適用できる。 In step S205, the test calculation unit 22 performs a pop process on the second stack S2 and names the acquired TM as the first element G. In the following step S205, the test calculation unit 22 performs a pop process on the second stack S2 again and names the acquired TM as the second element H. That is, two elements are deleted from the second stack S2 by the processes of steps S205 and S206. In the following step S207, the test calculation unit 22 applies a parallelization algorithm to the first element G to the second element H of the program P1. There is no restriction on the parallelization algorithm applied in this step, and various known algorithms can be applied.
続くステップS208ではテスト演算部22は、先祖リストC1に基づき第1要素Gから第2要素Hまでの部分先祖リストPDiを作成する。すなわち先祖リストC1における第1要素Gから第2要素Hまでの範囲を部分先祖リストPDiと名付ける。続くステップS209ではテスト演算部22は、プログラムP1の第1要素Gから第2要素Hまでの並列化されたバイナリBiを生成する。 In the following step S208, the test calculation unit 22 creates a partial ancestor list PDi from the first element G to the second element H based on the ancestor list C1. That is, the range from the first element G to the second element H in the ancestor list C1 is named the partial ancestor list PDi. In the following step S209, the test calculation unit 22 generates a parallelized binary Bi from the first element G to the second element H of the program P1.
続くステップS210ではテスト演算部22は、ステップS208において作成した部分先祖リストPDiをエリアテーブルT100のT108の欄に保存し、ステップS209において作成したバイナリBiをエリアテーブルT100のT103の欄に保存する。続くステップS210Aではテスト演算部22は、第1要素Gから第2要素HまでをエリアAiとしてエリアテーブルT100のT102の欄に保存する。 In the following step S210, the test calculation unit 22 stores the partial ancestor list PDi created in step S208 in the T108 column of the area table T100, and stores the binary Bi created in step S209 in the T103 column of the area table T100. In the following step S210A, the test calculation unit 22 stores the first element G to the second element H as the area Ai in the T102 column of the area table T100.
続くステップS211ではテスト演算部22は、エリアテーブルT100のT105の欄に、第2要素Hの最初の命令を記録する。続くステップS212ではテスト演算部22は、エリアテーブルT100のT104の欄に第1要素Gの最後の命令を記録してステップS204に戻る。ここで記録した2つの命令の間は、状況によりマクロタスクの実行順番が入れ替わるので、後のテストでは繰り返し実行を行う。そのため、繰り返し実行すべき始点と終点を記録するためにステップS211~S212が実行される。第2スタックS2は、ステップS205~S212の処理を1回行うごとに要素が2ずつ減少し、第2スタックS2の長さが2未満になると図9の処理が終了する。 In the next step S211, the test calculation unit 22 records the first command of the second element H in the T105 column of the area table T100. In the next step S212, the test calculation unit 22 records the last command of the first element G in the T104 column of the area table T100, and returns to step S204. Between the two commands recorded here, the execution order of the macrotasks changes depending on the situation, so repeated execution is performed in the subsequent test. For this reason, steps S211 to S212 are performed to record the start and end points of the repeated execution. The second stack S2 decreases by two elements each time the processing of steps S205 to S212 is performed, and when the length of the second stack S2 becomes less than two, the processing of FIG. 9 ends.
なおステップS211において第2要素Hの最後の命令を記録してもよいし、ステップS212において第1要素Gの最初の命令を記録してもよい。ただし第1要素Gおよび第2要素Hの内部における処理の順番は固定なので、順番が固定の箇所まで繰り返し実行することはテストの効率を悪化させる。したがって、フローチャートに記載したように、第1要素Gの最後の命令を記録し、第2要素Hの最初の命令を記録することが望ましい。 Note that the last command of the second element H may be recorded in step S211, and the first command of the first element G may be recorded in step S212. However, since the order of processing within the first element G and the second element H is fixed, repeatedly executing the processing up to the point where the order is fixed will reduce the efficiency of the test. Therefore, as shown in the flowchart, it is desirable to record the last command of the first element G and the first command of the second element H.
(テーブル作成処理の動作例)
上述した構造解析処理の動作例において作成した第2スタックS2を用いるテーブル作成処理の動作例を説明する。以下に説明する動作例では動作主体の記載を省略するが、動作主体は全てテスト演算部22である。ステップS200では、先頭から順番に「MT21、MT14、MT22、MT14」の4つが格納された第2スタックS2をコピーする。ステップS201~S202の説明は省略する。ステップS203では注目点Xが上述した動作例と同様に「MT22」なので、作成される先祖リストC1は上記と同様に「MT6,MT9、MT14、MT17、MT18、MT19、MT21」である。
(Example of table creation process)
An example of the operation of the table creation process using the second stack S2 created in the above-mentioned example of the structure analysis process will be described. In the example of the operation described below, the subject of the operation will be omitted, but the subject of the operation is the test calculation unit 22 in all cases. In step S200, the second stack S2 in which four items "MT21, MT14, MT22, MT14" are stored in order from the top is copied. Explanations of steps S201 to S202 will be omitted. In step S203, the focus point X is "MT22" as in the above-mentioned example of the operation, so the ancestor list C1 created is "MT6, MT9, MT14, MT17, MT18, MT19, MT21" as in the above-mentioned example of the operation.
次に実行される1回目のステップS204では、第2スタックS2の長さは「4」なので2以上であることから肯定判断する。そしてステップS205では最後に入力された「MT14」をポップして第1要素Gとし、ステップS206では「MT22」をポップして第2要素Hとする。1回目のステップS205~S206の処理により、第2スタックS2の長さは「4」から「2」になる。 In the first step S204 that is executed next, the length of second stack S2 is "4", which is greater than or equal to 2, so a positive judgment is made. Then in step S205, the last input "MT14" is popped and becomes the first element G, and in step S206, "MT22" is popped and becomes the second element H. As a result of the processing of steps S205 to S206 for the first time, the length of second stack S2 becomes "2" from "4".
続くステップS207では、MT14~MT22に並列化アルゴリズムを適用し、ステップS208ではMT14~MT22の部分先祖リストPDiを作成する。なお部分先祖リストPDiには、人間が理解しやすいように図式化した有向グラフの情報が含まれてもよいし、コンピュータによる処理が容易なように論理的に記載した有向グラフの情報が含まれてもよい。 In the next step S207, a parallelization algorithm is applied to MT14 to MT22, and in step S208, a partial ancestor list PDi is created for MT14 to MT22. The partial ancestor list PDi may contain information on a directed graph that is diagrammed so that it is easy for humans to understand, or it may contain information on a directed graph that is written logically so that it is easy for a computer to process.
続くステップS209ではMT14~MT22の並列化されたバイナリBiを作成する。ステップS210では、部分先祖リストPDiとバイナリBiをエリアテーブルT100に保存する。ステップS210Aでは、MT14~MT22に新たなエリアIDを付してエリアテーブルT100の最初のレコードに保存する。続くステップS211では、MT22の最初の命令を、続くステップS212ではMT14の最後の命令を、エリアテーブルT100の最初のレコードに保存する。 In the following step S209, a parallelized binary Bi of MT14 to MT22 is created. In step S210, the partial ancestor list PDi and the binary Bi are saved in the area table T100. In step S210A, new area IDs are assigned to MT14 to MT22 and saved in the first record of the area table T100. In the following step S211, the first command of MT22, and in the following step S212, the last command of MT14, are saved in the first record of the area table T100.
2回目のステップS204では、第2スタックS2の長さは「2」なので肯定判断してステップS205に進む。ステップS205では「MT14」が第1要素Gに設定され、ステップS206では「MT21」が第2要素Hに設定される。1回目のステップS205~S206の処理により、第2スタックS2の長さは「2」から「0」になる。以下のステップS207~S212では「MT14」~「MT21」を対象として、エリアテーブルT100の2行目に書き込みが行われる。個別の説明は省略する。 In the second iteration of step S204, the length of the second stack S2 is "2", so an affirmative judgment is made and the process proceeds to step S205. In step S205, "MT14" is set as the first element G, and in step S206, "MT21" is set as the second element H. The processing of steps S205 to S206 for the first iteration changes the length of the second stack S2 from "2" to "0". In the following steps S207 to S212, writing is performed on the second row of the area table T100 for "MT14" to "MT21". Individual explanations will be omitted.
3回目のステップS204では、第2スタックS2の長さは「0」なので否定判断してテーブル作成処理を終了する。以上がテーブル作成処理の動作例の説明である。 In the third iteration of step S204, the length of the second stack S2 is "0", so a negative judgment is made and the table creation process ends. This concludes the explanation of an example of the operation of the table creation process.
(メモリダンプ処理のフローチャート)
図10は、テスト演算部22によるメモリダンプ処理を示すフローチャートである。メモリダンプ処理は、構造解析処理が完了していれば実行可能であり、テーブル作成処理と実行の前後は不問である。ただしメモリダンプ処理は、プログラムテストよりも先に実行が完了している必要がある。
(Flowchart of memory dump process)
10 is a flowchart showing the memory dump process by the test calculation unit 22. The memory dump process can be executed as long as the structural analysis process is completed, regardless of whether it is executed before or after the table creation process. However, the memory dump process must be completed before the program test.
図10ではまずステップS300において、テスト演算部22は構造解析処理により作成された第2スタックS2をコピーする。後述するように図10に示す処理では第2スタックS2に対してポップ操作を行い第2スタックS2が変化するので、これがテーブル作成処理などの他の処理に影響を与えないように、コピーした第2スタックS2を以下の処理では用いる。続くステップS301ではテスト演算部22は、プログラムP1を読み込んでステップS302に進む。 In FIG. 10, first, in step S300, the test calculation unit 22 copies the second stack S2 created by the structural analysis process. As described later, in the process shown in FIG. 10, a pop operation is performed on the second stack S2, causing the second stack S2 to change. Therefore, in order to prevent this from affecting other processes such as the table creation process, the copied second stack S2 is used in the following process. In the following step S301, the test calculation unit 22 loads the program P1 and proceeds to step S302.
ステップS302ではテスト演算部22は、第2スタックS2の長さが2よりも長いか否かを判断する。テスト演算部22は、第2スタックS2の長さが2以上であると判断するとステップS303に進み、第2スタックS2の長さが2未満であると判断するとステップS307に進む。ステップS303ではテスト演算部22は、第2スタックS2に対してポップ処理を行い、取得したマクロタスクを第3要素Mと名付ける。続くステップS304ではテスト演算部22は、第3要素Mの最後をメモリダンプのための信号位置に設定する。続くステップS305ではテスト演算部22は、第2スタックS2に対して再度のポップ処理を行い、取得したTMを第4要素Nと名付ける。続くステップS306ではテスト演算部22は、第4要素NのTMの最初をメモリダンプのための信号位置に設定してステップS302に戻る。すなわちステップS303およびS305の処理により第2スタックS2から2つの要素が削除される。 In step S302, the test calculation unit 22 judges whether the length of the second stack S2 is longer than 2. If the test calculation unit 22 judges that the length of the second stack S2 is 2 or more, the process proceeds to step S303. If the test calculation unit 22 judges that the length of the second stack S2 is less than 2, the process proceeds to step S307. In step S303, the test calculation unit 22 performs a pop process on the second stack S2 and names the acquired macrotask as the third element M. In the following step S304, the test calculation unit 22 sets the end of the third element M as the signal position for memory dump. In the following step S305, the test calculation unit 22 performs a pop process on the second stack S2 again and names the acquired TM as the fourth element N. In the following step S306, the test calculation unit 22 sets the start of the TM of the fourth element N as the signal position for memory dump, and returns to step S302. That is, two elements are deleted from the second stack S2 by the processes of steps S303 and S305.
ステップS307ではテスト演算部22は、プログラムP1を実行する。そしてステップS308ではテスト演算部22は、プログラムP1がステップS304およびステップS306において設定した信号位置に到達するたびにメモリダンプを取得する。続くステップS309ではテスト演算部22は、ステップS308において取得したメモリダンプをエリアテーブルのT106とT107の欄に保存して図10に示す処理を終了する。具体的には、ステップS304に対応する信号位置で取得したメモリダンプはT106に記録し、ステップS306に対応する信号位置で取得したメモリダンプはT107に記録する。 In step S307, the test calculation unit 22 executes the program P1. Then, in step S308, the test calculation unit 22 acquires a memory dump every time the program P1 reaches the signal position set in steps S304 and S306. In the following step S309, the test calculation unit 22 stores the memory dump acquired in step S308 in the T106 and T107 columns of the area table, and ends the process shown in FIG. 10. Specifically, the memory dump acquired at the signal position corresponding to step S304 is recorded in T106, and the memory dump acquired at the signal position corresponding to step S306 is recorded in T107.
(メモリダンプ処理の動作例)
上述した構造解析処理の動作例において作成した第2スタックS2を用いるメモリダンプ処理の動作例を説明する。以下に説明する動作例では動作主体の記載を省略するが、動作主体は全てテスト演算部22である。ステップS300では、先頭から順番に「MT21、MT14、MT22、MT14」の4つが格納された第2スタックS2をコピーする。ステップS301ではプログラムP1を読み込む。
(Example of memory dump processing)
An example of the operation of memory dump processing using the second stack S2 created in the above-mentioned example of the operation of the structural analysis processing will be described. In the example of the operation described below, the subject of the operation will be omitted, but the subject of the operation is the test calculation unit 22. In step S300, the second stack S2 in which four items "MT21, MT14, MT22, MT14" are stored in order from the top is copied. In step S301, the program P1 is read.
1回目のステップS302では、第2スタックS2の長さは「4」なので2以上であることから肯定判断する。そしてステップS303では最後に入力された「MT14」をポップして第3要素Mとし、ステップS304では「MT14」の最後の命令を信号位置に設定する。ステップS305では「MT22」をポップして第4要素Nとし、ステップS306では「MT22」の最初の命令を信号位置に設定する。1回目のステップS303、S305の処理により、第2スタックS2の長さは「4」から「2」になる。 In the first iteration of step S302, the length of second stack S2 is "4", which is greater than or equal to 2, so a positive judgment is made. Then in step S303, the last input "MT14" is popped and made the third element M, and in step S304 the last command of "MT14" is set as the signal position. In step S305, "MT22" is popped and made the fourth element N, and in step S306 the first command of "MT22" is set as the signal position. As a result of the processing of steps S303 and S305 for the first iteration, the length of second stack S2 becomes "2" from "4".
2回目のステップS302では、第2スタックS2の長さは「2」なので2以上であることから肯定判断する。そしてステップS303では「MT14」をポップして第3要素Mとし、ステップS304では「MT14」の最後の命令を信号位置に設定する。ステップS305では「MT21」をポップして第4要素Nとし、ステップS306では「MT21」の最初の命令を信号位置に設定する。1回目のステップS303、S305の処理により、第2スタックS2の長さは「2」から「0」になる。 In step S302 the second time, the length of second stack S2 is "2", which is greater than or equal to 2, so a positive judgment is made. Then in step S303, "MT14" is popped and made the third element M, and in step S304 the last command of "MT14" is set as the signal position. In step S305, "MT21" is popped and made the fourth element N, and in step S306 the first command of "MT21" is set as the signal position. As a result of the processing of steps S303 and S305 the first time, the length of second stack S2 becomes "0" from "2".
3回目のステップS302では、第2スタックS2の長さは「0」なので2以上はないから否定判断してステップS307に進む。ステップS307ではプログラムP1を実行し、ステップS308では信号位置に到達するたびにメモリダンプ、換言するとメモリのスナップショットを取得する。そしてステップS309では取得したメモリダンプをエリアテーブルT100に保存してメモリダンプ処理を終了する。 In step S302 for the third time, the length of the second stack S2 is "0", which is not 2 or more, so a negative judgment is made and the process proceeds to step S307. In step S307, program P1 is executed, and in step S308, a memory dump, in other words a snapshot of the memory, is acquired each time a traffic light position is reached. Then, in step S309, the acquired memory dump is saved in the area table T100, and the memory dump process ends.
(プログラムテストのフローチャート)
図11は、テスト演算部22によるプログラムテストを示すフローチャートである。図11ではテスト演算部22は、まずステップS401においてエリアテーブルT100から対象とするエリアAiを選択する。この選択は、オペレータによるマニュアル操作に基づき行われてもよいし、所定のルールにより自動処理により選択されてもよい。所定のルールによる自動処理とはたとえば、エリアテーブルT100に記載されたエリアAiを上から順番に1つずつ選択することである。
(Program test flow chart)
Fig. 11 is a flowchart showing a program test by the test calculation unit 22. In Fig. 11, the test calculation unit 22 first selects a target area Ai from the area table T100 in step S401. This selection may be performed based on a manual operation by an operator, or may be selected by automatic processing according to a predetermined rule. The automatic processing according to a predetermined rule is, for example, selecting the areas Ai listed in the area table T100 one by one in order from the top.
続くステップS402ではテスト演算部22は、ステップS401において選択されたエリアAiをヒートランするか否かを決定する。テスト演算部22は、ヒートランすると判断する場合はステップS403に進み、ヒートランしないと判断する場合は丸囲みのDを経由して図12のS501に進む。なおステップS402の判断はたとえば、オペレータによる事前の設定に基づき行われる。ステップS403ではテスト演算部22は、メモリダンプを使用するか否かを決定する。テスト演算部22は、メモリダンプを使用すると判断する場合はステップS404に進み、メモリダンプを使用しないと判断する場合はステップS410に進む。なおステップS403の判断はたとえば、オペレータによる事前の設定に基づき行われる。 In the following step S402, the test calculation unit 22 decides whether or not to perform a heat run on the area Ai selected in step S401. If the test calculation unit 22 decides to perform a heat run, the process proceeds to step S403, and if the test calculation unit 22 decides not to perform a heat run, the process proceeds to S501 in FIG. 12 via circled D. Note that the decision in step S402 is made, for example, based on a setting made in advance by an operator. In step S403, the test calculation unit 22 decides whether or not to use a memory dump. If the test calculation unit 22 decides not to use a memory dump, the process proceeds to step S404, and if the test calculation unit 22 decides not to use a memory dump, the process proceeds to step S410. Note that the decision in step S403 is made, for example, based on a setting made in advance by an operator.
ステップS404ではテスト演算部22は、エリアテーブルT100のT106の欄を読み取りステップS405に進む。ステップS405ではテスト演算部22は、エリアテーブルT100のT103の欄から並列化済バイナリBiを取得してステップS406に進む。ステップS406ではテスト演算部22は、メモリダンプを用いて並列化済バイナリBiを初期化する。続くステップS407ではテスト演算部22は、並列化済バイナリBiの状態、換言するとメモリに格納される情報に必要な改変を加える。この改変とは、バイナリBiの実行結果を所定の閾値に達するようにするためのものであり、たとえば特定の変数の値を書き換えることである。書き換えではたとえば、初回にS407が実行される際には「1」だけ大きな値に変更し、2回目のS407では「2」だけ大きな値に変更し、それ以後もS407の実行回数に合わせて変数の値を更新する。 In step S404, the test calculation unit 22 reads the T106 column of the area table T100 and proceeds to step S405. In step S405, the test calculation unit 22 obtains the parallelized binary Bi from the T103 column of the area table T100 and proceeds to step S406. In step S406, the test calculation unit 22 initializes the parallelized binary Bi using a memory dump. In the following step S407, the test calculation unit 22 makes necessary modifications to the state of the parallelized binary Bi, in other words, the information stored in the memory. This modification is for making the execution result of the binary Bi reach a predetermined threshold value, for example, by rewriting the value of a specific variable. For example, when S407 is executed for the first time, the value is changed to a value that is only "1" larger, and when S407 is executed for the second time, the value is changed to a value that is only "2" larger, and the value of the variable is updated according to the number of times S407 is executed thereafter.
続くステップS408ではテスト演算部22は、並列化済バイナリBiを実行し、続くステップS409ではテスト演算部22は、並列化済バイナリBiの実行結果を取得する。続くステップS410ではテスト演算部22は、並列化済バイナリBiの実行結果が所定の閾値に達したか否かを判断する。テスト演算部22は、所定の閾値に達したと判断する場合は図11に示す処理を終了し、所定の閾値に達していないと判断する場合はステップS406に戻る。 In the next step S408, the test calculation unit 22 executes the parallelized binary Bi, and in the next step S409, the test calculation unit 22 acquires the execution result of the parallelized binary Bi. In the next step S410, the test calculation unit 22 judges whether or not the execution result of the parallelized binary Bi has reached a predetermined threshold. If the test calculation unit 22 judges that the predetermined threshold has been reached, it ends the processing shown in FIG. 11, and if it judges that the predetermined threshold has not been reached, it returns to step S406.
ステップS403において否定判断されると実行されるステップS410ではテスト演算部22は、プログラムP1を読み込む。続くステップS411ではテスト演算部22は、エリアテーブルT100から選択したエリアAiに対応するT104の欄を読み取り、以下ではこの欄に記載のマクロタスクをループ開始要素Fと呼ぶ。 In step S410, which is executed if a negative judgment is made in step S403, the test calculation unit 22 reads the program P1. In the following step S411, the test calculation unit 22 reads the column T104 corresponding to the selected area Ai from the area table T100, and hereinafter, the macro task written in this column is referred to as the loop start element F.
続くステップS412ではテスト演算部22は、ループ開始要素FにおいてプログラムP1が停止するように設定する。続くステップS413ではテスト演算部22はプログラムP1を実行する。続くステップS414ではテスト演算部22は、ループ開始要素Fにおいて停止したプログラムP1のメモリダンプを取得してステップS405に進む。以上が図11の説明である。 In the following step S412, the test calculation unit 22 sets the program P1 to stop at the loop start element F. In the following step S413, the test calculation unit 22 executes the program P1. In the following step S414, the test calculation unit 22 acquires a memory dump of the program P1 that has stopped at the loop start element F, and proceeds to step S405. This concludes the explanation of FIG. 11.
図12は、図11におけるステップS402において否定判断されると実行される処理を示すフローチャートである。ステップS402において否定判断されると実行されるステップS501ではテスト演算部22は、エリアテーブルT100のT108の欄の情報を読み込む。続くステップS502ではテスト演算部22は、オペレータによる有向グラフに関する追加要求を読み込む。続くステップS503ではテスト演算部22は、ステップS502において読み込んだ追加要求に応じて有向グラフを加工する。 Figure 12 is a flowchart showing the processing executed when a negative judgment is made in step S402 in Figure 11. In step S501, which is executed when a negative judgment is made in step S402, the test calculation unit 22 reads information in the T108 column of the area table T100. In the following step S502, the test calculation unit 22 reads an addition request for the directed graph made by the operator. In the following step S503, the test calculation unit 22 processes the directed graph in accordance with the addition request read in step S502.
ステップS502~S503における第1の具体例は、マクロタスクの実行順番が特定、より具体的には「MT17」が3番目に実行される実行順番だけに限定されることである。第2の具体例は、オペレータから指定されたマクロタスクを指定された位置に追加することである。 The first specific example in steps S502 and S503 is to specify the execution order of the macrotasks, more specifically, to limit the execution order to only one in which "MT17" is executed third. The second specific example is to add a macrotask specified by the operator to a specified position.
続くステップS504ではテスト演算部22は、ステップS503において加工された有向グラフD1から全ての経路を抽出する。続くステップS505ではテスト演算部22は、それぞれの経路に対応するバイナリPBiを作成し、丸囲みのEを経由して図13に進む。 In the next step S504, the test calculation unit 22 extracts all paths from the directed graph D1 processed in step S503. In the next step S505, the test calculation unit 22 creates binary PBi corresponding to each path, and proceeds to FIG. 13 via the circled E.
図13は、図12におけるステップS505の後に実行される処理を示すフローチャートである。ステップS505の次に実行されるステップS506ではテスト演算部22は、メモリダンプを使用するか否かを判断する。テスト演算部22は、メモリダンプを使用すると判断する場合はステップS507に進み、メモリダンプを使用しないと判断する場合はステップS513に進む。 Figure 13 is a flowchart showing the process executed after step S505 in Figure 12. In step S506 executed next to step S505, the test calculation unit 22 determines whether or not to use a memory dump. If the test calculation unit 22 determines that a memory dump will be used, the process proceeds to step S507, and if the test calculation unit 22 determines that a memory dump will not be used, the process proceeds to step S513.
ステップS507ではテスト演算部22は、エリアテーブルT100のT106の欄からメモリダンプを取得してステップS508に進む。ステップS508ではテスト演算部22は、ステップS507において取得したメモリダンプを用いてバイナリPBiを初期化する。続くステップS509ではテスト演算部22は、必要に応じて入力を操作する。この操作はたとえばメモリの値を書き換えることである。続くステップS510ではテスト演算部22は、バイナリPBIを実行する。続くステップS511ではテスト演算部22は、ステップS510において実行したバイナリPBIの実行結果を確認する。 In step S507, the test calculation unit 22 acquires a memory dump from the T106 column of the area table T100, and proceeds to step S508. In step S508, the test calculation unit 22 initializes the binary PBi using the memory dump acquired in step S507. In the following step S509, the test calculation unit 22 manipulates the input as necessary. This manipulation is, for example, rewriting a value in the memory. In the following step S510, the test calculation unit 22 executes the binary PBI. In the following step S511, the test calculation unit 22 checks the execution result of the binary PBI executed in step S510.
続くステップS512ではテスト演算部22は、実行すべきバイナリPBIがまだ存在するか否かを判断する。テスト演算部22は、実行すべきバイナリPBIがまだ存在すると判断するばあいはステップS508に戻り、実行すべきバイナリPBIが存在しないと判断する場合は図13に示す処理を終了する。 In the next step S512, the test calculation unit 22 determines whether or not there is still a binary PBI to be executed. If the test calculation unit 22 determines that there is still a binary PBI to be executed, the process returns to step S508. If the test calculation unit 22 determines that there is no binary PBI to be executed, the process ends as shown in FIG. 13.
ステップS506において否定判断されると実行されるステップS513ではテスト演算部22は、エリアテーブルT100におけるT104の欄に記載されたマクロタスクを読み取り、要素Eとする。続くステップS514ではテスト演算部22は、要素EにおいてプログラムP1が停止するように設定する。続くステップS515ではテスト演算部22は、プログラムP1を実行する。続くステップS516ではテスト演算部22は、要素Eにおいて停止したプログラムP1のメモリダンプを取得してステップS508に進む。以上が図13の処理である。 In step S513, which is executed if a negative judgment is made in step S506, the test calculation unit 22 reads the macrotask written in the T104 column in the area table T100 and sets it as element E. In the following step S514, the test calculation unit 22 sets program P1 to stop in element E. In the following step S515, the test calculation unit 22 executes program P1. In the following step S516, the test calculation unit 22 acquires a memory dump of program P1 stopped in element E and proceeds to step S508. This completes the process in FIG. 13.
(プログラムテストの動作例)
以下ではプログラムテストの複数の動作例を説明する。ただし以下では動作の概略を説明するにとどめ、詳細な説明は省略する。また、ヒートランの有無、およびメモリダンプの使用の有無は、動作例ごとにあらかじめオペレータから指示されている。以下に説明する動作例では動作主体の記載を省略するが、動作主体は全てテスト演算部22である。
(Program test operation example)
A number of operation examples of the program test will be described below. However, the following will only provide an overview of the operation, and detailed explanations will be omitted. In addition, the operator has instructed in advance for each operation example whether or not to perform a heat run and whether or not to use a memory dump. In the operation examples described below, the subject of the operation will be omitted, but the subject of the operation is the test calculation unit 22 in all cases.
(プログラムテストの動作例1)
プログラムテストの動作例1を説明する。この動作例1では、ヒートランを行わず、メモリダンプを使用しない。動作例1では、ヒートランを行わないのでステップS402において否定判断し、丸囲みのDを経由して図12のステップS501に進む。そしてステップS501~S505を実行し、丸囲みのEを経由して図13のステップS506に進む。ステップS506では、メモリダンプを使用しないので否定判断してステップS513に進む。
(Program test operation example 1)
An operation example 1 of the program test will be described. In this operation example 1, a heat run is not performed and a memory dump is not used. In operation example 1, a negative determination is made in step S402 since a heat run is not performed, and the process proceeds to step S501 in Fig. 12 via circled D. Then, steps S501 to S505 are executed, and the process proceeds to step S506 in Fig. 13 via circled E. In step S506, a negative determination is made and the process proceeds to step S513 since a memory dump is not used.
ステップS513~S516では、エリアテーブルT100の開始タスクT104の欄を読み取り要素Fとし、プログラムP1が要素Fに達した際のメモリダンプを取得する。ステップS508~S511ではS516において取得したメモリダンプを用いてバイナリPBiを初期化して実行する。実行すべきバイナリPBiは、ステップS504~S505において有向グラフの全ての経路に対応して作成され、その全てを実行するまではステップS508~S511の処理が繰り返される。 In steps S513 to S516, the column for start task T104 in area table T100 is read as element F, and a memory dump is obtained when program P1 reaches element F. In steps S508 to S511, the memory dump obtained in S516 is used to initialize and execute binary PBi. The binary PBi to be executed is created in steps S504 to S505 corresponding to all paths in the directed graph, and the processing of steps S508 to S511 is repeated until all of them have been executed.
(プログラムテストの動作例2)
プログラムテストの動作例2を説明する。この動作例2では、ヒートランを行わず、メモリダンプを使用する。動作例2は、図13に達するまでは動作例1と同様なのでステップS506までの処理の説明は省略する。ステップS506ではメモリダンプを使用するので肯定判断し、ステップS507においてエリアテーブルT100の開始点ダンプT106の欄からメモリダンプを取得する。ステップS508以降の処理は、動作例1と同様なので説明を省略する。
(Program test operation example 2)
An operation example 2 of the program test will be described. In this operation example 2, a memory dump is used without performing a heat run. Since operation example 2 is similar to operation example 1 until reaching FIG. 13, an explanation of the process up to step S506 will be omitted. Since a memory dump is used in step S506, an affirmative determination is made, and in step S507, a memory dump is obtained from the start point dump T106 column of the area table T100. Since the process from step S508 onwards is similar to operation example 1, an explanation will be omitted.
(プログラムテストの動作例3)
プログラムテストの第3の動作例を説明する。この第3の動作例では、ヒートランを行ない、メモリダンプを使用しない。動作例3では、ヒートランを行なうのでステップS402において肯定判断し、メモリダンプを使用しないのでステップS403では否定判断してステップS410に進む。
ステップS410~S414では、プログラムP1を読み込み、エリアテーブルT100の開始タスクT104の欄を読み取って要素Fとして、プログラムP1が要素Fに達した際のメモリダンプを取得する。続くステップS405~S06では、エリアテーブルT100から並列化したバイナリBiを取得し、メモリダンプを使用してバイナリBiを初期化する。ステップS407では必要な改変を加えてからバイナリBiを実行し、その実行結果が所望の閾値に達するまでS407における改変を変更しながら繰り返し実行する。そして所望の閾値に達するとテストを終了する。
(Program test operation example 3)
A third operation example of the program test will be described. In this third operation example, a heat run is performed, and a memory dump is not used. In operation example 3, a heat run is performed, so a positive determination is made in step S402, and a memory dump is not used, so a negative determination is made in step S403, and the process proceeds to step S410.
In steps S410 to S414, program P1 is read, the start task T104 column in the area table T100 is read as element F, and a memory dump is obtained when program P1 reaches element F. In subsequent steps S405 to S06, the parallelized binary Bi is obtained from the area table T100, and the memory dump is used to initialize the binary Bi. In step S407, necessary modifications are made and then the binary Bi is executed, and the execution is repeated while changing the modifications made in S407 until the execution result reaches the desired threshold. When the desired threshold is reached, the test ends.
(プログラムテストの動作例4)
プログラムテストの第4の動作例を説明する。この第4の動作例では、ヒートランを行ない、メモリダンプを使用する。動作例4では、ヒートランを行なうのでステップS402において肯定判断し、メモリダンプを使用するのでステップS403では肯定判断してステップS404に進む。ステップS404ではエリアテーブルT100からメモリダンプを読み込んでステップS405に進む。ステップS405以降の処理は、動作例3と同様なので説明を省略する。
(Program Test Operation Example 4)
A fourth operation example of the program test will be described. In this fourth operation example, a heat run is performed and a memory dump is used. In operation example 4, a heat run is performed, so an affirmative determination is made in step S402, and a memory dump is used, so an affirmative determination is made in step S403 and the process proceeds to step S404. In step S404, the memory dump is read from the area table T100 and the process proceeds to step S405. The process from step S405 onwards is the same as in operation example 3, so a description thereof will be omitted.
上述した第1の実施の形態によれば、次の作用効果が得られる。
(1)演算装置1が実行するテスト方法は、実行される順番が複数とおり存在し得る複数のマクロタスクを含むプログラムをコンピュータである演算装置1がテストするテスト方法である。この方法は、複数のマクロタスクのいずれかを注目点に設定することと(図6のS103)、注目点Xに影響を与えるマクロタスクの集合である先祖リストC1を特定すること(図6のS104)と、先祖リストC1に含まれるマクロタスクを、並列化に寄与しない非並列群および並列化に寄与する並列寄与群に分別すること(構造解析処理)と、並列寄与群についてテストパタンを複数生成すること(図12のS501~S504)と、非並列群に属するマクロタスクを実行して得られた結果を用いて、複数のテストパタンを実行することと(図11のS406~S408、図13のS508~S510)、を含む。そのため、実行される順番が複数とおり存在し得る複数のマクロタスクを含むプログラムP1のテストにおいて、注目点Xに設定された特定のマクロタスクを対象としたテストが効率的に実行できる。
According to the above-described first embodiment, the following advantageous effects can be obtained.
(1) The test method executed by the
(2)非並列群に属するマクロタスクを実行して得られた結果とは、マクロタスクを実行するコンピュータのメモリのダンプであり、1つのダンプを用いて、複数のテストパタンを実行する(図11のS410:NOのループ、図13のS512:YESのループ)。そのため、同一の処理を何度も実行する代わりにメモリダンプを利用するので、複数の手巣パタンを実行する時間を短縮できる。 (2) The result obtained by executing a macrotask belonging to a non-parallel group is a dump of the memory of the computer executing the macrotask, and one dump is used to execute multiple test patterns (loop S410: NO in FIG. 11, loop S512: YES in FIG. 13). Therefore, since a memory dump is used instead of executing the same process multiple times, the time required to execute multiple test patterns can be reduced.
(3)演算装置1が実行するテスト方法は、生成されたテストパタンをオペレータの指令に基づき修正することを含む(図12のS502~S503)。そのため、自動生成されたテストパタンだけでなく、オペレータが気になる修正を任意に加えることができる。
(3) The test method executed by the
(4)演算装置1が実行するテスト方法は、プログラムを実行してエラーが発生したマクロタスクを注目点Xに設定する(図6のS103)。そのため、オペレータによる指定を必須とせず、テスト全体を自動で実行できる。
(4) The test method executed by the
上述した各実施の形態および変形例において、機能ブロックの構成は一例に過ぎない。別々の機能ブロックとして示したいくつかの機能構成を一体に構成してもよいし、1つの機能ブロック図で表した構成を2以上の機能に分割してもよい。また各機能ブロックが有する機能の一部を他の機能ブロックが備える構成としてもよい。 In each of the above-described embodiments and variations, the functional block configurations are merely examples. Several functional configurations shown as separate functional blocks may be configured together, or a configuration shown in a single functional block diagram may be divided into two or more functions. In addition, some of the functions of each functional block may be provided by other functional blocks.
上述した各実施の形態および変形例において、演算装置1が実行するプログラムはROM3に格納されるとしたが、プログラムは記憶部5に格納されていてもよい。また、演算装置は、必要なときに外部インタフェース6が利用可能な媒体を介して、他の装置からプログラムが読み込まれてもよい。ここで媒体とは、例えば入出力インタフェースに着脱可能な記憶媒体、または通信媒体、すなわち有線、無線、光などのネットワーク、または当該ネットワークを伝搬する搬送波やディジタル信号、を指す。また、プログラムにより実現される機能の一部または全部がハードウエア回路やFPGAにより実現されてもよい。
In each of the above-mentioned embodiments and modifications, the program executed by the
上述した各実施の形態および変形例は、それぞれ組み合わせてもよい。上記では、種々の実施の形態および変形例を説明したが、本発明はこれらの内容に限定されるものではない。本発明の技術的思想の範囲内で考えられるその他の態様も本発明の範囲内に含まれる。 The above-mentioned embodiments and modifications may be combined with each other. Although various embodiments and modifications have been described above, the present invention is not limited to these. Other aspects that are conceivable within the scope of the technical concept of the present invention are also included within the scope of the present invention.
1…演算装置
5…記憶部
21…入出力部
22…テスト演算部
23…プログラム実行部
D1…有向グラフ
Q…キュー
S1…第1スタック
S2…第2スタック
T100…エリアテーブル
1...
Claims (5)
前記複数のマクロタスクのいずれかを注目タスクに設定することと、
前記注目タスクに影響を与える前記マクロタスクの集合である先祖リストを特定することと、
前記先祖リストに含まれる前記マクロタスクを、並列化に寄与しない非並列群および並列化に寄与する並列寄与群に分別することと、
前記並列寄与群についてテストパタンを複数生成することと、
前記非並列群に属する前記マクロタスクを実行して得られた結果を用いて、前記複数の前記テストパタンを実行することと、を含むテスト方法。 1. A method for testing a program including a plurality of macrotasks that can be executed in a plurality of different orders by a computer, comprising:
setting one of the plurality of macrotasks as a focus task;
identifying an ancestor list, which is a set of the macrotasks that affect the focus task;
classifying the macrotasks included in the ancestor list into a non-parallel group that does not contribute to parallelization and a parallel contributing group that contributes to parallelization;
generating a plurality of test patterns for the parallel contributions;
executing the plurality of test patterns using results obtained by executing the macrotasks belonging to the non-parallel group.
前記非並列群に属する前記マクロタスクを実行して得られた結果とは、前記マクロタスクを実行するコンピュータのメモリのダンプであり、
1つの前記ダンプを用いて、前記複数のテストパタンを実行する、テスト方法。 2. The test method according to claim 1,
the result obtained by executing the macrotask belonging to the non-parallel group is a dump of the memory of the computer executing the macrotask,
A testing method comprising: executing the plurality of test patterns using one of the dumps.
生成された前記テストパタンをオペレータの指令に基づき修正することをさらに含む、テスト方法。 2. The test method according to claim 1,
The testing method further includes modifying the generated test pattern based on an operator's instruction.
前記プログラムを実行してエラーが発生した前記マクロタスクを前記注目タスクに設定する、テスト方法。 2. The test method according to claim 1,
a macrotask in which an error occurs when the program is executed, the macrotask being set as the target task.
前記複数のマクロタスクのいずれかを注目タスクに設定し、前記注目タスクに影響を与える前記マクロタスクの集合である先祖リストを特定し、前記先祖リストに含まれる前記マクロタスクを、並列化に寄与しない非並列群および並列化に寄与する並列寄与群に分別し、前記並列寄与群についてテストパタンを複数生成するテスト演算部と、
前記非並列群に属する前記マクロタスクを実行して得られた結果を用いて、前記複数の前記テストパタンを実行するプログラム実行部と、を含む演算装置。
a storage unit for storing a program including a plurality of macrotasks that can be executed in a plurality of different orders;
a test calculation unit that sets one of the plurality of macrotasks as a focus task, identifies an ancestor list that is a set of the macrotasks that affect the focus task, classifies the macrotasks included in the ancestor list into a non-parallel group that does not contribute to parallelization and a parallel contribution group that contributes to parallelization, and generates a plurality of test patterns for the parallel contribution group;
a program execution unit that executes the plurality of test patterns using a result obtained by executing the macro task that belongs to the non-parallel group.
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020124296A JP7493405B2 (en) | 2020-07-21 | 2020-07-21 | Test method and computing device |
| PCT/JP2021/025689 WO2022019124A1 (en) | 2020-07-21 | 2021-07-07 | Test method and computation device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020124296A JP7493405B2 (en) | 2020-07-21 | 2020-07-21 | Test method and computing device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2022020981A JP2022020981A (en) | 2022-02-02 |
| JP7493405B2 true JP7493405B2 (en) | 2024-05-31 |
Family
ID=79728737
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2020124296A Active JP7493405B2 (en) | 2020-07-21 | 2020-07-21 | Test method and computing device |
Country Status (2)
| Country | Link |
|---|---|
| JP (1) | JP7493405B2 (en) |
| WO (1) | WO2022019124A1 (en) |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2018037787A1 (en) | 2016-08-22 | 2018-03-01 | 日立オートモティブシステムズ株式会社 | Test item generation method and computation device |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH11120030A (en) * | 1997-10-21 | 1999-04-30 | Toshiba Corp | Apparatus and method for testing a program and recording medium for recording software for testing the program |
-
2020
- 2020-07-21 JP JP2020124296A patent/JP7493405B2/en active Active
-
2021
- 2021-07-07 WO PCT/JP2021/025689 patent/WO2022019124A1/en not_active Ceased
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2018037787A1 (en) | 2016-08-22 | 2018-03-01 | 日立オートモティブシステムズ株式会社 | Test item generation method and computation device |
Non-Patent Citations (1)
| Title |
|---|
| 本多 弘樹 ほか,「Fortranプログラム粗粒度タスク間の並列性検出手法」,電子情報通信学会論文誌 D-I,1990年12月25日,Vol. J73-D-1 No.12,pp.951-960 |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2022020981A (en) | 2022-02-02 |
| WO2022019124A1 (en) | 2022-01-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Tricas et al. | An iterative method for deadlock prevention in FMS | |
| US8041744B2 (en) | Computer-aided modeling | |
| Behr et al. | MITIE: Simultaneous RNA-Seq-based transcript identification and quantification in multiple samples | |
| AU2001243500A1 (en) | Method, process and system for optimized outcome driven workflow synthesis and reduction | |
| JP2020057385A (en) | How to modify a model to create source code | |
| Georgoulakos et al. | Evolutionary multi-objective optimization of business process designs with pre-processing | |
| Jahanshahi et al. | On the efficiency of artificial neural networks for plastic analysis of planar frames in comparison with genetic algorithms and ant colony systems | |
| Swiercz | Hyper‐Heuristics and Metaheuristics for Selected Bio‐Inspired Combinatorial Optimization Problems | |
| JP7493405B2 (en) | Test method and computing device | |
| CN120029208A (en) | Assembly planning solution method and device for complex product assembly | |
| Hao et al. | POInT: a tool for modeling ancient polyploidies using multiple polyploid genomes | |
| Roy et al. | Distributed Mutual Exclusion Problem in Cellular Automata. | |
| Islam et al. | Focused layered performance modelling by aggregation | |
| Shao et al. | Preference-based surrogate modeling in engineering design | |
| Real et al. | AutoNumerics-Zero: automated discovery of state-of-the-art mathematical functions | |
| Huang | Algorithms for mixed continuous-discrete variable problems in structural optimization | |
| Balbo et al. | On petri nets in performance and reliability evaluation of discrete event dynamic systems | |
| JP7760354B2 (en) | Information integration system and information provision method | |
| Kodetzki et al. | Partial Proofs to Optimize Deductive Verification of Feature-Oriented Software Product Lines | |
| Henriques da Silva et al. | A 3-step cartesian genetic programming for designing combinational logic circuits with multiplexers | |
| Cudby et al. | Pangenome-guided sequence assembly via binary optimisation | |
| CN112204526A (en) | Methods for configuring automation systems | |
| Huang et al. | Bridging directed acyclic graphs to linear representations in linear genetic programming: a case study of dynamic scheduling | |
| US12204936B2 (en) | Computer-implemented method for performing a system assessment | |
| EP4250166A1 (en) | Computer-implemented method for performing a system assessment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20230127 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20231219 |
|
| 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: 20240514 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20240521 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7493405 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |