diff --git a/Assignments/Assig1/MarkingScheme.xlsx b/Assignments/Assig1/MarkingScheme.xlsx index 16d0b711c79bb9fc5f29a0ac4986ce28994453f5..b98e3c5869e0076fe9106f3182330cb66bd48a8a 100644 Binary files a/Assignments/Assig1/MarkingScheme.xlsx and b/Assignments/Assig1/MarkingScheme.xlsx differ diff --git a/Lectures/L13_ModuleDecomposition/ModuleDecomposition.pdf b/Lectures/L13_ModuleDecomposition/ModuleDecomposition.pdf index 8164cfbbbc819aaadad1d8e91d732aa923a33b36..12aa14d144ebafc44c0e9cba2ede745dca07642a 100644 Binary files a/Lectures/L13_ModuleDecomposition/ModuleDecomposition.pdf and b/Lectures/L13_ModuleDecomposition/ModuleDecomposition.pdf differ diff --git a/Lectures/L13_ModuleDecomposition/ModuleDecomposition.tex b/Lectures/L13_ModuleDecomposition/ModuleDecomposition.tex index eab927b58b9bfa122793455fc81367c788611472..144900f76f5c6c1f8f8c49dba0b516c29a727d5c 100755 --- a/Lectures/L13_ModuleDecomposition/ModuleDecomposition.tex +++ b/Lectures/L13_ModuleDecomposition/ModuleDecomposition.tex @@ -22,7 +22,7 @@ \input{../def-beamer} -\newcommand{\topic}{13 Module Decomposition (Ghezzi Ch.\ 4)} +\newcommand{\topic}{13 Module Decomposition (Ghezzi Ch.\ 4, H\&S Ch.\ 7)} \input{../titlepage} @@ -44,7 +44,7 @@ \item The USES relation \item Module decomposition by secrets \item The IS\_COMPONENT\_OF relation -\item Program family +\item Techniques for design for change \item Module guide % \item MIS and MID % \item Examples @@ -105,6 +105,40 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame} +\frametitle{QueueADT Module Syntax (Abstract Object)} + +What is missing from this interface? +~\newline + +\textbf{Exported Access Programs}\\ +~\newline +\begin{tabular}{| l | l | l | l |} +\hline +\textbf{Routine name} & \textbf{In} & \textbf{Out} & \textbf{Exceptions}\\ +\hline +q\_init & ~ & queueT & ~\\ +\hline +add & T & ~ & NOT\_INIT, FULL\\ +\hline +pop & ~ & ~ & NOT\_INIT, EMPTY\\ +\hline +front & ~ & T & NOT\_INIT, EMPTY\\ +\hline +isempty & ~ & boolean & NOT\_INIT\\ +\hline +isfull & ~ & boolean & NOT\_INIT\\ +\hline +\end{tabular} +~\newline + +If MAX\_SIZE is exported, what could you replace isempty and isfull by? (This +new interface will move some work to the programmer.) + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \begin{frame} \frametitle{Quality Criteria} @@ -115,7 +149,8 @@ \item Ordering of parameters in argument lists \item Exception handling, etc. \end{itemize} -\item Essential - omit unnecessary features +\item Essential - omit unnecessary features (only one way to access each + service) \item General - cannot always predict how the module will be used \item As implementation independent as possible \item Minimal - avoid access routines with two potentially independent services @@ -128,6 +163,43 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame} +\frametitle{QueueADT Module Syntax (Abstract Object)} + +Is this interface minimal? +~\newline + +\textbf{Exported Access Programs}\\ +~\newline +\begin{tabular}{| l | l | l | l |} +\hline +\textbf{Routine name} & \textbf{In} & \textbf{Out} & \textbf{Exceptions}\\ +\hline +q\_init & ~ & queueT & ~\\ +\hline +add & T & ~ & NOT\_INIT, FULL\\ +\hline +pop & ~ & T & NOT\_INIT, EMPTY\\ +\hline +% front & ~ & T & NOT\_INIT, EMPTY\\ +% \hline +size & ~ & integer & NOT\_INIT\\ +\hline +isinit & ~ & boolean & ~\\ +\hline +\end{tabular} +~\newline + +\bi +\item front has been merged with pop +\item size replaces isempty and isfull +\item isinit is added +\ei + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \begin{frame} \frametitle{Modular Decomposition} @@ -167,6 +239,17 @@ \begin{frame} \frametitle{Specific Techniques for Design for Change} +What software tool would you use if you wanted to select at build time between +two implementations of a module, each distinguished by a different decision for +their shared secret? + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{Specific Techniques for Design for Change} + \begin{itemize} \item Anticipate definition of all family members \item Identify what is common to all family members, delay decisions that @@ -178,7 +261,17 @@ \item MAXSPEED = 5600 \end{itemize} \item Conditional compilation +\bi +\item Compile time binding +\item Works well when there is a preprocessor, like for C +\item If performance is not a concern, can often ``fake it'' at run time +\ei +\item Make \item Software generation +\bi +\item Compiler generator, like \texttt{yacc} +\item Domain Specific Language +\ei \end{itemize} \end{frame} @@ -242,6 +335,24 @@ r^{+} M_j$$ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame} +\frametitle{DAG Versus Tree} + +Is a DAG a tree? Is a tree a DAG? + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{DAG Versus Tree} + +Would you prefer your uses relation is a tree? + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \begin{frame} \frametitle{The USES Relation} @@ -255,6 +366,7 @@ r^{+} M_j$$ \item For instance, A calls a routine exported by B \end{itemize} \item A is a client of B; B is a server +\item Inheritance, Association and Aggregation imply Uses \end{itemize} \end{frame} @@ -274,7 +386,7 @@ r^{+} M_j$$ \item They make software easier to test \end{itemize} \item Low coupling -\item Fan-in is better than Fan-out +\item Fan-in is considered better than Fan-out: \structure{WHY?} \end{itemize} \end{frame} @@ -309,6 +421,16 @@ r^{+} M_j$$ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame} +\frametitle{Module Decomposition (Parnas)} + +Does the module decomposition on the previous slide show a Uses relation? Is it +a DAG? Is it a tree? + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \begin{frame} \frametitle{IS\_COMPONENT\_OF} @@ -319,6 +441,7 @@ r^{+} M_j$$ \item B COMPRISES A \item $M_{S,i} = \{ M_k | M_k \in S \wedge M_k \mbox{ IS\_COMPONENT\_OF } M_i \}$ we say that $M_{S,i}$ IMPLEMENTS $M_i$ +\item \structure{How is IS\_COMPONENT\_OF represented in UML?} \end{itemize} \end{frame} @@ -401,7 +524,11 @@ other readers can understand and verify the decomposition \begin{itemize} \item The MG consists of a table that documents each module's service and secret \item Conceptual modules will have broader responsibilities and secrets -\item The leaf modules that represent code will contain much more precise services and secrets +\item Following a particular branch, the secrets at lower levels ``sum up'' to + the secret at higher levels +\item The leaf modules that represent code will contain much more precise + services and secrets +\item Only the leaf modules are actually implemented \item The MG should list the likely and unlikely changes on which the design is based \end{itemize} @@ -414,9 +541,11 @@ other readers can understand and verify the decomposition %\vspace{-1.5cm} \begin{center} -\includegraphics[width=0.55\textwidth]{DecompBySecretHierarchyExample.png} +\includegraphics[width=0.5\textwidth]{DecompBySecretHierarchyExample.png} \end{center} +\href{https://gitlab.cas.mcmaster.ca/smiths/se2aa4_cs2me3/blob/master/Lectures/L13_ModuleDecomposition/DecompBySecretHierarchyExample.png}{Link} + \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/ReferenceMaterial/ParnasEtAl1984.pdf b/ReferenceMaterial/ParnasEtAl1984.pdf new file mode 100644 index 0000000000000000000000000000000000000000..49727c3917c072ee7f22aa84f70687e364657dce Binary files /dev/null and b/ReferenceMaterial/ParnasEtAl1984.pdf differ diff --git a/ReferenceMaterial/References.bib b/ReferenceMaterial/References.bib index b77e277d274af5fea62da211937889755bfc031b..771e0242b0435219f80fa71bc91de54418392934 100644 --- a/ReferenceMaterial/References.bib +++ b/ReferenceMaterial/References.bib @@ -1,13 +1,23 @@ %% This BibTeX bibliography file was created using BibDesk. %% http://bibdesk.sourceforge.net/ -%% Created for Spencer Smith at 2017-01-09 09:40:31 -0500 +%% Created for Spencer Smith at 2017-02-01 10:10:23 -0500 %% Saved with string encoding Unicode (UTF-8) +@inproceedings{ParnasEtAl1984, + Author = {D.L. Parnas and P.C. Clement and D. M. Weiss}, + Booktitle = {International Conference on Software Engineering}, + Date-Added = {2017-02-01 15:09:44 +0000}, + Date-Modified = {2017-02-01 15:09:44 +0000}, + Pages = {408-419}, + Title = {The modular structure of complex systems}, + Year = {1984}, + Bdsk-File-1 = {YnBsaXN0MDDUAQIDBAUGJCVYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKgHCBMUFRYaIVUkbnVsbNMJCgsMDxJXTlMua2V5c1pOUy5vYmplY3RzViRjbGFzc6INDoACgAOiEBGABIAFgAdccmVsYXRpdmVQYXRoWWFsaWFzRGF0YV8QNi4uLy4uL3NlNHNjL1NjaUNvbXBBbmRTb2Z0RW5nUGFwZXJzL1Bhcm5hc0V0QWwxOTg0LnBkZtIXCxgZV05TLmRhdGFPEQHcAAAAAAHcAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADSSGuhSCsAAACF/GESUGFybmFzRXRBbDE5ODQucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIX8sdPtoS8AAAAAAAAAAAACAAMAAAkgAAAAAAAAAAAAAAAAAAAAF1NjaUNvbXBBbmRTb2Z0RW5nUGFwZXJzAAAQAAgAANJIo+EAAAARAAgAANPt2W8AAAABABQAhfxhAIXv/wAgs4MACWDeAAYqmgACAFVNYWNpbnRvc2ggSEQ6VXNlcnM6AHNtaXRoczoAUmVwb3M6AHNlNHNjOgBTY2lDb21wQW5kU29mdEVuZ1BhcGVyczoAUGFybmFzRXRBbDE5ODQucGRmAAAOACYAEgBQAGEAcgBuAGEAcwBFAHQAQQBsADEAOQA4ADQALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAENVc2Vycy9zbWl0aHMvUmVwb3Mvc2U0c2MvU2NpQ29tcEFuZFNvZnRFbmdQYXBlcnMvUGFybmFzRXRBbDE5ODQucGRmAAATAAEvAAAVAAIADf//AACABtIbHB0eWiRjbGFzc25hbWVYJGNsYXNzZXNdTlNNdXRhYmxlRGF0YaMdHyBWTlNEYXRhWE5TT2JqZWN00hscIiNcTlNEaWN0aW9uYXJ5oiIgXxAPTlNLZXllZEFyY2hpdmVy0SYnVHJvb3SAAQAIABEAGgAjAC0AMgA3AEAARgBNAFUAYABnAGoAbABuAHEAcwB1AHcAhACOAMcAzADUArQCtgK7AsYCzwLdAuEC6ALxAvYDAwMGAxgDGwMgAAAAAAAAAgEAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAyI=}} + @inproceedings{Parnas2010, Author = {David Lorge Parnas}, Bibsource = {dblp computer science bibliography, http://dblp.org},