JPH02224148A - Test program forming processor - Google Patents
Test program forming processorInfo
- Publication number
- JPH02224148A JPH02224148A JP1046217A JP4621789A JPH02224148A JP H02224148 A JPH02224148 A JP H02224148A JP 1046217 A JP1046217 A JP 1046217A JP 4621789 A JP4621789 A JP 4621789A JP H02224148 A JPH02224148 A JP H02224148A
- Authority
- JP
- Japan
- Prior art keywords
- description
- test program
- random number
- terminal
- attribute
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
〔概要〕
言語処理プログラム用のテストプログラムを属性文法記
述から自動作成するよう処理するテストプログラム作成
処理装置に関し、
属性文法記述の記述性の向上を図れるようにすることを
目的とし、
属性文法記述に従って記述された処理対象文に対しての
乱数的な選択処理により生成される乱数文と、乱数文の
実行結果の確認のためのテストルーチンを呼び出すli
I認文とを対とするテストプログラムを作成するテスト
プログラム作成処理装置であって、属性文法記述が繰り
返しと省略化の非終端記号の記述については、終端記号
との対を組として記述するよう構成し、かつ、非終端記
号の属性を構造的に管理するとともに、終端記号の付加
するものについては、該終端記号を印刷属性として管理
する構造体変数管理部と、作成されたテストプログラム
を出力するとともに、非終端記号のテキストを出力する
際に、該非終端記号が印刷属性を有するときには、該非
終端記号の出方に先立って、該印刷属性の終端記号のテ
キストを出力するライタとを備えるよう構成する。[Detailed Description of the Invention] [Summary] The present invention relates to a test program creation processing device that automatically creates a test program for a language processing program from attribute grammar descriptions, and is capable of improving the descriptive properties of attribute grammar descriptions. The purpose is to call a test routine to check the random number statement generated by random number selection processing for the processing target statement written according to the attribute grammar description and the execution result of the random number statement.
A test program creation processing device that creates a test program paired with an I-approved sentence, and is configured so that descriptions of non-terminal symbols whose attribute grammar description is repetition and abbreviation are described as a pair with a terminal symbol. In addition, a structure variable management unit that structurally manages the attributes of non-terminal symbols, and manages the terminal symbols as printing attributes for those to which terminal symbols are added, and outputs the created test program. , when outputting the text of a non-terminal symbol, when the non-terminal symbol has a print attribute, the writer is configured to output the text of the terminal symbol having the print attribute before the non-terminal symbol appears.
本発明は、言語処理プログラム用のテストプログラムを
属性文法記述から自動作成するよう処理するテストプロ
グラム作成処理装置に関し、特に、属性文法記述の記述
性の向上を図れるようにするテストプログラム作成処理
装置に関するものである。The present invention relates to a test program creation processing device that automatically creates a test program for a language processing program from attribute grammar descriptions, and particularly relates to a test program creation processing device that can improve the descriptive properties of attribute grammar descriptions. It is something.
作成した言語処理プログラム(COBOLやFORTl
?AN等のコンパイラに限られずに、コマンドを処理す
るプログラム等も含む)の機能を検査するために、マニ
ュアルに基づいて検証用のテストプログラムを作成して
、その実行結果を予想したものと比較していくという手
法がとられることになる。Created language processing program (COBOL, FORTl)
? In order to inspect the functionality of a program (not limited to compilers such as AN, but also programs that process commands), create a verification test program based on the manual and compare the execution results with the expected ones. The following approach will be taken.
しかるに、言語処理プログラムの機能の数は多(、しか
も複数の機能の組み合わせまで検査しなければならない
ことから、確認しなければならない機能の数は極めて多
くなることになる。これから、言語処理プログラムの機
能の検査のために必要とされるテストプログラムの作成
に、多大な労力が費やされているというのが現状である
。このような背景の元に、言語処理プログラム用のテス
トプログラムの自動作成処理装置の提供が望まれている
のである。However, since the number of functions of a language processing program is large (and even combinations of multiple functions must be checked, the number of functions that must be checked becomes extremely large. The current situation is that a great deal of effort is expended on creating test programs required for functional inspection.Based on this background, automatic creation of test programs for language processing programs has been developed. Providing processing equipment is desired.
従来では、人手によって、言語処理プログラム用のテス
トプログラムが作成されていた。すなわち、プログラマ
等が、各種文法規則とその意味を記述したマニュアルか
ら要因分析を行ってテスト項目を設定して、テスト項目
にあった機能の実行とその結果の検証手続きとを記述し
たテストプログラムを作成していたのである。Conventionally, test programs for language processing programs have been created manually. In other words, a programmer or the like performs factor analysis from a manual that describes various grammar rules and their meanings, sets test items, and creates a test program that describes the execution of functions that match the test items and the procedure for verifying the results. It was created.
しかしながら、この要因分析やテスト項目の設定には極
めて大きな労力がかかることから、従来技術では、テス
トプログラムの作成に極めて多大な工数がとられてしま
うという問題点があった。However, since this factor analysis and setting of test items requires an extremely large amount of effort, the conventional technology has a problem in that an extremely large number of man-hours are required to create a test program.
そして、人手による方法では作成するテストプログラム
の内容に限度があることから、従来技術では、言語処理
プログラムの機能の検査を十分行っていないという問題
点もあったのである。Furthermore, since there is a limit to the content of the test program that can be created using manual methods, there is also the problem that the functions of the language processing program are not sufficiently tested in the conventional technology.
そこで、本出願人は、先に出願の「特願昭63−465
10号(昭和63年2月29日出願、“言語処理プログ
ラム検証方式”)」で、言語処理プログラム用のテスト
プログラムの自動作成処理装置の発明を案出した。次に
、第7図に従って、この特許出願の発明の概要について
説明する。Therefore, the present applicant has previously filed the application for “Japanese Patent Application No.
No. 10 (filed on February 29, 1988, ``Language Processing Program Verification Method''), he devised an invention for a processing device for automatically creating test programs for language processing programs. Next, the outline of the invention of this patent application will be explained with reference to FIG.
図中、1は構文・意味記述であって、言語処理プログラ
ムの処理対象文を展開規則と意味記述とからなる属性文
法記述に従って記述するもの、2はTP自動作成部であ
って、構文・意味記述lからテストプログラムを自動作
成するもの、3はTP自動作成部2が備える生成規則選
択部であって、構文・意味記述1中の展開規則に対して
乱数的な選択処理を施すことで処理対象文の一態様をな
す乱数文を作成するもの、4はTP自動作成部2が備え
る確認文挿入部であって、作成された乱数文の実行によ
り引き起こされる実行結果の確認を行うためのテストル
ーチンを呼び出す確認文を乱数文に対応付けて挿入する
もの、5はTP自動作成部2が備える記号表であって、
乱数文名等を格納するもの、6はTP自動作成部2によ
り作成される一連の検証プログラムであって、言語処理
プログラムのテストフ“ログラムをなすもの、7は自動
判定部であって、検証プログラム6の乱数文を言語処理
プログラムに実行させたときの実行結果が正しいものと
なるのか否かを、その乱数文に対応付けられている確認
文により呼び出されるテストルーチンに従って自動的に
判定するもの、8は結果−覧表であって、自動判定部7
の判定結果をプリントアウトするものである。In the figure, 1 is a syntactic/semantic description, which describes the sentence to be processed by the language processing program according to an attribute grammar description consisting of expansion rules and semantic descriptions, and 2 is a TP automatic creation unit, which is a syntactic/semantic description. 3 is a production rule selection unit provided in the automatic TP creation unit 2, which automatically creates a test program from the description 1, and processes the expansion rules in the syntactic/semantic description 1 by performing random number selection processing. 4 is a confirmation sentence insertion section provided in the automatic TP creation section 2, which is a test for confirming the execution result caused by the execution of the created random number statement. 5 is a symbol table provided in the TP automatic creation unit 2, which inserts a confirmation statement that calls a routine in association with a random number statement;
6 is a series of verification programs created by the automatic TP creation section 2 and constitutes a test program for the language processing program; 7 is an automatic judgment section which is a verification program; A device that automatically determines whether the execution result when a language processing program executes the random number statement of No. 6 is correct according to a test routine called by a confirmation statement associated with the random number statement; 8 is a result list, in which the automatic judgment section 7
The judgment results are printed out.
このように構成される先の特許出願の発明にあっては、
生成規則選択部3は、構文・意味記述1中の処理対象文
の展開規則に対して乱数的な選択処理を施すことで処理
対象文の一態様をなす乱数文を作成し、確認文挿入部4
は、乱数文の正しい実行結果を引数とする確認文を挿入
していくことで、言語処理プログラム用のテストプログ
ラムを自動生成していくよう処理することになる。In the invention of the earlier patent application structured in this way,
The production rule selection unit 3 creates a random number sentence, which is an aspect of the sentence to be processed, by performing a random number selection process on the expansion rule of the sentence to be processed in the syntactic/semantic description 1, and generates a random number sentence, which is an aspect of the sentence to be processed, and sends it to the confirmation sentence insertion unit. 4
will automatically generate a test program for the language processing program by inserting confirmation statements that take the correct execution result of the random number statement as an argument.
このような先の特許出願の発明の実用性を高めていくた
めには、テストプログラムの作成のために用意する属性
文法記述の記述性の向上を図っていく必要がある。属性
文法記述が記述しにくいものとなると、属性文法記述の
作成に手間がかかって、テストプログラムの作成の生産
性が著しく低下することになるからである。In order to improve the practicality of the invention of the earlier patent application, it is necessary to improve the descriptive nature of the attribute grammar description prepared for creating a test program. This is because if the attribute grammar description becomes difficult to write, it will take time and effort to create the attribute grammar description, and the productivity in creating the test program will drop significantly.
本発明はかかる事情に鑑みてなされたものであって、本
出願人が出願した先の特許出願のテストプログラム作成
処理装置において、属性文法記述の記述性の向上を図る
手段を講じていくことで、先の特許出願のテストプログ
ラム作成処理装置の実用性を高めて、更に有効なものと
なるようにしていくことを目的とするものである。The present invention has been made in view of the above circumstances, and involves taking measures to improve the descriptive nature of attribute grammar descriptions in the test program creation processing device of the earlier patent application filed by the present applicant. The purpose of this patent is to improve the practicality of the test program creation processing device disclosed in the previous patent application and to make it even more effective.
第1図は本発明の原理構成図である。 FIG. 1 is a diagram showing the principle configuration of the present invention.
図中、IOは属性文法記述であって、検査対象となる言
語処理プログラムの処理対象文についての属性文法を記
述するとともに、この処理対象文の実行結果の確認を行
うテストルーチンの呼び出しのための確認文を記述する
ものである。この属性文法記述10は、繰り返しと省略
化についての非終端記号の記述については、終端記号と
の対を組として記述することになる。11は属性文法記
述10をなす展開規則であって、処理対象文の展開規則
を記述するもの、12は属性文法記述10をなす意味記
述であって、処理対象文中の意味内容を記述するもの、
20は本発明を具備するテストプログラム作成処理装置
であって、言語処理プログラム用のテストプログラムを
自動作成するもの、21はリーグであって、属性文法記
述10を内部形式に変換するもの、22は翻訳処理器で
あって、リーダ21により変換された内部形式を展開し
て内部形式テストプログラムを作成する展開処理部23
と、内部形式テストプログラムの作成にあたって必要と
なる意味記述12の実行依願を行う意味記述処理依頼部
26とを備えるもの、24は展開処理部23が備える乱
数発生部であって、展開規則に関しての選択処理に必要
となる乱数を発生させるもの、25は展開処理部23が
備える構造体変数管理部であって、内部形式テストプロ
グラムの展開処理のために必要となる変数データを構造
的に管理するとともに、終端記号と組とされた非終端記
号については、付加された終端記号を印刷属性として管
理するもの、27は意味記述解釈器であって、意味記述
処理依頼部26からの起動依鯨に応じて処理要求のある
意味記述12を実行するもの、28はライタであって、
翻訳処理器22により作成された内部形式テストプログ
ラムを実行可能なテストプログラムとしてファイル等に
出力するもの、29はライク28が備える機能である印
刷属性出力部であって、出力対象の非終端記号について
のテストプログラムのテキストを出力する際に、その非
終端記号が印刷属性の終端記号を有するときには、非終
端記号のテキストの出力に先立ってその印刷属性の終端
記号のテキストを出力するよう処理するもの、30は出
力されたテストプログラムである。ここで、属性文法記
述10中に記述される非終端記号とは、展開規則11に
従って展開されてテストプログラム30のテキストとな
る記号をいい、終端記号とは、テストプログラム30の
作成にあたって展開されることのない記号をいうもので
ある。In the figure, IO is an attribute grammar description, which describes the attribute grammar of the processing target statement of the language processing program to be tested, and is used to call a test routine that checks the execution result of this processing target statement. This is to write a confirmation statement. In this attribute grammar description 10, non-terminal symbols regarding repetition and abbreviation are described as pairs with terminal symbols. 11 is an expansion rule forming the attribute grammar description 10, which describes the expansion rule of the sentence to be processed; 12 is a semantic description forming the attribute grammar description 10, which describes the semantic content in the sentence to be processed;
20 is a test program creation processing device having the present invention, which automatically creates a test program for a language processing program; 21 is a league, which converts the attribute grammar description 10 into an internal format; An expansion processing unit 23, which is a translation processor, expands the internal format converted by the reader 21 and creates an internal format test program.
and a semantic description processing requesting unit 26 that requests execution of the semantic description 12 necessary for creating an internal format test program. 24 is a random number generation unit included in the expansion processing unit 23, and 24 is a random number generation unit provided in the expansion processing unit 23, which generates a 25 is a structure variable management unit included in the expansion processing unit 23 that generates random numbers necessary for selection processing, and structurally manages variable data required for expansion processing of the internal format test program. In addition, for non-terminal symbols paired with terminal symbols, 27 is a semantic description interpreter that manages the added terminal symbol as a print attribute, and 27 is a semantic description interpreter that responds to the activation request from the semantic description processing request unit 26. 28 is a writer that executes the semantic description 12 with a processing request;
It outputs the internal format test program created by the translation processor 22 as an executable test program to a file, etc. 29 is a print attribute output unit that is a function of the LIKE 28, and it outputs information about non-terminal symbols to be output. When outputting the text of the test program, if the non-terminal symbol has a terminal symbol with a print attribute, processing is performed to output the text of the terminal symbol with the print attribute prior to outputting the text of the non-terminal symbol; This is the output test program. Here, the non-terminal symbol described in the attribute grammar description 10 refers to a symbol that is expanded according to the expansion rule 11 and becomes the text of the test program 30, and the terminal symbol refers to a symbol that is expanded when creating the test program 30. It refers to a symbol without a .
本発明では、リーダ21の処理に従って、属性文法記述
lOを翻訳処理器22が解釈し易い形式である内部形式
に変換する。この内部形式を受は取ると、展開処理部2
3は、展開規則11に従って再帰的に展開を実行してい
くことで、内部形式テストプログラムへの展開を実行す
る。この展開時に意味記述12の実行が必要となる場合
には、意味記述処理依頼部26は、意味記述解釈器27
を起動していくよう処理し、このようにして起動される
意味記述解釈器27は、構造体変数管理部25の変数値
を新たなものに更新していく処理を実行する。そして、
展開処理部23は、この更新された変数値を参照しなが
ら内部形式テストプログラムへの展開を実行していくと
ともに、この展開にあたって必要となる展開規則ll中
に含まれる選択性の規則に関しては、乱数発生部24が
発生する乱数値に従って選択対象の選択や値の選択を実
行していく。In the present invention, according to the processing of the reader 21, the attribute grammar description IO is converted into an internal format that is easy for the translation processor 22 to interpret. After receiving this internal format, the expansion processing unit 2
3 executes expansion into an internal format test program by recursively executing expansion according to expansion rule 11. If it is necessary to execute the semantic description 12 during this expansion, the semantic description processing requesting unit 26 sends the semantic description interpreter 27
The semantic description interpreter 27 activated in this way executes a process of updating the variable values of the structure variable management unit 25 to new ones. and,
The expansion processing unit 23 executes the expansion to the internal format test program while referring to the updated variable values, and regarding the selectivity rules included in the expansion rules ll necessary for this expansion, Selection of selection targets and selection of values are executed in accordance with random numbers generated by the random number generation section 24.
そして、内部形式テストプログラムへの展開処理が終了
すると、属性文法記述lOに記述されている確認文中の
パラメータ部分に、処理対象文の一態様として翻訳され
た乱数文の実行結果に関しての値が設定され、言語処理
プログラム用のテストプログラムの基本単位に相当する
内部形式プログラムの作成が終了することになる。内部
形式プログラムの作成が終了すると、ライタ28は、内
部形式テストプログラムを実行可能なテストプログラム
30として出力して処理を終了する。When the expansion process to the internal format test program is completed, a value related to the execution result of the translated random number sentence is set as one aspect of the processing target sentence in the parameter part of the confirmation sentence described in the attribute grammar description IO. This completes the creation of an internal format program corresponding to the basic unit of a test program for a language processing program. When the creation of the internal format program is completed, the writer 28 outputs the internal format test program as an executable test program 30 and ends the process.
このテストプログラムの自動作成処理にあって、本発明
では、属性文法記述10中で記述される非終端記号につ
いての繰り返し記述と省略化記述については、終端記号
との対を組として記述できるようにする。ここで、この
繰り返し記述とは、乱数発生部24が発生する乱数値に
従って決定されることになる回数骨、記述しである非終
端記号を繰り返すという記述であり、省略化記述とは、
乱数発生部24が発生する乱数値に従って、記述しであ
る非終端記号を省略するか否かを決定するという記述で
ある。In this automatic test program creation process, the present invention allows repeated descriptions and abbreviated descriptions of non-terminal symbols described in the attribute grammar description 10 to be described in pairs with terminal symbols. . Here, this repeated description is a description that repeats a non-terminal symbol, which is a number of times determined according to the random number generated by the random number generator 24, and the abbreviated description is:
This is a description in which it is determined whether or not to omit a non-terminal symbol in accordance with a random number generated by the random number generator 24.
繰り返し記述の例で説明するならば、サブルーチン呼び
出しにおけるプログラム記述は、CALL サブ1ト
チン名(パラメタ1.パラメタ2.・・・)というよう
に、複数のパラメタが繰り返されるとともに、見易くす
るためにパラメタ間に「、」が記述されることになる。To explain this using an example of repeated description, the program description for a subroutine call includes multiple parameters that are repeated, such as CALL sub 1 tochin name (parameter 1, parameter 2, etc.), and parameters that are added for ease of viewing. "," will be written in between.
このような繰り返しに対応するテストプログラム30を
作成する必要があるときには、属性文法記述lOでは、
このプログラム記述を、
サブルーチン呼び出し→
’CALL” サブルーチン名”(’パラメタ (”、
′パラメタ) #どというように記述する。ここで、「
(・・・・・・)」で区切られた部分が、乱数値により
決定される回数付繰返されることを表し、「”」で区切
られる記号「、」は、そのままテストプログラム30の
テキストになる終端記号を表す。すなわち、「、」とい
う終端記号と「パラメタ」という非終端記号との対から
なる組の繰り返しを記述するのである。When it is necessary to create a test program 30 that supports such repetition, in the attribute grammar description IO,
This program description is called subroutine call → 'CALL' subroutine name"('parameter(",
'Parameter)#Describe it as follows. here,"
The part separated by `` (...)'' indicates that it will be repeated a number of times determined by a random value, and the symbol ``,'' separated by ``'' becomes the text of the test program 30 as it is. Represents a terminal symbol. That is, it describes the repetition of a pair consisting of a terminal symbol "," and a non-terminal symbol "parameter."
また、省略化記述の例で説明するならば、ELSE文が
省略できるIF文に対応するテストプロ・グラム30を
作成する必要があるときには、属性文法記述10では、
IF文→
’IF’条件’TIIEN’文[’E[、SE ’文]
”END−IF″というように記述する。ここで、「(
・・・・・・)」で区切られる部分が、乱数値に従って
省略の有無が決定されるところであることを表す。すな
わち、ビELSE”」というそのままテキストとなる終
端記号と「文」という非終端記号との対からなる組の記
述が省略可能であることを記述するのである。Also, to explain using an example of an abbreviated description, when it is necessary to create a test program 30 that corresponds to an IF statement where the ELSE statement can be omitted, in the attribute grammar description 10, IF statement → 'IF'condition'TIIEN' statement ['E[,SE' statement]
It is written as "END-IF". here,"(
. . .)” indicates that the presence or absence of omission is determined according to a random value. In other words, it is stated that the description of the pair consisting of the terminal symbol "BIELSE" which becomes text as is and the non-terminal symbol "sentence" can be omitted.
リーダ21は、このような終端記号と組とされた非終端
記号を読み取ると、構造体変数管理部25の該当する非
終端記号名の変数の印刷という属性に、組となっている
終端記号の内部形式を代入する。この処理により、構造
体変数管理部25は、終端記号の付加された非終端記号
については、組となる終端記号を印刷属性として管理す
ることになる。展開処理部23が内部形式プログラムの
作成を完了すると、非終端記号に対応するテストプログ
ラム30のテキストが求められる。このようにして求め
られたテキストは、構造体変数管理部25の該当する非
終端記号名の変数の値属性で管理されることになる。ラ
イタ28は、属性文法記述10中の非終端記号について
は、構造体変数管理部25により管理されるこの値属性
のテキストを出力してい(ことでテストプログラム30
を出力することになるが、このとき、ライタ28の印刷
属性出力部29は、印刷属性を有する非終端記号につい
ては、非終端記号のテキストの出力に先立って、印刷属
性として管理される終端記号のテキストを出力するよう
処理する。When the reader 21 reads a non-terminal symbol paired with such a terminal symbol, the internal format of the paired terminal symbol is added to the variable printing attribute of the corresponding non-terminal symbol name in the structure variable management unit 25. Substitute. Through this process, the structure variable management unit 25 manages the terminal symbol as a pair as a printing attribute for a non-terminal symbol to which a terminal symbol is added. When the expansion processing unit 23 completes the creation of the internal format program, the text of the test program 30 corresponding to the non-terminal symbol is obtained. The text obtained in this way is managed by the value attribute of the variable with the corresponding non-terminal symbol name in the structure variable management unit 25. For non-terminal symbols in the attribute grammar description 10, the writer 28 outputs the text of this value attribute managed by the structure variable management unit 25 (thereby outputting the text of the value attribute in the test program 30).
However, at this time, for non-terminal symbols that have print attributes, the print attribute output unit 29 of the writer 28 outputs the text of the terminal symbol managed as the print attribute before outputting the text of the non-terminal symbol. Process to output.
このようにして、終端記号との対を組とする非終端記号
の繰り返し記述を認めないときには、属性文法記述10
で、
サブルチン呼び出し→
CALL” サプトチン名”(”パラメタ (カンマと
パラメタ)′)0カンマとパラメタ→”、′パラメタ
と記述しなければならなかったのに対して、このような
記述形式を認めることで、
サブルーチン呼び出し→
”CALL’ サプトチン名“(″パラメタ じ、′
パラメタ) ”)mで足りることになることから、1行
文の記述を記述する必要がなくなって属性文法記述の記
述性の向上が図られることになる。In this way, when repeated descriptions of non-terminal symbols paired with terminal symbols are not allowed, attribute grammar description 10
Now, subroutin call → CALL” saputin name” (“parameter (comma and parameter)’) 0 comma and parameter →”, whereas it had to be written as ’parameter, this type of description format is now allowed. Then, subroutine call → ``CALL' saputin name'' (``parameter same,'
Since the parameter ) ``) m is sufficient, it is no longer necessary to write a one-line description, and the descriptive nature of the attribute grammar description can be improved.
また、終端記号との対を組とする非終端記号の省略化記
述を認めないときには、属性文法記述IOで、
IF文→
′1ビ条件”T)IEII”文fBLsE文)″END
−1PELSE文→”ELSE”文
と記述しなければならなかったのに対して、このような
記述形式を認めることで、
IF文→
”IF’条件”THEN’文1”ELSE”文)”EN
D−IF”で足りることになることから、1行文の記述
を記述する必要がなくなって属性文法記述の記述性の向
上が図られることになる。In addition, when the abbreviated description of a non-terminal symbol paired with a terminal symbol is not allowed, in the attribute grammar description IO, IF statement → '1bi condition "T)IEII" statement fBLsE statement)"END
-1 PELSE statement → "ELSE" statement had to be written, but by allowing such a description format, IF statement → "IF'condition"THEN' statement 1 "ELSE"statement)"EN
Since "D-IF" is sufficient, there is no need to write a one-line sentence description, and the descriptive nature of the attribute grammar description can be improved.
このように、本発明によれば、本出願人が出願した先の
特許出願のテストプログラム作成処理装置において、属
性文法記述の記述性の向上を図れるようになり、テスト
プログラムを効率的に生産できるようになるのである。As described above, according to the present invention, it is possible to improve the descriptive nature of the attribute grammar description in the test program creation processing device for the earlier patent application filed by the present applicant, and it is possible to efficiently produce test programs. This is what happens.
以下、実施例に従って本発明の詳細な説明する。 Hereinafter, the present invention will be explained in detail according to examples.
第2図に、本発明により自動作成されるテストプログラ
ムの使用方法の説明図を示す。図中、第1図で説明した
ものと同じものについては、同一の記号で示しである。FIG. 2 shows an explanatory diagram of how to use a test program automatically created according to the present invention. In the figure, the same parts as those explained in FIG. 1 are indicated by the same symbols.
40は検査対象となる言語処理プログラムであって、属
性文法記述lOに記述されることになる処理対象文のコ
ンパイル処理を実行するもの、41はテスト用オブジェ
クトプログラムであって、言語処理プログラム40によ
りコンパイルされたテストプログラム30のオブジェク
トプログラムであるもの、42はリンカであって、テス
ト用オブジェクトプログラム41とライブラリ43のプ
ログラムとのリンクを実行するもの、44はリンカ42
によってテスト用オブジックトプログラム41とリンク
されることになるCHECKプログラムであって、テス
トプログラム30中に記述される乱数文の実行結果の確
認を行うテストルーチンであるもの、45は実行単位を
なすロードモジュール、46はロードモジュール45の
実行結果を表す実行結果出力である。Reference numeral 40 denotes a language processing program to be inspected, which executes the compilation process of the processing target sentence to be described in the attribute grammar description IO, and 41 is a test object program, which is executed by the language processing program 40. 42 is an object program of the compiled test program 30; 42 is a linker for linking the test object program 41 with the program in the library 43; 44 is a linker 42;
The CHECK program 45 is a test routine that is linked to the test object program 41 and is a test routine for checking the execution results of random number statements written in the test program 30. The load module 46 is an execution result output representing the execution result of the load module 45.
この図に示すように、本発明に係るテストプログラム作
成処理装置20は、言語処理プログラム40の機能の検
証のために必要となるテストプログラム30を作成する
ために用意されるものであり、この必要とされるテスト
プログラム30を、マニュアルに従って記述される属性
文法記述IOから自動作成するよう処理することになる
。As shown in this figure, a test program creation processing device 20 according to the present invention is prepared for creating a test program 30 necessary for verifying the function of a language processing program 40, and The test program 30 is automatically created from the attribute grammar description IO written in accordance with the manual.
第3図に、「代入文」に関しての属性文法記述10の一
実施例を示す。この属性文法記述10は、様々な形式の
「代入文」を複数個作成して、言語処理プログラム40
がそれらの「代入文」についての計算処理を行ったとき
に、正しい数値を算出するのか否かをテストするために
プログラマ等により作成される。第4図に、この属性文
法記述10から自動作成されることになるテストプログ
ラム30の一実施例を示す、このテストプログラム30
は、「代入文」の−態様である乱数文(「代入文」の展
開規則に対しての乱数的な選択処理により生成される)
と、CHECKプログラム44を呼び出すための確認文
との対を基本単位にして、この基本単位を複数つなげる
ことで構成される。FIG. 3 shows an example of the attribute grammar description 10 regarding "assignment statement". This attribute grammar description 10 is created by creating a plurality of "assignment statements" in various formats, and then using the language processing program 40.
It is created by a programmer or the like to test whether or not a correct numerical value is calculated when the calculation process is performed on those "assignment statements". FIG. 4 shows an example of a test program 30 that will be automatically created from this attribute grammar description 10.
is a random number statement (generated by random number selection processing for the expansion rule of "assignment statement"), which is the − aspect of "assignment statement".
and a confirmation statement for calling the CHECK program 44 as a basic unit, and a plurality of these basic units are connected.
具体的に説明するならば、第4図中の
AAE=−2991448
CALL CHECK(1,AAE、−133952
)がテストプログラム30の基本単位をなすものである
。この基本単位の意味するところは、AAE=−299
*44B
という乱数文を言語処理プログラム40で処理させると
、変数名のrAAEJのところに、−133952(=
−299本448)の値がセントされていれば正しい処
理がなされたことになるので、この変数名と値とを引数
にして、CHECKプログラム44の呼び出しを行うC
A L L CHE CK (1、A A E、−
133952)という確認文を、この乱数文と対にして
作成するのである。To explain specifically, AAE=-2991448 CALL CHECK(1, AAE, -133952
) constitutes the basic unit of the test program 30. What this basic unit means is AAE=-299
When the random number statement *44B is processed by the language processing program 40, -133952 (=
If the value of -299 lines 448) is sent, it means that correct processing has been performed, so call the CHECK program 44 using this variable name and value as arguments.
A L L CHE CK (1, A A E, -
133952) is created by pairing it with this random number statement.
本発明の詳細な説明に入る前に、第3図の属性文法記述
lOを例にしながら、本発明に係るテストプログラム作
成処理装置20が実行することになるテストプログラム
30の自動作成処理について説明する。ここで、テスト
プログラム作成処理装置20のシステム構成は第1図で
説明したものと同一である。Before entering into a detailed explanation of the present invention, the automatic creation process of the test program 30 that will be executed by the test program creation processing device 20 according to the present invention will be explained using the attribute grammar description IO of FIG. 3 as an example. . Here, the system configuration of the test program creation processing device 20 is the same as that described in FIG.
リーダ21は、第3図の属性文法記述10を読み取ると
、この読み取った属性文法記述10を内部形式に変換す
る。この変換された属性文法記述IOを受は取ると、翻
訳処理器22は、出発記号の「¥文法記述」に続く
(設定 項番値 l)
に従って、システム変数の「項番値」という変数名のと
ころに、′l”をセントする。この設定処理は、翻訳処
理器22が「設定」という記号を解釈したときに、意味
記述解釈r&27が管理する「設定」という名の関数に
起動をかけることで実行されることになる。この意味記
述解釈器27は、具体的には、例えばLISPシステム
で構成されて、定義されている関数の呼び出しがかかる
と、その関数の処理を実行して処理値を翻訳処理器22
に返すよう処理することになる。When the reader 21 reads the attribute grammar description 10 shown in FIG. 3, it converts the read attribute grammar description 10 into an internal format. Upon receiving this converted attribute grammar description IO, the translation processor 22 uses the variable name "Item number value" of the system variable according to the starting symbol "\ Grammar description" (setting item number value l). In this setting process, when the translation processor 22 interprets the symbol "setting", it activates a function named "setting" managed by the semantic description interpretation r&27. This will cause it to be executed. Specifically, this semantic description interpreter 27 is constructed of, for example, a LISP system, and when a defined function is called, it executes the processing of the function and transfers the processed value to the translation processor 22.
It will be processed so that it is returned to
翻訳処理器22は、続いて記述される
<’aNL“ 代入文 5 10> &により、所定
の数(この例では、5から10までの間の乱数値で指定
される)の「代入文」についてのテストプログラム30
を、1つずつ改行して作成する必要があることを知る。The translation processor 22 generates a predetermined number (in this example, specified by a random number between 5 and 10) of "assignment statements" using the following <'aNL" assignment statement 5 10>&. Test program for 30
I learned that it is necessary to create each line with a new line.
この「代入文」は「“」で区切られていないので、その
ままテキストにできない非終端記号である。このような
非終端記号は、別の位置にどのようにテキストに展開し
ていけばよいかが記述されているので、翻訳処理器22
は、その展開規則11に従って展開処理を実行する。This "assignment statement" is not delimited by "", so it is a non-terminal symbol that cannot be converted into text as is. For such non-terminal symbols, the translation processing unit 22 has a description of how to expand them into text in another position.
executes the expansion process according to the expansion rule 11.
この例では、続いて、
変数 ′= 式
と「代入文」の定義がされており、更に、この定義中の
「変数」の定義が図中の0部分で展開されていて、「式
」の定義が図中の0部分で展開されている。この■及び
0部分のrNの記号は、いずれか1つのものを乱数に従
って選択することを表している。これから、翻訳処理器
22は、乱数処理に従って1代入文」の「変数」として
、例えばrAAEJの変数名を選択し、「代入文」の「
式」として、例えば「数1本数2」の弐を選択する。こ
のとき実行する乱数による選択対象の選択処理は、具体
的には、乱数発生部24が、選択対象の前に記述されて
いる選択値(この例では、すべて“100”である)の
総和(この例では、“500”である)の内にある乱数
値を発生させて、その発生した乱数値が属する選択値の
選択対象を選ぶことで行うことになる。また、「数1本
数2」のように、更に展開されるものについては、その
展開規則に従って展開を続行していく。この例では、「
数1本数2」は、更に0部分で展開されているので、そ
の展開に従って、例えば、「数値1」として“−299
”を選択し、「数値2」として“448′を選択するこ
とになる。In this example, the variable ′= expression and the "assignment statement" are then defined, and the definition of the "variable" in this definition is expanded at the 0 part in the diagram, and the "expression" is expanded. The definition is expanded in the 0 part of the diagram. The symbols ■ and rN in the 0 part indicate that one of them is selected according to a random number. From now on, the translation processor 22 selects, for example, the variable name rAAEJ as the "variable" of the "1 assignment statement" according to random number processing, and selects the variable name of "1 assignment statement" as the "variable", and
For example, select 2 of ``Number 1 and Number 2'' as the expression. Specifically, in the process of selecting a selection target using random numbers executed at this time, the random number generation unit 24 generates a total sum (in this example, all "100") of selection values written before the selection target ( In this example, this is done by generating a random number within the range of "500" and selecting the selection target to which the generated random number belongs. Furthermore, for items that are further expanded, such as "number 1 and number 2," expansion continues according to the expansion rules. In this example,
The number 1 and the number 2 are further expanded at the 0 part, so according to that expansion, for example, as the ``number 1'', we can write ``-299''.
” and “448′” as “Number 2”.
このようにして、第4図のテストプログラム30の先頭
に位置する代入文の一態様であるAAE=−299*4
48
というテキストが作成されることになる。In this way, AAE=-299*4, which is one aspect of the assignment statement located at the beginning of the test program 30 in FIG.
48 will be created.
「代入文」の定義に続いて記述される
「代入 変数 (値 式)J
により、翻訳処理器22は、意味記述解釈器27が管理
する「代入」という名の関数に起動をかけることで、テ
スト対象言語変数の「変数」のところに、「式」の値を
設定するよう処理する。いまの場合、「変数」としては
rAAEJが選択されているので、このrAAEJとい
う変数名のところに「式」の値を設定する。この「弐」
の値は、具体的には、■部分の選択規則の[数1*数2
Jの後に続いて記述されている
r値設定(*(値 数1)(値 数2))jで算出され
る。この算出処理も、意味記述解釈器27により実行さ
れて、いまの場合では、「数値1」の値である“−29
9″と、「数値2」の値である“448”との乗算値で
ある“−133952”が、この「式」の値として算出
される。これから、rAAEJという変数名のところに
、“−133952”が設定されることになる。By "assignment variable (value expression) J" written following the definition of "assignment statement", the translation processor 22 activates a function named "assignment" managed by the semantic description interpreter 27, The value of the "expression" is set in the "variable" of the language variable to be tested. In this case, rAAEJ is selected as the "variable", so the value of the "formula" is set in the variable name rAAEJ. This "Ni"
Specifically, the value of [Math 1 * Math 2
It is calculated using the r value setting (*(value number 1) (value number 2)) j written following J. This calculation process is also executed by the meaning description interpreter 27, and in this case, the value of “numeric value 1” is “-29”.
9'' and "448", which is the value of "Numerical value 2", "-133952" is calculated as the value of this "formula". From now on, "-133952" will be set in the variable name rAAEJ.
「代入文」の定義の最後では、「確認」を展開すること
が要求されている。この「rII認」がいかなるもので
あるかは、図中の0部分で展開されている。これから、
翻訳処理器22は、この0部分の展開規則に従って、「
項番」の値の“1”と、「変数」のrAAEJと、「変
数値」の“−133952”とを引数として、CHEC
Kプログラム44の呼び出しを行う
CALL CHECK(1,AAE、−133952
)という確認文の展開を実行する。このようにして、A
AE=−299*448
CALL CHECK(1,AAE、−133952
)という内部形式テストプログラムの作成が終了するこ
とになる。ぞして、最後に、0部分の更新規則に従って
、意味記述解釈器27に起動をかけて、次の乱数文のた
めに、システム変数の「項番値」の変数名の値を1つ歩
進させる処理を行うよう処理する。At the end of the definition of "assignment statement", it is required to expand "confirmation". The nature of this "rII recognition" is shown in the 0 part of the figure. from now,
The translation processor 22 follows the expansion rule for the 0 part and reads “
Use CHEC with the value "1" of "Item number", rAAEJ of "Variable", and "-133952" of "Variable value" as arguments.
CALL CHECK (1, AAE, -133952
) is executed. In this way, A
AE=-299*448 CALL CHECK(1, AAE, -133952
) The creation of the internal format test program will be completed. Finally, according to the update rule for the 0 part, the semantic description interpreter 27 is activated and the value of the variable name of the "item number value" of the system variable is incremented by one step for the next random number statement. Process to advance the process.
翻訳処理器22は、以下同様の処理を繰り返していくこ
とで、第4図に示したような内部形式テストプログラム
の作成を実行することになる。そして、属性文法記述I
Oに対応する内部形式テストプログラムの作成が終了す
ると、ライタ28は、この作成した内部形式テストプロ
グラムを実行可能なテストプログラムとして出力してテ
ストプログラム30の作成処理を終了する。The translation processor 22 then repeats the same process to create an internal format test program as shown in FIG. 4. And attribute grammar description I
When the creation of the internal format test program corresponding to O is completed, the writer 28 outputs the created internal format test program as an executable test program, and ends the creation process of the test program 30.
このように、翻訳処理器22は、属性文法記述10中の
展開規則11に従って再帰的に展開を実行していくこと
で、内部形式テストプログラムへの展開を実行する。こ
の展開時に、属性文法記述10中の意味記述12の実行
が必要となる場合には、意味記述解釈器27を起動して
いくよう処理し、この起動される意味記述解釈器27は
、構造体変数管理部25の変数データを新たなものに更
新していく処理を実行する。そして、翻訳処理器22は
、内部形式テストプログラムへの展開を、この更新され
た変数データを参照しながら実行していくとともに、展
開にあたって必要となる展開規則11中に含まれる選択
性の規則に関しては、乱数発生部24により発生される
乱数値に従って選択対象を選択することで行うことにな
る。In this way, the translation processor 22 executes expansion into an internal format test program by recursively executing expansion according to the expansion rule 11 in the attribute grammar description 10. During this expansion, if it is necessary to execute the semantic description 12 in the attribute grammar description 10, the semantic description interpreter 27 is activated, and the activated semantic description interpreter 27 is configured as a structure. A process of updating variable data in the variable management unit 25 to new data is executed. Then, the translation processor 22 executes the expansion into the internal format test program while referring to this updated variable data, and also regarding the selectivity rules included in the expansion rules 11 necessary for expansion. This is performed by selecting the selection target according to the random number value generated by the random number generation section 24.
次に、本発明の特徴部分について説明する。本発明では
、〔作用〕の欄でも説明したように、属性文法記述10
中で記述される非終端記号についての繰り返し記述と省
略化記述については、終端記号との対を組として記述す
ることを特徴とする。Next, the features of the present invention will be explained. In the present invention, as explained in the [Operation] section, the attribute grammar description 10
The repeated descriptions and abbreviated descriptions of non-terminal symbols described in the above are characterized in that they are described in pairs with terminal symbols.
すなわち、乱数発生部24が発生する乱数値に従って決
定される回数骨、記述しである非終端記号を繰り返すと
いう記述である繰り返し記述の例で説明するならば、
!ブトチン呼び出し→
’CALL″ サプトチン名′(″パラメタ (”、′
パラメタ) ”)′というように、「、」という終端記
号と「パラメタ」という非終端記号との対からなる組を
繰り返すというように記述する。また、乱数発生部24
が発生する乱数値に従って省略するか否かを決定すると
いう記述である省略化記述の例で説明するならば、
1F文→
IF”条件“THEN”文(”f!LSEs文]”EN
D−11というように、「”ELSE”」という終端記
号と「文」という非終端記号との対からなる組の記述が
省略可能であるというように記述するのである。That is, if we take an example of a repeated description, which is a description that repeats a non-terminal symbol, which is a number of times determined according to the random number generated by the random number generation unit 24, then ! Buttotin call → 'CALL'' Saputin name'(''parameter('','
Parameter) ``)'' is written by repeating a pair consisting of a terminal symbol ``,'' and a non-terminal symbol ``parameter''. In addition, the random number generator 24
To explain this using an example of an abbreviation description, which is a description that determines whether to omit or not according to the generated random value, 1F statement → IF" condition "THEN" statement ("f!LSEs statement]"EN
As shown in D-11, the description of a pair consisting of a terminal symbol "ELSE" and a non-terminal symbol "sentence" can be omitted.
次に、第5図及び第6図に示すフローチャートに従って
、本発明が、このような記述形式に対してどのように処
理するのかについて説明する。ここで、第5図のフロー
チャートは、リーダ21が実行するフローチャートであ
り、第6図のフローチャートは、ライタ28が実行する
フローチャートである。Next, how the present invention processes such a description format will be explained according to the flowcharts shown in FIGS. 5 and 6. Here, the flowchart in FIG. 5 is a flowchart executed by the reader 21, and the flowchart in FIG. 6 is a flowchart executed by the writer 28.
リーダ21は、第5図のフローチャートのステップlで
示すように、属性文法記述IOの文字を読み取って内部
形式に変換していくときに、読み取った文字が省略化記
述の先頭文字であるのか否かを判断する。上述の例に従
って説明するならば、読み取った文字が「(」であるの
か否かを判断するのである。読み取った文字が省略化記
述の先頭文字であると判断するときには、対応する関数
を起動して、ステップ2及びステップ3の処理を実行す
る。すなわち、ステップ2で示すように、省略化記述の
最終文字(上述の例では[]」である)までの読取処理
を実行するとともに、読み取った文字を内部形式に変換
して、翻訳処理器22に渡すよう処理する。このとき、
ステップ3で示すように、構造体変数管理部25の該当
する非終端記号名の変数の印刷という属性に、組となっ
ている終端記号を登録するよう処理する。この処理によ
り、上述の例で説明するならば、「(・・・・・・)」
で区切られた部分中に記述される非終端記号名の変数の
印刷属性に、「[・・・・・・]」で区切られた部分中
に記述される終端記号が登録されることになる。As shown in step 1 of the flowchart in FIG. 5, the reader 21, when reading the characters of the attribute grammar description IO and converting them into the internal format, determines whether the read characters are the first characters of the abbreviated description. to judge. To explain according to the example above, it is determined whether the read character is "(" or not. When it is determined that the read character is the first character of the abbreviation description, the corresponding function is started. Then, the processes of steps 2 and 3 are executed.In other words, as shown in step 2, the reading process up to the last character of the abbreviated description (in the above example, it is []'') is executed, and the The characters are converted into an internal format and processed to be passed to the translation processor 22. At this time,
As shown in step 3, processing is performed to register the paired terminal symbols in the variable printing attribute of the corresponding non-terminal symbol name in the structure variable management unit 25. With this process, if we explain using the above example, "(......)"
The terminal symbol described in the part delimited by "[...]" will be registered in the printing attribute of the variable of the non-terminal symbol name described in the part delimited by "[...]".
一方、読み取った文字が省略化記述の先頭文字でないと
判断するときは、ステップ4で示すように、読み取った
文字が繰り返し記述の先頭文字であるのか否かを判断す
る。上述の例に従って説明するならば、読み取った文字
が「(」であるのか否かを判断するのである。読み取っ
た文字が省略化記述の先頭文字であると判断するときに
は、対応する関数を起動して、ステップ5及びステップ
6の処理を実行する。すなわち、ステップ5で示すよう
に、繰り返し記述の最終文字(上述の例では口」である
)までの読取処理を実行するとともに、読み取った文字
を内部形式に変換して、翻訳処理器22に渡すよう処理
する。このとき、ステップ5で示すように、構造体変数
管理部25の該当する非終端記号名の変数の印刷という
属性に、組となっている終端記号を登録するよう処理す
る。On the other hand, when it is determined that the read character is not the first character of the abbreviated description, as shown in step 4, it is determined whether the read character is the first character of the repeated description. To explain according to the example above, it is determined whether the read character is "(" or not. When it is determined that the read character is the first character of the abbreviation description, the corresponding function is started. Then, the processes of steps 5 and 6 are executed.In other words, as shown in step 5, the reading process up to the last character of the repeated description (in the above example, ``mouth'') is executed, and the read characters are It converts it into an internal format and passes it to the translation processor 22.At this time, as shown in step 5, a set is added to the print attribute of the variable with the corresponding non-terminal symbol name in the structure variable management unit 25. Process to register the terminal symbol that is specified.
この処理により、上述の例で説明するならば、「(・・
・・・・)」で区切られた部分中に記述される非終端記
号名の変数の印刷属性に、「(・・・・・・)」で区切
られた部分中に記述される終端記号が登録されることに
なる。By this process, if we explain using the example above, "(...
The terminal symbol written in the part delimited by "(......)" is registered in the printing attribute of the variable of the non-terminal symbol name written in the part delimited by "(......)". will be done.
ステップ4の処理で繰り返し記述の先頭文字でもないと
判断するときに、そのまま読取処理を実行して、読み取
った文字を内部形式に変換して翻訳処理器22に渡すよ
う処理することになる。そして、ステップ3、ステップ
6及びステップ7に続いて、ステップ8で、属性文法記
述10の読取が完了したのか否かを判断して、完了して
いないと判断するときにはステップ1に戻るよう処理す
ることになる。When it is determined in step 4 that the character is not the first character of the repeated description, the reading process is performed as is, and the read character is converted into an internal format and passed to the translation processor 22. Then, following steps 3, 6, and 7, in step 8, it is determined whether or not reading of the attribute grammar description 10 has been completed, and when it is determined that reading has not been completed, processing returns to step 1. It turns out.
この属性文法記述10の内部形式を受は取ると、翻訳処
理器22は、第3図の属性文法記述10の例で説明した
ような乱数的な選択処理を施すことで展開処理を実行し
て、内部形式テストプログラムの作成を実行する。そし
て、内部形式テストプログラムの作成が終了すると、構
造体変数管理部25の各非終端記号名の変数の値属性に
出力するテキストが代入されることになる。この内部形
式テストプログラムの作成にあたって、展開処理部23
は、省略化記述については、乱数発生部24が発生する
乱数値と指定された確率値とを比較することで、その省
略化記述の対象となった非終端記号の省略の有無を決定
し、繰り返し記述については、乱数発生部24が発生す
る乱数値に従って、その繰り返し記述の対象となった非
終端記号の繰り返し回数を決定していくことになる。Upon receiving the internal format of the attribute grammar description 10, the translation processor 22 executes the expansion process by performing the random number selection process as explained in the example of the attribute grammar description 10 in FIG. , execute the creation of an internal format test program. When the creation of the internal format test program is completed, the text to be output is assigned to the value attribute of the variable of each non-terminal symbol name in the structure variable management unit 25. In creating this internal format test program, the expansion processing unit 23
For the abbreviated description, by comparing the random number generated by the random number generator 24 with the specified probability value, it is determined whether or not the non-terminal symbol targeted by the abbreviated description is omitted, and the process is repeated. Regarding the description, the number of repetitions of the non-terminal symbol that is the object of the repeated description is determined according to the random number generated by the random number generator 24.
このようにして、出力対象となるテストプログラム30
の作成が終了すると、ライタ28は、テキストの出力に
あたって、第6図のフローチャートのステップ11で示
すように、出力対象のテキストの非終端記号の印刷属性
に終端記号が登録されているのか否かをチエツクする。In this way, the test program 30 to be output
When the creation of the text is completed, the writer 28 determines whether or not a terminal symbol is registered in the print attribute of the non-terminal symbol of the text to be output, as shown in step 11 of the flowchart of FIG. 6, when outputting the text. Check.
このチエツクにより、印刷属性に終端記号が登録されて
いると判断するときには、ステップ12で示すように、
組となるその終端記号のテキストを出力し、続いて、ス
テップ13で示すように、該当する非終端記号の展開結
果のテキストを出力するよう処理する。このとき、繰り
返し記述については、各繰り返し毎に組となる終端記号
を出力することになる。When it is determined by this check that a terminal symbol is registered in the printing attributes, as shown in step 12,
The text of the pair of terminal symbols is output, and then, as shown in step 13, the text of the expansion result of the corresponding non-terminal symbol is output. At this time, for repeated descriptions, a set of terminal symbols is output for each repetition.
これから、(”、′パラメタ)を3回繰り返すというこ
とになるときには、あたかも、
”、′ハラメタ”、′パラメタ”、′パラメタと定義さ
れていたかのようにテキストが出力されることになる。From now on, when ('', 'parameter) is repeated three times, the text will be output as if it were defined as ``, 'harameta', 'parameter', 'parameter'.
一方、ステップ11のチエツクにより、印刷属性に終端
記号が登録されていないと判断するときには、ステップ
I2の処理は行わずに、直ちにステップ13の処理に従
って、該当する非終端記号の展開結果のテキストを出力
するよう処理する。On the other hand, if it is determined through the check in step 11 that the terminal symbol is not registered in the printing attributes, the text resulting from the expansion of the corresponding non-terminal symbol is output immediately according to the process in step 13 without performing the process in step I2. Process it so that it does.
そして、ステップ14で、すべてのテキストを出力した
のか否かを判断して、出力されていないものが残されて
いるときには、ステップ11に戻るよう処理することに
なる。なお、省略化記述にあって、省略することが決定
されるときには、実質的なテキストは何も出力されない
よう処理される。Then, in step 14, it is determined whether or not all the text has been output, and if there is any remaining text that has not been output, the process returns to step 11. Note that in the abbreviated description, when it is decided to omit, no substantial text is output.
以上に説明したように、本発明では、非終端記号につい
ての繰り返し記述と省略化記述については終端記号との
対を組として記述することを特徴とし、そして、そのよ
うな記述がなされたときに、本来の記述内容のテキスト
を出力するよう処理することを特徴とするものである。As explained above, the present invention is characterized in that repeated descriptions and abbreviated descriptions of non-terminal symbols are described as a pair with a terminal symbol, and when such a description is made, It is characterized by processing to output the text of the original description content.
これから、非終端記号1A”の繰り返しを、
A*−(A)
という記号方式で定義すると、
サブルーチン呼び出し→
”CALピ サブルーチン名″(mパラメタ (カンマ
とパラメタ) “)″カンマとパラメタ→#、′パラメ
タ
と記述しなければならなかったのに対して、本発明では
、
サブルーチン呼び出し→
’CALL″ サブルーチン名″(″パラメタ (”、
″パラメタ) ”)″という記述で足りることになる。From now on, if we define the repetition of the non-terminal symbol 1A'' using the symbol system A*-(A), then subroutine call → ``CAL pi subroutine name'' (m parameter (comma and parameter) ``)'' comma and parameter → #, ' In contrast, in the present invention, subroutine call → 'CALL'' subroutine name'' (``parameter ('',
The description ``parameter) ``)'' is sufficient.
このように定義が1つ減らせることになるのは、〔作用
〕の欄でも説明したように、省略化記述についても同様
である。This reduction in the number of definitions by one also applies to abbreviated descriptions, as explained in the [Operation] section.
また、非終端記号“A”の繰り返しを、A*→A
A* e
但し、eは空記号
と記述すると、繰り返し回数の制御や生成された木の解
釈が難しくなるという問題点がでてくるが、本発明を用
いればそのようなことも起こらない。Also, the repetition of the non-terminal symbol “A” is expressed as A*→A
A* e However, if e is written as an empty symbol, there will be a problem that it will be difficult to control the number of repetitions and interpret the generated tree, but if the present invention is used, such problems will not occur.
このように、本発明によれば、属性文法記述から言語処
理プログラム用のテストプログラムを自動作成するテス
トプログラム作成処理装置にあって、属性文法記述中で
定義しなければならない展開規則の定義の数を1つ減ら
せるようになるとともに、属性文法記述も見易いものと
なる。これから、テストプログラムの作成効率が著しく
高められることになるとともに、テストの質も向上でき
るようになる。As described above, according to the present invention, in a test program creation processing device that automatically creates a test program for a language processing program from an attribute grammar description, the number of expansion rule definitions that must be defined in the attribute grammar description can be reduced. can be reduced by one, and attribute grammar descriptions can also be made easier to read. From now on, the efficiency of creating test programs will be significantly increased, and the quality of testing will also be improved.
第1図は本発明の原理構成図、
第2図は本発明により自動作成されるテストプログラム
の使用方法を説明する説明図、第3図は属性文法記述の
一実施例図、
第4図は第3図の属性文法記述から作成されるテストプ
ログラムの説明図、
第5図はり−ダが実行するフローチャート、第6図はラ
イタが実行するフローチャート、第7図は先に出願の発
明の説明図である。
図中、10は属性文法記述、11は展開規則、l2は意
味記述、20はテストプログラム作成処理装置、21は
リーグ、22は翻訳処理器、23は展開処理部、24は
乱数発生部、25は構造体変数管理部、26は意味記述
処理依願部、27は意味記述解釈器、28はライタ、2
9は印刷属性出力部、30はテストプログラムである。Figure 1 is a diagram showing the principle configuration of the present invention, Figure 2 is an explanatory diagram explaining how to use a test program automatically created by the present invention, Figure 3 is an example diagram of an attribute grammar description, and Figure 4 is an illustration of an example of attribute grammar description. Figure 3 is an explanatory diagram of a test program created from the attribute grammar description, Figure 5 is a flowchart executed by the reader, Figure 6 is a flowchart executed by the writer, and Figure 7 is an explanatory diagram of the invention previously filed. It is. In the figure, 10 is an attribute grammar description, 11 is an expansion rule, l2 is a semantic description, 20 is a test program creation processing device, 21 is a league, 22 is a translation processor, 23 is an expansion processing unit, 24 is a random number generation unit, 25 2 is a structure variable management unit, 26 is a semantic description processing request unit, 27 is a semantic description interpreter, 28 is a writer, and 2
9 is a print attribute output unit, and 30 is a test program.
Claims (1)
従って記述された言語処理プログラムの処理対象文に対
して、展開規則に関しての乱数的な選択処理を施すこと
で該処理対象文の一態様をなす乱数文を生成するととも
に、該乱数文の実行結果の確認を行うテストルーチンの
呼び出しのための確認文を、該属性文法記述中に該処理
対象文と対応付けて記述することで該乱数文と対にして
生成して、言語処理プログラム用のテストプログラムと
なすテストプログラム作成処理装置であって、上記属性
文法記述(10)が、非終端記号についての繰り返し記
述と省略化記述については、終端記号との対を組として
記述するよう構成し、 かつ、上記属性文法記述(10)により記述される非終
端記号の属性を構造的に管理するとともに、終端記号と
組とされた非終端記号については、該終端記号を印刷属
性として管理するよう処理する構造体変数管理部(25
)と、 作成された上記テストプログラムを出力するとともに、
該テストプログラムをなす非終端記号のテキストを出力
する際に、該非終端記号が上記構造体変数管理部(25
)により印刷属性を有するものとして管理されるもので
あるときには、該非終端記号のテキストの出力に先立っ
て、該印刷属性の終端記号のテキストを出力するよう処
理するライタ(28)とを備えることを、 特徴とするテストプログラム作成処理装置。[Claims] The processing is performed by performing random number selection processing regarding the expansion rules on a sentence to be processed by a language processing program written according to the attribute grammar description (10) consisting of expansion rules and semantic descriptions. A confirmation statement for calling a test routine that generates a random number sentence that is one aspect of the target sentence and confirms the execution result of the random number statement is written in association with the target sentence in the attribute grammar description. A test program creation processing device that generates a test program for a language processing program by generating a pair with the random number sentence by The description is structured so that pairs with terminal symbols are described as a set, and the attributes of non-terminal symbols described by the above attribute grammar description (10) are managed structurally, and the attributes of non-terminal symbols that are paired with terminal symbols are managed structurally. Regarding non-terminal symbols, a structure variable management unit (25
) and output the above created test program,
When outputting the text of non-terminal symbols forming the test program, the non-terminal symbols are stored in the structure variable management section (25).
) is managed as having a print attribute by a writer (28) that processes to output the text of the terminal symbol with the print attribute prior to outputting the text of the non-terminal symbol. , a test program creation processing device characterized by:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1046217A JPH02224148A (en) | 1989-02-27 | 1989-02-27 | Test program forming processor |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1046217A JPH02224148A (en) | 1989-02-27 | 1989-02-27 | Test program forming processor |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH02224148A true JPH02224148A (en) | 1990-09-06 |
Family
ID=12740940
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1046217A Pending JPH02224148A (en) | 1989-02-27 | 1989-02-27 | Test program forming processor |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH02224148A (en) |
-
1989
- 1989-02-27 JP JP1046217A patent/JPH02224148A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Boujarwah et al. | Compiler test case generation methods: a survey and assessment | |
| US10459829B2 (en) | Overall test tool migration pipeline | |
| US6321376B1 (en) | Apparatus and method for semi-automated generation and application of language conformity tests | |
| JPH08194623A (en) | Method and apparatus for diagnosing lexical errors | |
| JPS61103247A (en) | Translation program generation system | |
| CN1971518A (en) | Compiling system, debugging system and program development system | |
| US7895575B2 (en) | Apparatus and method for generating test driver | |
| CN120780593A (en) | Method and device for writing test cases on vehicle based on large model assistance | |
| Murali et al. | A sentence generator for a compiler for PT, a pascal subset | |
| Conrad et al. | Graph transformations for model-based testing | |
| Henry | A technique for hiding proprietary details while providing sufficient information for researchers; or, do you recognize this well-known algorithm? | |
| JPH02224143A (en) | Test program forming processor | |
| MacLennan | The Synmac syntax macroprocessor: Introduction and manual, version 5 | |
| JPH10187461A (en) | Language processing system | |
| JPH02224144A (en) | Test program forming processor | |
| US20240202522A1 (en) | Device and method for generating deep learning model graph and abstract syntax tree for integrated compiler | |
| JPH10187450A (en) | Object-oriented program automatic generation device, automatic generation method and program storage medium | |
| JPH02224146A (en) | Test program forming processor | |
| Bromell et al. | A Strategy for the Development of Safety Critical Software | |
| JPH02224147A (en) | Test program forming processor | |
| Marick et al. | The VERUS™ Design Verification System | |
| JPS58169637A (en) | Compile processing system | |
| CN121657968A (en) | Software development method, system and equipment | |
| KR20240097681A (en) | Apparatus and method for generating deep learning model graph and abstract syntax tree for integrated compiler | |
| CN121326756A (en) | Unit test code generation method, device, equipment, medium and program product based on large model |