Skip to content

Commit

Permalink
update metamodel and quickref
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornregnell committed Jan 19, 2025
1 parent 7e5a702 commit 220bbfd
Show file tree
Hide file tree
Showing 5 changed files with 257 additions and 118 deletions.
6 changes: 3 additions & 3 deletions docs/concepts-GENERATED.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Benefit Attr IntAttr A characterization of a good or helpful result or effect (e
Breakpoint EntType QualityEnt A point of change, representing an important shift in the relation between quality and benefit.
Capacity Attr IntAttr An amount that can be held or contained (e.g. by a resource).
Class EntType DataEnt An extensible template for creating objects. A set of objects with certain attributes in common. A category.
Comment Attr StrAttr A note with a remark or a discussion on an entity.
Comment Attr StrAttr A note, remark or discussion.
Component EntType DesignEnt A composable part of a system architecture. A reusable, interchangeable system unit or functionality.
Configuration EntType VariabilityEnt A specific combination of variants.
Constraints Attr StrAttr Propositions that constrain a solution space or restrict possible attribute values.
Constraints Attr StrAttr Propositions that constrain a solution space or restrict attribute values.
Cost Attr IntAttr An expenditure of something, such as time or effort, necessary if implementing an entity.
Damage Attr IntAttr A characterization of the negative consequences if some entity (e.g. a risk) occurs.
Data EntType DataEnt A data entity, type, class, or record stored or processed by a system.
Expand Down Expand Up @@ -73,7 +73,7 @@ User EntType ContextEnt A human interacting with a system.
Value Attr IntAttr Some general integer value.
Variant EntType VariabilityEnt An object or system property that can be chosen from a set of options.
VariationPoint EntType VariabilityEnt An opportunity of choice among variants.
Why Attr StrAttr A description of intention or rationale of an entity.
Why Attr StrAttr A description of intention or rationale.
WorkPackage EntType GeneralEnt A coherent collection of (development) activities.
binds RelType VariabilityRel Ties a value to an option. A configuration binds a variation point.
deprecates RelType GeneralRel Makes outdated. An entity deprecates (supersedes) another entity.
Expand Down
255 changes: 186 additions & 69 deletions docs/reqT-quickref-GENERATED.tex
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@

\usepackage{fancyhdr}
\pagestyle{fancy}
\chead{\url{https://github.com/reqT/reqT-lang/blob/main/docs/reqT-quickref-GENERATED.tex}}
\lhead{QuickRef reqT v4}
\chead{\url{https://reqT.github.io}}
\lhead{QuickRef reqT v4.3}
\rhead{Compiled \today}

\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=blue, urlcolor=blue}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\definecolor{entityColor}{RGB}{0,100,200}
\definecolor{attributeColor}{RGB}{0,100,50}
\definecolor{stringAttributeColor}{RGB}{180,100,40}
\definecolor{intAttributeColor}{RGB}{0,120,50}
\definecolor{relationColor}{RGB}{160,0,30}

\usepackage{listings}
Expand All @@ -36,8 +37,10 @@
emphstyle=\bfseries\color{entityColor},
emph={[2]binds,deprecates,excludes,has,helps,hurts,impacts,implements,interactsWith,is,precedes,relatesTo,requires,verifies,Binds,Deprecates,Excludes,Has,Helps,Hurts,Impacts,Implements,InteractsWith,Is,Precedes,RelatesTo,Requires,Verifies},
emphstyle={[2]\bfseries\color{relationColor}},
emph={[3]Benefit,Capacity,Comment,Constraints,Cost,Damage,Deprecated,Example,Expectation,Failure,Frequency,Gist,Input,Location,Max,Min,Order,Output,Prio,Probability,Profit,Spec,Text,Title,Value,Why},
emphstyle={[3]\bfseries\color{attributeColor}},
emph={[3]Comment,Constraints,Deprecated,Example,Expectation,Failure,Gist,Input,Location,Output,Spec,Text,Title,Why},
emphstyle={[3]\bfseries\color{stringAttributeColor}},
emph={[4]Benefit,Capacity,Cost,Damage,Frequency,Max,Min,Order,Prio,Probability,Profit,Value},
emphstyle={[4]\bfseries\color{intAttributeColor}},
}

\lstset{style=reqT}
Expand Down Expand Up @@ -67,7 +70,7 @@

\begin{document}

\fontsize{9.1}{11}\selectfont
\fontsize{9.0}{10.5}\selectfont

\begin{multicols*}{4}
\raggedright
Expand All @@ -79,6 +82,8 @@ \section*{What is reqT?}
common requirements engineering concepts.




\section*{reqT Markdown syntax}
A reqT model in markdown syntax starts with \lstinline+*+ followed by an element and a colon and an optional relation followed by an indented list of sub-elements.

Expand All @@ -89,18 +94,45 @@ \section*{reqT Markdown syntax}

\end{lstlisting}

\section*{reqT Scala DSL constructors}
\lstinline+EntType+, \lstinline+StrAttrType+ and \lstinline+IntAttrType+ enums have apply-methods that construct \lstinline+Ent+, \lstinline+StrAttr+ and \lstinline+IntAttr+ instances respectively. Each instance of \lstinline+Ent+ has lower-case relation constructors (see \lstinline+enum relType+ on next page):
\begin{lstlisting}
Model(
Feature("helloWorld").has(
Spec("Show informal greeting."),
Prio(1)))

\end{lstlisting}


\section*{reqT Scala case classes}
Each constructor instantiate the metamodel classes using nested Scala case class structures:
\begin{lstlisting}
Model(
Rel(Ent(Feature,"helloWorld"),
Has, Model(
StrAttr(Spec,
"Show informal greeting."),
IntAttr(Prio,1))))

\end{lstlisting}


\section*{reqT Metamodel}

A model is a sequence of elements.
An element can be a node or a relation.
A node can be an entity or an attribute.
An entity has a type and an id.
An attribute has a type and a value.
An attribute can be a string attribute or an integer attribute.
A relation connects an entity to a sub-model via a relation type.
A \textbf{Model} is a sequence of \textbf{elements}.
An element can be a \textbf{node} or a \textbf{relation}.
A node can be an \textbf{entity} or an \textbf{attribute}.
An entity has a \textit{type} and an \textit{id}.
An attribute has a \texttt{type} and a \texttt{value}.
An attribute can be a \textbf{string attribute} or an \textbf{integer attribute}.
A relation connects an entity to a \textit{sub-model} via a relation type.


\section*{reqT Metamodel class diagram}
Leafs are implemented as Scala \textbf{case classes}. \\Fields \texttt{t} are Scala \textbf{enum} types.

\noindent\hspace*{-2.1em}\includegraphics[width=8.2cm]{metamodel-Elem-GENERATED.pdf}
\noindent\hspace*{-3.1em}\vspace{-3em}\includegraphics[width=8.2cm,trim={0 0 0 3em},clip]{metamodel-Elem-GENERATED.pdf}

\section*{\texttt{EntType}.values}
\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{EntGroup.}\textcolor{black}{GeneralEnt}}\textcolor{gray}{.types}}}}}
Expand Down Expand Up @@ -216,40 +248,56 @@ \subsection*{\underline{\texttt{\textit{{\textcolor{gray}{EntGroup.}\textcolor{b



\section*{reqT Scala DSL constructors}
\lstinline+EntType+, \lstinline+StrAttrType+ and \lstinline+IntAttrType+ enums have apply-methods that construct \lstinline+Ent+, \lstinline+StrAttr+ and \lstinline+IntAttr+ instances respectively. Each instance of \lstinline+Ent+ has lower-case relation constructors (see \lstinline+enum relType+ on next page):
\begin{lstlisting}
Model(
Feature("helloWorld").has(
Spec("Show informal greeting."),
Prio(1)))
%\vfill\null\columnbreak

\end{lstlisting}
\section*{\texttt{RelType.values}}

\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{GeneralRel}}\textcolor{gray}{.types}}}}}
\Concept{Deprecates}{Makes outdated. An entity deprecates (supersedes) another entity.}

\section*{reqT Scala case classes}
Each constructor instantiate the metamodel classes using nested Scala case class structures:
\begin{lstlisting}
Model(
Rel(Ent(Feature,"helloWorld"),
Has, Model(
StrAttr(Spec,
"Show informal greeting."),
IntAttr(Prio,1))))
\Concept{Has}{Expresses containment, substructure, composition or aggregation. One entity contains another.}

\end{lstlisting}
\Concept{Impacts}{Some unspecific influence. A new feature impacts an existing component.}

\end{multicols*}
%\raggedcolumns
\begin{multicols*}{4}
\raggedright
\Concept{RelatesTo}{Some general, unspecific relation to another entity.}


\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{ClassRel}}\textcolor{gray}{.types}}}}}
\Concept{Is}{One entity inherits properties of another entity. A specialization, extension or subtype relation. }


