メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

テスト仕様からの要件のインポート

Microsoft® Word などのサードパーティ製アプリケーションを使用して要件を作成し、その要件を Requirements Toolbox™ にインポートできます。要件のインポートにより、サードパーティ製ツールで要件を作成および管理し、それらの要件のトレーサビリティを Requirements Toolbox を使用して解析および測定することができます。

チュートリアルのこのステップでは、Microsoft Word で作成されたテスト仕様から要件をインポートし、Word ドキュメントの元の要件を確認して、その要件を MATLAB® テストにリンクします。

テスト仕様の確認

テスト仕様が含まれている MyAdd プロジェクトを開きます。

openProject("MyAdd");

documents フォルダーに移動し、テスト仕様 myAddTestSpecification.docx を開きます。

Screenshot of the test requirements in myAddTestSpecification.docx.

このテスト仕様は、myAdd 関数のテスト方法について記述したものです。テスト ケースの要件のいくつかで myAddReqs の機能要件が調整され、関数のテスト方法についての詳細が追加されています。ドキュメントの各要件にブックマークがあります。

Microsoft Word からの要件のインポート

Microsoft Word から Requirements Toolbox に要件をインポートするには、要件エディターを開き、[ファイル] セクションで [インポート] をクリックします。[要件をインポート] ダイアログで、インポートするドキュメント タイプを選択できます。さらに、インポート設定をニーズに合わせて設定できます。

この例では、設定を次のように選択して、既に myAddTestSpecification.docx から要件がインポートされています。

Importing Requirements dialog with Document type set to Microsoft Word and these settings selected: Plain text, Use bookmarks to identify items and serve as custom IDs, Ignore outline numbers in section, Allow update from external source.

プロジェクトの documents フォルダーにある myAddTestSpecification.slreqx という要件セットに、インポートされた要件が含まれています。

インポートされた要件の確認

インポートされた要件セットを開きます。

slreq.open("myAddTestSpecification");

要件エディターにインポートされた要件で Word ドキュメントでの階層が維持されています。Word ドキュメントのブックマークは、インポートされた要件では要件 ID になります。

The imported requirements from myAddTestSpecification.docx are shown and the hierarchy matches the hierarchy from the Word document, with the Validity checks requirement and Functional tests requirement as containers for the test requirements.

Validity checks という概要をもつ要件から Microsoft Word の元の要件に移動します。要件エディターで要件を選択し、右側のペインの [プロパティ][ドキュメントに表示] をクリックします。Microsoft Word でドキュメントが開き、要件が強調表示されます。

The mouse points to the Show in document button in the right pane, under Properties. The tooltip says "Show the selected requirement in the external document."

要件のテストへのリンク

テスト ファイル tMyAdd.m を開きます。

open tMyAdd

tMyAdd ファイルは、myAdd 関数の MATLAB テストを含むテスト クラスです。これらのテストは、myAddReqs で記述された機能的な動作と myAddTestSpecification.docx で指定された追加のテスト要件を検証します。テストは関数で定義されています。

Lines 1-18 of the tMyAdd test file are shown, which includes the first test methods block with tags Functional and Integration.

要件の強調表示により、23 行目、26 行目、29 行目、39 行目、42 行目、および 46 行目に要件へのリンクがあることが示されています。

The tMyAdd test file lines 20-51 are shown, which includes the test methods block with the Validity tag and the test methods block with the Functional tag.

要件エディターを開き、[リンクの表示] をクリックします。tMyAdd~m リンク セットに、インポートされた要件と tMyAdd.m のテストの間のリンクが含まれています。

The tMyAdd~m.slmx link set file is shown, with 7 verifies links between the imported test requirements and tests in tMyAdd.m.

36 行目で定義されているテストと Test for a positive input という概要をもつ要件の間のリンクがありません。それらの項目間のリンクを作成します。

  1. tMyAdd.m で 36 行目を選択します。

  2. 要件エディターで [要件の表示] をクリックします。

  3. Test for a positive input という概要をもつ要件を選択します。

  4. [リンクの追加][MATLAB エディターの選択内容からのリンク] をクリックします。

リンク セットを保存します。

要件をドキュメントとして表示

要件をドキュメントとして表示します。要件エディターで、[要件の表示][ドキュメント ビュー] をクリックします。表示スペースを最大化するには、右側のペインを最小化します。右側のペインで、[アクション] ボタン The button with the down arrow をクリックして [最小化] を選択します。

The document view for myAddTestSpecification.

ドキュメント ビューで、要件コンテンツのすぐ横に検証リンクが表示されます。

参考

アプリ

クラス

トピック