JP2003296139A - Stub forming device and program - Google Patents

Stub forming device and program

Info

Publication number
JP2003296139A
JP2003296139A JP2002095746A JP2002095746A JP2003296139A JP 2003296139 A JP2003296139 A JP 2003296139A JP 2002095746 A JP2002095746 A JP 2002095746A JP 2002095746 A JP2002095746 A JP 2002095746A JP 2003296139 A JP2003296139 A JP 2003296139A
Authority
JP
Japan
Prior art keywords
function
stub
program
inspection
description
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.)
Pending
Application number
JP2002095746A
Other languages
Japanese (ja)
Inventor
Yuko Hayashi
祐子 林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2002095746A priority Critical patent/JP2003296139A/en
Publication of JP2003296139A publication Critical patent/JP2003296139A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To prepare a stub function reliable in terms of matching property to a processing program including an object for inspection. <P>SOLUTION: In a server 90, an out-of-field program having a function which is required in a source program described therein is read as a file to be stubbed to form a stub file. A non-delete part recognizing block 101 recognizes a non- delete part necessary for compile link. Then, a function recognizing block 102 and a preprocessor command recognizing block 103 recognize the description range of the function including the case having a preprocessor command described therein, thereby, a substantial processing description such as execution line in the function is deleted by an unnecessary part deleting block 105. A form recognizing block 105 recognizes the form of the function to judge the presence of a return value, and a declaration and return adding block 106 adds a variable declaration and return command for the return value thereto. <P>COPYRIGHT: (C)2004,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、検査スクリプトに
基づく結合テストに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a test script-based integration test.

【0002】[0002]

【従来の技術】近年、自動車等の車両にも多くのコンピ
ュータシステムが採用されており、車両の随所にソフト
ウェアを搭載した電子制御装置が配置されるようになっ
た。そのため、今日では、ソフトウェア開発工数の削減
が重要な課題となっている。特に、車載用のコンピュー
タシステムに搭載される制御ソフトウェアでは、車両側
の部品変更や仕様変更などでソフトウェアの変更を余儀
なくされる。
2. Description of the Related Art In recent years, many computer systems have been adopted in vehicles such as automobiles, and electronic control devices equipped with software have been arranged everywhere in the vehicles. Therefore, reduction of man-hours for software development has become an important issue today. In particular, in the control software installed in the vehicle-mounted computer system, the software has to be changed by changing the parts and specifications of the vehicle.

【0003】そこで、近年のプログラム開発ではオブジ
ェクト指向設計が主流となってきた。その一つの現れ
が、車両部品やその機能に着目し、その単位でプログラ
ムを作成するという手法である。このようにすれば、プ
ログラムの再利用性が高くなるからである。なお、本明
細書では、部品単位や機能単位のプログラムを「部品プ
ログラム」ということにする。
Therefore, object-oriented design has become mainstream in recent program development. One of them is a method of paying attention to vehicle parts and their functions and creating a program for each unit. This is because the reusability of the program is improved. In this specification, a program for each component or each function will be referred to as a “component program”.

【0004】一方、このようなプログラムの検査では、
部品プログラム個々の単体検査を行い、次に、部品プロ
グラムを結合させた結合検査を行うのが一般的である。
部品検査では部品プログラムの個々の動作を検査するの
に対し、結合検査においては、部品プログラムが検査仕
様書にある通りの順序でコールされているかや、入力デ
ータを与えて得られる演算結果が予め用意される出力デ
ータと同一であるかといった検査が主となる。
On the other hand, in the inspection of such a program,
In general, individual inspections of individual component programs are performed, and then combined inspection in which component programs are combined is performed.
In the component inspection, the individual operations of the component program are inspected, whereas in the combined inspection, whether the component programs are called in the order specified in the inspection specifications or the operation results obtained by inputting the input data are The main inspection is whether the output data is the same as the prepared output data.

【0005】そしてこのような結合検査は、図15
(a)に示すように、部品プログラムを結合したソース
プログラム中の検査対象220に対応させてドライバ2
10を用意して行うことが考えられる。これによって、
ドライバ210により、検査対象220を、いわゆるシ
ミュレータと呼ばれる実行履歴記録装置が実行し、検査
することができる。
[0005] And, such a joint inspection is shown in FIG.
As shown in (a), the driver 2 is made to correspond to the inspection target 220 in the source program in which the component programs are combined.
It is conceivable that 10 is prepared and performed. by this,
With the driver 210, the inspection target 220 can be executed and inspected by an execution history recording device called a simulator.

【0006】しかし、この場合、検査対象220に対し
て個々にドライバ210を用意する必要があり、また、
ドライバ210と検査対象220という単位でコンパイ
ル・リンクする必要がある。特に、車両制御用の大規模
なプログラムであれば、検査対象220が数千といった
オーダーで存在するため、検査対象220に対応するド
ライバ210の準備や、検査対象220とドライバ21
0をセットにしてコンパイル・リンクするのに多大な時
間を要してしまう。
However, in this case, it is necessary to individually prepare the driver 210 for the inspection target 220, and
It is necessary to compile and link in units of the driver 210 and the inspection target 220. In particular, in the case of a large-scale program for vehicle control, since the inspection target 220 exists in the order of several thousand, preparation of the driver 210 corresponding to the inspection target 220, or inspection target 220 and driver 21.
It takes a lot of time to compile and link with 0 set.

【0007】これを解決するための手法として、図15
(b)に示すように、ソースプログラム81全体を実行
履歴記録装置で実行し、検査対象81aを、検査情報の
記述される検査スクリプト82で特定することが考えら
れる。この場合、検査対象81a毎に検査スクリプト8
2を用意する必要はあるが、ドライバ41をソースプロ
グラム81と共にコンパイル・リンクすれば、後は、検
査スクリプト82を変えるだけで、実行履歴記録装置に
よる複数の検査対象81aに対する検査が可能となる。
つまり、検査対象81aが多くなっても、コンパイル・
リンクが発生しないため、検査工数が削減できるのであ
る。
As a method for solving this, FIG.
As shown in (b), it is conceivable that the entire source program 81 is executed by the execution history recording device and the inspection target 81a is specified by the inspection script 82 in which the inspection information is described. In this case, the inspection script 8 for each inspection target 81a
However, if the driver 41 is compiled and linked together with the source program 81, the execution history recording device can inspect a plurality of inspection targets 81a by simply changing the inspection script 82.
In other words, even if the inspection target 81a is increased,
Since no link occurs, the inspection man-hour can be reduced.

【0008】[0008]

【発明が解決しようとする課題】このとき、図16
(a)に示すように、関数Aからコールされる関数Bを
検査開始関数とする場合、すなわち、関数Aからコール
される関数B以下が検査対象81aとなる場合を考え
る。
At this time, FIG.
As shown in (a), consider the case where the function B called from the function A is used as the check start function, that is, the case where the function B or lower called from the function A becomes the check target 81a.

【0009】このような場合、オブジェクト2の関数B
からコールされる関数Cがソースプログラム81とは別
の例えばプラットフォーム(以下「PF」と記述する)
と呼ばれる分野外プログラムに存在することがある。そ
して、開発途中では、ソースプログラム81の検査対象
81aからコールされる関数Cが存在しないことがあ
る。
In such a case, the function B of the object 2
The function C called from the source program 81 is different from the source program 81, for example, a platform (hereinafter referred to as “PF”).
May exist in a program outside the field called. During the development, the function C called from the inspection target 81a of the source program 81 may not exist.