\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{ContextRel}}\textcolor{gray}{.types}}}}}
\Concept{InteractsWith}{A communication relation. A user interacts with an interface.}

%\vfill\null\columnbreak

\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{DependencyRel}}\textcolor{gray}{.types}}}}}
\Concept{Excludes}{Prevents an entity combination. One feature excludes another in a release.}

\Concept{Implements}{Realisation of an entity, e.g. a component implements a feature.}

\Concept{Precedes}{Temporal ordering. A feature precedes (should be implemented before) another feature.}

\Concept{Requires}{A requested combination. One function requires that a another function is implemented.}

\Concept{Verifies}{Gives evidence of correctness. A test verifies the implementation of a feature.}


\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{GoalRel}}\textcolor{gray}{.types}}}}}
\Concept{Helps}{Positive influence. A goal supports the fulfillment of another goal.}

\Concept{Hurts}{Negative influence. A goal hinders another goal.}


\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{VariabilityRel}}\textcolor{gray}{.types}}}}}
\Concept{Binds}{Ties a value to an option. A configuration binds a variation point.}



\vfill\null\columnbreak
\section*{\texttt{StrAttrType.values}}
\Concept{Comment}{A note with a remark or a discussion on an entity.}
\Concept{Comment}{A note, remark or discussion.}

