diff --git a/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.pdf b/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.pdf index 4dd75e26885b2e1a976388297321ae79f6f529f6..a6b45eba95240d2b566666019f64573d7516b5c2 100644 Binary files a/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.pdf and b/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.pdf differ diff --git a/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.tex b/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.tex index 7c3ac7788bab12d1de347ea4bf15b46fa0ba7a5e..04443166a867600795ae7a4b51aa6817e6e3d0b7 100755 --- a/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.tex +++ b/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.tex @@ -408,7 +408,8 @@ application or version of the application \frametitle{White-box Coverage Testing} \begin{itemize} -\item (In)adequacy criteria - if significant parts of the program structure are not tested, testing is inadequate +\item (In)adequacy criteria - if significant parts of the program structure are + not tested, testing is inadequate \item Control flow coverage criteria \begin{itemize} \item Statement coverage @@ -426,9 +427,10 @@ application or version of the application \frametitle{Statement-Coverage Criterion} \begin{itemize} -\item Select a test set $T$ such that every elementary statement in $P$ is executed at least once by some $d$ in $T$ -\item An input datum executes many statements - try to minimize the number of test cases still preserving the desired -coverage +\item Select a test set $T$ such that every elementary statement in $P$ is + executed at least once by some $d$ in $T$ +\item An input datum executes many statements - try to minimize the number of + test cases still preserving the desired coverage \end{itemize} \end{frame} @@ -475,9 +477,10 @@ coverage \frametitle{Edge-Coverage Criterion} \begin{itemize} -\item Select a test set $T$ such that every edge (branch) of the control flow is exercised at least once by some $d$ -in $T$ -\item This requires formalizing the concept of the control graph and how to construct it +\item Select a test set $T$ such that every edge (branch) of the control flow is + exercised at least once by some $d$ in $T$ +\item This requires formalizing the concept of the control graph and how to + construct it \begin{itemize} \item Edges represent statements \item Nodes at the ends of an edge represent entry into the statement and exit diff --git a/Lectures/L33_WhiteBoxTestingContinued/WhiteBoxTestingContinued.pdf b/Lectures/L33_WhiteBoxTestingContinued/WhiteBoxTestingContinued.pdf index 29cb07d548254f5aecc8ff3ad7d906e67c0d4387..6d71ed36d5005d3445b97e48d378cf579187e6d2 100644 Binary files a/Lectures/L33_WhiteBoxTestingContinued/WhiteBoxTestingContinued.pdf and b/Lectures/L33_WhiteBoxTestingContinued/WhiteBoxTestingContinued.pdf differ diff --git a/Lectures/L33_WhiteBoxTestingContinued/WhiteBoxTestingContinued.tex b/Lectures/L33_WhiteBoxTestingContinued/WhiteBoxTestingContinued.tex index 1a07f82501cf3d43d97056421c055f2d565982eb..f4a52d64621da8bedbe18351edaba1209b4d35f2 100755 --- a/Lectures/L33_WhiteBoxTestingContinued/WhiteBoxTestingContinued.tex +++ b/Lectures/L33_WhiteBoxTestingContinued/WhiteBoxTestingContinued.tex @@ -30,7 +30,7 @@ \input{../def-beamer} -\newcommand{\topic}{32 White Box Testing Continued (Ch.\ 6) DRAFT} +\newcommand{\topic}{32 White Box Testing Continued (Ch.\ 6)} \input{../titlepage} @@ -53,11 +53,11 @@ \item Condition coverage \item Path coverage \end{itemize} -\item Black Box Testing -\begin{itemize} -\item Informal Example -\item Formal using MIS for PointT -\end{itemize} +% \item Black Box Testing +% \begin{itemize} +% \item Informal Example +% \item Formal using MIS for PointT +% \end{itemize} \end{itemize} \end{frame} @@ -71,18 +71,118 @@ \item Today's slide are partially based on slides by Dr.\ Wassyng +\item A4 +\bi +\item Due April 3 at 11:59 pm +\ei + +\item Course evaluations +\bi +\item \href{https://evals.mcmaster.ca/login.php}{https://evals.mcmaster.ca/} +\item Opens: 10:00 am, Monday, March 27 +\item Closes: 11:59 pm, Monday, April 10 +\ei \end{itemize} \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame} +\frametitle{Complete-Coverage Principle} + +\includegraphics[scale=0.5]{../Figures/CompleteCoveragePrinciple.png} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{White-box Testing} + +\begin{itemize} +\item \structure{Intuitively, after running your test suites, what percentage of + the lines of code in your program should be exercised?} +\end{itemize} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{White-box Coverage Testing} + +\begin{itemize} +\item (In)adequacy criteria - if significant parts of the program structure are not tested, testing is inadequate +\item Control flow coverage criteria +\begin{itemize} +\item Statement coverage +\item Edge coverage +\item Condition coverage +\item Path coverage +\end{itemize} +\end{itemize} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{Statement-Coverage Criterion} + +\begin{itemize} +\item Select a test set $T$ such that every elementary statement in $P$ is + executed at least once by some $d$ in $T$ +\item An input datum executes many statements - try to minimize the number of + test cases still preserving the desired coverage +\end{itemize} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{Example} + +\includegraphics[scale=0.5]{../Figures/ExampleStatementCoverageOnlyCode.png} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{Example} + +\includegraphics[scale=0.5]{../Figures/ExampleStatementCoverage.png} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{Weakness of the Criterion} + +\includegraphics[scale=0.6]{../Figures/WeaknessStatementCoverageOnlyCode.png} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{Weakness of the Criterion} + +\includegraphics[scale=0.6]{../Figures/WeaknessStatementCoverage.png} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \begin{frame} \frametitle{Edge-Coverage Criterion} \begin{itemize} -\item Select a test set $T$ such that every edge (branch) of the control flow is exercised at least once by some $d$ -in $T$ +\item Select a test set $T$ such that every edge (branch) of the control flow is + exercised at least once by some $d$ in $T$ \item This requires formalizing the concept of the control graph and how to construct it \begin{itemize} \item Edges represent statements @@ -92,7 +192,7 @@ in $T$ \end{frame} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Control Graph Construction Rules} @@ -101,7 +201,7 @@ in $T$ \end{frame} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Simplification} @@ -113,7 +213,16 @@ A sequence of edges can be collapsed into just one edge\\ \end{frame} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{Example: Euclid's Algorithm} + +\includegraphics[scale=0.5]{../Figures/EuclidsAlgorithm.png} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Weakness} @@ -123,7 +232,7 @@ A sequence of edges can be collapsed into just one edge\\ \end{frame} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} %\frametitle{Alternative View of Condition Coverage} @@ -133,20 +242,20 @@ A sequence of edges can be collapsed into just one edge\\ \end{frame} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Condition-Coverage Criterion} \begin{itemize} -\item Select a test set $T$ such that every edge of $P$s control flow is traversed and all possible values of the +\item Select a test set $T$ such that every edge of $P$'s control flow is traversed and all possible values of the constituents of compound conditions are exercised at least once \item This criterion is finer than edge coverage \end{itemize} \end{frame} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Weakness} @@ -155,7 +264,7 @@ constituents of compound conditions are exercised at least once \end{frame} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Path-Coverage Criterion} @@ -174,7 +283,7 @@ constituents of compound conditions are exercised at least once \end{frame} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{The Infeasibility Problem} @@ -191,7 +300,7 @@ constituents of compound conditions are exercised at least once \end{frame} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Further Problem} @@ -203,7 +312,6 @@ constituents of compound conditions are exercised at least once \end{frame} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\end{document} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\end{document} \ No newline at end of file