【0010】そのため、結合検査を行うためには、スタ
ブと呼ばれるダミーの関数Cを用意する必要が生じてく
る。すなわち、上述した結合検査を行うためには、ソー
スプログラム81に必要なスタブ関数を用意しておく必
要がある。このとき、ソースプログラム81を基にスタ
ブを作成することが考えられるが、ソースプログラム8
1が、車両用の制御プログラムである場合は特に仕向地
の違いにより、実行される部分と実行されない部分とを
含む可能性がある。いわゆるコンパイラによる条件コン
パイルがなされることがある。
Therefore, it is necessary to prepare a dummy function C called a stub in order to perform the joint inspection. That is, it is necessary to prepare the stub function necessary for the source program 81 in order to perform the above-mentioned connection inspection. At this time, it is possible to create a stub based on the source program 81.
When 1 is a control program for a vehicle, there is a possibility that a part to be executed and a part not to be executed may be included depending on the destination. A so-called compiler may be used for conditional compilation.

【0011】そのため、ソースプログラム81を基に自
動作成する場合には、スタブ作成処理が煩雑になり、結
果的に、ソースプログラム81との整合性という面にお
いて信頼性が低くなるという問題があった。本発明は、
検査対象を含む処理プログラムに対し、整合性という面
において信頼性の高いスタブ関数を作成することを目的
とする。
Therefore, in the case of automatically creating the source program 81, the stub creating process becomes complicated, and as a result, the reliability with respect to the consistency with the source program 81 becomes low. . The present invention is
The purpose is to create a stub function that is highly reliable in terms of consistency with respect to a processing program including an inspection target.

【0012】[0012]

【課題を解決するための手段及び発明の効果】本発明の
スタブ作成装置は、単位機能毎に細分化された処理プロ
グラムを実行し、検査情報が記述された検査スクリプト
に基づいて処理実行の履歴を記録するにあたり、処理プ
ログラムの実行に必要となるスタブ関数を作成する。
Means for Solving the Problems and Effects of the Invention A stub creation apparatus of the present invention executes a processing program subdivided for each unit function, and a history of processing execution based on an inspection script in which inspection information is described. To record, create a stub function required to execute the processing program.

【0013】ここで特に、本発明は、ソース取得手段
と、スタブ作成手段とを備えることを特徴とする。ソー
ス取得手段は、処理プログラムからコールされる関数を
含むスタブ化対象プログラムのソース記述を取得する。
スタブ化対象プログラムとは、処理プログラムとは別に
用意される、PFといった分野外プログラムである。そ
してスタブ作成手段が、取得されたソース記述に基づ
き、実質的な処理記述を削除してスタブ関数を作成す
る。
Here, in particular, the present invention is characterized by including source acquisition means and stub creation means. The source acquisition means acquires the source description of the stubbing target program including the function called from the processing program.
The stubification target program is an out-of-field program such as PF prepared separately from the processing program. Then, the stub creation means creates a stub function by deleting the substantial process description based on the acquired source description.

【0014】この技術思想は、検査対象を含む処理プロ
グラムに対し、少なくとも関数コールの面で整合性の確
認されたスタブ化対象ファイルが存在することを前提と
するものである。つまり、特に車両制御に係るプログラ
ム開発過程にあっては、プログラムの再利用という側面
から、処理内容自体は適切でないかもしれないが、処理
プログラムで必要となる関数記述がなされた分野外プロ
グラムが存在することが多い。そして、このような分野
外プログラムは、過去に開発された処理プログラムとの
関係においては、完全な整合性が保障されている。した
がって、開発中の処理プログラムの関数コール部分に変
更がなければ、既存の分野外プログラムを用いてスタブ
関数を作成でき、整合性が保障されることになる。
This technical idea is based on the premise that there is a stub object file whose consistency is confirmed at least in terms of function calls in the processing program including the object to be inspected. In other words, especially in the process of developing a program related to vehicle control, the processing content itself may not be appropriate from the aspect of reusing the program, but there are out-of-field programs in which the function description necessary for the processing program has been made. I often do it. And, such a program outside the field is guaranteed to be completely consistent with the processing program developed in the past. Therefore, if there is no change in the function call part of the processing program under development, the stub function can be created using the existing program outside the field, and the consistency is guaranteed.

【0015】本発明では、このような点に着目し、整合
性の保障された分野外プログラムをスタブ化対象プログ
ラムとし、実質的な処理記述を削除することによって、
スタブ関数を作成する。その結果、検査対象を含む処理
プログラムに対し、整合性という面において信頼性の高
いスタブ関数を作成することができる。
In the present invention, paying attention to such a point, the out-of-field program whose consistency is guaranteed is set as the stubization target program, and the substantial processing description is deleted,
Create a stub function. As a result, it is possible to create a highly reliable stub function in terms of consistency with respect to the processing program including the inspection target.

【0016】なお、スタブ作成手段は、例えば、スタブ
化対象プログラムのコンパイル・リンクに必要な部分を
非削除部分として認識することにより、実質的な処理記
述を削除することが考えられる(請求項2)。このよう
な非削除部分の認識を行えば、スタブ作成の自動化が促
進される。またこのとき、非削除部分には、コンパイル
・リンクに関係しないコメント文を含めてもよい(請求
項3)。作成後の可読性が向上するからである。
It is considered that the stub creating means deletes the substantial process description by recognizing, as a non-deleted part, a part necessary for compiling and linking the program to be stubbed (claim 2). ). By recognizing such a non-deleted portion, automation of stub creation is promoted. At this time, the non-deleted portion may include a comment statement not related to compile / link (claim 3). This is because the readability after creation is improved.

【0017】ところで、具体的に、スタブ作成手段は、
関数の記述範囲を認識することにより、実質的な処理記
述を削除する構成とすることが考えられる(請求項
4)。関数内の実質的な処理記述だけを確実に削除する
必要があるからである。このとき、スタブ作成手段は、
プリプロセッサ命令を認識することにより、関数の記述
範囲を認識するようにすることが望ましい(請求項
5)。プリプロセッサ命令によって、選択的にコンパイ
ルされる部分が関数の一部をなすことがあるためであ
る。このようにすれば、処理プログラムの条件コンパイ
ルにも対応したスタブ関数を作成することができる。
By the way, specifically, the stub creating means is
It is conceivable to delete the substantial process description by recognizing the description range of the function (claim 4). This is because it is necessary to surely delete only the substantive processing description in the function. At this time, the stub creation means is
It is desirable to recognize the description range of the function by recognizing the preprocessor instruction (claim 5). This is because, depending on the preprocessor instruction, the part that is selectively compiled may be part of the function. By doing this, it is possible to create a stub function that also supports conditional compilation of the processing program.

【0018】また、スタブ作成手段は、関数がマクロ定
義されている場合に、当該マクロ定義部分を含めて、関
数の記述範囲を認識するようにするとさらによい(請求
項6)。マクロ定義された関数においては、マクロ定義
部分に実質的な処理が記述されるからである。このよう
にすれば、マクロ定義された関数からも、自動的にスタ
ブ関数を作成することができる。
Further, when the function is macro-defined, the stub creating means is better to recognize the description range of the function including the macro definition part (claim 6). This is because in a macro-defined function, the actual processing is described in the macro definition part. By doing this, it is possible to automatically create a stub function from a macro-defined function.

【0019】なお、スタブ関数は実質的な処理を行わな
いダミーの関数であるが、処理プログラムとの関数コー
ルの整合性という意味においては、ダミーの戻り値を用
意する必要が生じる。そこで、スタブ作成手段は、関数
記述に基づき、当該関数の型を認識し、戻り値があるか
否かを判断して、戻り値がある場合には、戻り値のため
の変数宣言及びリターン命令を追加することにより、ス
タブ関数を作成する構成にするとよい(請求項7)。こ
のようにすれば、さらに、スタブ関数の自動作成が促進
される。このとき、関数がマクロ定義されている場合に
は、当該マクロ定義を用いて、変数宣言及びリターン命
令を追加することが考えられる(請求項8)。このよう
にマクロ定義を用いて変数宣言及びリターン命令を追加
すれば、マクロ定義された関数のそれぞれに対し、戻り
値の適切な記述ができる。
Note that the stub function is a dummy function that does not perform substantial processing, but in terms of consistency of function calls with the processing program, it is necessary to prepare a dummy return value. Therefore, the stub creating means recognizes the type of the function based on the function description, determines whether there is a return value, and if there is a return value, declares a variable for the return value and returns an instruction. It is preferable that the stub function is created by adding. This further facilitates the automatic creation of the stub function. At this time, when the function is macro-defined, it is conceivable to add a variable declaration and a return instruction using the macro definition (claim 8). By thus adding the variable declaration and the return instruction using the macro definition, the return value can be appropriately described for each of the macro-defined functions.

【0020】ところで、関数の戻り値は関数の型に依存
するものであるが、関数の型が別名で定義されることが
ある。そこで、スタブ作成手段は、関数の型が別名で定
義されていることを示す定義情報を用いて、関数に戻り
値があるか否かを判断可能にすることが望ましい(請求
項9)。このようにすれば、関数の型が別名で定義され
ていても、戻り値があるか否かを判断でき、適切に変数
宣言及びリターン命令を追加できる。関数の型の別名定
義は、C言語であれば「typedef」命令などによ
ってソースファイル又はヘッダーファイルに記されるの
で、それらを解析して定義情報とすることが考えられ
る。このとき、定義情報は、戻り値のない関数の型が記
述されたものとすることが考えられる(請求項10)。
つまり、戻り値があるか否かを判断するためには、戻り
値のある型、あるいは、戻り値のない型のいずれかが分
かればよい。そして、戻り値のない型の定義が、戻り値
のある型の定義よりも少なくなるのが一般的である。し
たがって、このようにすれば、定義情報の情報量が削減
される。
By the way, the return value of a function depends on the type of the function, but the type of the function may be defined by an alias. Therefore, it is desirable that the stub creating means can determine whether or not the function has a return value by using the definition information indicating that the function type is defined by an alias (claim 9). By doing so, even if the function type is defined by an alias, it is possible to determine whether or not there is a return value, and it is possible to appropriately add a variable declaration and a return instruction. Since the function type alias definition is written in the source file or the header file by a "typedef" command or the like in the C language, it is conceivable to analyze them as definition information. At this time, it is conceivable that the definition information describes the type of a function having no return value (claim 10).
That is, in order to determine whether or not there is a return value, it is sufficient to know either the type with a return value or the type without a return value. And the definition of a type without a return value is generally smaller than the definition of a type with a return value. Therefore, in this way, the amount of definition information is reduced.

【0021】なお、通常、検査スクリプトに基づいて検
査開始関数が判断され、検査開始関数配下の関数につい
ての処理実行の履歴が記録される。このとき、検査開始
関数がスタブ関数からコールされることもある。そこ
で、スタブ作成手段は、検査スクリプトに基づいて作成
される、検査開始の関数及び当該検査開始関数のコール
元を示す検査開始関数情報を用い、スタブ関数がコール
元である場合には、当該検査開始関数への引数宣言及び
コール命令を追加して、スタブ関数を作成するようにす
るとよい(請求項11)。これによって、スタブ関数か
らの検査開始までが自動化できることになる。
Incidentally, the inspection start function is usually judged based on the inspection script, and the history of processing execution for the functions under the inspection start function is recorded. At this time, the inspection start function may be called from the stub function. Therefore, the stub creation means uses the test start function information created based on the test script and indicating the call source of the test start function and the test start function. If the stub function is the call source, the test A stub function may be created by adding an argument declaration and a call instruction to the start function (claim 11). This makes it possible to automate the process from the stub function to the start of inspection.

【0022】以上は、スタブ作成装置の発明として説明
してきたが、このようなスタブ作成装置の機能は、コン
ピュータで起動されるプログラムとして実現できる。こ
の意味で、本発明は、上述したスタブ作成装置の各手段
としてコンピュータを機能させるプログラムとして実現
できる(請求項12)。
Although the invention of the stub creating apparatus has been described above, the function of such a stub creating apparatus can be realized as a program activated by a computer. In this sense, the present invention can be realized as a program that causes a computer to function as each unit of the stub creating apparatus described above (claim 12).

【0023】このようなプログラムの場合、例えば、F
D、MO、CD−ROM、DVD−ROM、HD等のコ
ンピュータ読み取り可能な記録媒体に記録し、必要に応
じてコンピュータにロードして起動することにより用い
ることができる。この他、ROMやバックアップRAM
をコンピュータ読み取り可能な記録媒体として本プログ
ラムを記録しておき、このROMあるいはバックアップ
RAMをコンピュータに組み込んで用いてもよい。
In the case of such a program, for example, F
It can be used by recording it on a computer-readable recording medium such as D, MO, CD-ROM, DVD-ROM, HD, etc., and by loading it into a computer and activating it as necessary. In addition, ROM and backup RAM
The program may be recorded as a computer-readable recording medium, and the ROM or the backup RAM may be incorporated into a computer for use.

【0024】[0024]

【発明の実施の形態】以下、本発明を具体化した一実施
例を図面を参照して説明する。図1は、本実施例の実行
履歴記録システムの概略構成を示す説明図である。実行
履歴記録システムは、実行履歴記録装置10と、サーバ
90とを備えている。なお、ここでは実行履歴記録装置
10とサーバ90とを備えるシステムとして構成した
が、一つのコンピュータシステムとしても実現できる。
すなわち、実行履歴記録装置10とサーバ90の機能を
共に備えるシステムとして実現してもよい。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is an explanatory diagram showing a schematic configuration of the execution history recording system of the present embodiment. The execution history recording system includes an execution history recording device 10 and a server 90. It should be noted that although the system is configured here to include the execution history recording device 10 and the server 90, it may be implemented as a single computer system.
That is, it may be realized as a system having both the functions of the execution history recording device 10 and the server 90.

【0025】実行履歴記録装置10は、装置本体11、
表示手段としてのモニタ12、及び、入力手段としての
キーボード13を備える、いわゆるコンピュータシステ
ムである。一方、サーバ90も、コンピュータシステム
であり、装置本体91、表示手段としてのモニタ92を
備えている。
The execution history recording device 10 includes an apparatus main body 11,
This is a so-called computer system including a monitor 12 as display means and a keyboard 13 as input means. On the other hand, the server 90 is also a computer system, and includes a device body 91 and a monitor 92 as a display unit.

【0026】装置本体91には大容量のハードディスク
装置80が接続されており、このハードディスク装置8
0には、ソースプログラム81、検査スクリプト82、
及びスタブ83が記録されている。ソースプログラム8
1及び検査スクリプト82は、利用者によって作成され
て記憶される。スタブ83は、検査に先だってサーバ9
0によって自動作成される。実行履歴記録装置10は、
上述した3つの情報をサーバ90から読み込み、これら
3つの情報に基づいて実行履歴を記録する。
A large-capacity hard disk device 80 is connected to the device main body 91.
0 is a source program 81, an inspection script 82,
And the stub 83 is recorded. Source program 8
1 and the inspection script 82 are created and stored by the user. The stub 83 is installed on the server 9 before the inspection.
It is automatically created by 0. The execution history recording device 10
The above three pieces of information are read from the server 90, and the execution history is recorded based on these three pieces of information.

