JP2001043110A - Debugging method for program - Google Patents

Debugging method for program

Info

Publication number
JP2001043110A
JP2001043110A JP11250556A JP25055699A JP2001043110A JP 2001043110 A JP2001043110 A JP 2001043110A JP 11250556 A JP11250556 A JP 11250556A JP 25055699 A JP25055699 A JP 25055699A JP 2001043110 A JP2001043110 A JP 2001043110A
Authority
JP
Japan
Prior art keywords
program
time
input
value
simulator
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
JP11250556A
Other languages
Japanese (ja)
Inventor
Kenji Kobayashi
憲次 小林
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to JP11250556A priority Critical patent/JP2001043110A/en
Publication of JP2001043110A publication Critical patent/JP2001043110A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To reduce man-hour for debugging and to reuse the debugging by comparing time described in a simulation input file with a described programmed value at that time and recording compared result in the simulation output file. SOLUTION: An interface part with a simulator of an interface 1 with the simulator is embedded in a source of an application program. Then, an execution program 'regular. exe' execution file 3 linking the simulator by linking a simulator library 2 is prepared. A simulator input file name of a simulator input file 'SimIn. txt' 4 is applied as an argument of a command line and 'regular. exe' 'SimIn. txt' are executed. The executed result is recorded in a simulation output file 'output. txt' 5 recorded in the simulation output file.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【産業上の利用分野】この発明はデバッグ操作での入力
値や確認データ値を、経過時間と一緒に記述したファイ
ルを作っておき、このファイルを使って、プログラムの
操作と確認をコンピュータに行わせるデバッグ方法に関
する
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention creates a file in which input values and confirmation data values in a debugging operation are described together with elapsed time, and uses this file to operate and confirm a program on a computer. How to debug

【従来の技術】プログラムのデバッグ方法についての標
準的な技法は確立していない。 1.とにかく闇雲に人間が操作して、おかしな動作をす
る部分がないか見てみる。 2.仕様書に従って操作してみて、仕様書と異なる動作
がないかを確認する。 ことが行われてる。より進んだデバッグ方法として、確
認項目の抜けをなくすために 1.状態遷移表を作り、すべての状態遷移についての操
作を行い、異常動作がないことを確認する 2.プログラムの条件分岐が発生する部分すべてについ
てチェック・リストを作り、その条件分岐を発生させる
操作を行って、異常動作がないことを確認する といったことも行われている 本発明に似たものとして「MS−Test」と呼ばれる
マイクロソフト社の製品があった。1999年8月現在
は Rational Rose 社がマイクロソフト
社より権利を購入して「Rational Visua
l Test」の製品名で販売している。このソフトは
マイクロソフト・ウィンドウズのソフトに対して、テス
タが行う作業をコンピュータに行わせるものである。テ
スト作業を自動化するソフトである。これは以下のこと
を行っている。 1.基本となるマイクロソフト・ウィンドウズ用のソフ
トを走らせる。キーボード、マウスの操作を行う。その
操作をファイルに記録しておく。 2.その操作に応答した結果として作られるウィンドウ
ズ画面のビット・マップ・データをファイルに記録して
おく。 3.CPUや実装されるボードが異なるパソコン上でテ
ストするとき、先に記録した操作のファイルに従って、
コンビュータがテストされるプロクラムを操作する。 4.テストされるプロクラムが動作した結果のビット・
マップ画面と、以前に記録してあったビット・マップ画
面をコンビュータに比較させ、違いがないことをコンピ
ュータに確認させる。 5.キーホード、マウスの操作を記録する変わりに、W
indows APIを呼び出すスクリプトを作成する
こともできる。 このようにして、マイクロソフト・ウィンドウズでのプ
ログラム動作チェックを、多くの種類のパソコン自体に
行わせる。「MS−Test」「Rational V
isual Test」はソフトウェアの自動チェック
を行う所は、本発明と同じである。パソコンの種類を変
えてのテストだけではなく、一部を改良したソフトウェ
アのテストにも、これらを使えるだろう。しかし以下の
点で異なっている。 1.入寮変数、出力変数の予定値の時間変化をシミュレ
ーション入力ファイルに、あらかじめ記述しておくこと
がない 2.ループ回数、経過時間とシミュレーション入力ファ
イルを関連付けて、プログラムの動作に反映させること
がない。 3.出力変数の変化の予定値をシミュレーション入力フ
ァイルに記述しておき、予定値と一致するかコンピュー
タに確認 させることもない。「MS−Test」「Ration
al Visual Test」はテスト・エンジニア
のためのソフトである。本発明はプログラマーのための
デバッグ方法である。本発明と「Rational V
isual Test」は似ているけれど、別物であ
る。本発明と比較すべき、プログラムのデバッグ自体の
ために一般的に使われる従来の技術やデバッグ手法は人
手によってソフトウェアを操作し、人間が確認するもの
であった。
2. Description of the Related Art Standard techniques for debugging programs have not been established. 1. Anyway, let's see if there is a part that operates strangely by human beings in the dark cloud. 2. Operate according to the specifications and confirm that there is no operation different from the specifications. Things are going on. As a more advanced debugging method, to eliminate missing check items 1. 1. Create a state transition table, perform operations for all state transitions, and confirm that there is no abnormal operation. A check list is created for all parts of the program where a conditional branch occurs, and an operation for generating the conditional branch is performed to confirm that there is no abnormal operation. There was a Microsoft product called "MS-Test". As of August 1999, Rational Rose purchased rights from Microsoft and said, "Rational Visual
l Test ". This software allows Microsoft Windows software to let the computer do the work that the tester does. This software automates the test work. It does the following: 1. Run the basic Microsoft Windows software. Perform keyboard and mouse operations. Record the operation in a file. 2. The bit map data of the Windows screen created as a result of responding to the operation is recorded in a file. 3. When testing on a personal computer that has a different CPU and board, according to the previously recorded operation file,
The computer operates the program to be tested. 4. The bits resulting from running the program under test
Have the computer compare the map screen with the previously recorded bit map screen and have the computer confirm that there is no difference. 5. Instead of recording the key operation and mouse operation, W
A script that calls the Windows API can also be created. In this way, many types of personal computers themselves can perform program operation checks on Microsoft Windows. “MS-Test” “Rational V”
"Isual Test" is the same as that of the present invention in that the software is automatically checked. You can use them not only for testing different types of personal computers, but also for testing software with some improvements. However, they differ in the following points. 1. There is no need to describe in advance the time change of the expected values of the dormitory variables and output variables in the simulation input file. The number of loops, the elapsed time, and the simulation input file are not associated with each other and reflected in the operation of the program. 3. The expected value of the output variable change is described in the simulation input file, and the computer does not check whether the expected value matches the expected value. “MS-Test” “Ration
al Visual Test "is software for test engineers. The present invention is a debugging method for a programmer. The present invention and "Rational V
“Isual Test” is similar but different. Conventional techniques and debugging techniques generally used for program debugging itself, which should be compared with the present invention, involve manually operating software and confirming it by a human.

