Main Content

Generate Test Specification Reports

Test specification reports are reports of the test settings and parameters used for test cases, test suites, or test files. Common uses for these reports are capturing information for test procedure design reviews and archiving test information. You can create the report before or after running a test. In addition to using the Test Manager to create the report, you can create the report programmatically. See the sltest.testmanager.TestSpecReport reference page for examples.

For a test specification report, all of the items you select must be of the same type, either test files, test suites, or test cases. If you select a mixture of test files, suites, and cases, the Test Spec Report button and the context menu Create Report option are dimmed. If you select a test file, the report includes all of its test suites and test cases. If you select a test suite, the report includes all of its test cases.

This example uses an existing test file (AutopilotTestFile.mldatx), which was created for the RollAutopilotMdlRef.slx model and its RollReference_Requirement1_3 test harness.

  1. To change to the folder that contains the RollAutopilotMdlRef.slx model and AutopilotTestFile.mldatx test file, enter openExample('RollAutopilotMdlRef') on the MATLAB® command line.

  2. To open the Test Manager, enter sltest.testmanager.view on the MATLAB command line.

  3. Click Open.

  4. In the Open File dialog box, open the matlab/examples/simulink/main folder and select AutopilotTestFile.mldatx.

  5. Highlight the Requirement 1.3 Test test case and click Test Spec Report.

    Test Manager with Requirement 1.3 test case selected

  6. In the Create a Test Specification Report dialog box, specify the Title as RollAutopilot Model Test Specification Report and the Author as John Smith.

    Create a Test Specification report dialog box

  7. Leave all the report sections selected by default in the Include in Report section.

  8. Leave PDF as the default output format.

  9. Specify the filename for the saved report as mynewReport.pdf in a writable folder. If your current working folder is not writable, use a full pathname to a writable folder.

  10. Leave the Test Case Reporter field blank because this report uses the default test case template.

  11. Click Create to generate the report and open it automatically. These images from the report show the title page, images of the model and harness, and test inputs and assessment information.

    Test specification report cover page

    Test specification report detail page

See Also

Related Topics