Skip to content
Snippets Groups Projects
Commit eef48987 authored by alicj's avatar alicj
Browse files

add exercise for testing

parent 849b5766
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -405,16 +405,32 @@ class TestCircles:
\begin{itemize}
\item{\url{https://pypi.python.org/pypi/pytest-cov}}
\item{You can install it via pip: \texttt{pip install pytest-cov}}
\item{Then, in the source code directory, run \texttt{pytest --cov}}
\end{itemize}
\begin{figure}[b]
{\includegraphics[width=8cm]{test-coverage}}
\end{figure}
\end{frame}
\begin{frame}[fragile]
\frametitle{Running the coverage plugin}
\begin{itemize}
\item{In the source code directory, run \texttt{pytest --cov}}
\end{itemize}
\begin{figure}[b]
{\includegraphics[width=6cm]{test-coverage}}
\end{figure}
\begin{itemize}
\item{We can see that \texttt{CircleADT.py} has onlyl 51\% coverage. This is because only the methods \texttt{xcoord} and \texttt{ycoord} were tested}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Exercise}
\begin{itemize}
\item{The rest of the methods are left for you as practices}
\item{You can Refer to testStatistics.py for a more complete breakdown on how to test complicated functions}
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Documentation on pytest}
\frametitle{References}
\begin{itemize}
\item {\url{https://docs.pytest.org/en/latest/xunit_setup.html}}
\item {\url{https://en.wikipedia.org/wiki/Code_coverage}}
......
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