【発明が解決しようとする問題点】[デバッグ結果の再
利用ができない]漏れのないプログラム・デバッグのた
めに多くの工数が費やされている。ソフトウェア開発工
数の1−3割がデバッグ工数と思って良いだろう。時に
よっては半分以上がデバッグ工数に取られることもあ
る。プログラムは一部の修正をすることで、何度も再利
用されている。デバッグは結果を記録に残すことができ
るが、再利用することは難しかった。プログラムのバグ
がどのような問題を引き起こすか、どんな動作に影響を
与えるか予測することは極めて難しい。プログラムの一
部を修正するたびに、前に行ったデバッグのための一連
の作業を、再び繰り返しているのが現状である。以前に
行ったデバッグを再利用できないため、膨大なデバッグ
工数を何度も発生させていた。 [デバッグ結果を得るまでに時間がかかる]人間が行う
操作や確認には時間がかかる。コンピュータならば0.
01mSecで行える操作や確認処理でも人間が行うと
1秒程度の時間がかかる。 [専用の装置(ICE)が必要となる]ワンチップ・マ
イコンのソフト開発など、異なったCPUのクロス・ソ
フトウェア開発では、デバッグのためにICE(In
Circuit Emulator)が必要となる。余
分な設備と、コストと手間が必要となる。 [デバッグしようにもバグの再現性がとぼしい。]プロ
グラムの誤動作には多くの要因が関係する。プログラム
のバグが見つかっても、その原因を特定し、対策するた
めには、バグの動作を再現させなければならない。操作
の微妙なタイミングの違いによって動作が異なるなどし
て、バグの再現が難しいことがある。プログラム開発の
最終段階では、このようなバグの対策で悩まされること
が多い。特に一日に一回といっと発生頻度のすくない誤
動作が発生したとき、その再現条件を見つけるのは極端
に難しくなる。 [入力変化が高速なとき、デバッグが難しい]メカ系な
どは数10mSecの速さで動作するものがある。この
ように高速な入力をデバッグのために人間が手動で変化
させて信号を作ることができない。タイミングの変化に
よる誤動作しないことを確認するためには、専用の治具
を作ったりする必要がある。その手間を惜しんで机上デ
バッグだけですます例も多くある。 [デバッグ結果の信頼性が低い]人間が行う操作や確認
にはミスが含まれる。状態遷移表を使って数百、数千の
デバッグのためのチェックを行うとき、操作ミスや確認
抜け、または確認の誤りが発生してくる。膨大なデバッ
グ工数には数%のミスが含まれていた。その信頼性は低
いままであった。 [仕様書をデバッグ・動作確認に直接に使えない]プロ
グラム仕様書を人間が読んでデバッグしていた。コンピ
ュータが直接扱えるファイルとなっているプログラム仕
様書であるにもかかわらず、それを使って、仕様書と実
際のプログラムの動作をコンピュータに比較確認させる
ことは行われてこなかった。 [仕様情報の伝達]プログラムの仕様書は日本語、英語
といった自然言語で記述される。自然言語でプログラム
の動作仕様を伝達している。でも膨大な情報の全てを正
確に伝えることは難しい。自然言語を使った文章表現に
は多義性がある。使用される単語の意味も人によって少
しづづ異なるからだ。母国語を異にするプログラマがソ
フトウェアを開発するとき、この問題がより鮮明に現れ
てくる。 [デバッグ結果の伝達が難しい]デバッグをプログラマ
ーとは別の人間が行い、プログラムのバグを見つけたと
き、その情報を修正するプログラマーに伝えることが難
しかった。デバッグしている人間が、誤動作の現象とそ
の再現条件を完全に把握し、表現することができないか
らだ。ここにも自然言語の限界が有る。
[Problems to be Solved by the Invention] [The debugging result cannot be reused] A lot of man-hours are spent for program debugging without omission. One-thirty percent of software development man-hours can be considered debug man-hours. In some cases, more than half is spent on debugging. The program has been reused many times with some modifications. Debugging can record results, but was difficult to reuse. It is very difficult to predict what problems a program bug will cause and what it will do. Each time a part of the program is modified, the previous debugging sequence is repeated again. Because the debugging done before cannot be reused, a lot of debugging man-hours were generated many times. [It takes time to get a debug result] It takes time to perform operations and check by humans. 0 for computer.
It takes about one second for humans to perform operations and confirmation processes that can be performed with 01mSec. [Dedicated device (ICE) is required] In cross software development of different CPUs such as software development of one-chip microcomputer, ICE (In
Circuit Emulator) is required. Extra equipment, cost and effort are required. [The reproducibility of the bug is poor for debugging. Many factors are involved in the malfunction of a program. If you find a bug in a program, you must reproduce the behavior of the bug in order to identify the cause and take action. Sometimes it is difficult to reproduce the bug because the operation differs depending on the delicate timing of the operation. In the final stage of program development, it is often troubled to deal with such bugs. In particular, when an erroneous operation occurs less frequently than once a day, it is extremely difficult to find the reproduction condition. [It is difficult to debug when the input change is fast.] Some mechanical systems operate at a speed of several tens of mSec. A human cannot manually change such a high-speed input for debugging to create a signal. In order to confirm that no malfunction occurs due to a change in timing, it is necessary to make a dedicated jig. There are many examples where only the desktop debugging has been spared. [Low reliability of debugging results] Operations and confirmations performed by humans include mistakes. When performing hundreds or thousands of checks for debugging using the state transition table, operational errors, missing confirmations, or incorrect confirmations occur. The enormous debugging effort included a few percent of mistakes. Its reliability remained low. [Specifications cannot be used directly for debugging and checking operation] A human being read and debugged a program specification. Despite being a program specification that is a file that can be directly handled by a computer, it has not been used to let the computer compare the specification with the actual program operation using it. [Transmission of specification information] The specification of the program is described in a natural language such as Japanese or English. The operating specifications of the program are transmitted in natural language. But it is difficult to accurately convey all of the vast amount of information. Sentence expression using natural language has ambiguity. The meaning of the words used is slightly different for each person. The problem becomes more apparent when programmers in different languages develop software. [Difficult to communicate debug results] When debugging was done by a different person than the programmer, it was difficult to tell the programmer who fixed the information when a bug was found in the program. This is because the person who is debugging cannot fully understand and represent the malfunction phenomenon and its reproduction conditions. There are limitations of natural language here as well.

【問題点を解決するための手段】プログラムは 1.入力の変化を受けて 2.割り込みの発生を受けて 3.キーボードやマウスの操作などOSのアプリケーシ
ョン・インターフェースの呼び出しを浮けて 動作している。これらは以下のようにすることで、コン
ピュータによる操作に代換できる。 1.入力の変化はプログラムの入力変数を変化させてや
る。 2.割り込みの発生については、割り込みを処理するサ
ブルーチン(関数)を呼び出してやる 3.キーボードやマウスの操作の代わりに、OSのアプ
リケーション・インターフェースを直接に呼び出してや
る。 動作結果の確認も出力変数の変化と、その予定値をコン
ピュータに比較させる合否を判定させることができる。
より詳細に説明する。人間がデバッグのための操作・確
認をする代わりに、以下の手順を使ってコンピュータに
デバッグのための操作・確認をさせることが可能であ
る。。 1.入力のシーケンシャルな変化を、変化の発生した時
間と変化した結果の値の数値データとしてシミュレーシ
ョン入力ファイルに記述しておく。 2.シミュレータ・ライブラリをアプリケーション・プ
ログラムにリンクさせてやる。 3.シミュレータ・プログラムはシミュレーション入力
ファイルから入力変数の変化する時刻とその値、割り込
みの種類と発生すべき時刻を読み出す。 4.シミュレータ・プログラはアプリケーション・プロ
グラムと同期して動き、動作時間を管理する。上記の入
力変数の変化する時間になったら、入力変数をシミュレ
ーション入力ファイルに示された値に変えてやる。 5.シミュレータ・プログラは、上記の割り込みが発生
する時間になったら、その割り込みサブルーチンを呼び
出してやる。 こうすることで、人間が、デバッグのための入力操作を
するのではなく、シミュレーション・ファイルに記述し
てあった入力の時間変化をシミュレータ・プログラムが
アプリケーションに注入してプログラムの動作に反映さ
せる。入力操作だけではない。人間がプログラムの動作
結果を確認を行う代わりに、以下の手順でコンピュータ
にプログラムの確認処理もさせる。 1.入力のシーケンシャルな変化アプリケーションが応
答することで定まる出力変数の変化する時間とその値も
シミュレーション入力ファイルに記述しておく。 2.シミュレーション入力ファイルに記述してある時間
になったら、シミュレータ・プログラムはアプリケーシ
ョンの出力変数をシミュレーション・ファイルに記述し
てあった予定値と比較する。 3.比較結果をシミュレーション出力ファイルに時刻と
共に記録する。
[Means for solving the problems] The program is: 1. In response to input change 2. Upon receiving an interrupt It operates by calling OS application interface such as keyboard and mouse operations. These can be replaced by computer operations by doing the following. 1. Changes in inputs change the input variables of the program. 2. 2. For the occurrence of an interrupt, call a subroutine (function) that handles the interrupt. Instead of operating the keyboard and mouse, the application interface of the OS is directly called. Confirmation of the operation result can also determine whether the output variable has changed and whether or not the scheduled value should be compared with the computer.
This will be described in more detail. Instead of human beings performing operations and confirmations for debugging, it is possible to cause a computer to perform operations and confirmations for debugging using the following procedure. . 1. The sequential change of the input is described in the simulation input file as numerical data of the time when the change occurred and the value of the result of the change. 2. Link the simulator library with the application program. 3. The simulator program reads from the simulation input file the time at which the input variable changes and its value, the type of interrupt, and the time at which it should occur. 4. The simulator program runs in synchronization with the application program and manages the operation time. At the time when the above input variables change, the input variables are changed to the values shown in the simulation input file. 5. The simulator program calls the interrupt subroutine at the time when the above interrupt occurs. By doing so, the simulator program injects the time change of the input described in the simulation file into the application and reflects it on the operation of the program, instead of the human performing the input operation for debugging. Not just input operations. Instead of confirming the operation result of the program by a human, the computer causes the computer to confirm the program in the following procedure. 1. The change time of the output variable determined by the response of the application to the sequential change of the input and its value are also described in the simulation input file. 2. At a certain time described in the simulation input file, the simulator program compares the output variables of the application with the expected values described in the simulation file. 3. The comparison result is recorded in the simulation output file together with the time.

【作用】1.デバッグ操作が入力変数の時間変化の形式
で、シミュレーション入力ファイル上に表現される。 2.ソフトウェアの動作仕様が入力・出力の時間変化デ
ータとして記号を使って記述される 3.人間が行っていたテストされるプログラムの入力操
作を、コンピュータが行う。 4.人間が行っていたテストされるプログラムの動作結
果の確認を、コンピュータが行う。 5.請求項2の方法によって、時間に依存したプログラ
ムだけではなく、実施例2に示すように繰り返し実行さ
れるプログラムのときは、時間の代わりにループ回数を
使って、コンピュータにデバッグさせる。 6.請求項3の方法によって、人間が行っていた確認結
果の記録をコンピュータが行う。 7.プログラムのシミュレーション入力による動作の結
果が、コンピュータで処理可能な出力ファイルとして残
る。 8.請求項の4によって、入力値の変化を記述するだけ
では複雑になってしまう入力操作を、より簡便なサブル
ーチン(関数)の呼び出し、内部変数の直接設定で代換
できる。
[Action] Debugging operations are represented on the simulation input file in the form of time-varying input variables. 2. 2. Software operation specifications are described using symbols as input / output time-varying data. The computer performs the input operation of the program to be tested which has been performed by a human. 4. The computer confirms the operation result of the program to be tested that has been performed by a human. 5. According to the method of the second aspect, when the program is not only a time-dependent program but also a program that is repeatedly executed as shown in the second embodiment, the computer is debugged using the number of loops instead of the time. 6. According to the method of claim 3, the computer records the result of the confirmation performed by a human. 7. The result of the operation by the simulation input of the program remains as an output file that can be processed by the computer. 8. According to the fourth aspect, an input operation that is complicated only by describing a change in an input value can be replaced by a simpler call of a subroutine (function) and a direct setting of an internal variable.

【実施例1】単純例 まず、単純なANDゲートの例を検討する。実用性はな
いけれど、シミュレータの動作を分かりやすくするため
に「図1Y=一秒ディレー(A and B)」の例を
使って説明する。これは 1.入力Aまたは入力Bのどちらかが変化したら、 2.そのANDをとった結果が1秒後に出力Yに現れる を動作仕様とするプログラムである。「図2実施例1の
フローチャート」にシミュレーション・プログラムも含
めたメイン・ループ形式のプログラム例を示す。「図
2」(1)「入出力変数の登録」と(2)「シミュレー
タとアプリケーションの同期」の処理が、シミュレーシ
ョン・デバッグを可能にするために、アプリケーション
に追加されるプログラムである。デバッグが終わり出荷
するときには、これらをアプリケーション・プログラム
から外す。「図2」(1)では入力変数A,Bをシミュ
レータに登録している。これによってアプリケーション
・プログラムで実際に変数A,Bとして配置したメモリ
・アドレスとシミュレーション入力ファイルでの入力変
数名を対応させる。入力変数のアドレスと変数名を登録
されたシミュレータ・プログラムは、シミュレータ入力
ファイルに記述されている入力変数の時間に伴う変化を
アプリケーション・プログラムの入力変数の変化として
反映させることができる。同様に出力変数Yも登録す
る。これによってアプリケーション・プログラムで実際
に変数Yとして配置したメモリ・アドレスとシミュレー
ション入力ファイルでの出力変数名を対応させる。出力
変数のアドレスと変数名を登録されたシミュレータ・プ
ログラムは、出力変数の変化を検出できるようになる。
変化した時間と、その値をシミュレータ出力ファイルに
記録できるようになる。シミュレーション入力ファイル
の実施例を「図3シミュレーション入力ファイル」に示
す。このシミュレーション入力ファイルは入力変数A,
Bの時間変化と、出力変数Yの予定シーケンスを羅列し
ている。”+数字”と ’+’記号に数値を続けて書く
ことで、相対的な経過時間を示している。 1.「図3」(1)「A,B入力の初期値設定」で最初
の時間0で入力A,B両方を0にしている。 2.「図3」(2)「1100mSec後でのY出力の
確認」で1秒より少し後に、出力Yが0を継続している
ことを確認している 3.「図3」(3)「A,B入力を1に設定」で上から
100mSec後に入力A,Bの両方を1に変化させて
いる。 4.「図3」(4)「500mSec後でのY出力の確
認」で上から500mSec後には、出力Yがまだ0を
継続していることを確認している。 5.「図3」(5)「600mSec後でのY出力の確
認」でA,Bが1になってから1秒を過ぎて、出力Yが
1になっていることを確認している。 初めのプログラム仕様書では、入力が変化してから1秒
後に出力が変化するとしていた。この1秒の間の出力に
ついては、仕様書に明記されていない。このシミュレー
ション入力ファイルでは入力が変化してから1秒の間、
出力Yは前の値を継続することが「図3」(4)の個所
で確認されている。自然言語の仕様書で記述すると煩雑
になりすぎてしまう動作の詳細が、シミュレーション入
力ファイルの中で、記号の羅列の形式で記述できてい
る。シミュレーション入力ファイルはコンピュータで扱
える記号で記述されている。そのためシミュレーション
入力ファイルは、母国語が異なるプログラマーでも理解
できる正確なプログラム仕様書にもなっている。
Embodiment 1 Simple Example First, an example of a simple AND gate will be considered. Although not practical, an example of "FIG. 1Y = one second delay (A and B)" will be used to make the operation of the simulator easy to understand. This is 1. 1. When either input A or input B changes, The result of the AND operation appears on the output Y one second later. An example of a program in a main loop format including a simulation program is shown in "Flowchart of Embodiment 1 in FIG. 2". The processes of “FIG. 2” (1) “Registration of input / output variables” and (2) “Synchronization of simulator and application” are programs added to the application to enable simulation / debugging. When shipping after debugging, remove them from the application program. In FIG. 2 (1), input variables A and B are registered in the simulator. As a result, the memory addresses actually arranged as variables A and B in the application program correspond to the input variable names in the simulation input file. A simulator program in which addresses and variable names of input variables are registered can reflect a change with time of an input variable described in a simulator input file as a change in an input variable of an application program. Similarly, the output variable Y is also registered. Thereby, the memory address actually arranged as the variable Y in the application program is made to correspond to the output variable name in the simulation input file. The simulator program in which the address and the variable name of the output variable are registered can detect the change of the output variable.
The changed time and its value can be recorded in the simulator output file. An example of the simulation input file is shown in "FIG. 3 Simulation Input File". This simulation input file contains input variables A,
The time change of B and the scheduled sequence of the output variable Y are listed. The relative elapsed time is indicated by writing a numerical value following the “+ number” and the “+” sign. 1. In FIG. 3 (1), both inputs A and B are set to 0 at the first time 0 in "setting of initial values of A and B inputs". 2. In FIG. 3 (2) “Confirmation of Y output after 1100 mSec”, it is confirmed that output Y continues to be 0 after slightly more than one second. In FIG. 3 (3) “Inputs A and B are set to 1”, both inputs A and B are changed to 1 after 100 mSec from the top. 4. In FIG. 3 (4) “Confirmation of Y output after 500 mSec”, it is confirmed that the output Y is still 0 after 500 mSec from the top. 5. In FIG. 3 (5) “Confirmation of Y output after 600 mSec”, it is confirmed that one second has passed since A and B became 1, and output Y became 1. The initial program specification states that the output changes one second after the input changes. The output during this one second is not specified in the specification. In this simulation input file, for one second after the input changes
It has been confirmed in FIG. 3 (4) that the output Y continues the previous value. The details of the operation that would be too complicated to describe in the specification of the natural language can be described in the simulation input file in the form of a list of symbols. The simulation input file is described with symbols that can be handled by a computer. Therefore, the simulation input file is also an accurate program specification that can be understood by programmers with different native languages.

【実施例2】正規表現 正規表現とは、文字列パターンの表現方法である。もと
もとはユニックスから始った。現在では、DOS,MS
Windowsなどでも広く使われている。正規表現
はプログラマーには必須の知識である。正規表現はDO
Sの’*’や’?’のワイルド・カード−文字をより一
般的にしたものである。これは、以下のようにメタ文字
を使って一般的な文字列パターンを定義する。 ’^’ 行の初め ’$’ 行の最後 ’.’ 任意の一文字 ’¥’ quote next character ’*’ 0文字以上の繰り返し ’+’ 一文字以上の繰り返し ’?’0または1文字の繰り返し ”[aeiou0−9]” a,e,i,o,u, または 0から9までのどれか一文字 ”[^aeiou0−9]” a,e,i,o,u, または 0から9までのどれか以外の一文字 次に正規表現による文字列パターンの具体例を示す。 [a−c]xyは”axy”,”bxy”,”cxy” いずれかの文字列を表す [a−c]?xyは”xy”,”axy”,”bxy”,”cxy” いずれかの文字列を表す [a−c]*xyは”xy”,”axy”,”bxy”,”cxy””ab xy”,”abcxy” などの無限個の文字列を表す 正規表現は与えられた文字列にマッチする文字列を抜き
出す用途で使うことも多い。 例正規表現のマッチング ”hijkabcxyzLMN” は[a−c]+xy
にマッチする部分文字列”abcxy” を持つ。さ
て、このような正規表現文字列パターンを処理するプロ
グラムはC/C++言語で記述して1000行程度の規
模である。プログラム自体は数ヶ月で開発できる。しか
し、できたプログラムにバグが存在しないことを示すこ
とは難しい。正規表現による文字列パターンの組み合わ
せは無限に存在するからである。実務で使う正規表現プ
ログラムでは使用する文字コードなど更に複雑な要素が
加わる。このような正規表現プログラムに本発明を適用
したデバッグを考えてみる。「図4実施例2のフローチ
ャート」に全体の流れを示す。「図4」(1)「入出力
変数の登録」で登録し、「図4」(2)「シミュレータ
とアプリケーションの同期」でシミュレーションとでア
プリケーションの動作を同期させることは「実施例1」
と同じである。アプリケーションとシミュレータ・プロ
グラム・ライブラリとの関係を「図5シミュレータのリ
ンクと実行」に示す。アプリケーション・プログラム
(この場合は正規表現プログラム)のソースのなかに
「図5」(1)「シミュレータとのインターフェース」
のシミュレータとのインターフェース部分を埋め込む。
そしてシミュレータ・ライブラリとリンクして「図5」
(3)「シミュレータをリンクした実行プログラム」r
egular.exe実行ファイルを作成する。「図
5」(4)「シミュレータ入力ファイルSimIn.t
xt」シミュレータ入力ファイル名をコマンドラインの
引数として与え regular.exe SimIn.txt と実行させる。実行させた結果は「図5」(5)「シミ
ュレーション出力ファイルに記録」シミュレーション出
力ファイル:output.txtに記録される。「実
施例2」のシミュレータを含んだプログラムを「図6実
施例2のC言語による疑似コード」に示す。「図6」5
行目のDfSimInitialize(.)がシミュ
レーションに関連する初期化を行う。このなかで 「図
6」25行目のdoAtInitial(char*p
ChAg)を呼び出す。doAtInitial(.)
の処理の中で、 1.setRglExprssnStrin(char
*): 正規表現文字列をシミュレータから設定する 2.setSentenseString(char
*): 正規表現で検索される文字列を設定する 3.checkMatchedStrin(char
*): マッチした結果の文字列を比較・確認する 関数を登録する。この三つの関数は「図5」(1)正規
表現アプリケーションのシミュレータとのインターフェ
ース部分に記述されるべきである。シミュレータは登録
された関数を呼び出すところまでを行う。アプリケーシ
ョンの正規表現パターン入力文字列の設定、パターン・
マッチ調べられるセンテンス入力の設定、その結果を確
認したりする処理はアプリケーション側に記述した関数
が行う。シミュレータ側には、そこまでの汎用的な機能
を用意していないが、関数を呼び出すことで、シミュレ
ータ変数の複雑な設定・確認が可能となる。。「図6」
7行目のDfSimTickBreak()が 「図
4」(2)のアプリケーションの動作とシミュレーター
の動作を同期させる部分である。正規表現のデバッグで
はアプリケーションの経過時間ではなく、ループ回数で
シミュレータを動作させる。ループ回数に応じてset
RglExprssnStrin()ほか三つの関数を
シミュレータが呼び出す。「実施例2」で使うシミュレ
ータ入力ファイル:SimIn.txtを「図7実施例
2のシミュレータ入力ファイル」に示す。「図7」1行
目で正規表現文字列”[A−F]+” を与える。「図
4実施例2のフローチャート」に従って、アプリケーシ
ョンに「正規表現オートマトン」を生成させる。「図
7」3行目により、2回目のループでテストされる文字
列”xaAABFxabcb” が設定される。すると
「図4実施例2のフローチャート」に従って、先の正規
表現にマッチする文字列を検索する。「図7」4行目で
マッチした文字列が”AABF”であることを確認す
る。6,7行目も同じことを繰り返している。「図7」
9行目でデバッグを終了させ、OSに戻る。すなわち、
「図6」7行目がbreak命令を実行する。このよう
に正規表現文字列と検索させる文字列を設定し、その結
果を確認する作業をコンピュータに行わせられる。本発
明を適用することで、正規表現プログラムのような、無
限に存在する組み合わせでの動作試験を再利用可能なフ
ァイルに残してやることができた。これはデバッグを非
常に効率化する。デバッグの途中でプログラムの修正が
何度も発生する。完全なチェックのためには、プログラ
ム修正の前に行ったチェックを、プログラム修正の後に
も行わねばならない。このとき、シミュレーション入力
ファイルに修正前のデバッグが残してあると、プログラ
ム修正後に、それまでに確認した動作をコンピューター
に行わせることができる。
Second Embodiment Regular Expression A regular expression is a method for expressing a character string pattern. Originally started with Unix. Currently, DOS, MS
Widely used in Windows. Regular expressions are essential knowledge for programmers. Regular expression is DO
'*' Or '? The 'wildcard-is a more generalized version of the character. It defines a general string pattern using metacharacters as follows: '^' Beginning of line '$' End of line '. 'Any single character' ¥ 'quote next character' * 'Zero or more characters repeated' + 'One or more characters repeated'? 'Repetition of 0 or 1 character "[aeiou0-9]" a, e, i, o, u, or any one of characters from 0 to 9 "[@ aeiou0-9]" a, e, i, o, u , Or One character other than 0 to 9 Next, a specific example of a character string pattern by a regular expression is shown. [Ac] xy represents any character string of “axy”, “bxy”, “cxy” [ac]? xy represents any character string of “xy”, “axy”, “bxy”, “cxy” [ac] * xy represents “xy”, “axy”, “bxy”, “cxy” “ab xy” Regular expressions representing an infinite number of character strings such as "," abcxy "are often used to extract character strings that match a given character string. Example Matching of regular expression "hijkabcxyzLMN" is [ac] + xy
Has a partial character string "abcxy". A program for processing such a regular expression character string pattern is described in the C / C ++ language and has a scale of about 1000 lines. The program itself can be developed in a few months. However, it is difficult to show that there are no bugs in the resulting program. This is because there are infinite combinations of character string patterns based on regular expressions. More complex elements are added to the regular expression program used in business, such as the character code used. Consider debugging in which the present invention is applied to such a regular expression program. The entire flow is shown in "Flowchart of Embodiment 2 in FIG. 4". Synchronizing the application operation with the simulation by “FIG. 4” (1) “Registering input / output variables” and “FIG. 4” (2) “Synchronization of simulator and application” is “Example 1”.
Is the same as The relationship between the application and the simulator program library is shown in "FIG. 5 Linking and executing the simulator". "Figure 5" (1) "Interface with simulator" in the source of the application program (regular expression program in this case)
Embed the interface with the simulator.
And link with the simulator library "Figure 5"
(3) "Execution program linked with simulator"
egular. Create an exe executable file. “FIG. 5” (4) “Simulator input file SimIn.t
xt "input the simulator input file name as a command line argument. exe SimIn. txt. The result of the execution is shown in FIG. 5 (5) “Record in simulation output file” Simulation output file: output. txt. A program including the simulator of the "second embodiment" is shown in "Pseudo code in C language of the second embodiment in FIG. 6". "Figure 6" 5
DfSimInitialize (.) On the line performs initialization related to the simulation. Among them, doAtInitial (char * p
ChAg). doAtInitial (.)
In the processing of 1. setRglExprsnStrin (char
*): Set a regular expression character string from the simulator. setSentenceString (char
*): Set a character string to be searched with a regular expression. checkMatchedString (char
*): Register a function that compares and confirms the character string of the matching result. These three functions should be described in FIG. 5 (1) in the interface part of the regular expression application with the simulator. The simulator performs up to the point where the registered function is called. Set the regular expression pattern input character string of the application,
The function of setting the sentence input to be checked for matching and confirming the result is performed by a function described on the application side. Although the simulator does not provide such general-purpose functions, complex functions can be set and confirmed by calling functions. . "Figure 6"
DfSimTickBreak () on the seventh line is a part for synchronizing the operation of the application shown in FIG. 4 (2) with the operation of the simulator. In debugging a regular expression, the simulator is operated by the number of loops, not by the elapsed time of the application. Set according to the number of loops
The simulator calls RglExpressnString () and three other functions. Simulator input file used in “Example 2”: SimIn. txt is shown in "Simulator input file of the second embodiment in FIG. 7". The regular expression character string "[AF] +" is given in the first line of FIG. The application is caused to generate a “regular expression automaton” according to the “flowchart of the second embodiment in FIG. 4”. In FIG. 7, the third line sets a character string “xaAABFxabcb” to be tested in the second loop. Then, a character string that matches the above regular expression is searched according to the “flowchart of FIG. 4 Example 2”. It is confirmed that the character string matched in the fourth line of FIG. 7 is “AABF”. Lines 6 and 7 repeat the same. "Figure 7"
The debugging is terminated at the ninth line, and the process returns to the OS. That is,
The seventh line in FIG. 6 executes the break instruction. In this way, the computer sets the regular expression character string and the character string to be searched, and checks the result. By applying the present invention, an operation test in an infinite number of combinations, such as a regular expression program, can be left in a reusable file. This makes debugging much more efficient. Program modifications occur many times during debugging. For a thorough check, the checks performed before the program modification must also be performed after the program modification. At this time, if the debug before the correction is left in the simulation input file, the computer can perform the operation confirmed so far after the correction of the program.

【実施例3】ワンチップ・マイコンのデバッグ 近年のワンチップ・マイコンのロム・サイズは64Kバ
イトが普通となった。プログラムもC言語で記述される
ことが多い。ROMサイズの増大つれてプログラムの規
模も大きくなる。ワンチップ・マイコンのプログラムけ
でも、C言語で数万行の規模になってきている。そのプ
ログラムの動作確認に必要な項目も極端に増大してきて
いる。状態遷移表でのチェック項目が10000を超え
ることもある。このような実務的な例にも適用可能な、
ワンチップ・マイコンでの本発明の実施例を述べる。こ
のように大規模なプログラムでは「図5」(6)「RT
OSライブラリ」のようにRTOSを使ってアプリケー
ション・タスクを記述する。RTOSライブラリをアプ
リケーションにリンクする。シミュレータの側面から見
るとRTOSは時間駆動エンジンとみなせる。1mSe
c毎の割り込みを基準にして時間を管理するRTOSな
らば、メインループの一回毎に、その1mSecの割り
込みプログラムをシミュレータから呼び出してやる。こ
のようにすることで、メイン・ループを回る回数をプロ
グラムの経過時間に対応させることができる。本発明を
使うことで、このようなワンチップ・マイコンであって
も、ICEを使わずに、パソコンなどのクロス環境でプ
ログラムの大部分をデバッグできる。たとえプログラム
が動作する実機がなくてもデバッグが可能である。 1.C言語で記述してあるワンチップ・マイコン用プロ
グラムは、Cプログラムが動作する他のコンピュータで
動作試験が可能である 2.ワンチップ・マイコンの入力ポートの変化は、入力
ポート変数の変化として設定することで模擬できる 3.ワンチップ・マイコンの出力ポートの変化は、出力
ポート変数の変化として模擬的に確認できる。 4.ワンチップ・マイコンの割り込み入力は、割り込み
処理を記述しているCの関数を呼び出すことで模擬的に
動作させることができる。 5.ワンチップ・マイコンには蛍光表示管のダイナミッ
ク点灯などの表示回路が組み込んであることが多い。通
常は点灯させるセグメントと一対一に対応するラムがマ
イコンの内部に存在している。マイコンの表示結果を確
認するためには、対応するラム変数の値を確認すれば良
い。 からである。本発明を利用することで、ワンチップ・マ
イコン・ソフトウェアのデバッグがパソコン上で可能に
なるワンチップ・マイコンのデバッグをパソコン上でデ
バッグする作業に本発明を適用する実施例を説明する。
「図8ワンチップ・マイコンでの実施例」に示すような
ワンチップ・マイコンの制御プログラムを考えてみる。
このワンチップ・マイコン・プログラムの動作仕様を次
のようなものとする。 1.スイッチがオンのときキー入力があるたびに表示を
1,2,3,1,2,..と繰り返す 2.キー入力はA/Dコンバータ入力とする。キーが離
れていると0xffとなり、キーが押されると0x00
になるものとする。 3.スイッチがオフのときキー入力があるたびに表示を
7,8,9,7,8,..と繰り返す 4.割り込み入力があると表示を1秒後に0にする 5.OutPortはDispRAMが偶数のとき0、
奇数のとき1となるこの動作をシミュレーション入力フ
ァイルを使って表現すると「図9ワンチップ・マイコン
でのシミュレーション入力ファイル」のようになる。
「図9」(1)「シミュレーション・エラー」に意識し
てエラーとなるデータ”7’を設定してある。 このマイコンの動作仕様を実現するCプログラムと、変
数の登録を行っている部分のソースを「図10ワンチッ
プ・マイコンのソース・プログラム」に示す。ここでも
「図10」(1)「シミュレータとのインターフェー
ス」部分が変数の登録を行っている部分である。プログ
ラムの最後に記述できるので、アプリケーションから簡
単に取り外せる。これを実行したときのシミュレーショ
ン出力ファイルを「図11シミュレーション結果」にし
めす。「図11」(1)「シミュレーション・エラー」
部分にに先ほどの設定したエラーのシミュレーションに
よる検出が示されている。この「図11」ではシミュレ
ーションの結果が時間と変数名と変数値の羅列として表
現されている。これはコンピュータが処理できるファイ
ルでもある。これを人間に理解しやすいタイムチャート
の形式にしたものが「図12シミュレーション結果のタ
イムチャート表示」である。ここでも、シミュレーショ
ン入力ファイルで作っておいたエラーが「図11」
(1)「シミュレーション・エラー」として表示されて
いる。このエラー動作には確実に再現する。ループ回数
を時間経過とみなしているからだ。実機でのようにエラ
ーが起きたり、起きなかったりの不確実性はない。シミ
ュレーション入力ファイルをプログラムの作成者以外が
作ることは容易である。動作仕様に従って入出力変数の
シーケンシャルな変化をシミュレーション入力ファイル
の記号の羅列に変換するだけである。エラーの発生する
シミュレーション入力ファイルを作ることができたら、
そのエラーは誰が操作しても再現する。エラーが確実に
発生するシミュレーション入力ファイルの動作をプログ
ラムの作成者デバッガを使って追っていけば、容易にエ
ラーの原因を見つけることができる。このデバッガはク
ロス環境でのCコンパイラのデバッガを使うことができ
る。シミュレーション入力ファイルでの入力変化のタイ
ミングは1mSec単位で任意に設定できる。キー入力
のオンオフを10mSec毎と極端に高速に行わせるこ
とも可能である。プロファイラと呼ばれるソフトの上で
アプリケーションとシミュレーション入力を走らせれ
ば、プログラムのどの行がチェックされたかを客観的な
%数値で計数できる。「図13プロファイル結果」にカ
バレッジ計測の結果を示す。「図13」(1)「カバレ
ッシ」部分は、今回のシミュレーション入力ファイルに
よるカバレッジが100%であることを示している。こ
のように、Cで記述されたワンチップ・マイコンのプロ
グラムがクロス・プラットフォーム上で実行され確認さ
れる。ICEがなくても、実機がなくてもデバッグが可
能である。ICEや実機で実行できる以上のデバッグが
可能である。
Third Embodiment Debugging of One-Chip Microcomputer In recent years, the ROM size of a one-chip microcomputer has been generally 64 Kbytes. Programs are often described in C language. As the ROM size increases, the size of the program also increases. Even a one-chip microcomputer program has become tens of thousands of lines in C language. The items required for confirming the operation of the program have been extremely increased. Check items in the state transition table may exceed 10,000. Applicable to such practical examples,
An embodiment of the present invention using a one-chip microcomputer will be described. In such a large-scale program, "Fig. 5" (6) "RT
An application task is described using an RTOS such as “OS library”. Link the RTOS library to the application. From a simulator perspective, an RTOS can be considered a time driven engine. 1mSe
If the RTOS manages the time based on the interrupt for each c, the 1 mSec interrupt program is called from the simulator each time the main loop is executed. By doing so, the number of times of going around the main loop can be made to correspond to the elapsed time of the program. By using the present invention, even with such a one-chip microcomputer, most of the program can be debugged in a cross environment such as a personal computer without using ICE. Even if there is no actual machine on which the program runs, debugging is possible. 1. The operation test of the one-chip microcomputer program described in the C language can be performed by another computer on which the C program operates. Changes in the input ports of a one-chip microcomputer can be simulated by setting them as changes in input port variables. A change in the output port of the one-chip microcomputer can be simulated as a change in the output port variable. 4. The interrupt input of the one-chip microcomputer can be simulated by calling the C function describing the interrupt processing. 5. In many cases, a one-chip microcomputer incorporates a display circuit for dynamically lighting a fluorescent display tube. Usually, a ram corresponding to the segment to be lit one-to-one exists inside the microcomputer. In order to confirm the display result of the microcomputer, the value of the corresponding ram variable may be confirmed. Because. An embodiment in which the present invention is applied to an operation of debugging a one-chip microcomputer on a personal computer that enables debugging of one-chip microcomputer software on a personal computer by utilizing the present invention will be described.
Consider a control program of a one-chip microcomputer as shown in "FIG. 8 One-chip microcomputer embodiment".
The operation specifications of this one-chip microcomputer program are as follows. 1. When the switch is on, every time a key is pressed, the display is changed to 1, 2, 3, 1, 2,. . Repeat 2. The key input is an A / D converter input. When the key is away, it becomes 0xff, and when the key is pressed, it becomes 0x00.
Shall be 3. When the switch is off, every time a key is pressed, the display is changed to 7, 8, 9, 7, 8,. . Repeat 4. 4. When there is an interrupt input, the display is set to 0 after one second. OutPort is 0 when DispRAM is even,
When this operation, which becomes 1 when the number is odd, is expressed by using a simulation input file as shown in “FIG. 9 Simulation input file with one-chip microcomputer”.
(Fig. 9) (1) Data "7 '" that causes an error is set in consideration of the "simulation error." The C program for realizing the operation specifications of this microcomputer and the part where variables are registered The source is shown in "Source program of one-chip microcomputer in FIG. 10". Also in this case, "FIG. 10" (1) "Interface with simulator" portion is a portion in which variables are registered. Because it can be written at the end of the program, it can be easily removed from the application. The simulation output file when this is executed is shown in "FIG. 11 Simulation Result". "Figure 11" (1) "Simulation error"
In the part, the detection of the previously set error by simulation is shown. In FIG. 11, the result of the simulation is expressed as a sequence of time, variable names, and variable values. This is also a file that can be processed by a computer. What is converted into a time chart format that is easy for humans to understand is "display of simulation result time chart in FIG. 12". Again, the error created in the simulation input file is "Figure 11"
(1) Displayed as "Simulation error". This error behavior is reliably reproduced. This is because the number of loops is regarded as the passage of time. There is no uncertainty that errors occur and do not occur as in actual machines. It is easy for anyone other than the program creator to create a simulation input file. It merely converts sequential changes in input and output variables into a sequence of symbols in the simulation input file according to the operating specifications. If you can create a simulation input file with errors,
The error can be reproduced by anyone. By using the program creator's debugger to follow the operation of the simulation input file where errors occur reliably, the cause of the errors can be easily found. This debugger can use a C compiler debugger in a cross environment. The timing of the input change in the simulation input file can be arbitrarily set in 1 mSec units. It is also possible to make key input ON / OFF at an extremely high speed of every 10 mSec. If you run the application and simulation input on software called a profiler, you can count which lines of the program have been checked with objective% figures. The result of the coverage measurement is shown in “FIG. 13 Profile Result”. "FIG. 13" (1) The "coverage" portion indicates that the coverage by the current simulation input file is 100%. Thus, the one-chip microcomputer program described in C is executed and confirmed on the cross platform. Debugging is possible without an ICE or without an actual device. It is possible to debug more than ICE or real machine can execute.

【効果】1.人間が行っていたデバッグ操作をコンピュ
ータに行わせることで、デバッグ工数を削減できる。 2.人間が行っていたデバッグ操作をコンピュータに行
わせることで、デバッグを高速にできる。 3.人間が行っていたデバッグ操作をコンピュータに行
わせることで、デバッグでの人間が発生させるミスをな
くすことができる。デバッグの信頼性を上げることがで
きる。 4.シミュレーション・ファイルに入力変数の変化時間
と値、出力変数の変化時間と値を記述しておくことで、
デバッグ作業の再利用を可能とする。プログラムの仕様
変更などで一部の動作が変わっても、シミュレーション
・ファイルの対応する部分だけを変更することで、大部
分の以前のデバッグ結果を再利用できる。 5.プログラムの動作をシミュレーション・ファイルで
のシーケンシャルな時間と値で表現できる。プログラム
の動作仕様をシミュレーション・ファイルで表現してお
けば、仕様書をコンピュータによるデバッグにも利用で
きる。 6.プログラムの動作をシミュレーション・ファイルで
のシーケンシャルな時間と値で表現できる。自然言語の
曖昧さを含むことなく簡単・確実に動作仕様を表現でき
る。 7.プログラムの動作をシミュレーション・ファイルで
のシーケンシャルな時間と値で表現できる。自然言語の
ような民族性・地域性はない。単純な数学的抽象能力を
互いに持っていれば、母国語が異なる人間同士でも、動
作仕様を確実に伝達できる。 8.再現性がある。コンピュータのプログラムだけによ
る操作であるからだ。同じタイミングによる同じ操作を
繰り返す。誤動作を引き起こすシミュレータ入力ファイ
ルを作ったら、必ず同じ誤動作を引き起こす。誤動作が
おきているけれど、その再現条件がわからないために、
何日にもわたって誤動作を確実に再現させる方法を探す
すことがなくなる。 9.結果が時間データと値のペアのデータとしてファイ
ルに残る。それをタイムチャートなどの人間が直感的に
理解し易い表示に変換できる。 10.デバッガやプロファイラといった既存の道具と組
み合わせて使用できる 11.プログラムの信頼性の証明に使える。ユーザー側
での試験・再確認が可能である。プロファイラーのカバ
レッジ機能を使えばデバッグの確認達成率を客観的な、
再現性のある%数値で表現できる。ソースコード以外に
シミュレータ・ファイルもプログラムの資料に含める
と、悪意のあるプログラムを紛れ込ませることが極端に
難しくなる。 12.第三者がプログラムの修正や動作確認が容易にな
る。シミュレーション入力ファイルが作ってあれば、作
成者と同様なデバッグが可能になるからだ。2000年
問題のような対策も容易となる。 組み込みソフトの開発では以下の効果もある。 1.実機ががなくても、プログラム動作の確認ができ
る。 2.ICEに代表されるデバッグ専用の装置がなくても
デバッグできる。 3.ICEを動作させるためのデータを作らなくてもす
む。デバッグが高速になる。 4.Emulator ICなどの開発をまたずにシミ
ュレーションできる。DSPなどのコアCPUのアプリ
ケーション・ソフトの開発が容易になる。周辺回路の動
作確認に必要なソフトは自分でC言語を使って作る。回
路の動作確認ソフトは、概ね簡単なものである。
[Effect] 1. By causing a computer to perform a debugging operation that has been performed by a human, debugging man-hours can be reduced. 2. Debugging can be accelerated by causing a computer to perform a debugging operation that has been performed by a human. 3. By causing a computer to perform a debugging operation that has been performed by a human, mistakes made by the human in debugging can be eliminated. Debugging reliability can be improved. 4. By describing the change time and value of the input variable and the change time and value of the output variable in the simulation file,
Enables reuse of debugging work. Even if some operations change due to changes in program specifications, etc., most of the previous debugging results can be reused by changing only the corresponding parts of the simulation file. 5. The operation of a program can be represented by sequential time and value in a simulation file. If the operating specifications of a program are expressed in a simulation file, the specifications can be used for computer debugging. 6. The operation of a program can be represented by sequential time and value in a simulation file. The operation specification can be easily and reliably expressed without including the ambiguity of natural language. 7. The operation of a program can be represented by sequential time and value in a simulation file. There is no ethnicity or regionality like natural language. As long as they have simple mathematical abstraction capabilities, even people with different native languages can surely communicate their operation specifications. 8. There is reproducibility. It's just a computer program. Repeat the same operation at the same timing. If you make a simulator input file that causes a malfunction, be sure to cause the same malfunction. Although there is a malfunction, but I do not know the reproduction conditions,
You will not have to look for ways to reliably reproduce the malfunction over the days. 9. The result remains in the file as time / value pair data. It can be converted into a display such as a time chart that is easy for humans to understand intuitively. 10. 10. Can be used in combination with existing tools such as debuggers and profilers Can be used to prove program reliability. Testing and reconfirmation on the user side are possible. If you use the profiler's coverage function, you can objectively check the debug confirmation achievement rate,
It can be represented by a reproducible% value. If a simulator file is included in the program documentation in addition to the source code, it becomes extremely difficult to insert a malicious program. 12. Third parties can easily modify the program and check the operation. If you have a simulation input file, you can debug it in the same way as the author. Countermeasures such as the year 2000 problem will also be easy. The following effects are also obtained in the development of embedded software. 1. Even if there is no actual machine, the program operation can be checked. 2. Debugging can be performed without a device dedicated to debugging represented by ICE. 3. There is no need to create data for operating the ICE. Debugging is faster. 4. Simulations can be performed without having to develop Emulator ICs. Development of application software for a core CPU such as a DSP is facilitated. The software required to check the operation of the peripheral circuits is made by using the C language. The circuit operation confirmation software is generally simple.

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

【図1】Y=一秒ディレー(A and B)FIG. 1 Y = one second delay (A and B)

【図2】実施例1のフローチャート 1:入出力変数の登録 2:シミュレータとアプリケーションの同期FIG. 2 is a flowchart of the first embodiment 1: registration of input / output variables 2: synchronization of a simulator and an application

【図3】シミュレーション入力ファイル 1:A,B入力の初期値設定 2:1100mSec後でのY出力の確認 3:A,B入力を1に設定 4:500mSec後でのY出力の確認 5:600mSec後でのY出力の確認FIG. 3 Simulation input file 1: Initial value setting of A and B inputs 2: Confirmation of Y output after 1100 mSec 3: Setting of A and B inputs to 1: 4: Confirmation of Y output after 500 mSec 5: 600 mSec Check Y output later

【図4】実施例2のフローチャート 1:入出力変数の登録 2:シミュレータとアプリケーションの同期FIG. 4 is a flowchart of the second embodiment 1: registration of input / output variables 2: synchronization of simulator and application

【図5】シミュレータのリンクと実行 1:シミュレータとのインターフェース 2:シミュレータ・ライブラリ 3:シミュレータをリンクした実行プログラム 4:シミュレータ入力ファイルSimIn.txt 5:シミュレーション出力ファイルに記録 6:RTOSライブラリ[Fig. 5] Linking and execution of simulator 1: Interface with simulator 2: Simulator library 3: Execution program linked with simulator 4: Simulator input file SimIn. txt 5: Record in simulation output file 6: RTOS library

【図6】実施例2のC言語による疑似コードFIG. 6 is a pseudo code in C language according to the second embodiment.

【図7】実施例2のシミュレータ入力ファイルFIG. 7 is a simulator input file according to the second embodiment.

【図8】ワンチップ・マイコンでの実施例FIG. 8 is an embodiment using a one-chip microcomputer.

【図9】ワンチップ・マイコンでのシミュレーション入
力ファイル 1:シミュレーション・エフー
FIG. 9: Simulation input file for one-chip microcomputer 1: Simulation EF

【図10】ワンチップ・マイコンのソース・プログラム 1:シミュレータとのインターフェースFIG. 10: Source program of one-chip microcomputer 1: Interface with simulator

【図11】シミュレーション結果 1:シミュレーション・エラーFIG. 11: Simulation result 1: Simulation error

【図12】シミュレーション結果のタイムチャート表示 1:シミュレーション・エラーFIG. 12 is a time chart display of a simulation result 1: simulation error

【図13】プロファイル結果 1:カバレッジFIG. 13: Profile result 1: Coverage

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 入力値の変化に応答して出力値を制御・
変化させるソフトウェア・プログラムの動作確認におい
て、 ・入力の変化する時間と値を蓄えておく、入力値の記憶
手段を備え ・プログラムが入力値に応答した結果として予定される
出力値と時間を蓄えておく出力値の記憶手段を備え ・プログラムの動作時間が、入力値の記憶手段に記録し
てあった時間になったとき、入力値の記憶手段に蓄えて
ある該時間の入力値をプログラムの入力値の変化とし
て、プログラムの動作に反映させる手段を備え ・プログラムの動作時間が、予定される出力値の記憶手
段に記録してあった時間になったとき、記録してあった
予定の出力値とプログラムが動作した結果の出力値を比
較する手段を備えたことを特徴とするプログラムの動作
確認方法。
An output value is controlled in response to a change in an input value.
In the operation check of the software program to be changed, ・ The input value storage means is provided to store the time and value at which the input changes ・ The output value and time scheduled as a result of the program responding to the input value are stored When the operation time of the program reaches the time recorded in the input value storage means, the input value of the time stored in the input value storage means is input to the program. A means for reflecting the change in the value to the operation of the program is provided.When the operation time of the program reaches the time recorded in the storage means for the expected output value, the scheduled output value recorded And a means for comparing an output value of a result of the operation of the program with the program.
【請求項2】 プログラムの動作確認を時間の代わりに
処理の繰り返し回数を使ったことを特徴とする特許請求
の範囲第一項記載のプログラムの動作確認方法。
2. The program operation check method according to claim 1, wherein the program operation check is performed using the number of repetitions of processing instead of time.
【請求項3】 プログラムの外部入力変数のほかに、プ
ログラム内部の入力変数の変化する時間と値を蓄えてお
く記憶手段を備えたことを特徴とする、特許請求の範囲
第一項記載のプログラムの動作確認方法。
3. The program according to claim 1, further comprising storage means for storing a time and a value at which an input variable in the program changes in addition to an external input variable of the program. How to check the operation.
【請求項4】 プログラムの外部出力変数のほかに、プ
ログラム内部の出力変数の変化する時間と値を蓄えてお
く記憶手段を備えたことを特徴とする、特許請求の範囲
第一項記載のプログラムの動作確認方法。
4. The program according to claim 1, further comprising storage means for storing a time and a value at which an output variable in the program changes in addition to an external output variable of the program. How to check the operation.
【請求項5】・入力値だけではなく、プログラム内部の
サブルーチン(関数)とそれらを呼び出す時間の記憶手
段を備え ・プログラムの動作時間が該時間になったら、サブルー
チンを呼び出す手段を備え たことを特徴とする特許請求の範囲第一項記載のプログ
ラムの動作確認方法。
5. A storage means for storing not only input values but also subroutines (functions) in the program and a time for calling them. ・ A means for calling the subroutine when the operation time of the program reaches the time is provided. A method for confirming the operation of a program according to claim 1, characterized in that:
【請求項6】 プログラムの動作結果の結果として定ま
る出力変数値とその変化した時間を蓄えておく記憶手段
を備えたことを特徴とする、特許請求の範囲第一項記載
のプログラムの動作確認方法。
6. The method according to claim 1, further comprising storage means for storing an output variable value determined as a result of the operation result of the program and a time when the output variable value has changed. .
【請求項7】 特許請求項1の機能を持ったプログラム
を記録した媒体
7. A medium on which a program having the function of claim 1 is recorded.
【請求項8】 特許請求項7に加えて、特許請求項2か
ら7までの一つ以上の機能を持ったプログラムを記録し
た媒体
8. A medium recording a program having at least one function according to claims 2 to 7 in addition to claim 7.
JP11250556A 1999-08-03 1999-08-03 Debugging method for program Pending JP2001043110A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11250556A JP2001043110A (en) 1999-08-03 1999-08-03 Debugging method for program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11250556A JP2001043110A (en) 1999-08-03 1999-08-03 Debugging method for program

Publications (1)

Publication Number Publication Date
JP2001043110A true JP2001043110A (en) 2001-02-16

Family

ID=17209675

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11250556A Pending JP2001043110A (en) 1999-08-03 1999-08-03 Debugging method for program

Country Status (1)

Country Link
JP (1) JP2001043110A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9740592B2 (en) 2011-10-27 2017-08-22 International Business Machines Corporation Supporting debugging of program and graphical user interface for supporting debugging
CN110673878A (en) * 2019-09-11 2020-01-10 上海高性能集成电路设计中心 Instruction information query and execution debugging method based on instruction set simulator

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9740592B2 (en) 2011-10-27 2017-08-22 International Business Machines Corporation Supporting debugging of program and graphical user interface for supporting debugging
CN110673878A (en) * 2019-09-11 2020-01-10 上海高性能集成电路设计中心 Instruction information query and execution debugging method based on instruction set simulator

Similar Documents

Publication Publication Date Title
JP2795244B2 (en) Program debugging system
US9317408B2 (en) System and method for systematic error injection in generated code
US5966541A (en) Test protection, and repair through binary-code augmentation
CA2143145C (en) Determining dynamic properties of programs
US20030046029A1 (en) Method for merging white box and black box testing
US7761282B2 (en) System and method to simulate conditions and drive control-flow in software
JP2006185211A (en) Program analysis system, test execution device, and analysis method and program thereof
US20070061641A1 (en) Apparatus and method for generating test driver
KR20070053106A (en) Pseudo translation within integrated development environment
Goli et al. Automated nonintrusive analysis of electronic system level designs
Goli et al. Automatic protocol compliance checking of SystemC TLM-2.0 simulation behavior using timed automata
JPH03188535A (en) Assembly language programming error detecting process
Xie et al. Automatic extraction of abstract-object-state machines from unit-test executions
US20030177471A1 (en) System and method for graphically developing a program
US10579761B1 (en) Method and system for reconstructing a graph presentation of a previously executed verification test
US6546526B2 (en) Active trace debugging for hardware description languages
US20080300846A1 (en) Methods and apparatus for hardware simulation and design verification
CN112765018B (en) Instrument and meter debugging system and method
JP2001043110A (en) Debugging method for program
Prathyusha et al. A survey paper on debugging tools and frameworks for debugging real time industrial problems and scenerios
CN116501378B (en) Implementation method and device for reverse engineering reduction source code and electronic equipment
CN112580282B (en) Method, apparatus, device and storage medium for integrated circuit design verification
Miller The industrial use of formal methods: was Darwin right?
Chisolm et al. The use of computer language compilers in legacy code migration
US20060178863A1 (en) Combining and representing signals of a hardware simulation device and elements of a program listing