【0027】ソースプログラム81は、部品単位あるい
は機能単位に作成される部品プログラムによって構成さ
れ、複数のファイルからなっている。検査スクリプト8
2は、検査情報を記述したものであり、テキストファイ
ルとして作成されている。この検査スクリプト82は、
検査対象毎に作成される。
The source program 81 is composed of a component program created for each component or for each function, and is composed of a plurality of files. Inspection script 8
Reference numeral 2 describes the inspection information and is created as a text file. This inspection script 82 is
Created for each inspection target.

【0028】具体的に検査スクリプト82には、検査開
始関数の名称、当該検査開始関数をコール元である親関
数の名称がセットになって記述される。これによって、
特定の親関数からコールされた場合の検査開始関数以下
の関数が検査対象として指定される。また、検査スクリ
プト82には、変数設定記述がなされる。すなわち、検
査対象とする変数の名称、及び、変数への入力データが
記述される。さらに、入力データに対応する解である出
力データが予め記述される。
Specifically, in the inspection script 82, the name of the inspection start function and the name of the parent function that calls the inspection start function are described as a set. by this,
Check start function when called from a specific parent function The following functions are specified as the check target. Further, the inspection script 82 has a variable setting description. That is, the name of the variable to be inspected and the input data to the variable are described. Furthermore, output data that is a solution corresponding to the input data is described in advance.

【0029】スタブ83は、検査開始関数以下の関数か
らコールされるダミーの関数群である。このスタブ83
は、上述したようにサーバ90により自動作成される。
そして、本実施例では、このサーバ90によるスタブ8
3の作成に特徴を有する。
The stub 83 is a dummy function group that is called from a function below the inspection start function. This stub 83
Are automatically created by the server 90 as described above.
In this embodiment, the stub 8 by the server 90 is used.
It has a feature in the creation of 3.

【0030】そこで以下では、サーバ90によるスタブ
83の作成について、詳細に説明する。図2は、サーバ
90の機能ブロック図である。サーバ90は、スタブ化
対象ファイル、環境ファイル、検査開始情報を読み込
み、スタブファイル及び結果ログを出力する。ここで出
力されるスタブファイルが、図1に示したスタブ83に
相当する。
Therefore, the creation of the stub 83 by the server 90 will be described in detail below. FIG. 2 is a functional block diagram of the server 90. The server 90 reads a stub object file, an environment file, and inspection start information, and outputs a stub file and a result log. The stub file output here corresponds to the stub 83 shown in FIG.

【0031】スタブ化対象ファイルは、ソースプログラ
ム81とは別に用意される分野外プログラムであり、上
述したPFなどを含む。ここにある技術思想は、開発中
のソースプログラム81に対し、少なくとも関数コール
の面で整合性の確認された分野外プログラムが存在する
ことを前提とし、この分野外プログラムを用いてスタブ
関数を作成するというものである。なお、スタブ化対象
ファイルは、C言語で記述されているものとして以下の
説明を続ける。
The stubbing target file is a program outside the field prepared separately from the source program 81 and includes the above-mentioned PF and the like. The technical idea here is that a stub function is created using this out-of-field program, assuming that there is an out-of-field program whose consistency is confirmed at least in terms of function calls with respect to the source program 81 under development. Is to do. The following description will be continued assuming that the stubbing target file is described in C language.

【0032】環境ファイルは、図3(a)に示すよう
に、ユーザによって別名で定義された関数型を認識する
ための情報が記述される。ここでいう関数型の認識は、
作成すべきスタブ関数に戻り値があるか否かの認識であ
る。したがって、環境ファイルには、戻り値のない、つ
まりvoid型と同値の関数型を記述しておく。図3
(a)には、「NOTmodori」、「VIOD」、
「HANDLER」という型名がvoid型の別名とし
て示されている。
In the environment file, as shown in FIG. 3A, information for recognizing the function type defined by the user by an alias is described. The functional recognition here is
It is the recognition whether the stub function to be created has a return value. Therefore, the return type, that is, the function type having the same value as the void type is described in the environment file. Figure 3
In (a), "NOTmodori", "VIOD",
The type name "HANDLER" is shown as an alias for the void type.

【0033】検査開始関数情報は、図1に示した検査ス
クリプト82から、作業者によってあるいは自動的に作
成される。検査開始関数情報としては、図3(b)に示
すように、検査開始関数のコール元である定義関数の名
称と、検査開始関数の名称及び引数が記述される。この
ような検査開始関数情報が必要となるのは、スタブ関数
から検査開始関数がコールされることがあるためであ
る。例えば、図16(b)に示すように、PFにあるス
タブ関数Cからコールされる関数Aが検査開始関数とな
るという具合である。
The inspection start function information is created by the operator or automatically from the inspection script 82 shown in FIG. As the inspection start function information, as shown in FIG. 3B, the name of the definition function that is the caller of the inspection start function, the name of the inspection start function, and the argument are described. Such inspection start function information is necessary because the inspection start function may be called from the stub function. For example, as shown in FIG. 16B, the function A called from the stub function C in the PF is the check start function.

【0034】サーバ90の機能は、図2に示すように、
非削除部分認識ブロック101、関数認識ブロック10
2、プリプロセッサ命令認識ブロック103、型認識ブ
ロック104、不要部削除ブロック105、宣言・リタ
ーン追加ブロック106、及び、検査開始関数作成ブロ
ック107で示すことができる。
The function of the server 90 is as shown in FIG.
Non-Deleted Part Recognition Block 101, Function Recognition Block 10
2, a preprocessor instruction recognition block 103, a type recognition block 104, an unnecessary portion deletion block 105, a declaration / return addition block 106, and a check start function creation block 107.

【0035】非削除部分認識ブロック101は、スタブ
化対象ファイル記述の非削除部分を認識する。非削除部
分はコンパイル・リンクに必要となる部分であり、非削
除部分には、プリプロセッサ命令、外部変数の宣言、関
数のプロトタイプ宣言、及び継続コード「¥」などが含
まれる。また、コンパイル・リンクに直接必要でないコ
メント文も、可読性向上のため非削除部分として取り扱
う。
The non-deleted portion recognition block 101 recognizes the non-deleted portion of the stubbing target file description. The non-deleted part is a part required for compile and link, and the non-deleted part includes a preprocessor instruction, an external variable declaration, a function prototype declaration, a continuation code "\", and the like. In addition, comment sentences that are not directly required for compiling and linking are also treated as non-deleted parts to improve readability.

【0036】関数認識ブロック102は、関数の実行行
の削除を行うための関数の認識を行う。ここでは、スタ
ブ化対象ファイルにある「シンボル(){」という記述
形式を検索し、小括弧「(」の直前のシンボルを関数名
と認識する。そして、「シンボル(){」から中括
弧「}」までを関数の範囲とする。
The function recognition block 102 recognizes a function for deleting the execution line of the function. Here, the description form "symbol () {" in the file to be stubbed is searched, and the symbol immediately before the parenthesis "(" is recognized as the function name. }] Is the range of the function.

