JP2004151884A - Program for extracting test item - Google Patents
Program for extracting test item Download PDFInfo
- Publication number
- JP2004151884A JP2004151884A JP2002314907A JP2002314907A JP2004151884A JP 2004151884 A JP2004151884 A JP 2004151884A JP 2002314907 A JP2002314907 A JP 2002314907A JP 2002314907 A JP2002314907 A JP 2002314907A JP 2004151884 A JP2004151884 A JP 2004151884A
- Authority
- JP
- Japan
- Prior art keywords
- test item
- test
- program
- extraction
- event
- 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
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
この発明は、開発対象のプログラムの試験項目を抽出する試験項目抽出プログラムに関する。
【0002】
【従来の技術】
通常、ソフトウェア開発を行う場合、開発段階でソフトウェア(プログラム)の試験作業を行うことが一般的である。このようなプログラムの試験は、開発段階で作成された仕様書などに従って、ソフトウェア開発者が試験する項目を人手で抽出する。そして、プログラムを動作させて、抽出された試験項目に従ったソフトウェア試験を行っている。ここで、試験項目を作成する際に使用される仕様書は、文書化された機能仕様書、詳細仕様書などや、例えばUML(Unified Modeling Language)等の表記法で記述された図表などがある。
【0003】
昨今のソフトウェアは大規模化・複雑化の一途を辿り、特に携帯電話に代表される組込み機器の高機能化によるソフトウェアの大規模化・複雑化は試験項目を幾何級数的に増加させており、特に携帯電話で動作するソフトウェアでは、試験項目数は、10万件とも言われている。
【0004】
近年、ソフトウェア開発において、開発の複雑さを回避するため、UML、状態遷移図、状態遷移表などの表記方法によるソフトウェア設計手法が多数利用されている。例えば、状態遷移表を用いて自動的にプログラムを生成するプログラム生成装置なども一般的に知られている(例えば、特許文献1)。そして、このような手法を利用することにより、ソフトウェア開発の効率化、開発モレやヌケの防止は、徐々に改善されてきている。
【0005】
【特許文献1】
特開2000−20347号公報
【0006】
【発明が解決しようとする課題】
しかしながら、ソフトウェア開発者は、仕様書を参照しながら、必要な試験項目を抽出する作業を人手で行っているため、開発対象のプログラムの機能の全てを網羅する試験項目を抽出することが困難である。すなわち、ソフトウェア開発者は、ソフトウェアの機能を熟知しているものの、すべての機能について的確な試験項目を抽出することには限度があり、このため、未試験項目が発生する可能性が高い。このような未試験項目がソフトウェアの重要な機能に関するものである場合には、最終製品に重大な障害が発生してしまい、高品質のソフトウェアを提供することができないという問題がある。
【0007】
また、UML、状態遷移図、状態遷移表などの表記方法によるソフトウェア設計手法のような効率的な手法を利用した開発においても、仕様書に基づいて試験項目を抽出する作業は、あいかわらず人手に頼っており、試験項目の抽出モレやヌケが生じ、結果として、ソフトウェアの障害の原因となっている。また、このような試験項目の抽出作業には、大量の工数が必要となり、開発期間が長期化するという問題もある。
【0008】
この発明は上記に鑑みてなされたもので、仕様書に基づくプログラムの試験項目を自動的に抽出することにより、高品質なソフトウェアを提供するとともに、開発期間の短縮化を図ることができる試験項目抽出プログラムを得ることを目的とする。
【0009】
【課題を解決するための手段】
上記目的を達成するため、請求項1にかかる発明は、開発対象のプログラムに対する試験項目を抽出する試験項目抽出方法をコンピュータに実行させる試験項目抽出プログラムにおいて、開発対象のプログラムが動作するシステムの取り得る状態と、前記システムの外部又は内部からの刺激であるイベントと、前記イベントにより前記システムの遷移すべき状態の遷移とを示す仕様書データに基づいて、前記イベントに対する前記状態の遷移の状況を示す経路情報を検索し、前記イベントを発生させて検索された経路情報に対する実行処理を行う経路検索ステップと、前記経路検索手段の実行処理による前記イベントと前記状態の遷移の経路情報を、前記試験項目として出力する試験項目出力処理ステップと、を含むことを特徴とする。
【0010】
この請求項1の発明によれば、開発対象のプログラムが動作するシステムの取り得る状態と、前記システムの外部又は内部からの刺激であるイベントと、前記イベントにより前記システムの遷移すべき状態の遷移とを示す仕様書データに基づいて、前記イベントに対する前記状態の遷移の状況を示す経路情報を検索し、前記イベントを発生させて検索された経路情報に対する実行処理を行う経路検索ステップと、前記経路検索手段の実行処理による前記イベントと前記状態の遷移の経路情報を、前記試験項目として出力する試験項目出力処理ステップと、を含むことで、仕様書データに基づくプログラムの試験項目を自動的に抽出することができ、高品質なソフトウェアを提供するとともに、開発期間の短縮化を図ることができる。
【0011】
また、請求項2にかかる発明は、請求項1に記載の試験項目抽出プログラムにおいて、抽出する試験項目または経路の抽出条件を設定する抽出項目設定ステップをさらに含み、前記経路検索ステップは、前記抽出項目設定ステップによって設定された抽出条件に基づいて、前記状態の遷移の経路を検索して前記イベントの発生による実行処理を行うことを特徴とする。
【0012】
この請求項2の発明によれば、抽出項目設定ステップによって、抽出する試験項目または経路の抽出条件を設定し、経路検索ステップによって、設定された抽出条件に基づいて、状態の遷移の経路を検索してイベントの発生による実行処理を行うことで、利用者が希望する範囲で試験項目を自動的に抽出することができ、利用者の便宜が図られる。
【0013】
また、請求項3にかかる発明は、請求項1または2に記載の試験項目抽出プログラムにおいて、前記試験項目出力処理ステップは、前記プログラムの試験項目を予め定められた記法に基づいて出力することを特徴とする。
【0014】
この請求項3の発明によれば、試験項目出力処理ステップによって、プログラムの試験項目を予め定められた記法に基づいて出力することで、抽出された試験項目の形式を統一することができる。
【0015】
また、請求項4にかかる発明は、請求項3に記載の試験項目抽出プログラムにおいて、前記試験項目出力処理ステップは、前記プログラムの試験項目をTTCNの記法に従って出力することを特徴とする。
【0016】
この請求項4の発明によれば、試験項目出力処理ステップは、前記プログラムの試験項目をTTCNの記法に従って出力することで、抽出された試験項目の形式を一般的に使用されている記法に統一することができ、試験項目の汎用性を向上させることができる。
【0017】
また、請求項5にかかる発明は、請求項1〜4のいずれか一つに記載の試験項目抽出プログラムにおいて、前記試験項目出力処理ステップは、前記プログラムの試験項目を、記憶手段に格納することを特徴とする。
【0018】
この請求項5の発明によれば、試験項目出力処理ステップによって、プログラムの試験項目を記憶手段に格納することで、抽出された試験項目を再利用することができる。
【0019】
また、請求項6にかかる発明は、請求項5に記載の試験項目抽出プログラムにおいて、前記記憶手段に格納された試験項目に基づいて、プログラムの試験実行を行う試験実行処理ステップをさらに含むことを特徴とする。
【0020】
この請求項6の発明によれば、試験実行処理ステップによって、記憶手段に格納された試験項目に基づいてプログラムの試験実行を行うことで、試験実行の自動化を実現することができ、開発期間のさらなる短縮化を図ることができる。
【0021】
【発明の実施の形態】
以下に添付図面を参照して、この発明にかかる試験項目抽出プログラムの好適な実施の形態を詳細に説明する。
【0022】
(実施の形態1)
図1は、この発明の実施の形態1である試験項目抽出プログラムが動作することによって機能する試験項目抽出装置の機能的構成を示すブロック図である。本実施の形態の試験項目抽出装置は、試験項目抽出プログラムが実行されることによってRAM上に生成される試験項目抽出部100と、ハードディスクドライブ装置(HDD)などの記憶装置110から構成される。なお、本実施の形態の試験項目抽出装置は、CPUなどの制御装置、HDDなどの記憶装置、キーボードやマウスなどの入力装置、ディスプレイ装置などの表示装置などからなる通常のコンピュータと同様のハードウェア構成を有している。
【0023】
本実施の形態の試験項目抽出装置において、試験項目抽出プログラムを実行することによって生成される試験項目抽出部100は、図1に示すとおり、経路検索部101と、経路比較部102と、入力処理部103と、ループ判定部104と、試験項目出力処理部105と、試験実行処理部106とから構成される。これら各部は、試験項目抽出プログラムの内部モジュール構成と同様の構成となっている。
【0024】
また、記憶装置110には、仕様書データ111と、経路データ112とがファイル形式で格納され、試験項目抽出部100によって生成された試験項目データ113も格納されるようになっている。
【0025】
入力処理部103は、記憶装置110に格納されている仕様書データ111を読み出し、読み出したデータを経路検索部101に送るものである。ここで、仕様書データとは、開発対象のプログラムを実行したときに、当該プログラムを実行するシステムの状態と、外部または内部からの刺激であるイベントと、イベントを受けたときの遷移先の状態とを記述したデータ、またはかかるデータを実行可能な形式の中間コードに変換したデータ、例えば状態遷移図、状態遷移表、ステートチャートなどのデータまたはその中間コードデータが該当する。本実施の形態では、仕様書データ111として主として状態遷移表データを使用している。
【0026】
経路検索部101は、入力処理部103によって読み出された仕様書データ111から、イベント、状態、アクション、遷移先の状態の組で構成される経路データを検索するものである。具体的には、経路検索部101は、仕様書データ111のプログラムの開始位置からイベントを発生させて状態の遷移を行わせながら、イベントと状態の組で構成される経路データを記憶装置110に格納し、仕様書データ111に従った経路を辿ることによって、仕様書データ111に基づいた経路を検索する。
【0027】
経路比較部102は、経路検索部101が開発対象のプログラム内のループ処理内の経路をプログラム進行の逆方向に辿っているときに、現時点の経路データと記憶装置110に記憶された経路データとを比較するものである。比較の結果、両経路データが一致しない場合に、検索再開メッセージを経路検索部101に送出する。
【0028】
ループ判定部104は、経路検索部101によって現在辿っている経路がプログラムのループ処理内部のものか否かを判定するものである。具体的には、ループ判定部104は、経路検索部101から受け取った経路データを最初に受け取った経路データとを比較し、両経路データが一致する場合にはループ処理内部の経路であると判断し検索停止メッセージを経路検索部101に送出する。両経路データが一致しない場合に検索続行メッセージを経路検索部101に送出する。
【0029】
試験項目出力処理部105は、経路検索部101によって経路検索処理が終了した後、経路検索部101によって記憶装置110に格納された経路データを、TTCN記法(Tree and Tabular Combined Notation)に変換し、変換後のデータを試験項目データ113としてファイル形式で記憶装置110に保存するものである。
【0030】
試験実行処理部106は、記憶装置110に格納されている試験項目データ113を読み出して、当該データの内容に従ってプログラムの試験を実行するものである。
【0031】
次に、記憶装置110に格納された各種データについて説明する。図2は、仕様書データ111としての状態遷移表の一例を示す説明図である。状態遷移表は、図2に示すように、表の行に開発対象のプログラムが動作するシステムが受信するイベント(発生するイベント)を、列にシステムが取りうる状態をとり、イベントと状態の交差点をセルとして、そのセルの上段に次の遷移先の状態を、下段にアクションを記述したものである。そして、システムがある状態にいるときに、あるイベントが発生した場合には、現在の状態と受信した事象の交差するセルに記述されたアクションを実行し、その後、セルに記述された遷移先の状態にシステムが遷移することを示すものである。例えば、図2では、イベントとして送信要求(イベントNo.1)、送信完了(イベントNo.2)、タイムアウト(イベントNo.3)があり、状態として待機(状態No.1)、送信中(状態No.2)がある。
【0032】
ここで、この状態遷移表で表現されたシステムの現在の状態が待機であり、このとき送信要求のイベントを受信したとすると、送信要求イベントと待機状態の交差するセルに記述されたアクションであるデータ送信が実行され、システムの状態はそのセルに記述された状態No.2、すなわち送信中に遷移する。
【0033】
図3(a)は、経路データ112の一例を示す説明図であり、図2の状態遷移表に対応した経路データの例を示している。図3(a)に示すように、経路データは状態遷移表のイベント、状態、アクション、遷移先の状態の組からなるデータとなっている。
【0034】
図3(b)は、試験項目データ113の一例を示す説明図である。図3(b)に示すように、試験項目データ113は、経路データと同様に、イベント、状態、アクションを含み、TTCN記法によって記述されている。
【0035】
次に、以上のように構成された本実施の形態の試験項目抽出装置および試験項目抽出プログラムによる試験項目抽出処理について説明する。図4は、試験項目抽出の全体処理の手順を示すフローチャートである。
【0036】
まず入力処理部103によって、記憶装置110から仕様書データ111(状態遷移表データ)を読み込み(ステップS401)、経路検索部101に送出する。そして、経路検索部101によって、この仕様書データ111から経路の検索処理を実行し、経路データ112を生成する(ステップS402)。そして、経路検索部101によって生成された経路データ112をTTCN記法に変換して試験項目データ113を生成し、生成された試験項目データを記憶装置110に保存する(ステップS403)。
【0037】
次に、ステップ402の経路検索部101で行われる経路検索処理について説明する。図5は、経路検索処理の手順を示すフローチャートである。経路検索部101は、まず入力処理部103から受け取った仕様書データ111(状態遷移表データ)を参照し、ポインタを開始位置のセルに移動する(ステップS501)。そして、かかる開始位置から経路の実行処理を行い、経路を辿る(ステップS502)。
【0038】
図6は、経路検索部101の経路検索処理で行われる経路の実行処理の手順を示すフローチャートである。まず、ポインタが指す現在のセルの状態をメモリなどに一時的に記憶する(ステップS601)。次いで、ポインタが指す現在のセルのイベントを発生させる(ステップS602)。そして、イベントと状態とアクションを対応付けて記憶する(ステップS603)。そして、ステップS601からS603までの処理を、ポインタが終了位置のセルに到達するまで繰り返し行う(ステップS604)。ポインタが終了位置のセルに到達したら、記憶されている状態、イベント、アクションを一組単位で経路データとして記憶装置110に格納する(ステップS605)。
【0039】
図5に戻り、このようなステップ502の経路の実行処理を行ったら、生成された経路データをループ判定部104に送出する(ステップS503)。ループ判定部104では、経路データから現在のポインタのセルの位置がループ処理内のものであるかどうかを判断する。なお、かかるループ判定部104による判断処理については後述する。
【0040】
経路検索部101は、ループ判定部104から判断結果を受け取り(ステップS504)、その判断結果が検索停止メッセージであるか否かを判断する(ステップS505)。判断結果が検索停止メッセージでない場合(検索続行メッセージの場合)には、ループ処理でないと判断し、ステップS502からステップS504までの処理を繰り返す。すなわち、そのまま経路を辿って良いか否かの判断をループ判定部104から得ながら経路を辿ることになる。
【0041】
一方、ループ判定部104による判断結果が検索停止メッセージである場合には現在のポインタ位置からプログラムの進行方向と逆方向に経路を戻りながら経路の実行処理を行う(ステップS506)。このとき、辿った経路を記憶装置110に経路データとして記憶する。かかる経路の逆方向の実行処理は、ポインタを今まで辿ってきた経路を逆方向に進めながら図6で説明した経路実行処理と同様の処理を行う。
【0042】
次に、経路検索部101は、経路データを経路比較部102に送出する(ステップS507)。経路比較部102では、経路データを記憶装置110に格納されている経路データと比較して、ループ処理を抜け経路検索を再開するか否かの判断を行う。なお、かかる経路比較部102による判断処理については後述する。
【0043】
経路検索部101は、経路比較部102から判断結果を受け取り(ステップS508)、その判断結果が検索再開メッセージであるか否かを判断する(ステップS509)。判断結果が検索再開メッセージでない場合には、ループ内をまだ抜けていないので、ステップS502からステップS508までの処理を繰り返す。
【0044】
一方、判断結果が検索再開メッセージである場合には、ループ内をもう抜けたと判断し、ポインタの現在位置が終了位置であるか否かを判断する(ステップS510)。ポインタの現在位置が終了位置でない場合には、ステップS502からS509までの処理を繰り返し行う。一方、ポインタの現在位置が終了位置である場合には、検索終了通知を試験項目出力処理部105に通知する(ステップS511)。これによって、仕様書データ111の経路検索は終了する。
【0045】
試験項目出力処理部105では、経路検索部101から検索終了通知を受け取った場合、記憶装置110に格納された経路データをTTCN記法に変換し、試験項目データ113として記憶装置110に書き込む。なお、経路データのTTCN記法への変換は、図3(a)に示す経路データの文字列操作、文字列結合などを行って、図3(b)のTTCN記法のデータへの整形を行い、試験項目データ113を生成する。
【0046】
次に、ループ判定部104によるループ判定処理について説明する。図7は、ループ判定処理の手順を示すフローチャートである。ループ判定部104は、経路検索部101から経路データを受け取り(ステップS701)、経路検索部101から呼び出しは最初の呼び出しであるか否かを判断する(ステップS702)。そして、最初の呼び出しである場合には、検索続行メッセージを経路検索部101に送出し(ステップS705)、処理を終了する。
【0047】
一方、2回目以降の呼び出しである場合には、受け取った経路データと最初の呼び出しで受け取った経路データが一致するか否かを判断する(ステップS703)。そして、一致する場合には、ループ処理内であると判断し、検索停止メッセージを経路検索部101に送出し(ステップS704)、処理を終了する。一方、、両経路データが一致しない場合には、ループ処理外であると判断し、検索続行メッセージを経路検索部101に送出し(ステップS705)、処理を終了する。このようにして現在のポインタのセルの位置がループ処理内であるか否かを判断している。
【0048】
次に、経路比較部102による経路データの比較処理について説明する。図8は、経路比較処理の手順を示すフローチャートである。経路比較部102は、経路検索部101から経路データを受け取り(ステップS801)、記憶装置110に記憶されている経路データ112を読み出す(ステップS802)。そして、経路検索部101から受け取った経路データと記憶装置110の経路データが一致するか否かを判断する(ステップS803)。そして、一致しない場合には、検索再開メッセージを経路検索部101に送出し(ステップS804)、処理を終了する。一方、両経路データが一致する場合には、ステップS801およびステップS802の処理を繰り返して行う。このようにして、経路データの比較処理が行われる。
【0049】
試験項目出力処理部105によって記憶装置110に生成されたTTCN記法の試験項目データ113は、試験実行処理部106によって読み出されて、試験実行を行うことが可能である。すなわち、試験実行処理部106は、記憶装置110からTTCN形式の試験項目データ113を読み込み、TTCN記法のフォーマッットに従って、イベント、状態、アクションを一組を単位に取得し、一組を単位に実行する。
【0050】
このように実施の形態1の試験項目抽出装置および試験項目抽出プログラムでは、状態遷移表という仕様書データに基づいて、経路を辿って検索しながら試験項目を生成しているので仕様書データに基づくプログラムの試験項目を自動的に抽出することができ、高品質なソフトウェアを提供するとともに、開発期間の短縮化を図ることができる。
【0051】
(実施の形態2)
実施の形態1の試験項目抽出装置および試験項目抽出プログラムは、仕様書データ111(状態遷移表)のすべての経路を辿って試験項目を生成していたが、この実施の形態2の試験項目抽出装置および試験項目抽出プログラムは、利用者に抽出条件を設定させ、仕様書データ111(状態遷移表)から設定された抽出条件の範囲で経路を辿り、試験項目を生成するものである。
【0052】
図9は、実施の形態2の試験項目抽出プログラムが動作することによって機能する試験項目抽出装置の機能的構成を示すブロック図である。本実施の形態の試験項目抽出装置は、試験項目抽出プログラムが実行されることによってRAM上に生成される試験項目抽出部900と、ハードディスクドライブ装置(HDD)などの記憶装置110から構成される。
【0053】
本実施の形態の試験項目抽出装置において、試験項目抽出プログラムを実行することによって生成される試験項目抽出部900は、図9に示すとおり、経路検索部901と、経路比較部102と、入力処理部103と、ループ判定部104と、試験項目出力処理部105と、試験実行処理部106と、抽出条件設定部903と、抽出条件判定部902とから構成される。これら各部は、試験項目抽出プログラムの内部モジュール構成と同様の構成となっている。
【0054】
経路検索部901は、実施の形態1と同様に、入力処理部103によって読み出された仕様書データ111から、イベント、状態、アクション、遷移先の状態の組で構成される経路データを検索するものである。本実施の形態では、具体的には、経路検索部901は、抽出条件設定部903によって設定された開始条件、終了条件の範囲内で、経路を辿るようになっている。すなわち、仕様書データ111の開始条件の位置からイベントを発生させて状態の遷移を行わせながら、経由条件の位置を通り、終了条件の位置まで、イベントと状態の組で構成される経路データを記憶装置110に格納し、仕様書データ111に従った経路を辿ることによって、仕様書データ111に基づいた経路を検索するようになっている。
【0055】
抽出条件設定部903は、ディスプレイ装置などの表示装置に抽出条件設定画面を表示し、利用者に開始条件、経由条件、終了条件となるそれぞれのセルの位置を指定させて抽出条件を設定するものである。また、抽出条件設定部903は、利用者が設定した抽出条件を、抽出条件データ904として記憶装置110に格納する。
【0056】
抽出条件判定部902は、経路検索部901による経路検索の処理中に現在のポインタのセルの位置が抽出条件で設定された開始条件と終了条件の範囲内にあるか否かを判定するものである。抽出条件判定部902は、ポインタの位置が当該範囲外となった場合、検索終了メッセージを経路検索部901に送出するようになっている。
【0057】
次に、以上のように構成された本実施の形態の試験項目抽出装置および試験項目抽出プログラムによる試験項目抽出処理について説明する。図10は、試験項目抽出の全体処理の手順を示すフローチャートである。
【0058】
まず、入力処理部103によって、記憶装置110から仕様書データ111(状態遷移表データ)を読み込む(ステップS1001)。そして、次に抽出条件設定部903によって仕様書データ(状態遷移表データ)111の中で試験項目を抽出する範囲である抽出条件を設定する(ステップS1002)。
【0059】
抽出条件設定部903では、まず試験項目抽出装置(コンピュータ)のディスプレイ装置に、抽出条件設定画面を表示出力する。図11は、抽出条件設定画面の一例を示す説明図である。図11に示すように、抽出条件設定画面には、試験を行うプログラムの仕様書データである状態遷移表が表示される。そして、かかる画面上で、マウスなどの入力装置によって状態遷移表の所望のセルをクリック操作することにより、抽出条件を設定するようになっている。抽出条件には、試験項目の抽出の開始位置を示す開始条件、試験項目の抽出の終了位置を示す終了条件、試験項目の抽出の際の経由位置を示す経由条件があり、経由条件は複数のセルを設定することができる。図11に示すように、抽出条件設定部903によって各条件が設定されたセルは互いに異なる色彩等の属性で表示されるようになている。
【0060】
また、抽出条件設定部903は、このように抽出条件設定画面で指定された各抽出条件を、抽出条件データ904として記憶装置110に保存する。図12は、抽出条件データ904の一例を示す説明図である。図12に示すように、抽出条件データ904は、開始条件、一または複数の経由条件、終了条件の各々に対し、「状態−イベント−アクション」が対応して設定されたものとなっている。
【0061】
図10に戻り、抽出条件設定部903によって抽出条件が設定されたら、経路検索部901によって、仕様書データ111から経路の検索処理を実行し、経路データ112を生成する(ステップS1003)。そして、経路検索部901によって生成された経路データ112をTTCN記法に変換して試験項目データ113を生成し、生成された試験項目データを記憶装置110に保存する(ステップS1004)。
【0062】
次に、上述のステップS1003において経路検索部901で行われる経路検索処理について説明する。図13は、経路検索処理の手順を示すフローチャートである。経路検索部901は、まず入力処理部103から受け取った仕様書データ111(状態遷移表データ)と記憶装置110の抽出条件データ904を参照し、ポインタを抽出条件データ904の開始条件に該当するセルに移動する(ステップS1301)。そして、かかる開始条件の位置から経路の実行処理を行い、経路を辿る(ステップS1302)。なお、かかる経路の実行処理は、実施の形態1(図6の処理)と同様に行われる。
【0063】
経路の実行処理を行ったら、生成された経路データをループ判定部104と抽出条件判定部902に送出する(ステップS1303)。ループ判定部104では、経路データから現在のポインタのセルの位置がループ処理内のものであるかどうかを判断する。なお、かかるループ判定部104による判断処理については実施の形態1と同様である。
【0064】
抽出条件判定部902では、現在のポインタ位置のセルが抽出条件である開始条件と終了条件の範囲内であるか否かが判断される。そして、範囲外であれば、検索終了メッセージを経路検索部901に送出する。
【0065】
経路検索部901は、ループ判定部104と抽出条件判定部902から判断結果を受け取り(ステップS1304)、その判断結果がループ判定部104からの検索停止メッセージであるか否かまたは抽出条件判定部902からの検索終了メッセージであるか否かを判断する(ステップS1305)。判断結果が検索停止メッセージ、検索終了メッセージのいずれでもでない場合には、ループ処理でないと判断し、ステップS1302からステップS1304までの処理を繰り返す。
【0066】
一方、判断結果が検索停止メッセージか検索終了メッセージのいずれかである場合には現在のポインタ位置からプログラムの進行方向と逆方向に経路を戻りながら経路の実行処理を行う(ステップS1306)。かかる経路の逆方向の実行処理は、ポインタを今まで辿ってきた経路を逆方向に進めながら実施の形態1の図6で説明した経路実行処理と同様の処理を行う。以下、ステップS1307からS1311までの処理は、実施の形態1で説明した経路検索処理と同様である。
【0067】
このように実施の形態2の試験項目抽出装置および試験項目抽出プログラムでは、状態遷移表という仕様書データに基づいて、経路を辿って検索しながら試験項目を生成しているので仕様書データに基づくプログラムの試験項目を自動的に抽出することができ、高品質なソフトウェアを提供するとともに、開発期間の短縮化を図ることができる。
【0068】
実施の形態2の試験項目抽出装置および試験項目抽出プログラムでは、利用者が希望する抽出条件の範囲で試験項目を抽出できるので、利用者の便宜が図られる。
【0069】
なお、実施の形態1および2の試験項目抽出装置および試験項目抽出プログラムでは、仕様書データとして状態遷移表を利用したが、この他、状態遷移図、ステートチャートなど、状態、イベント、アクション、遷移先の状態がわかるものであれば、いずれの仕様書を用いてもよい。また、ユースケース図やアクティビティ図などを仕様書として用いることもできる。
【0070】
【発明の効果】
以上説明したように、請求項1にかかる発明によれば、仕様書データに基づくプログラムの試験項目を自動的に抽出することができ、高品質なソフトウェアを提供するとともに、開発期間の短縮化を図ることができるという効果を奏する。
【0071】
また、請求項2にかかる発明によれば、利用者が希望する範囲で試験項目を自動的に抽出することができ、利用者の便宜が図られるという効果を奏する。
【0072】
また、請求項3にかかる発明によれば、抽出された試験項目の形式を統一することができるという効果を奏する。
【0073】
また、請求項4にかかる発明によれば、抽出された試験項目の形式を一般的に使用されている記法に統一することができ、試験項目の汎用性を向上させることができるという効果を奏する。
【0074】
また、請求項5にかかる発明によれば、抽出された試験項目を再利用することができるという効果を奏する。
【0075】
また、請求項6にかかる発明によれば、試験実行の自動化を実現することができ、開発期間のさらなる短縮化を図ることができるという効果を奏する。
【図面の簡単な説明】
【図1】実施の形態1である試験項目抽出プログラムの機能的ブロック図である。
【図2】状態遷移表の一例を示す説明図である。
【図3】図3(a)は、経路データの一例を示す説明図であり、図3(b)は、試験項目データの一例を示す説明図である。
【図4】試験項目抽出の全体処理の手順を示すフローチャートである。
【図5】経路検索処理の手順を示すフローチャートである。
【図6】経路検索部の経路検索処理で行われる経路の実行処理の手順を示すフローチャートである。
【図7】ループ判定処理の手順を示すフローチャートである。
【図8】経路比較処理の手順を示すフローチャートである。
【図9】実施の形態2の試験項目抽出プログラムの機能ブロック図である。
【図10】実施の形態2の試験項目抽出プログラムにおける試験項目抽出の全体処理の手順を示すフローチャートである。
【図11】抽出条件設定画面の一例を示す説明図である。
【図12】抽出条件データの一例を示す説明図である。
【図13】経路検索処理の手順を示すフローチャートである。
【符号の説明】
100,900 試験項目抽出部
101,901 経路検索部
102 経路比較部
103 入力処理部
104 ループ判定部
105 試験項目出力処理部
106 試験実行処理部
110 記憶装置
111 仕様書データ
112 経路データ
113 試験項目データ
902 抽出条件判定部
903 抽出条件設定部
904 抽出条件データ[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a test item extraction program for extracting test items of a program to be developed.
[0002]
[Prior art]
Usually, when performing software development, it is common to perform software (program) test work at the development stage. In such a program test, items to be tested by a software developer are manually extracted according to a specification or the like created in a development stage. Then, the program is operated to perform a software test according to the extracted test items. Here, the specification used when creating test items includes a documented functional specification, detailed specification, and the like, and a chart described in a notation such as UML (Unified Modeling Language). .
[0003]
Recently, software has become larger and more complex, and in particular, the scale and complexity of software due to the high functionality of embedded devices such as mobile phones have increased the number of test items geometrically. In particular, it is said that the number of test items for software operating on a mobile phone is 100,000.
[0004]
2. Description of the Related Art In recent years, in software development, in order to avoid the complexity of development, many software design methods using notation methods such as UML, state transition diagrams, and state transition tables have been used. For example, a program generation device that automatically generates a program using a state transition table is generally known (for example, Patent Document 1). By using such a method, the efficiency of software development and the prevention of development leaks and omissions have been gradually improved.
[0005]
[Patent Document 1]
JP 2000-20347 A
[0006]
[Problems to be solved by the invention]
However, since software developers manually perform the work of extracting necessary test items while referring to the specifications, it is difficult to extract test items that cover all the functions of the program to be developed. is there. That is, although the software developer is familiar with the functions of the software, there is a limit in extracting accurate test items for all functions, and therefore, there is a high possibility that untested items will occur. If such untested items relate to important functions of the software, there is a problem that a serious failure occurs in the final product, and high-quality software cannot be provided.
[0007]
Also, in the development using an efficient method such as a software design method using notation such as UML, a state transition diagram, a state transition table, etc., the work of extracting test items based on specifications always depends on humans. As a result, some test items are leaked or missing, resulting in software failure. Further, there is a problem that a large number of man-hours are required for the work of extracting such test items, and the development period is prolonged.
[0008]
The present invention has been made in view of the above, and by automatically extracting test items of a program based on specifications, it is possible to provide high-quality software and to shorten a development period. The purpose is to obtain an extraction program.
[0009]
[Means for Solving the Problems]
In order to achieve the above object, an invention according to
[0010]
According to the first aspect of the present invention, a possible state of the system in which the program to be developed operates, an event that is a stimulus from outside or inside the system, and a transition of a state to which the system should transition due to the event A path search step of searching for path information indicating a state of the state transition with respect to the event based on the specification data indicating the event, generating the event, and performing an execution process on the searched path information; Automatically extracting test items of a program based on specification data by including a test item output processing step of outputting, as the test items, the path information of the event and the state transition by the execution processing of the search means. It is possible to provide high quality software and shorten the development period.
[0011]
According to a second aspect of the present invention, in the test item extraction program according to the first aspect, an extraction item setting step of setting an extraction condition of a test item or a path to be extracted is further included. Based on the extraction condition set in the item setting step, a path of the state transition is searched, and an execution process by the occurrence of the event is performed.
[0012]
According to the second aspect of the present invention, the extraction item setting step sets the extraction condition of the test item or the path to be extracted, and the path search step searches the state transition path based on the set extraction condition. Then, by performing the execution process by the occurrence of the event, the test items can be automatically extracted in a range desired by the user, and the user's convenience is achieved.
[0013]
According to a third aspect of the present invention, in the test item extraction program according to the first or second aspect, the test item output processing step outputs the test items of the program based on a predetermined notation. Features.
[0014]
According to the invention of
[0015]
According to a fourth aspect of the present invention, in the test item extracting program according to the third aspect, the test item output processing step outputs the test items of the program according to TTCN notation.
[0016]
According to the invention of claim 4, the test item output processing step outputs the test items of the program according to the TTCN notation, thereby unifying the format of the extracted test items into a commonly used notation. And the versatility of the test items can be improved.
[0017]
According to a fifth aspect of the present invention, in the test item extraction program according to any one of the first to fourth aspects, the test item output processing step stores the test items of the program in storage means. It is characterized by.
[0018]
According to the fifth aspect of the present invention, by storing the test items of the program in the storage means in the test item output processing step, the extracted test items can be reused.
[0019]
The invention according to claim 6 is the test item extraction program according to claim 5, further comprising a test execution processing step of executing a test of the program based on the test items stored in the storage means. Features.
[0020]
According to the invention of claim 6, by executing the test of the program based on the test items stored in the storage means by the test execution processing step, the automation of the test execution can be realized, and Further shortening can be achieved.
[0021]
BEST MODE FOR CARRYING OUT THE INVENTION
Preferred embodiments of a test item extraction program according to the present invention will be described below in detail with reference to the accompanying drawings.
[0022]
(Embodiment 1)
FIG. 1 is a block diagram showing a functional configuration of a test item extraction device that functions when the test item extraction program according to the first embodiment of the present invention operates. The test item extraction device according to the present embodiment includes a test
[0023]
In the test item extraction device according to the present embodiment, a test
[0024]
The
[0025]
The
[0026]
The
[0027]
When the
[0028]
The
[0029]
After the route search process is completed by the
[0030]
The test
[0031]
Next, various data stored in the
[0032]
Here, if the current state of the system represented by this state transition table is standby, and if a transmission request event is received at this time, the action described in the cell where the transmission request event and the standby state intersect is the action. Data transmission is executed, and the state of the system is the state No. described in the cell. 2, that is, transition during transmission.
[0033]
FIG. 3A is an explanatory diagram illustrating an example of the
[0034]
FIG. 3B is an explanatory diagram illustrating an example of the
[0035]
Next, a description will be given of test item extraction processing by the test item extraction device and the test item extraction program of the present embodiment configured as described above. FIG. 4 is a flowchart showing the procedure of the entire process of test item extraction.
[0036]
First, the
[0037]
Next, the route search process performed by the
[0038]
FIG. 6 is a flowchart illustrating a procedure of a route execution process performed by the
[0039]
Referring back to FIG. 5, after performing the route execution processing in
[0040]
The
[0041]
On the other hand, if the result of the determination by the
[0042]
Next, the
[0043]
The
[0044]
On the other hand, if the result of the determination is a search restart message, it is determined that the loop has been exited, and it is determined whether the current position of the pointer is the end position (step S510). If the current position of the pointer is not the end position, the processing from steps S502 to S509 is repeated. On the other hand, if the current position of the pointer is the end position, the search item
[0045]
When receiving the search completion notification from the
[0046]
Next, a loop determination process performed by the
[0047]
On the other hand, if it is the second or later call, it is determined whether the received route data matches the route data received in the first call (step S703). If they match, it is determined that the processing is within the loop processing, a search stop message is sent to the route search unit 101 (step S704), and the processing ends. On the other hand, if the two route data do not match, it is determined that the process is outside the loop process, a search continuation message is sent to the route search unit 101 (step S705), and the process ends. In this way, it is determined whether or not the cell position of the current pointer is within the loop processing.
[0048]
Next, a comparison process of the route data by the
[0049]
The
[0050]
As described above, in the test item extraction device and the test item extraction program according to the first embodiment, the test items are generated while searching along the route based on the specification data called the state transition table, so that the test items are based on the specification data. The test items of the program can be automatically extracted, and high-quality software can be provided, and the development period can be shortened.
[0051]
(Embodiment 2)
The test item extraction device and the test item extraction program according to the first embodiment generate test items by following all the paths of the specification data 111 (state transition table). However, the test item extraction according to the second embodiment is performed. The apparatus and the test item extraction program allow a user to set extraction conditions, follow a path within the range of the extraction conditions set from the specification data 111 (state transition table), and generate test items.
[0052]
FIG. 9 is a block diagram illustrating a functional configuration of a test item extraction device that functions when the test item extraction program according to the second embodiment operates. The test item extraction device of the present embodiment includes a test
[0053]
In the test item extraction device according to the present embodiment, the test
[0054]
The
[0055]
The extraction
[0056]
The extraction
[0057]
Next, a description will be given of test item extraction processing by the test item extraction device and the test item extraction program of the present embodiment configured as described above. FIG. 10 is a flowchart showing the procedure of the entire test item extraction process.
[0058]
First, the
[0059]
The extraction
[0060]
Further, the extraction
[0061]
Returning to FIG. 10, when the extraction condition is set by the extraction
[0062]
Next, the route search process performed by the
[0063]
After performing the route execution processing, the generated route data is sent to the
[0064]
The extraction
[0065]
The
[0066]
On the other hand, if the result of the determination is either the search stop message or the search end message, the route execution processing is performed while returning from the current pointer position in the direction opposite to the direction in which the program proceeds (step S1306). In the execution process in the reverse direction of the route, the same process as the route execution process described with reference to FIG. Hereinafter, the processing from step S1307 to S1311 is the same as the route search processing described in the first embodiment.
[0067]
As described above, in the test item extraction device and the test item extraction program according to the second embodiment, test items are generated while searching along a path based on specification data called a state transition table. The test items of the program can be automatically extracted, and high-quality software can be provided, and the development period can be shortened.
[0068]
In the test item extraction device and the test item extraction program according to the second embodiment, test items can be extracted within a range of extraction conditions desired by the user.
[0069]
In the test item extraction device and the test item extraction program of the first and second embodiments, the state transition table is used as the specification data. In addition, the state, event, action, transition, etc., such as a state transition diagram and a state chart, are used. Any specification may be used as long as the previous state is known. In addition, a use case diagram, an activity diagram, and the like can be used as a specification document.
[0070]
【The invention's effect】
As described above, according to the first aspect of the present invention, it is possible to automatically extract a test item of a program based on specification data, provide high-quality software, and shorten a development period. This has the effect that it can be achieved.
[0071]
Further, according to the second aspect of the present invention, it is possible to automatically extract test items within a range desired by the user, so that there is an effect that convenience of the user is achieved.
[0072]
Further, according to the invention according to
[0073]
Further, according to the invention of claim 4, the format of the extracted test items can be unified into a commonly used notation, and the versatility of the test items can be improved. .
[0074]
Further, according to the invention of claim 5, there is an effect that the extracted test items can be reused.
[0075]
Further, according to the invention according to claim 6, it is possible to realize the automation of the test execution, and it is possible to further shorten the development period.
[Brief description of the drawings]
FIG. 1 is a functional block diagram of a test item extraction program according to a first embodiment.
FIG. 2 is an explanatory diagram illustrating an example of a state transition table.
FIG. 3A is an explanatory diagram illustrating an example of route data, and FIG. 3B is an explanatory diagram illustrating an example of test item data.
FIG. 4 is a flowchart showing a procedure of an entire process of test item extraction.
FIG. 5 is a flowchart illustrating a procedure of a route search process.
FIG. 6 is a flowchart illustrating a procedure of a route execution process performed in the route search process of the route search unit.
FIG. 7 is a flowchart illustrating a procedure of a loop determination process.
FIG. 8 is a flowchart illustrating a procedure of a route comparison process.
FIG. 9 is a functional block diagram of a test item extraction program according to the second embodiment.
FIG. 10 is a flowchart illustrating the procedure of the entire test item extraction process in the test item extraction program according to the second embodiment.
FIG. 11 is an explanatory diagram showing an example of an extraction condition setting screen.
FIG. 12 is an explanatory diagram illustrating an example of extraction condition data.
FIG. 13 is a flowchart illustrating a procedure of a route search process.
[Explanation of symbols]
100,900 test item extractor
101,901 Route search unit
102 route comparison unit
103 Input processing unit
104 Loop judgment unit
105 Test item output processing unit
106 Test execution processing unit
110 storage device
111 Specification Data
112 Route data
113 Test item data
902 Extraction condition judgment unit
903 Extraction condition setting unit
904 Extraction condition data
Claims (6)
開発対象のプログラムが動作するシステムの取り得る状態と、前記システムの外部又は内部からの刺激であるイベントと、前記イベントにより前記システムの遷移すべき状態の遷移とを示す仕様書データに基づいて、前記イベントに対する前記状態の遷移の状況を示す経路情報を検索し、前記イベントを発生させて検索された経路情報に対する実行処理を行う経路検索ステップと、
前記経路検索ステップの実行処理による前記イベントと前記状態の遷移の経路情報を、前記試験項目として出力する試験項目出力処理ステップと、
を含むことを特徴とする試験項目抽出プログラム。In a test item extraction program for causing a computer to execute a test item extraction method for extracting test items for a program to be developed,
Based on specification data indicating a possible state of the system in which the program to be developed operates, an event that is a stimulus from outside or inside the system, and a transition of a state to which the system should transition due to the event. A path search step of searching for path information indicating a state of the state transition with respect to the event, and performing an execution process on the searched path information by generating the event;
A test item output processing step of outputting the event and the path information of the transition of the state by the execution processing of the path search step as the test item;
A test item extraction program characterized by including:
前記経路検索ステップは、前記抽出項目設定ステップによって設定された抽出条件に基づいて、前記状態の遷移の経路を検索して前記イベントの発生による実行処理を行うことを特徴とする請求項1に記載の試験項目抽出プログラム。Further including an extraction item setting step of setting extraction conditions of a test item or a path to be extracted,
2. The path search step according to claim 1, wherein a search is made for a path of the state transition based on an extraction condition set in the extraction item setting step, and execution processing is performed by occurrence of the event. Test item extraction program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002314907A JP2004151884A (en) | 2002-10-29 | 2002-10-29 | Program for extracting test item |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002314907A JP2004151884A (en) | 2002-10-29 | 2002-10-29 | Program for extracting test item |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2004151884A true JP2004151884A (en) | 2004-05-27 |
Family
ID=32459095
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002314907A Pending JP2004151884A (en) | 2002-10-29 | 2002-10-29 | Program for extracting test item |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2004151884A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009265810A (en) * | 2008-04-23 | 2009-11-12 | Dainippon Screen Mfg Co Ltd | Status transition test support device, status transition test support program and status transition test support method |
JP2010267024A (en) * | 2009-05-13 | 2010-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Test data generation method, device and program |
JP2010267023A (en) * | 2009-05-13 | 2010-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Test data generation method, device and program |
JP2010267022A (en) * | 2009-05-13 | 2010-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Test data generation method, device and program |
-
2002
- 2002-10-29 JP JP2002314907A patent/JP2004151884A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009265810A (en) * | 2008-04-23 | 2009-11-12 | Dainippon Screen Mfg Co Ltd | Status transition test support device, status transition test support program and status transition test support method |
JP2010267024A (en) * | 2009-05-13 | 2010-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Test data generation method, device and program |
JP2010267023A (en) * | 2009-05-13 | 2010-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Test data generation method, device and program |
JP2010267022A (en) * | 2009-05-13 | 2010-11-25 | Nippon Telegr & Teleph Corp <Ntt> | Test data generation method, device and program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7379600B2 (en) | Method and system for automatically determining differences in a user interface throughout a development cycle | |
US10223076B1 (en) | Generating code based on user interactions with a user interface element in a code editor | |
US20140359569A1 (en) | Graphical function specialization | |
CN105843734A (en) | Automatic test method and device and computing device | |
JP5350428B2 (en) | Automatic program generation apparatus, method and computer program | |
KR101029332B1 (en) | Testing apparatus and method for mobile software | |
TW201821990A (en) | Computer system and detection method | |
JP2022019524A (en) | Modeling parameter configuration method, apparatus, device, computer storage medium, and computer program | |
JP2003173270A (en) | Software debugging device | |
US9880925B1 (en) | Collecting structured program code output | |
US10192013B1 (en) | Test logic at register transfer level in an integrated circuit design | |
JP2004151884A (en) | Program for extracting test item | |
EP2972879A1 (en) | Method and system for analyzing a trace timeline of computer system activity | |
KR20100056338A (en) | Gui test automatic system for improving reusability of test script and method thereof | |
US10095822B1 (en) | Memory built-in self-test logic in an integrated circuit design | |
JP5199393B2 (en) | User interface model generation system supporting multi-channel and multi-platform | |
JP2008197883A (en) | Lsi analytic program, recording medium with program recorded, lsi analytic device, and lsi analytic method | |
JP2007287025A (en) | Method and apparatus for creating screen transition program | |
JP2007257077A (en) | Program debugging device, method and program | |
JP6124594B2 (en) | Power system monitoring and control apparatus and control program therefor | |
EP3989059B1 (en) | Interactive code optimizer | |
US20200019387A1 (en) | Managing software components for software application development | |
JP4925514B2 (en) | Program execution control method, program, execution control apparatus, and recording medium by internal / external event driven system | |
KR20190087724A (en) | Mnemonic based method for gui test automation and apparatus using the same | |
CN115981711B (en) | Code processing method and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040824 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20070705 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070717 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20071204 |