Skip to content

Commit

Permalink
WIP: I am not so sure this is the best idea, starting to look into bu…
Browse files Browse the repository at this point in the history
…ilding 'requirement-type' into spec

(refs idaholab#16410)
  • Loading branch information
aeslaughter committed Dec 10, 2020
1 parent 03f23be commit d645420
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 68 deletions.
9 changes: 7 additions & 2 deletions framework/doc/content/sqa/framework_srs.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,16 @@ each addition to the MOOSE framework or its modules.
!template-end!

!template! item key=useability-requirements
!sqa requirements link=False prefix=U category=useability
!sqa requirements link=False prefix=U category=framework

!!!
!sqa requirements-matrix prefix=U
- The system will be command-line and input file driven.
- The system shall return usage messages when unidentified arguments or incorrectly used arguments are passed.
- The system shall provide diagnostics when the input file fails to parse, or the format is incorrect.
- The system will provide on screen information about the simulation and performance characteristics of the solves under normal operating conditions.
!template-end!
!!!

!!!
!template! item key=performance-requirements
Expand All @@ -102,7 +105,9 @@ each addition to the MOOSE framework or its modules.
- The system will support execution on Unix-based workstation systems.
- The system will support execution on large Unix-based cluster systems.
!template-end!
!!!

!!!
!template! item key=system-interfaces
!sqa requirements-matrix prefix=S
- The system shall support POSIX compliant systems.
Expand Down Expand Up @@ -215,5 +220,5 @@ The following is a complete list of each requirement that has been assigned to a
!template-end!

!template! item key=requirement-collections
!sqa collections category={{category}} link=False
!sqa collections category=framework link=False
!template-end!
7 changes: 1 addition & 6 deletions framework/doc/content/templates/sqa/srs.md.template
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,9 @@ the requirements.

!template-end!

!template! field
key=useability-requirements
!template field-begin

## Usability Requirements

!template! field key=useability-requirements
Define usability requirements. Usability requirements and objectives for the system or service
include measurable effectiveness, efficiency, and satisfaction criteria in specific contexts of
use. For example:
Expand All @@ -200,10 +197,8 @@ use. For example:
| - | - |
| U1.1 | Users shall be able to point-and-click a date rather than typing a date into a text field or selecting month, day, and year independently. |
| U1.2 | Users shall select values from a list of valid values instead of having to type a value into a text field |

!template-end!


### Performace Requirements id=performance-requirements

!template! field key=performance-requirements
Expand Down
15 changes: 10 additions & 5 deletions framework/doc/sqa_framework.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
directories:
- ${MOOSE_DIR}/test/tests
specs:
- tests
repo: moose
functional:
directories:
- ${MOOSE_DIR}/test/tests
specs:
- tests
repo: moose
useability:
files:
- ${MOOSE_DIR}/framework/doc/useability_requirements.hit
prefix: U
14 changes: 11 additions & 3 deletions framework/doc/useability_requirements.hit
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
[Useability]
[command_line]
requirement = "The system will be command-line and input file driven."
[use]
requirement = "The system will be operated using"
issues = ""
design = ""
test =

[command_line]
detail = "using the command-line"
#test =
[]
[input_file]
detail = "and input files."
#test = /test/tests/kernels/simple_diffusion/simple_diffusion.i
[]
[]
[]
102 changes: 54 additions & 48 deletions python/MooseDocs/extensions/sqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def defaultConfig():
config['requirement-groups'] = (dict(), "Allows requirement group names to be changed")
config['reports'] = (None, "Build SQA reports for dashboard creation.")
config['add_run_exception_to_failure_analysis'] = (True, "Automatically include RunException tests in the 'FAILURE_ANALYSIS' collection.")
config['custom-requirements'] = (dict(), "Add the ability to read in hit files for creating custom requirements.")

# Disable by default to allow for updates to applications
config['active'] = (False, config['active'][1])
Expand Down Expand Up @@ -125,53 +124,9 @@ def preExecute(self):
start = time.time()
LOG.info("Gathering SQA requirement information...")

repos = self.get('repos')
for index, (category, info) in enumerate(self.get('categories').items(), 1):
prefix = info.get('prefix', 'F')
specs = info.get('specs', ['tests'])
repo = info.get('repo', 'default')
reports = info.get('reports', None)

# Test directories
directories = list()
for d in info.get('directories', []):
path = mooseutils.eval_path(d)
if not os.path.isdir(path):
path = os.path.join(MooseDocs.ROOT_DIR, d)
if not os.path.isdir(path):
msg = "Input directory does not exist: %s"
LOG.error(msg, path)
continue
directories.append(path)

# Custom requirement files
files = list()
for f in info.get('files', []):
loc, fname = os.path.split(f)
path = os.path.join(mooseutils.eval_path(loc), fname)
if not os.path.isfile(path):
path = os.path.join(MooseDocs.ROOT_DIR, loc, fname)
if not os.path.isfile(path):
msg = "Input file does not exist: %s"
LOG.error(msg, path)
continue
files.append(path)

# Create requirement database from tests
self.__requirements[prefix][category].update(moosesqa.get_requirements_from_tests(directories, specs))

# Create requirement database from files
self.__requirements[prefix][category].update(moosesqa.get_requirements_from_files(files))

# Create dependency database
self.__dependencies[category] = info.get('dependencies', [])

# Create remote repository database
self.__remotes[category] = repos.get(repo, None)

# Create reports from included SQA apps (e.g., moose/modulus/stochastic_tools)
if reports:
self.__reports[category] = moosesqa.get_sqa_reports(reports)
for category, item in self.get('categories').items():
for info in item.values():
self._updateCategoryItems(category, info)

# Number the requirements
for p in self.__requirements.keys():
Expand Down Expand Up @@ -217,6 +172,57 @@ def preExecute(self):

LOG.info("Gathering SQA requirement information complete [%s sec.]", time.time() - start)

def _updateCategoryItems(self, category, info):
"""
Helper for processing 'categories' configuration items.
"""
prefix = info.get('prefix', 'F')
specs = info.get('specs', ['tests'])
repo = info.get('repo', 'default')
reports = info.get('reports', None)

# Test directories
directories = list()
for d in info.get('directories', []):
path = mooseutils.eval_path(d)
if not os.path.isdir(path):
path = os.path.join(MooseDocs.ROOT_DIR, d)
if not os.path.isdir(path):
msg = "Input directory does not exist: %s"
LOG.error(msg, path)
continue
directories.append(path)

# Custom requirement files
files = list()
for f in info.get('files', []):
loc, fname = os.path.split(f)
path = os.path.join(mooseutils.eval_path(loc), fname)
if not os.path.isfile(path):
path = os.path.join(MooseDocs.ROOT_DIR, loc, fname)
if not os.path.isfile(path):
msg = "Input file does not exist: %s"
LOG.error(msg, path)
continue
files.append(path)

# Create requirement database from tests
self.__requirements[prefix][category].update(moosesqa.get_requirements_from_tests(directories, specs))

# Create requirement database from files
self.__requirements[prefix][category].update(moosesqa.get_requirements_from_files(files))

# Create dependency database
self.__dependencies[category] = info.get('dependencies', [])

# Create remote repository database
repos = self.get('repos')
self.__remotes[category] = repos.get(repo, None)

# Create reports from included SQA apps (e.g., moose/modulus/stochastic_tools)
if reports:
self.__reports[category] = moosesqa.get_sqa_reports(reports)

def postTokenize(self, page, ast):
"""Update the requirement storage with requirements given in input text."""
for key, value in self.getAttributeItems():
Expand Down
2 changes: 1 addition & 1 deletion python/moosesqa/get_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_requirements_from_files(filenames):
return out

def get_requirements_from_file(filename):
"""
"""lo
Opens hit file and extracts requirement items.
Input:
Expand Down
3 changes: 0 additions & 3 deletions test/doc/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ Extensions:
requirement-groups:
dgkernels: DGKernel Objects
interfacekernels: InterfaceKernel Objects
custom-requirements:
useability:
prefix: U

0 comments on commit d645420

Please sign in to comment.