diff --git a/Lectures/L31_OverviewOfTesting/OverviewOfTesting.pdf b/Lectures/L31_OverviewOfTesting/OverviewOfTesting.pdf index 6e8a56f8b1abca88e8ca28980677e7b23ac3e6f5..ab74717dfc79deff4fbad7fc2a97eb39fa253fb4 100644 Binary files a/Lectures/L31_OverviewOfTesting/OverviewOfTesting.pdf and b/Lectures/L31_OverviewOfTesting/OverviewOfTesting.pdf differ diff --git a/Lectures/L31_OverviewOfTesting/OverviewOfTesting.tex b/Lectures/L31_OverviewOfTesting/OverviewOfTesting.tex index 18fa01e70dcffb5f349d027a1efced148b6fa3a5..a609a5f94d1a692efce60462cff65fd25874348e 100755 --- a/Lectures/L31_OverviewOfTesting/OverviewOfTesting.tex +++ b/Lectures/L31_OverviewOfTesting/OverviewOfTesting.tex @@ -352,59 +352,5 @@ validity %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\begin{frame} -\frametitle{Fault Testing} -\begin{itemize} -\item Common analogy involves planting fish in a lake to estimate the fish population -\item T = total number of fish in the lake (to be estimated) -\item N = fish stocked (marked) in the lake -\item M = total number of fish caught in lake -\item M' = number of marked fish caught -\item T = (M - M')*N/M' -\item Artificially seed faults, discover both seeded and new faults, estimate the total number of faults -\end{itemize} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame} -\frametitle{Fault Testing Continued} -\begin{itemize} -\item Method assumes that the real and seeded faults have the same distribution -\item Hard to seed faults -\begin{itemize} -\item By hand (not a great idea) -\item Independent testing by two groups and obtain the faults from one group for use by the other -\end{itemize} -\item Want most of the discovered faults to be seeded faults -\item If many faults are found, this is a bad thing -\item The probability of errors is proportional to the number of errors already found -\end{itemize} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame} -\frametitle{Exam Question: Homework} -After completion of a complex software project, two independent groups test -it. The first group finds 300 errors and the second group finds 200 errors. A -comparison of the errors discovered by the two teams shows that they found the -same error in 50 cases. What is the range that estimates the number of errors in -the original software project? - -% M1 = 300, M1'=50, N1 = 200, T1 = 1000 -% M2 = 200, M2'=50, N2 = 300, T2 = 900 - -\be[A.] -\item 900--1000 %answer -\item -17--25 -\item 600--1500 -\item 0--150 -\item 150--250 -\ee -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - \end{document} diff --git a/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.pdf b/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.pdf index dfc7a6932a7918ac4a77ad3283a950893df95480..e7470556c8ce931c6daa8f83af0b5cb2952ff2c0 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 3749fa04ad5a7aac84fb2b31cbb3c783005b794f..1702257e7aa25528faf56b3108f8f5f52a4e4e75 100755 --- a/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.tex +++ b/Lectures/L32_WhiteBoxTesting/WhiteBoxTesting.tex @@ -29,7 +29,7 @@ \mode<presentation>{} \input{../def-beamer} -\Drafttrue +\Draftfalse \newcommand{\topicTitle}{32 White Box Testing (Ch.\ 6)} \ifDraft @@ -77,29 +77,23 @@ TBD { \begin{itemize} -\item Problems with GitLab - now resolved +\item A4: Due April 9 at 11:59 pm -\item A4 +\item No classes on Thurs, Mar 29 or Fri, Mar 30 +\item Final tutorial (examination review) \bi -\item \href{https://gitlab.cas.mcmaster.ca/Group7/Battleship}{Sample Design and - Documentation} -\item \structure{Marking scheme has 175 potential marks (8.75/5)} -\item \structure{Consider using a tool for code coverage metrics} -\bi -\item Coverage.py -\item JCov -\item etc. -\ei -\item Due April 3 at 11:59 pm +\item Monday, Mar 26 +\item Tuesday, Mar 27 +\item Friday, Apr 6 (no tutorial on Fri, Mar 30) \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 +\item \href{https://evals.mcmaster.ca}{https://evals.mcmaster.ca} +\item Start: Tues, Mar 27, 10:00 am +\item Close: Tues, Apr 10, 11:59 pm \item \textbf{Your participation is highly valued!} -\item Hi class participation means bonus marks +\item \emph{Grade bonus for class participation!} \ei \end{itemize} } @@ -110,60 +104,25 @@ TBD %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} -\frametitle{Continuous Integration Testing} +\frametitle{Quality Testing: Installability} \begin{itemize} -\item \structure{What is continuous integration testing?} +\item \structure{How might you test installability?} %virtual machines, docker \end{itemize} \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} -\frametitle{Continuous Integration Testing} +\frametitle{Bugs Per Lines of Code} +\href{http://amartester.blogspot.ca/2007/04/bugs-per-lines-of-code.html}{Some numbers} \begin{itemize} -\item Information available on - \href{https://en.wikipedia.org/wiki/Continuous_integration}{Wikipedia} -\item Developers integrate their code into a shared repo frequently (multiple - times a day) -\item Each integration is automatically accompanied by regression tests and - other build tasks -\item Build server -\bi -\item Unit tests -\item Integration tests -\item Static analysis -\item Profile performance -\item Extract documentation -\item Update project web-page -\item Portability tests -\item etc. -\ei -\item Avoids potentially extreme problems with integration when the baseline and - a developer's code greatly differ -\end{itemize} -\end{frame} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\begin{frame} -\frametitle{Continuous Integration Tools} -\begin{itemize} -\item Gitlab -\bi -\item Example at - \href{https://gitlab.cas.mcmaster.ca/andrem5/RogueReborn/pipelines}{Rogue - Reborn} -\ei -\item Jenkins -\item Travis -\item \href{https://www.docker.com/}{Docker} -\bi -\item Eliminates the ``it works on my machine'' problem -\item Package dependencies with your apps -\item A container for lightweight virtualization -\item Not a full VM -\ei +\item Indust avg: 15--50 errors per 1000 lines of delivered code +\item Microsoft apps: 10--20 errors per 1000 lines in-house testing, 0.5/1000 for + released product +\item Harlan Mills: 3/1000 in-house testing, 0.1/1000 released product +\item Space shuttle: 0/500 000 \end{itemize} +\structure{How do we estimate these numbers?} \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -416,6 +375,64 @@ application or version of the application %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\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} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \end{document}