\Concept{Constraints}{Propositions that constrain a solution space or restrict possible attribute values.}
\Concept{Constraints}{Propositions that constrain a solution space or restrict attribute values.}

\Concept{Deprecated}{A description of why an entity should be avoided, often because it is superseded by another entity, as indicated by a 'deprecates' relation.}

Expand All @@ -273,9 +321,9 @@ \section*{\texttt{StrAttrType.values}}

\Concept{Title}{A general or descriptive heading.}

\Concept{Why}{A description of intention or rationale of an entity.}
\Concept{Why}{A description of intention or rationale.}


%\vfill\null\columnbreak
\section*{\texttt{IntAttrType.values}}
\Concept{Benefit}{A characterization of a good or helpful result or effect (e.g. of a feature).}

Expand All @@ -302,48 +350,117 @@ \section*{\texttt{IntAttrType.values}}
\Concept{Value}{Some general integer value.}


\section*{\texttt{RelType.values}}

\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{GeneralRel}}\textcolor{gray}{.types}}}}}
\Concept{Deprecates}{Makes outdated. An entity deprecates (supersedes) another entity.}

\Concept{Has}{Expresses containment, substructure, composition or aggregation. One entity contains another.}

\Concept{Impacts}{Some unspecific influence. A new feature impacts an existing component.}

\Concept{RelatesTo}{Some general, unspecific relation to another entity.}
\section*{Examples}

\subsection*{examples.Lauesen.ContextDiagramSimple}
\begin{lstlisting}
* Section: context has
* Product: hotelApp interactsWith
* User: receptionist
* User: guest
* System: accounting
* System: telephony

\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{ClassRel}}\textcolor{gray}{.types}}}}}
\Concept{Is}{One entity inherits properties of another entity. A specialization, extension or subtype relation. }


