MOOSE SQA Tools

The "moosesqa" python package is a set of utilities for gathering requirements from test specifications as well as generating software quality reports.

Software Requirements

The software requirement information for a directory can be collected using the get_requirements_from_tests function. This must be provided two inputs: a list of directories to search and a list of test specification names to consider. It will return a dict of lists. The key is the top level folder (or "group") and the list entries contain a Requirement object that contains data for each requirement. For example, the following can be executed within the MOOSE repository to load all the requirement information from the moose test application.


$ cd ~/projects/moose/test
$ python
Python 3.7.6 | packaged by conda-forge | (default, Jun  1 2020, 18:33:30)
[Clang 9.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import moosesqa
>>> req = moosesqa.get_requirements_from_tests(['tests'], ['tests'])

SQA Reports

The information that is output from the SQA check command (i.e., ./moosedocs.py check) and the shown in the MOOSE SQA documentation are generated from report objects. There exists three types of report objects:

  • SQADocumentReport
    Provides information regarding the existence of the various necessary documents needed to satisfy the NQA-1 standard (e.g., the Software Test Plan).

  • SQARequirementReport
    Provides information regarding the requirements that are defined within the test specifications, including checks for duplicates and missing information.

  • SQAMooseAppReport
    Collects data regarding the inclusion of source and syntax design documentation based on MOOSE-based application registered syntax.

The SQA software reports may be retrieved by using the get_sqa_reports function. This function requires one argument, the name of a report configuration YAML file. This is comprised of three sections: "Applications", "Documents", and "Requirements". These sections include the options for the SQAMooseAppReport, SQADocumentReport, and the SQARequirementReport, respectively. The file shown in Listing 1 is configuration file from the Stochastic Tools SQA page. The available options for each report should be gathered from the source code for the various report objects. If you are creating reports for a new application and need assistance getting started please contact MOOSE developers via the Discussions forum.

Listing 1: Example SQA report configuration file.

Applications:
    stochastic_tools:
        exe_directory: ${MOOSE_DIR}/modules/stochastic_tools
        content_directory: ${MOOSE_DIR}/modules/stochastic_tools/doc/content
        unregister:
            - ${MOOSE_DIR}/framework/doc/unregister.yml
        remove:
            - ${MOOSE_DIR}/framework/doc/remove.yml
            - ${MOOSE_DIR}/modules/stochastic_tools/doc/remove.yml

Documents:
    software_quality_plan: sqa/inl_records.md#software_quality_plan
    enterprise_architecture_entry: sqa/inl_records.md#enterprise_architecture_entry
    safety_software_determination: sqa/inl_records.md#safety_software_determination
    quality_level_determination: sqa/inl_records.md#quality_level_determination
    configuration_management_plan: sqa/inl_records.md#configuration_management_plan
    asset_management_plan: sqa/inl_records.md#asset_management_plan
    verification_validation_plan: sqa/inl_records.md#verification_and_validation_plan
    software_requirements_specification: sqa/stochastic_tools_srs.md
    software_design_description: sqa/stochastic_tools_sdd.md
    software_test_plan: sqa/stochastic_tools_stp.md
    requirements_traceability_matrix: sqa/stochastic_tools_rtm.md
    verification_validation_report: sqa/stochastic_tools_vvr.md
    failure_analysis_report: sqa/stochastic_tools_far.md
    software_library_list: sqa/stochastic_tools_sll.md
    communication_and_contact_information: sqa/framework_cci.md
    software_coding_standards: sqa/framework_scs.md
    user_manual: modules/stochastic_tools/index.md
    theory_manual: modules/stochastic_tools/index.md

Requirements:
    stochastic_tools:
        directories:
            - ${MOOSE_DIR}/modules/stochastic_tools
(moose/modules/stochastic_tools/doc/sqa_reports.yml)

It is possible to generate the reports manually by running the following commands, but in general it is recommended that the SQA "check" command be used from the application doc directory.


$ cd ~/projects/moose/modules/stochastic_tools/doc
$ python
Python 3.7.6 | packaged by conda-forge | (default, Jun  1 2020, 18:33:30)
[Clang 9.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import moosesqa
>>> report_tuple = moosesqa.get_sqa_reports('sqa_reports.yml')
>>> for reports in report_tuple:
>>>     for r in reports:
>>>         print(r.getReport())
>>>