Skip to content

Commit

Permalink
Add database unit tests to report
Browse files Browse the repository at this point in the history
  • Loading branch information
mcttn22 committed Feb 29, 2024
1 parent d957173 commit 1936046
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
Binary file modified project-report/project-report.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions project-report/src/latex/analysis.tex
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ \subsection{Requirements}
\hline
2 & Develop Artificial Neural Networks from first principles & & \\
\hline
2.1 & Provide utilities for creating Artificial Neural Networks & \hyperref[sec:utils-subpackage]{Page \pageref{sec:utils-subpackage}} & \hyperref[sec:unit-tests]{Page \pageref{sec:unit-tests}} \\
2.1 & Provide utilities for creating Artificial Neural Networks & \hyperref[sec:utils-subpackage]{Page \pageref{sec:utils-subpackage}} & \hyperref[sec:models-utils-unit-tests]{Page \pageref{sec:models-utils-unit-tests}} \\
\hline
2.2 & Allow for the saving and loading of trained models' weights and biases & \hyperref[sec:model-module]{Page \pageref{sec:model-module}} & \hyperref[sec:unit-tests]{Page \pageref{sec:unit-tests}} \\
2.2 & Allow for the saving and loading of trained models' weights and biases & \hyperref[sec:model-module]{Page \pageref{sec:model-module}} & \hyperref[sec:models-utils-unit-tests]{Page \pageref{sec:models-utils-unit-tests}} \\
\hline
2.3 & Allow use of Graphics Cards for faster training & Code not included in report & \hyperref[sec:cpu-vs-gpu-analysis]{Page \pageref{sec:cpu-vs-gpu-analysis}} \\
\hline
Expand All @@ -108,7 +108,7 @@ \subsection{Requirements}
\hline
3.2 & Allow unique datasets and train dataset size to be loaded & \hyperref[sec:ann-implementations]{Page \pageref{sec:ann-implementations}} & \hyperref[sec:train-dataset-size-analysis]{Page \pageref{sec:train-dataset-size-analysis}} \\
\hline
4 & Use a database to store a model's features and the location of its weights and biases & \hyperref[sec:__main__-module]{Page \pageref{sec:__main__-module}} & TODO Unit Test \\
4 & Use a database to store a model's features and the location of its weights and biases & \hyperref[sec:__main__-module]{Page \pageref{sec:__main__-module}} & \hyperref[sec:database-unit-tests]{Page \pageref{sec:database-unit-tests}} \\
\hline
5 & Develop a Graphical User Interface & & \\
\hline
Expand Down
4 changes: 4 additions & 0 deletions project-report/src/latex/design.tex
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ \subsection{Database Design}
\begin{minted}{sql}
UNIQUE (Dataset, Name)
\end{minted}
\item I will also use the following constraint on each attribute to ensure no attribute is left empty:
\begin{minted}{sql}
NOT NULL
\end{minted}
\end{itemize}

\subsection{Queries}
Expand Down
27 changes: 17 additions & 10 deletions project-report/src/latex/testing.tex
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,26 @@ \subsubsection{Input Validation Testing} % See table on teams
\subsection{Automated Testing}

\subsubsection{Unit Tests}
\label{sec:unit-tests}

Within the test package, I have written the following unit tests for the utils subpackage of both the cpu and gpu subpackage of the models package. Similarly to the code for the cpu
and gpu subpackage, it is only worth showing the code for the cpu version as both are very similar in functionality.
Within the test package, I have written the following unit tests:

\begin{itemize}
\item test\_model.py module:
\inputminted{python}{./school_project/test/models/cpu/utils/test_model.py}

\pagebreak

\item test\_tools.py module:
\inputminted{python}{./school_project/test/models/cpu/utils/test_tools.py}
\label{sec:database-unit-tests}
\item Unit tests for the database in a test\_database.py module:
\inputminted{python}{./school_project/test/test_database.py}

\label{sec:models-utils-unit-tests}
\item Unit tests for the utils subpackage of both the cpu and gpu subpackage of the models package. Similarly to the code for the cpu and gpu subpackage, it is
only worth showing the code for the cpu version as both are very similar in functionality.
\begin{itemize}
\item test\_model.py module:
\inputminted{python}{./school_project/test/models/cpu/utils/test_model.py}

\pagebreak

\item test\_tools.py module:
\inputminted{python}{./school_project/test/models/cpu/utils/test_tools.py}
\end{itemize}
\end{itemize}

\subsubsection{GitHub Automated Testing}
Expand Down

0 comments on commit 1936046

Please sign in to comment.