From 107c117aabb9549d1c229bb8de21fa59c1d4e017 Mon Sep 17 00:00:00 2001 From: jw255 Date: Wed, 7 Mar 2018 15:23:18 +0000 Subject: testing in report complete --- Report/main.tex | 2 +- Report/texts/testing.tex | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Report/texts/testing.tex (limited to 'Report') diff --git a/Report/main.tex b/Report/main.tex index 812a482..231951d 100644 --- a/Report/main.tex +++ b/Report/main.tex @@ -12,7 +12,7 @@ % \input{texts/protocol} % \input{texts/auth} \input{texts/logging} - % \input{texts/testing} + \input{texts/testing} \input{texts/conclusion} \clearpage diff --git a/Report/texts/testing.tex b/Report/texts/testing.tex new file mode 100644 index 0000000..8a17e5b --- /dev/null +++ b/Report/texts/testing.tex @@ -0,0 +1,15 @@ +\section{Testing} +Tests do not currently run on the gitlab server, as the postgres integration with the docker gilab-ci is still missing. This means any tests run automatically when pushing will fail. \par +When running integration tests locally, please make sure the postgres server is up and running on localhost. +\subsection{Structure} +Testing files were restructured for a more organised and professional approach. All test files end in "*.\(<\)context\(>\).test.ts" and were moved to the "test" directory. At this moment, "\(<\)context\(>\)" includes "unit" and "routes". Further, they were categorised into \textit{integration} and \textit{unit} tests and moved into corresponding sub-directories. \par +Apart from making test files easier to find, this new structure also allowed us to run specific tests independently to isolate failures and quickly rerun individual tests. For example \shellcmd{yarn test:routes:auth} runs all authentication tests. +\subsection{Integration Testing} +\shellcmd{yarn test:routes} +This category of tests targeted the interplay of different server components as it tested server endpoints (routes) rather than internal functions. We aimed to test all routes for responses of success, and various degrees of failure. \par +E.g. \textbf{"auth.routes.test.ts"} tested the authentication middle-ware, checking existing users could log in only with correct usernames, passwords and reauthentication tokens. During our later meetings, we realised that security is a key-component of medical systems, and requires further much more in-depth testing to guarantee safety of patient data. \par +\textbf{"protocol.routes.test.ts"} aims to cover all endpoints specified in the agreed protocol by using the \textit{mocha-each} npm module. This allowed us to write few mocha testing functions iterating over the long list of endpoints, checking HTTP responses to fit the JSON response templates to conform to the protocol. This form of testing is still incomplete. +\subsection{Unit Testing} +\shellcmd{yarn test:unit} +The main motivation for this category of tests was to find bugs early on without having to run the whole server. This saves time and uncovers new code breaking old functionality. We also found that unit tests improved the design process by forcing implementation of code that is testable. Furthermore, unit tests were often used as a form of documentation, as it aided in understanding how code of other team members worked and could be used. \par +We decided that each team-member was responsible for creating the unit tests for their code. Unfortunately the number and coverage of unit tests is still quite low. This may be the result of prioritising functionality over bug-resilience and test-driven development. -- cgit v1.2.1 From de39907e9a5e47998f429743855cdfd3d3ec8d97 Mon Sep 17 00:00:00 2001 From: jw255 Date: Wed, 7 Mar 2018 16:24:43 +0000 Subject: scrum report & added sth everywhere --- Report/appendix/minutes.tex | 75 +++++++++++++++++++++++++++++++++++++++++ Report/appendix/scrumboard.tex | 8 +++++ Report/graphics/scrum.jpg | Bin 0 -> 1829499 bytes Report/graphics/scrum2.jpg | Bin 0 -> 1746169 bytes Report/graphics/scrum3.jpg | Bin 0 -> 1830134 bytes Report/graphics/scrum4.jpg | Bin 0 -> 164302 bytes Report/graphics/scrum5.jpg | Bin 0 -> 152855 bytes Report/preamble.tex | 3 ++ Report/texts/conclusion.tex | 3 +- Report/texts/scrum.tex | 10 +++--- Report/texts/testing.tex | 2 +- 11 files changed, 94 insertions(+), 7 deletions(-) create mode 100644 Report/appendix/minutes.tex create mode 100644 Report/appendix/scrumboard.tex create mode 100644 Report/graphics/scrum.jpg create mode 100644 Report/graphics/scrum2.jpg create mode 100644 Report/graphics/scrum3.jpg create mode 100644 Report/graphics/scrum4.jpg create mode 100644 Report/graphics/scrum5.jpg (limited to 'Report') diff --git a/Report/appendix/minutes.tex b/Report/appendix/minutes.tex new file mode 100644 index 0000000..e1942be --- /dev/null +++ b/Report/appendix/minutes.tex @@ -0,0 +1,75 @@ + +\section{Scrum Meeting Minutes} \label{app:meet} + +\begin{lstlisting} + +Group Project Meeting 1 post submission +Date: 12/02/18 +Topics: +Reassigning scrum roles +Creating next set of tasks +Task allocation + +Outcomes: +* Scrum: + * scrum master - Hafeez + * project owner - Calum + +*Tasks: + * Implementing endpoints + * Implementing file conversions + * Improving test coverage + * Writing tests for untested sections + * Connecting all middleware + * Decide on how to deal with errors + * Organising file-system + * Creating a Linter to maintain a consistent file structure + +Group Project Meeting 2 Pre-sprint +Date 15/02/18 +Topics: +Define user stories +Task allocation + +Outcomes: +* Sprint + * Week long sprint + * Meeting set for 22/02/18 + +Group Project Meeting 3 Post-Sprint +Date 22/02/18 +Topics: +Analysis of work +Next task assignment + +Outcomes: + +Group Project Meeting 4 +Date 24/02/18 +Topics: +Sprint aims +Sprint deadline + +Outcomes: + *Decided to hold a sprint now to leave time + before next submission to finish off all leftover work + +Group Project Meeting 5 +Date 03/03/18 +Topics +Analysis of work todo after sprint +Work needed to complete before deadline + + +Outcomes: + * Finishing off of the report + *Connecting work with another HCI group + *Finish testing + + + + + + + +\end{lstlisting} diff --git a/Report/appendix/scrumboard.tex b/Report/appendix/scrumboard.tex new file mode 100644 index 0000000..e868278 --- /dev/null +++ b/Report/appendix/scrumboard.tex @@ -0,0 +1,8 @@ +\section{Scrum Board Images} \label{app:board} + +{ +\centering +\includegraphics[width=\textwidth]{graphics/scrum.jpg} +\includegraphics[width=\textwidth]{graphics/scrum3.jpg} +\includegraphics[width=\textwidth]{graphics/scrum4.jpg} +} diff --git a/Report/graphics/scrum.jpg b/Report/graphics/scrum.jpg new file mode 100644 index 0000000..4b5c911 Binary files /dev/null and b/Report/graphics/scrum.jpg differ diff --git a/Report/graphics/scrum2.jpg b/Report/graphics/scrum2.jpg new file mode 100644 index 0000000..231cf1f Binary files /dev/null and b/Report/graphics/scrum2.jpg differ diff --git a/Report/graphics/scrum3.jpg b/Report/graphics/scrum3.jpg new file mode 100644 index 0000000..012e9b3 Binary files /dev/null and b/Report/graphics/scrum3.jpg differ diff --git a/Report/graphics/scrum4.jpg b/Report/graphics/scrum4.jpg new file mode 100644 index 0000000..ab1f7a5 Binary files /dev/null and b/Report/graphics/scrum4.jpg differ diff --git a/Report/graphics/scrum5.jpg b/Report/graphics/scrum5.jpg new file mode 100644 index 0000000..e79e828 Binary files /dev/null and b/Report/graphics/scrum5.jpg differ diff --git a/Report/preamble.tex b/Report/preamble.tex index dcf579c..9d2d513 100644 --- a/Report/preamble.tex +++ b/Report/preamble.tex @@ -9,3 +9,6 @@ \usepackage{float} \usepackage{listings} \usepackage{cite} + +\newcommand{\shellcmd}[1]{\\\indent\indent\texttt{\footnotesize\# #1}\\} + diff --git a/Report/texts/conclusion.tex b/Report/texts/conclusion.tex index f0cc6c6..8d49366 100644 --- a/Report/texts/conclusion.tex +++ b/Report/texts/conclusion.tex @@ -1,4 +1,5 @@ \section{Conclusion} As a group we have made a lot of progress for this submission, we were proactive in setting out goals for ourselves and feel we are now well on track to produce an outstanding final hand in. Our continued use of scrum has helped keep workload consistent and effective right through to this submission and we hope to continue in this way. Having now combined our work with the HCI group we are looking forward to working with machine learning to tie together all 3 groups to create the desired system set out by the project owner. -\subsection{Next Tasks} \ No newline at end of file +\subsection{Next Tasks} +Viewing the system as a whole, substantial progress has been made in completing each required task whilst also managing time for each task appropriately. Looking further ahead, our next objectives will surround performance enhancing, further testing and finally completing the integration process with the rest of the system. The process for these will include a large amount of analysis on the working server, which include finding delays between certain requests and responses, measuring time taken for converting files and testing for bugs after integration. Another important aspect is the security of the application, and preventing bugs from leading to exploits which can be used for malicious use. This is particularly important within the medical industry as data confidentiality and integrity are apart of practitioners' policy. One method of testing for this task would be penetration testing, using a suite of tools to attack the application, which would determine any vulnerabilities that exist. \ No newline at end of file diff --git a/Report/texts/scrum.tex b/Report/texts/scrum.tex index 7426e5b..12e0ecf 100644 --- a/Report/texts/scrum.tex +++ b/Report/texts/scrum.tex @@ -1,9 +1,9 @@ \section{Continued use of Scrum} -In general the size and the time taken of each individual task was a lot smaller when comparing to the last submission. We found using scrum extremely helped in managing this to clearly set out tasks and outline what everyone was doing. +The scrum process was continued as we found this very useful in terms of clearly setting out tasks for each member and managing the progress of the implementation. In general the size and the time taken of each individual task was a lot smaller when comparing to the last submission. \subsection{Scrum board} -We again went with using a board system to set up and allocate tasks. This gave a clear visual representation of what we wanted to achieve. With everyone now being in the same location it also made it a lot easier for everyone to set up and manage ongoing tasks. +Again, the scrum board was used to outline and track the completion of each task. This gave a clear visual representation of the objectives. With everyone now being in the same location it also made it a lot easier for everyone to set up and manage ongoing tasks. \subsection{Sprints} -Now being familiar with the scrum process we decided to reduce the length of the sprints. This was also based on the fact that the timeline of this submission was smaller so the sprint assessment process needed to be undertaken more often to make sure we were on the right track with our progress as a team. +As a team, it was decided that we would have only a single sprint, up until the next point of submission. This was because of the short time period, enough for only a two week sprint. In addition to this, the sprint assessment process was completed more often to ensure that as a team time was managed well and sufficient progress was being made. \subsection{Meetings} -As we were attempting to do shorter sprints we held more regular meet ups to discuss progress and make design decisions as a team. -The minutes for formal meetings are available in Appendix +Regular meetings were also held to discuss and evaluate progress. This was crucial in the scrum process and as working in a team to allow a point of communication between each member at the same point in time. Multiple meetings were held during the most recent sprint to determine the tasks required for completion, to evaluate whether each task was completed and track progress in between. +The minutes for formal meetings are available in the Appendix. diff --git a/Report/texts/testing.tex b/Report/texts/testing.tex index 8a17e5b..ba88162 100644 --- a/Report/texts/testing.tex +++ b/Report/texts/testing.tex @@ -12,4 +12,4 @@ E.g. \textbf{"auth.routes.test.ts"} tested the authentication middle-ware, check \subsection{Unit Testing} \shellcmd{yarn test:unit} The main motivation for this category of tests was to find bugs early on without having to run the whole server. This saves time and uncovers new code breaking old functionality. We also found that unit tests improved the design process by forcing implementation of code that is testable. Furthermore, unit tests were often used as a form of documentation, as it aided in understanding how code of other team members worked and could be used. \par -We decided that each team-member was responsible for creating the unit tests for their code. Unfortunately the number and coverage of unit tests is still quite low. This may be the result of prioritising functionality over bug-resilience and test-driven development. +We decided that each team-member was responsible for creating the unit tests for their code. Unfortunately the number and coverage of unit tests is still quite low. This may be the result of prioritising functionality over bug-resilience and test-driven development. \ No newline at end of file -- cgit v1.2.1 From 3f36cbd27254ed4afc60205ca9d2030edf131f22 Mon Sep 17 00:00:00 2001 From: jw255 Date: Wed, 7 Mar 2018 16:42:29 +0000 Subject: fixed shellcmd --- Report/preamble.tex | 2 -- Report/texts/testing.tex | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'Report') diff --git a/Report/preamble.tex b/Report/preamble.tex index 9d2d513..b592df1 100644 --- a/Report/preamble.tex +++ b/Report/preamble.tex @@ -10,5 +10,3 @@ \usepackage{listings} \usepackage{cite} -\newcommand{\shellcmd}[1]{\\\indent\indent\texttt{\footnotesize\# #1}\\} - diff --git a/Report/texts/testing.tex b/Report/texts/testing.tex index ba88162..d5c0fc7 100644 --- a/Report/texts/testing.tex +++ b/Report/texts/testing.tex @@ -3,13 +3,13 @@ Tests do not currently run on the gitlab server, as the postgres integration wit When running integration tests locally, please make sure the postgres server is up and running on localhost. \subsection{Structure} Testing files were restructured for a more organised and professional approach. All test files end in "*.\(<\)context\(>\).test.ts" and were moved to the "test" directory. At this moment, "\(<\)context\(>\)" includes "unit" and "routes". Further, they were categorised into \textit{integration} and \textit{unit} tests and moved into corresponding sub-directories. \par -Apart from making test files easier to find, this new structure also allowed us to run specific tests independently to isolate failures and quickly rerun individual tests. For example \shellcmd{yarn test:routes:auth} runs all authentication tests. +Apart from making test files easier to find, this new structure also allowed us to run specific tests independently to isolate failures and quickly rerun individual tests. For example \texttt{yarn test:routes:auth} runs all authentication tests. \subsection{Integration Testing} -\shellcmd{yarn test:routes} +\texttt{yarn test:routes} This category of tests targeted the interplay of different server components as it tested server endpoints (routes) rather than internal functions. We aimed to test all routes for responses of success, and various degrees of failure. \par E.g. \textbf{"auth.routes.test.ts"} tested the authentication middle-ware, checking existing users could log in only with correct usernames, passwords and reauthentication tokens. During our later meetings, we realised that security is a key-component of medical systems, and requires further much more in-depth testing to guarantee safety of patient data. \par \textbf{"protocol.routes.test.ts"} aims to cover all endpoints specified in the agreed protocol by using the \textit{mocha-each} npm module. This allowed us to write few mocha testing functions iterating over the long list of endpoints, checking HTTP responses to fit the JSON response templates to conform to the protocol. This form of testing is still incomplete. \subsection{Unit Testing} -\shellcmd{yarn test:unit} +\texttt{yarn test:unit} The main motivation for this category of tests was to find bugs early on without having to run the whole server. This saves time and uncovers new code breaking old functionality. We also found that unit tests improved the design process by forcing implementation of code that is testable. Furthermore, unit tests were often used as a form of documentation, as it aided in understanding how code of other team members worked and could be used. \par -We decided that each team-member was responsible for creating the unit tests for their code. Unfortunately the number and coverage of unit tests is still quite low. This may be the result of prioritising functionality over bug-resilience and test-driven development. \ No newline at end of file +We decided that each team-member was responsible for creating the unit tests for their code. Unfortunately the number and coverage of unit tests is still quite low. This may be the result of prioritising functionality over bug-resilience and test-driven development. -- cgit v1.2.1 From 1df281c4bd4ec3b583e9914ce90361f5195dcdc2 Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Wed, 7 Mar 2018 17:12:03 +0000 Subject: Add nicer title page, and improve Makefile --- Report/Makefile | 4 ++-- Report/graphics/title-logo.png | Bin 0 -> 220102 bytes Report/main.tex | 3 +++ Report/title.tex | 16 ++++++++++++++-- 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 Report/graphics/title-logo.png (limited to 'Report') diff --git a/Report/Makefile b/Report/Makefile index 22d7496..135009b 100644 --- a/Report/Makefile +++ b/Report/Makefile @@ -1,8 +1,8 @@ -.PHONY: default clean +.PHONY: default clean FORCE default : main.pdf -%.pdf : %.tex +%.pdf : %.tex FORCE latexmk -pdf $< clean : diff --git a/Report/graphics/title-logo.png b/Report/graphics/title-logo.png new file mode 100644 index 0000000..8a72423 Binary files /dev/null and b/Report/graphics/title-logo.png differ diff --git a/Report/main.tex b/Report/main.tex index b208df0..e01bbbb 100644 --- a/Report/main.tex +++ b/Report/main.tex @@ -5,6 +5,9 @@ \begin{document} \maketitle + \thispagestyle{empty} + \newpage + \setcounter{page}{1} \input{texts/aims} \input{texts/scrum} diff --git a/Report/title.tex b/Report/title.tex index 97064ff..4406ef6 100644 --- a/Report/title.tex +++ b/Report/title.tex @@ -1,3 +1,15 @@ -\title{Report --- Juniour Honours Project Submission 2} -\author{Hafeez Abdul-Rehaman, Johannes Weck, Josh Lee, Calum Duff, Tom Harley} +\title{Report \\ Juniour Honours Project \\[0.5ex] Submission 2} +\author{Hafeez Abdul-Rehaman \\[1ex] Johannes Weck \\[1ex] Josh Lee \\[1ex] Calum Duff \\[2ex] Tom Harley} \date{\today} + +\makeatletter + \def\@maketitle{ + \begin{center} + \includegraphics[width=0.7\linewidth]{title-logo}\\[10ex] + {\huge \bfseries \@title{ }}\\[1ex] + \rule{0.5\textwidth}{.4pt}\\[1ex] + {\LARGE \@author}\\[15ex] + {\large \@date} + \end{center} + } +\makeatother -- cgit v1.2.1 From fba174b079dd012db9fdc86e07130ed34816e4c4 Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Wed, 7 Mar 2018 18:16:04 +0000 Subject: Add section on typing support, and \file macro --- Report/graphics/km-dash.png | Bin 0 -> 97345 bytes Report/main.tex | 1 + Report/preamble.tex | 1 + Report/texts/process-management.tex | 2 +- Report/texts/typings.tex | 27 +++++++++++++++++++++++++++ 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 Report/graphics/km-dash.png create mode 100644 Report/texts/typings.tex (limited to 'Report') diff --git a/Report/graphics/km-dash.png b/Report/graphics/km-dash.png new file mode 100644 index 0000000..840395d Binary files /dev/null and b/Report/graphics/km-dash.png differ diff --git a/Report/main.tex b/Report/main.tex index e01bbbb..d6be02c 100644 --- a/Report/main.tex +++ b/Report/main.tex @@ -17,6 +17,7 @@ \input{texts/logging} \input{texts/process-management} \input{texts/testing} + \input{texts/typings} \input{texts/conclusion} \clearpage diff --git a/Report/preamble.tex b/Report/preamble.tex index b592df1..14787a9 100644 --- a/Report/preamble.tex +++ b/Report/preamble.tex @@ -10,3 +10,4 @@ \usepackage{listings} \usepackage{cite} +\def\file{\texttt} diff --git a/Report/texts/process-management.tex b/Report/texts/process-management.tex index bb40faa..d99a73c 100644 --- a/Report/texts/process-management.tex +++ b/Report/texts/process-management.tex @@ -17,7 +17,7 @@ its profiling extension. \begin{figure} \centering - % \includegraphics[width=0.5\linewidth]{km-dash} + \includegraphics[width=0.95\linewidth]{km-dash} \caption{The KeyMetrics dashboard web client in use.}\label{fig:dash} \end{figure} diff --git a/Report/texts/typings.tex b/Report/texts/typings.tex new file mode 100644 index 0000000..65a0de0 --- /dev/null +++ b/Report/texts/typings.tex @@ -0,0 +1,27 @@ +\section{Type Enforcement} +In order to run JavaScript code as TypeScript code, typings (usually +supplied in a \file{.d.ts}-extended file) are applied at compile-time to +make sense of the original source's variable types. For a couple of +packages that have been used in the submission, these typings are not +available, due to a lack of desirablilty --- the packages in question are +niche and as such see little use. + +\subsection{mocha-each} +One such package is \emph{mocha-each}, a utility package for compacting +Mocha tests for readability and classification~\cite{mocha-each}. Without +typings, this package cannot be used in TypeScript projects. Due to its +single-facet use, however, it was simple to design a custom +\file{.d.ts} file. With small edits to conform to +guidelines~\cite{@types}, typings for +mocha-test were contributed to the DefinitelyTyped types repository\footnote{% +https://github.com/DefinitelyTyped/DefinitelyTyped/% +tree/master/types/mocha-each}. + +\subsection{pmx} +The package pmx (as previously described in \S\ref{sec:pmx}) is useful for +profiling. Similarly to mocha-each, however, it does not have supported typing. +Since this package covers a far wider range of functionality, and since said +functionality is very involved with sensitive run-time engine manipulation, +typings were written only for the functions being used by the team, and have +been kept in-house for their incompleteness. The files in question can be found +in \file{src/profiler}. -- cgit v1.2.1