\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{ContextRel}}\textcolor{gray}{.types}}}}}
\Concept{InteractsWith}{A communication relation. A user interacts with an interface.}

\end{lstlisting}

\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{DependencyRel}}\textcolor{gray}{.types}}}}}
\Concept{Excludes}{Prevents an entity combination. One feature excludes another in a release.}

\Concept{Implements}{Realisation of an entity, e.g. a component implements a feature.}
\subsection*{examples.Lauesen.DataRelations}
\begin{lstlisting}
* Class: Guest relatesTo
* Class: Stay
* Min: 1
* Class: Stay relatesTo
* Class: RoomState
* Class: RoomService
* Min: 1
* Class: RoomServiceType relatesTo
* Class: RoomService
* Min: 1
* Class: Room relatesTo
* Class: RoomState
* Min: 1

\Concept{Precedes}{Temporal ordering. A feature precedes (should be implemented before) another feature.}
\end{lstlisting}

\Concept{Requires}{A requested combination. One function requires that a another function is implemented.}

\Concept{Verifies}{Gives evidence of correctness. A test verifies the implementation of a feature.}
\subsection*{examples.Prioritization.DollarTest}
\begin{lstlisting}
* Stakeholder: a has
* Prio: 2
* Req: r1 has Benefit: 5
* Req: r2 has Benefit: 300
* Req: r3 has Benefit: 8
* Req: r4 has Benefit: 9
* Req: r5 has Benefit: 100
* Req: r6 has Benefit: 10
* Req: r7 has Benefit: 20
* Stakeholder: b has
* Prio: 4
* Req: r1 has Benefit: 100
* Req: r2 has Benefit: 7
* Req: r3 has Benefit: 20
* Req: r4 has Benefit: 80
* Req: r5 has Benefit: 10
* Req: r6 has Benefit: 90
* Req: r7 has Benefit: 20

\end{lstlisting}

\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{GoalRel}}\textcolor{gray}{.types}}}}}
\Concept{Helps}{Positive influence. A goal supports the fulfillment of another goal.}

\Concept{Hurts}{Negative influence. A goal hinders another goal.}
\vfill\null\columnbreak
\subsection*{examples.Lauesen.DataEntities}
\begin{lstlisting}
* Class: RoomServiceType has
* Field: name
* Field: price
* Class: RoomService has
* Field: serviceDate
* Field: serviceCount
* Class: Room has
* Field: roomId
* Field: bedCount
* Field: roomType
* Field: price1
* Field: price2
* Class: RoomState has
* Field: date
* Field: personCount
* Field: state

\end{lstlisting}

\subsection*{\underline{\texttt{\textit{{\textcolor{gray}{RelGroup.}\textcolor{black}{VariabilityRel}}\textcolor{gray}{.types}}}}}
\Concept{Binds}{Ties a value to an option. A configuration binds a variation point.}

\subsection*{examples.constraintProblems.\\releasePlanSimple}
\begin{lstlisting}
* Stakeholder: X has
* Prio: 1
* Feature: 1 has Benefit: 4
* Feature: 2 has Benefit: 2
* Feature: 3 has Benefit: 1
* Stakeholder: Y has
* Prio: 2
* Feature: 1 has Benefit: 2
* Feature: 2 has Benefit: 1
* Feature: 3 has Benefit: 1
* Release: A precedes Release: B
* Resource: dev has
* Feature: 1 has Cost: 10
* Feature: 2 has Cost: 70
* Feature: 3 has Cost: 40
* Release: A has Capacity: 100
* Release: B has Capacity: 100
* Resource: test has
* Feature: 1 has Cost: 40
* Feature: 2 has Cost: 10
* Feature: 3 has Cost: 70
* Release: A has Capacity: 100
* Release: B has Capacity: 100
* Feature: 3 precedes Feature: 1

\end{lstlisting}


\end{multicols*}


\end{document}
Loading

0 comments on commit 220bbfd

Please sign in to comment.