Skip to content
Snippets Groups Projects
Commit 6c8a29a0 authored by Steven Palmer's avatar Steven Palmer
Browse files

Move exception testing section to be before discussion of coverage in T5

parent 18e5bfc9
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -127,7 +127,7 @@ McMaster University\\ }
\begin{itemize}
\item{You can catch bugs much earlier}
\item{Provides documentation on a specific function}
\item{Helps developer improve the implementation design of a function}
\item{Helps developer improve the implementation/design of a function}
\item{Every good developer should be a good tester too!\\
No one likes to work with someone who doesn't verify/test if their code works.}
......@@ -291,7 +291,7 @@ class TestCircles:
\end{itemize}
\item{By default, \texttt{approx} considers numbers within a relative tolerance of 1e-6 of its expected value to be equal. }
\item{By default, \texttt{approx} considers numbers within a relative tolerance of 1e-6 and absolute tolerance of 1e-12 of its expected value to be equal. }
\end{itemize}
\begin{lstlisting}[language=Python, escapechar=!]
......@@ -369,41 +369,6 @@ class TestCircles:
\end{frame}
% -----------------------------------------------------
\section{Code Coverage}
% -----------------------------------------------------
\begin{frame}[fragile]
\frametitle{How much should I test?}
\begin{itemize}
\item {Test all requirements in each function}
\item{Cover edge cases that may cause unintended consequences}
\item{Have an acceptable amount of
\href{https://en.wikipedia.org/wiki/Code_coverage}{code coverage}}
\item{Code coverage will be covered in more detail in future lectures}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Code Coverage}
\begin{itemize}
\item{Function coverage: has each function (or subroutine) in the program been called?}
\item{Statement coverage: has each statement in the program been executed?}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Code Coverage}
\begin{itemize}
\item{Branch coverage: has each branch of each control structure (such as in if and case statements) been executed?}
\begin{itemize}
\item{For example, given an if statement, have both the true and false branches been executed?}
\item{Another way of saying this is, has every edge in the program been executed?}
\end{itemize}
\item{Condition coverage (or predicate coverage): has each Boolean sub-expression evaluated both to true and false?}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Asserting about exceptions}
\begin{itemize}
......@@ -444,6 +409,42 @@ def test_zero_division():
\end{frame}
% -----------------------------------------------------
\section{Code Coverage}
% -----------------------------------------------------
\begin{frame}[fragile]
\frametitle{How much should I test?}
\begin{itemize}
\item {Test all requirements in each function}
\item{Cover edge cases that may cause unintended consequences}
\item{Have an acceptable amount of
\href{https://en.wikipedia.org/wiki/Code_coverage}{code coverage}}
\item{Code coverage will be covered in more detail in future lectures}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Code Coverage}
\begin{itemize}
\item{Function coverage: has each function (or subroutine) in the program been called?}
\item{Statement coverage: has each statement in the program been executed?}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Code Coverage}
\begin{itemize}
\item{Branch coverage: has each branch of each control structure (such as in if and case statements) been executed?}
\begin{itemize}
\item{For example, given an if statement, have both the true and false branches been executed?}
\item{Another way of saying this is, has every edge in the program been executed?}
\end{itemize}
\item{Condition coverage (or predicate coverage): has each Boolean sub-expression evaluated both to true and false?}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Pytest plugin for measuring coverage}
\begin{itemize}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment