Skip to content

Commit

Permalink
#3288: added a function to create a common NFR for maintainability
Browse files Browse the repository at this point in the history
  • Loading branch information
BilalM04 committed May 22, 2024
1 parent 2d6e1a2 commit cc87090
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions code/drasil-docLang/lib/Drasil/Sections/Requirements.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Drasil.Sections.Requirements (
fullReqs, fullTables, inReq, inTable,
mkInputPropsTable, mkQRTuple, mkQRTupleRef, mkValsSourceTable,
-- * Non-functional Requirements
nfReqF
nfReqF, mkMaintainableNFR
) where

import Language.Drasil
Expand All @@ -17,7 +17,7 @@ import qualified Language.Drasil.Sentence.Combinators as S
import Drasil.Sections.ReferenceMaterial(emptySectSentPlu)
import Theory.Drasil (HasOutput(output))

import Data.Drasil.Concepts.Documentation (description, funcReqDom,
import Data.Drasil.Concepts.Documentation (description, funcReqDom, nonFuncReqDom,
functionalRequirement, input_, nonfunctionalRequirement, {-output_,-} section_,
software, symbol_, value, reqInput)
import Data.Drasil.Concepts.Math (unit_)
Expand Down Expand Up @@ -100,6 +100,17 @@ nfReqIntro :: [Contents] -> Contents
nfReqIntro [] = mkParagraph $ emptySectSentPlu [nonfunctionalRequirement]
nfReqIntro _ = mkParagraph $ reqIntroStart +:+. nfrReqIntroBody

-- | Common Non-Functional Requirement for Maintainability.
-- Takes in a Reference Address ('String'), a percent value ('Integer'),
-- and a label ('String').
mkMaintainableNFR :: String -> Integer -> String -> ConceptInstance
mkMaintainableNFR refAddress percent lbl = cic refAddress (foldlSent [
S "If a likely change is made" `S.toThe`
S "finished software, it will take", addPercent percent, EmptyS `S.ofThe`
S "original development time,",
S "assuming the same development resources are available"
]) lbl nonFuncReqDom

-- | Creates an Input Data Table for use in the Functional Requirments section. Takes a list of wrapped variables and something that is 'Referable'.
mkInputPropsTable :: (Quantity i, MayHaveUnit i, HasShortName r, Referable r) =>
[i] -> r -> LabelledContent
Expand Down
1 change: 1 addition & 0 deletions code/drasil-docLang/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ library:
- Drasil.DocumentLanguage.Units
- Drasil.DocumentLanguage.TraceabilityGraph
- Drasil.SRSDocument
- Drasil.Sections.Requirements
when:
- condition: false
other-modules: Paths_drasil_docLang

0 comments on commit cc87090

Please sign in to comment.