【0037】プリプロセッサ命令認識ブロック103
は、プリプロセッサ命令を認識して関数範囲を補正す
る。上述したように関数認識ブロック102は「シンボ
ル(){」の記述を関数として認識するのであるが、プ
リプロセッサ命令により、シンボルがない場合でも、関
数範囲となる部分が存在する。したがって、プリプロセ
ッサ命令を認識することにより、条件コンパイルによっ
て選択的にコンパイルされる関数記述の全てを関数範囲
として認識する。
Preprocessor instruction recognition block 103
Recognizes a preprocessor instruction and corrects the function range. As described above, the function recognition block 102 recognizes the description of "symbol () {" as a function. However, even if there is no symbol, there is a part that is in the function range due to the preprocessor instruction. Therefore, by recognizing the preprocessor instruction, all the function descriptions selectively compiled by the conditional compilation are recognized as the function range.

【0038】型認識ブロック104は、関数の型を認識
する。通常は、シンボルの前に記述されるものが関数の
型である。ただし、ユーザによって別名で定義されるこ
とがあるため、上述した環境ファイルを参照して、戻り
値があるか否かを判断する。戻り値がある場合とない場
合とで、スタブの処理が異なるためである。
The type recognition block 104 recognizes the type of the function. Usually, what is written before a symbol is the function type. However, since it may be defined by another name by the user, it is determined whether or not there is a return value by referring to the environment file described above. This is because the stub processing differs depending on whether there is a return value or not.

【0039】不要部削除ブロック105は、関数認識ブ
ロック102及びプリプロセッサ命令認識ブロック10
3にて認識された関数範囲を基に、関数の実行行、すな
わち実質的な処理記述を削除する。関数の実行行にはロ
ーカル変数の宣言文やリターン命令などが含まれる。
The unnecessary portion deletion block 105 includes a function recognition block 102 and a preprocessor instruction recognition block 10.
Based on the function range recognized in 3, the execution line of the function, that is, the substantial processing description is deleted. The execution line of the function includes declaration statements of local variables and return instructions.

【0040】宣言・リターン追加ブロック106は、型
認識ブロック104にて戻り値があると判断された関数
について、戻り値のための変数を宣言し、リターン命令
を追加する。戻り値のための変数宣言は、各関数型で宣
言する。検査開始関数作成ブロック107は、上述した
検査開始関数情報に基づき、スタブ関数からコールされ
る関数が検査開始関数である場合、関数コールのための
引数宣言とコール命令とを追加する。
The declaration / return addition block 106 declares a variable for the return value for the function judged to have a return value by the type recognition block 104, and adds a return instruction. The variable declaration for the return value is declared in each function type. The check start function creation block 107 adds an argument declaration and a call instruction for the function call when the function called from the stub function is the check start function, based on the check start function information described above.

【0041】ここでスタブ化対象ファイルの記述を例示
して、上述した各ブロック101〜107の機能を具体
的に説明する。 (記述例1)図4には、スタブ化対象ファイルの一例と
して、file1.cの記述を示した。なお、左端の数
値は説明上便宜的に割り振ったものであり、以降の図面
でも同様である。
Here, the function of each of the blocks 101 to 107 described above will be specifically described by exemplifying the description of the stubbing target file. (Description example 1) In FIG. 4, file1. The description of c is shown. Note that the numerical values at the left end are assigned for convenience of explanation, and the same applies to the subsequent drawings.

【0042】まず非削除部分認識ブロック101は、こ
のようなスタブ化対象ファイルを読み込んで、非削除部
分を認識する。実際に認識される非削除部分を、図5に
下線を施して示した。これらは、コンパイル・リンクに
必要な記述であるため、最初に非削除部分として認識さ
れる。
First, the non-deleted part recognition block 101 reads such a stubbing target file and recognizes the non-deleted part. The non-deleted portion that is actually recognized is shown by underlining in FIG. Since these are descriptions required for compiling and linking, they are first recognized as non-deleted parts.

【0043】そして次に、関数認識ブロック102及び
プリプロセッサ命令認識ブロック103によって、関数
の範囲が認識される。図6に下線を引いて示す如くであ
る。5,9,13行にあるプリプロセッサ命令によっ
て、関数f1に対しては、実行行1と実行行2とが選択
的にコンパイルされる。したがってここでは、プリプロ
セッサ命令認識ブロック103によって、関数f1の範
囲が12行までであると認識される。関数f2の範囲は
14〜17行、関数f3の範囲は18〜21行、関数f
4の範囲は22〜25行として、それぞれ認識される。
Then, the function recognition block 102 and the preprocessor instruction recognition block 103 recognize the range of the function. This is as shown by underlining in FIG. Execution line 1 and execution line 2 are selectively compiled for the function f1 by the preprocessor instructions in lines 5, 9, and 13. Therefore, here, the preprocessor instruction recognition block 103 recognizes that the range of the function f1 is up to 12 lines. The range of the function f2 is 14 to 17 lines, the range of the function f3 is 18 to 21 lines, and the function f
The range of 4 is recognized as 22 to 25 lines.

【0044】また、型認識ブロック104にて、各関数
f1〜f4の型が認識される。関数f1については「i
nt」型として、関数f2については「char」型と
して、関数f3については「NOTmodori」型と
して、関数f4については「void」型として認識さ
れる。そして、環境ファイル(図3(a)参照)を参照
することにより、関数f3の型「NOTmodori」
は、void型と同値の戻り値のないものであると判断
される。
The type recognition block 104 recognizes the types of the functions f1 to f4. For the function f1, "i
As the "nt" type, the function f2 is recognized as the "char" type, the function f3 is recognized as the "NOTmodori" type, and the function f4 is recognized as the "void" type. Then, by referring to the environment file (see FIG. 3A), the type “NOTmodori” of the function f3
Is judged to have no return value equivalent to the void type.

【0045】次に、不要部削除ブロック105が、不要
部分を削除する。このとき削除される不要部を、図7中
に下線を施して示した。ここでは、実行行1(7行)、
実行行2(11行)、実行行3(16行)、実行行4
(20行)、及び、実行行5(24行)が不要部分とし
て削除される。
Next, the unnecessary portion deletion block 105 deletes the unnecessary portion. The unnecessary portion deleted at this time is shown by underlining in FIG. 7. Here, execution line 1 (7 lines),
Execution line 2 (11 lines), execution line 3 (16 lines), execution line 4
(20 lines) and execution line 5 (24 lines) are deleted as unnecessary parts.

【0046】そして、宣言・リターン追加ブロック10
6が、戻り値のある関数f1,f2に対し、戻り値のた
めの変数宣言と、リターン命令とを追加する。図8に下
線を施して示す如くである。図8では、関数f1(4
行)の直前のn1行で、戻り値のための変数「f1_r
et」をint型で宣言し、7行に、リターン命令「r
eturn f1_ret;」を追加している。また、
関数f2(14行)の直前のn2行で、戻り値のための
変数「f2_ret」をchar型で宣言し、16行に
リターン命令「return f2_ret;」を追加
している。
Declaration / return addition block 10
6 adds a variable declaration for a return value and a return instruction to the functions f1 and f2 having a return value. This is as shown by underlining in FIG. In FIG. 8, the function f1 (4
In the n1 line immediately before the line), the variable "f1_r" for the return value
"et" is declared as an int type, and the return instruction "r
"turn f1_ret;" is added. Also,
In the n2 line immediately before the function f2 (14th line), the variable “f2_ret” for the return value is declared in the char type, and the return instruction “return f2_ret;” is added to the 16th line.

【0047】そしてさらに、図3(b)に示す検査開始
関数情報によれば、定義関数f3からコールされる関数
call_func1が検査開始関数となっているた
め、検査開始関数作成ブロック107によって、関数コ
ールのための引数宣言とコール命令とが追加される。図
9に下線を施して示す如くである。図9では、20行に
引数宣言が追加され、n3行で関数call_func
1がコールされている。
Further, according to the inspection start function information shown in FIG. 3B, since the function call_func1 called from the definition function f3 is the inspection start function, the inspection start function creation block 107 calls the function call. Argument declarations and call instructions for are added. This is as shown by underlining in FIG. In FIG. 9, the argument declaration is added to the 20th line, and the function call_func is added to the n3th line.
1 is being called.

【0048】(記述例2)次に、マクロ定義された関数
記述を例に挙げて説明する。図10には、マクロ定義さ
れた関数を含むスタブ化対象ファイルの一例として、f
ile2.cの記述を示した。
(Description Example 2) Next, a description of a macro-defined function will be described as an example. In FIG. 10, as an example of the stubbing target file including the macro-defined function, f
ile2. The description of c is shown.

【0049】まず非削除部分認識ブロック101は、こ
のようなスタブ化対象ファイルを読み込んで、非削除部
分を認識する。実際に認識される非削除部分を、図11
に下線を施して示した。これらは、コンパイル・リンク
に必要な記述であるため、最初に非削除部分として認識
される。また、ここでは、可読性向上のために、コメン
ト文が非削除部分として認識されている(5,6行)。
First, the non-deleted portion recognition block 101 reads such a stubbing target file and recognizes the non-deleted portion. The non-deleted part that is actually recognized is shown in FIG.
Is underlined. Since these are descriptions required for compiling and linking, they are first recognized as non-deleted parts. Further, here, in order to improve readability, the comment sentence is recognized as a non-deleted portion (lines 5 and 6).

【0050】そして次に、関数認識ブロック102及び
プリプロセッサ命令認識ブロック103によって、関数
の範囲が認識される。図12に下線を施して示す如くで
ある。ここでは特に、マクロ定義を含めて関数範囲を認
識する。そして、2〜10行のマクロ定義を用い、1
5,16行の関数が認識される。具体的に、関数「MA
CRO(1)」は関数「func_C1」として、関数
「MACRO(2)」は関数「func_C2」とし
て、それぞれ認識される。
Then, the function recognition block 102 and the preprocessor instruction recognition block 103 recognize the range of the function. This is as shown by underlining in FIG. Here, in particular, the function range is recognized including the macro definition. Then, using the macro definition of lines 2-10, 1
Functions in lines 5 and 16 are recognized. Specifically, the function "MA
CRO (1) "is recognized as a function" func_C1 ", and function" MACRO (2) "is recognized as a function" func_C2 ".

【0051】また、型認識ブロック104にて、各関数
f1,func_C1,func_C2の型が認識され
る。関数f1については「int」型として、関数fu
nc_C1,func_C2については「long」型
として認識される。次に、不要部削除ブロック105
が、不要部分を削除する。このとき削除される不要部
を、図13中に下線を施して示した。ここでは、「in
t i;」(5行)、実行行1(7行)、「retur
n 0;」(8行)、及び、実行行2(13行)が不要
部分として削除される。
The type recognition block 104 recognizes the types of the functions f1, func_C1, func_C2. The function f1 is of type “int” and the function fu
nc_C1 and func_C2 are recognized as "long" type. Next, the unnecessary portion deletion block 105
However, delete unnecessary parts. The unnecessary portion deleted at this time is shown by underlining in FIG. Here, "in
t i; "(line 5), execution line 1 (line 7)," retur
n 0; ”(line 8) and execution line 2 (line 13) are deleted as unnecessary parts.

【0052】そして、宣言・リターン追加ブロック10
6が、戻り値のある関数f1,func_C1,fun
c_C2に対し、戻り値のための変数宣言と、リターン
命令とを追加する。図14に下線を施して示す如くであ
る。図14では、マクロ定義中のn1行に、マクロ定義
に合わせたリターン命令を追加している。これに対応し
て、マクロ関数(15,16行)の直前のn3,n4行
で、戻り値のための変数「func_C1_ret」及
び「func_C2_ret」をlong型で宣言して
いる。また、関数f1(11行)の直前のn2行で、戻
り値のための変数「f1_ret」をint型で宣言
し、13行にリターン命令「returnf1_re
t;」を追加している。
Declaration / return addition block 10
6 is a function f1, func_C1, fun with a return value
A variable declaration for a return value and a return instruction are added to c_C2. This is as shown by underlining in FIG. In FIG. 14, a return instruction matching the macro definition is added to the n1 line in the macro definition. Correspondingly, the variables "func_C1_ret" and "func_C2_ret" for the return value are declared in the long type in the lines n3 and n4 immediately before the macro function (lines 15 and 16). Also, in the n2 line immediately before the function f1 (line 11), the variable “f1_ret” for the return value is declared in the int type, and the return instruction “returnf1_re” is written in the 13th line.
"t;" is added.

【0053】次に、本実施例のサーバ90の発揮する効
果を説明する。本実施例では、サーバ90において、ソ
ースプログラム81で必要となる関数記述がなされた分
野外プログラムをスタブ化対象ファイルとして読み込
み、非削除部分認識ブロック101がコンパイル・リン
クに必要な非削除部分を認識する。次に、関数認識ブロ
ック102及びプリプロセッサ命令認識ブロック103
により、プリプロセッサ命令が記述されている場合を含
めて関数の記述範囲が認識され、これにより、関数内の
実行行など実質的な処理記述が、不要部削除ブロック1
05によって削除される。また、型認識ブロック104
が、関数の型を認識して戻り値の有無を判断し、宣言・
リターン追加ブロック106により、戻り値のための変
数宣言及びリターン命令が追加される。
Next, the effect of the server 90 of this embodiment will be described. In the present embodiment, in the server 90, a program outside the field in which the function description required by the source program 81 is written is read as a file to be stubbed, and the non-deleted part recognition block 101 recognizes the non-deleted part necessary for compile / link. To do. Next, the function recognition block 102 and the preprocessor instruction recognition block 103
By this, the description range of the function is recognized, including the case where the preprocessor instruction is described, so that the substantial processing description such as the execution line in the function is deleted by the unnecessary part deletion block 1
Deleted by 05. Also, the type recognition block 104
Recognizes the function type, determines whether there is a return value, and
The add return block 106 adds variable declarations and return instructions for the return value.

【0054】つまり、特に車両制御に係るソフトウェア
の開発過程にあっては、再利用という側面から、ソース
プログラム81で必要となる関数記述がなされた分野外
プログラムが存在することが多い。したがって、ソース
プログラム81の関数コール部分に変更がなければ、分
野外プログラムをスタブ化対象ファイルとして用い、主
として関数内の実行行を削除することにより、スタブ関
数を作成する。
That is, particularly in the process of developing software related to vehicle control, there are many out-of-field programs in which the function description necessary for the source program 81 is described from the viewpoint of reuse. Therefore, if there is no change in the function call part of the source program 81, the stub function is created by using the program outside the field as the file to be stubbed and mainly deleting the execution line in the function.

【0055】その結果、ソースプログラム81に対し、
整合性という面において信頼性の高いスタブ関数を作成
することができる。このとき、非削除部分認識ブロック
101が、スタブ化対象プログラムのコンパイル・リン
クに必要な部分を非削除部分として認識するため(図
5,11参照)、スタブ作成の自動化に寄与する。さら
に、コメント文についても非削除部分として取り扱うた
め、作成されたスタブファイルの可読性が向上する。
As a result, for the source program 81,
It is possible to create a stub function that is highly reliable in terms of consistency. At this time, the non-deleted part recognition block 101 recognizes a part necessary for compiling and linking the program to be stubbed as a non-deleted part (see FIGS. 5 and 11), which contributes to automation of stub creation. Furthermore, since the comment text is also treated as a non-deleted portion, the readability of the created stub file is improved.

【0056】また、関数認識ブロック102が関数の記
述範囲を認識するため、関数内の実質的な処理記述だけ
を確実に削除できる。さらに、プリプロセッサ命令認識
ブロック103が、プリプロセッサ命令を認識して、関
数の記述範囲を認識するようにした(図6参照)。これ
によって、ソースプログラム81の条件コンパイルに対
応したスタブファイルを作成できる。またここで、関数
がマクロ定義されている場合には、当該マクロ定義部分
を含めて、関数の記述範囲を認識する(図12参照)。
これによって、マクロ定義された関数からも、自動的に
スタブファイルを作成できる。
Further, since the function recognition block 102 recognizes the function description range, it is possible to surely delete only the substantial process description in the function. Further, the preprocessor instruction recognition block 103 recognizes the preprocessor instruction and recognizes the description range of the function (see FIG. 6). This makes it possible to create a stub file corresponding to the conditional compilation of the source program 81. If the function is defined as a macro, the description range of the function is recognized, including the macro definition part (see FIG. 12).
This allows you to automatically create a stub file from a macro-defined function.

【0057】さらにまた、型認識ブロック104が関数
の型を認識し、戻り値の有無を判断する。このとき、別
名で定義された関数型を示す環境ファイルを参照するよ
うにしたため、関数の型が別名で定義されていても、戻
り値があるか否かを判断できる。また、戻り値のない関
数の型を環境ファイルに記述するため、環境ファイルの
情報量が削減される。
Furthermore, the type recognition block 104 recognizes the type of the function and determines whether or not there is a return value. At this time, since the environment file indicating the function type defined by the alias is referred to, even if the function type is defined by the alias, it is possible to determine whether or not there is a return value. Moreover, since the type of a function that does not have a return value is described in the environment file, the amount of information in the environment file is reduced.

【0058】そして、宣言・リターン追加ブロック10
6は、型認識ブロック104の判断に基づき、戻り値の
ための変数宣言及びリターン命令を追加する(図8参
照)。これにより、さらに、スタブ関数の自動作成が促
進される。そして、関数がマクロ定義されている場合に
は、当該マクロ定義を用いて、変数宣言及びリターン命
令を追加する(図14参照)。したがって、マクロ定義
された関数のそれぞれに対しても、自動的に戻り値を定
義することができる。
Declaration / return addition block 10
6 adds a variable declaration for the return value and a return instruction based on the judgment of the type recognition block 104 (see FIG. 8). This further facilitates the automatic creation of stub functions. Then, when the function is macro-defined, a variable declaration and a return instruction are added using the macro definition (see FIG. 14). Therefore, a return value can be automatically defined for each macro-defined function.

【0059】また、本実施例では、検査スクリプト82
から作成された検査開始情報を取得するようにした。こ
の検査開始情報には、検査開始の関数及び当該検査開始
関数のコール元が示される。そして、検査開始関数作成
ブロック107は、スタブ関数がコール元である場合に
は、当該検査開始関数への引数宣言及びコール命令を追
加して、スタブ関数を作成する(図9参照)。これによ
って、スタブ関数からの検査開始まで自動化できる。
Further, in the present embodiment, the inspection script 82
The inspection start information created from was acquired. The inspection start information indicates the inspection start function and the caller of the inspection start function. Then, when the stub function is the caller, the check start function creation block 107 adds an argument declaration and a call instruction to the check start function to create a stub function (see FIG. 9). This makes it possible to automate the inspection from the stub function.

【0060】なお、本実施例におけるサーバ90の機能
を示す各ブロック101〜107が「スタブ作成手段」
に相当し、さらに、非削除部分認識ブロック101は
「ソース取得手段」に相当する。以上本発明はこのよう
な実施形態に何等限定されるものではなく、本発明の主
旨を逸脱しない範囲において種々なる形態で実施し得る
ことは言うまでもない。
The blocks 101 to 107 showing the function of the server 90 in this embodiment are "stub creating means".
Further, the non-deleted part recognition block 101 corresponds to “source acquisition means”. It is needless to say that the present invention is not limited to such an embodiment, and can be implemented in various forms without departing from the spirit of the present invention.

【図面の簡単な説明】[Brief description of drawings]

【図1】実施例の実行履歴記録システムの構成を示す説
明図である。
FIG. 1 is an explanatory diagram showing a configuration of an execution history recording system according to an embodiment.

【図2】サーバの機能を示す機能ブロック図である。FIG. 2 is a functional block diagram showing functions of a server.

【図3】(a)は環境ファイルを例示する説明図であ
り、(b)は検査開始関数情報を例示する説明図であ
る。
FIG. 3A is an explanatory diagram illustrating an environment file, and FIG. 3B is an explanatory diagram illustrating inspection start function information.

【図4】スタブ化対象ファイルを示す説明図である。FIG. 4 is an explanatory diagram showing a stubbing target file.

【図5】スタブ化対象ファイルの非削除部分を示す説明
図である。
FIG. 5 is an explanatory diagram showing a non-deleted portion of a stubbing target file.

【図6】スタブ化対象ファイルの関数範囲を示す説明図
である。
FIG. 6 is an explanatory diagram showing a function range of a stubbing target file.

【図7】スタブ化対象ファイルの不要部分を示す説明図
である。
FIG. 7 is an explanatory diagram showing unnecessary portions of a stubbing target file.

【図8】スタブ化対象ファイルに対するリターン命令の
追加を示す説明図である。
FIG. 8 is an explanatory diagram showing addition of a return instruction to a file to be stubbed.

【図9】検査開始関数へのコール命令の追加を示す説明
図である。
FIG. 9 is an explanatory diagram showing addition of a call instruction to a check start function.

【図10】別のスタブ化対象ファイルを示す説明図であ
る。
FIG. 10 is an explanatory diagram showing another file to be stubbed.

【図11】別のスタブ化対象ファイルの非削除部分を示す
説明図である。
FIG. 11 is an explanatory diagram showing a non-deleted portion of another stubbing target file.

【図12】別のスタブ化対象ファイルの関数範囲を示す説
明図である。
FIG. 12 is an explanatory diagram showing a function range of another stubbing target file.

【図13】別のスタブ化対象ファイルの不要部分を示す説
明図である。
FIG. 13 is an explanatory diagram showing an unnecessary portion of another stubbing target file.

【図14】別のスタブ化対象ファイルに対するリターン命
令の追加を示す説明図である。
FIG. 14 is an explanatory diagram showing addition of a return instruction to another stubbing target file.

【図15】結合検査の手法を示す説明図である。FIG. 15 is an explanatory diagram showing a method of joint inspection.

【図16】スタブ関数のコールを示す説明図である。FIG. 16 is an explanatory diagram showing a stub function call.

【符号の説明】[Explanation of symbols]

10…実行履歴記録装置 11…装置本体 12…モニタ 13…キーボード 41…ドライバ 80…ハードディスク装置 81…ソースプログラム 81a…検査対象 82…検査スクリプト 83…スタブ 90…サーバ 91…装置本体 92…モニタ 101…非削除部分認識ブロック 102…関数認識ブロック 103…プリプロセッサ命令認識ブロック 104…型認識ブロック 105…不要部削除ブロック 106…宣言・リターン追加ブロック 107…検査開始関数作成ブロック 210…ドライバ 220…検査対象 10 ... Execution history recording device 11 ... Device body 12 ... Monitor 13 ... Keyboard 41 ... driver 80 ... Hard disk device 81 ... Source program 81a ... inspection target 82 ... Inspection script 83 ... Stub 90 ... server 91 ... Device main body 92 ... Monitor 101 ... Non-deleted part recognition block 102 ... Function recognition block 103 ... Preprocessor instruction recognition block 104 ... Type recognition block 105 ... Unnecessary part deletion block 106 ... Declaration / return additional block 107 ... Inspection start function creation block 210 ... driver 220 ... Inspection target

Claims (12)

【特許請求の範囲】[Claims] 【請求項1】単位機能毎に細分化された処理プログラム
を実行し、検査情報が記述された検査スクリプトに基づ
いて処理実行の履歴を記録するにあたり、前記処理プロ
グラムの実行に必要となるスタブ関数を作成するスタブ
作成装置であって、 前記処理プログラムからコールされる関数を含むスタブ
化対象プログラムのソース記述を取得するソース取得手
段と、 前記取得されたソース記述に基づき、実質的な処理記述
を削除して前記スタブ関数を作成するスタブ作成手段と
を備えていることを特徴とするスタブ作成装置。
1. A stub function required to execute the processing program when executing a processing program subdivided for each unit function and recording a history of processing execution based on an inspection script in which inspection information is described. A source acquisition means for acquiring a source description of a stubbing target program including a function called from the processing program, and a substantial processing description based on the acquired source description. And a stub creating means for creating the stub function by deleting the stub function.
【請求項2】請求項1に記載のスタブ作成装置におい
て、 前記スタブ作成手段は、前記スタブ化対象プログラムの
コンパイル・リンクに必要な部分を非削除部分として認
識することにより、前記実質的な処理記述を削除するこ
とを特徴とするスタブ作成装置。
2. The stub creation device according to claim 1, wherein the stub creation means recognizes a portion necessary for compiling and linking the program to be stubbed as a non-deleted portion, thereby performing the substantial processing. A stub creation device characterized by deleting a description.
【請求項3】請求項2に記載のスタブ作成装置におい
て、 前記非削除部分には、コンパイル・リンクに関係しない
コメント文も含まれることを特徴とするスタブ作成装
置。
3. The stub creation device according to claim 2, wherein the non-deleted portion also includes a comment statement not related to compile / link.
【請求項4】請求項1〜3のいずれかに記載のスタブ作
成装置において、 前記スタブ作成手段は、前記関数の記述範囲を認識する
ことにより、前記実質的な処理記述を削除することを特
徴とするスタブ作成装置。
4. The stub creating device according to claim 1, wherein the stub creating unit deletes the substantial process description by recognizing a description range of the function. A stub making device.
【請求項5】請求項4に記載のスタブ作成装置におい
て、 前記スタブ作成手段は、プリプロセッサ命令を認識する
ことにより、前記関数の記述範囲を認識することを特徴
とするスタブ作成装置。
5. The stub creation device according to claim 4, wherein the stub creation means recognizes a description range of the function by recognizing a preprocessor instruction.
【請求項6】請求項4又は5に記載のスタブ作成装置に
おいて、 前記スタブ作成手段は、前記関数がマクロ定義されてい
る場合に、当該マクロ定義部分を含めて、前記関数の記
述範囲を認識することを特徴とするスタブ作成装置。
6. The stub creation device according to claim 4 or 5, wherein the stub creation means, when the function is macro-defined, recognizes the description range of the function including the macro definition part. A stub creation device characterized by:
【請求項7】請求項1〜6のいずれかに記載のスタブ作
成装置において、 前記スタブ作成手段は、関数記述に基づき、当該関数の
型を認識し、戻り値があるか否かを判断して、戻り値が
ある場合には、戻り値のための変数宣言及びリターン命
令を追加することにより、前記スタブ関数を作成するこ
とを特徴とするスタブ作成装置。
7. The stub creation device according to claim 1, wherein the stub creation means recognizes the type of the function based on the function description and determines whether or not there is a return value. Then, when there is a return value, the stub creating apparatus is characterized in that the stub function is created by adding a variable declaration and a return instruction for the return value.
【請求項8】請求項7に記載のスタブ作成装置におい
て、 前記スタブ作成手段は、前記関数がマクロ定義されてい
る場合には、当該マクロ定義を用いて、前記変数宣言及
びリターン命令を追加することを特徴とするスタブ作成
装置。
8. The stub creation device according to claim 7, wherein the stub creation means adds the variable declaration and the return instruction by using the macro definition when the function is macro defined. A stub creation device characterized in that
【請求項9】請求項7又は8に記載のスタブ作成装置に
おいて、 前記スタブ作成手段は、前記関数の型が別名で定義され
ていることを示す定義情報を用いて、前記関数に戻り値
があるか否かを判断可能であることを特徴とするスタブ
作成装置。
9. The stub creating device according to claim 7, wherein the stub creating means uses definition information indicating that the type of the function is defined by an alias, and the return value is returned to the function. A stub creation device characterized by being able to determine whether or not there is.
【請求項10】請求項9に記載のスタブ作成装置におい
て、 前記定義情報は、戻り値のない関数の型が記述されたも
のであることを特徴とするスタブ作成装置。
10. The stub creation device according to claim 9, wherein the definition information describes a type of a function having no return value.
【請求項11】請求項1〜10のいずれかに記載のスタ
ブ作成装置において、 前記スタブ作成手段は、前記検査スクリプトに基づいて
作成される検査開始の関数及び当該検査開始関数のコー
ル元を示す検査開始関数情報を用い、前記スタブ関数が
前記コール元である場合には、当該検査開始関数への引
数宣言及びコール命令を追加して、前記スタブ関数を作
成することを特徴とするスタブ作成装置。
11. The stub creation device according to claim 1, wherein the stub creation means indicates a test start function created based on the test script and a caller of the test start function. A stub creation device that uses the inspection start function information and, when the stub function is the caller, adds an argument declaration and a call instruction to the inspection start function to create the stub function. .
【請求項12】請求項1〜11のいずれかに記載のスタ
ブ作成装置の各手段としてコンピュータを機能させるプ
ログラム。
12. A program for causing a computer to function as each unit of the stub creating apparatus according to claim 1.
JP2002095746A 2002-03-29 2002-03-29 Stub forming device and program Pending JP2003296139A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002095746A JP2003296139A (en) 2002-03-29 2002-03-29 Stub forming device and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002095746A JP2003296139A (en) 2002-03-29 2002-03-29 Stub forming device and program

Publications (1)

Publication Number Publication Date
JP2003296139A true JP2003296139A (en) 2003-10-17

Family

ID=29387295

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002095746A Pending JP2003296139A (en) 2002-03-29 2002-03-29 Stub forming device and program

Country Status (1)

Country Link
JP (1) JP2003296139A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016018253A (en) * 2014-07-04 2016-02-01 富士通株式会社 Software change program, software change device, and software change method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016018253A (en) * 2014-07-04 2016-02-01 富士通株式会社 Software change program, software change device, and software change method

Similar Documents

Publication Publication Date Title
US9274928B1 (en) Verification of computer-executable code generated from a model
US5926638A (en) Program debugging system for debugging a program having graphical user interface
US8316349B2 (en) Deployment script generation and execution
US8943423B2 (en) User interface indicators for changed user interface elements
US8621435B2 (en) Time debugging
US9823902B2 (en) Editing source code
JPH08272648A (en) Method for automatically generating debugging command file and device for automatically regenerating break point in debugging command file
JP2000181725A (en) Method and system for altering executable code and giving addition function
US20070245322A1 (en) System and method for interactive and assisted program development
JP2009169828A (en) Test case creation device and creation program
JPH0748182B2 (en) Program error detection method
Schuts et al. Large‐scale semi‐automated migration of legacy C/C++ test code
JP2003296139A (en) Stub forming device and program
Samara A practical approach for detecting logical error in object oriented environment
JP2021111389A (en) Improvement in parsability of code snippet
JPH10293683A (en) Device for comparatively analyzing program, method therefor and mechanically readable recording medium recording comparative analytic program for program
JP4061931B2 (en) Execution history recording device, break instruction setting device, and program
Alshahwan et al. Observation-based unit test generation at Meta
US20100251213A1 (en) Method for executing debug commands
JP3368795B2 (en) Compilation control method, compilation device, and recording medium
Palakkal et al. Automatic C to Simulink Model Converter (C2M) Tool
JP2003296137A (en) Execution history recording device, label substitution device and program
JPH06250884A (en) Device for supporting module test
CN118113291A (en) Memory security management method and equipment
JPH07200357A (en) Automatic computer program logic test equipment