diff options
Diffstat (limited to 'report/deliverable-3')
24 files changed, 176 insertions, 186 deletions
diff --git a/report/deliverable-3/appendix/scrumboard.tex b/report/deliverable-3/appendix/scrumboard.tex index e868278..acb531c 100644 --- a/report/deliverable-3/appendix/scrumboard.tex +++ b/report/deliverable-3/appendix/scrumboard.tex @@ -3,6 +3,6 @@ { \centering \includegraphics[width=\textwidth]{graphics/scrum.jpg} +\includegraphics[width=\textwidth]{graphics/scrum2.jpg} \includegraphics[width=\textwidth]{graphics/scrum3.jpg} -\includegraphics[width=\textwidth]{graphics/scrum4.jpg} } diff --git a/report/deliverable-3/graphics/burndown.png b/report/deliverable-3/graphics/burndown.png Binary files differindex f3ae71d..162691d 100644 --- a/report/deliverable-3/graphics/burndown.png +++ b/report/deliverable-3/graphics/burndown.png diff --git a/report/deliverable-3/graphics/scrum.jpg b/report/deliverable-3/graphics/scrum.jpg Binary files differindex 4b5c911..aa3b058 100644 --- a/report/deliverable-3/graphics/scrum.jpg +++ b/report/deliverable-3/graphics/scrum.jpg diff --git a/report/deliverable-3/graphics/scrum2.jpg b/report/deliverable-3/graphics/scrum2.jpg Binary files differindex 231cf1f..7cd31ae 100644 --- a/report/deliverable-3/graphics/scrum2.jpg +++ b/report/deliverable-3/graphics/scrum2.jpg diff --git a/report/deliverable-3/graphics/scrum3.jpg b/report/deliverable-3/graphics/scrum3.jpg Binary files differindex 012e9b3..d8b622f 100644 --- a/report/deliverable-3/graphics/scrum3.jpg +++ b/report/deliverable-3/graphics/scrum3.jpg diff --git a/report/deliverable-3/graphics/scrum4.jpg b/report/deliverable-3/graphics/scrum4.jpg Binary files differdeleted file mode 100644 index ab1f7a5..0000000 --- a/report/deliverable-3/graphics/scrum4.jpg +++ /dev/null diff --git a/report/deliverable-3/graphics/scrum5.jpg b/report/deliverable-3/graphics/scrum5.jpg Binary files differdeleted file mode 100644 index e79e828..0000000 --- a/report/deliverable-3/graphics/scrum5.jpg +++ /dev/null diff --git a/report/deliverable-3/main.dvi b/report/deliverable-3/main.dvi Binary files differnew file mode 100644 index 0000000..c1ed465 --- /dev/null +++ b/report/deliverable-3/main.dvi diff --git a/report/deliverable-3/main.out b/report/deliverable-3/main.out new file mode 100644 index 0000000..738ad91 --- /dev/null +++ b/report/deliverable-3/main.out @@ -0,0 +1,39 @@ +\BOOKMARK [1][-]{section.1}{Aims for Final Submission}{}% 1 +\BOOKMARK [1][-]{section.2}{Completed Work}{}% 2 +\BOOKMARK [2][-]{subsection.2.1}{Endpoints}{section.2}% 3 +\BOOKMARK [1][-]{section.3}{Continued use of Scrum}{}% 4 +\BOOKMARK [2][-]{subsection.3.1}{Sprints}{section.3}% 5 +\BOOKMARK [2][-]{subsection.3.2}{Scrum board}{section.3}% 6 +\BOOKMARK [1][-]{section.4}{Code Quality}{}% 7 +\BOOKMARK [2][-]{subsection.4.1}{Linter}{section.4}% 8 +\BOOKMARK [2][-]{subsection.4.2}{Scripts}{section.4}% 9 +\BOOKMARK [1][-]{section.5}{File Conversion}{}% 10 +\BOOKMARK [2][-]{subsection.5.1}{Dealing with Images}{section.5}% 11 +\BOOKMARK [3][-]{subsubsection.5.1.1}{Extraction of Zeiss Within `C'}{subsection.5.1}% 12 +\BOOKMARK [3][-]{subsubsection.5.1.2}{Converting Extracted Files}{subsection.5.1}% 13 +\BOOKMARK [3][-]{subsubsection.5.1.3}{Stitching Base Tiles}{subsection.5.1}% 14 +\BOOKMARK [3][-]{subsubsection.5.1.4}{Building Up Hierarchy of Zoom Levels}{subsection.5.1}% 15 +\BOOKMARK [2][-]{subsection.5.2}{Leica \046 Other Formats}{section.5}% 16 +\BOOKMARK [2][-]{subsection.5.3}{Non image formats \(.csv etc.\)}{section.5}% 17 +\BOOKMARK [1][-]{section.6}{File Management}{}% 18 +\BOOKMARK [2][-]{subsection.6.1}{Directory Structure}{section.6}% 19 +\BOOKMARK [2][-]{subsection.6.2}{File Upload and Download}{section.6}% 20 +\BOOKMARK [1][-]{section.7}{Testing}{}% 21 +\BOOKMARK [2][-]{subsection.7.1}{Using Mocha and Postman}{section.7}% 22 +\BOOKMARK [2][-]{subsection.7.2}{Integration Testing}{section.7}% 23 +\BOOKMARK [3][-]{subsubsection.7.2.1}{CORS}{subsection.7.2}% 24 +\BOOKMARK [1][-]{section.8}{Process Management and Deployment}{}% 25 +\BOOKMARK [2][-]{subsection.8.1}{Process Manager Selection}{section.8}% 26 +\BOOKMARK [2][-]{subsection.8.2}{pm2 and KeyMetrics}{section.8}% 27 +\BOOKMARK [2][-]{subsection.8.3}{Process Limitations}{section.8}% 28 +\BOOKMARK [2][-]{subsection.8.4}{Heroku Hosting}{section.8}% 29 +\BOOKMARK [2][-]{subsection.8.5}{External System Hosting}{section.8}% 30 +\BOOKMARK [1][-]{section.9}{Conclusion}{}% 31 +\BOOKMARK [2][-]{subsection.9.1}{Future Development}{section.9}% 32 +\BOOKMARK [1][-]{section.10}{Individual Contributions}{}% 33 +\BOOKMARK [2][-]{subsection.10.1}{Tom Harley}{section.10}% 34 +\BOOKMARK [2][-]{subsection.10.2}{Josh Lee}{section.10}% 35 +\BOOKMARK [2][-]{subsection.10.3}{Calum Duff}{section.10}% 36 +\BOOKMARK [2][-]{subsection.10.4}{Johannes Weck}{section.10}% 37 +\BOOKMARK [2][-]{subsection.10.5}{Hafeez Abdul-Rehaman}{section.10}% 38 +\BOOKMARK [1][-]{appendix.A}{Scrum Board Images}{}% 39 diff --git a/report/deliverable-3/main.synctex.gz b/report/deliverable-3/main.synctex.gz Binary files differnew file mode 100644 index 0000000..a89fc1a --- /dev/null +++ b/report/deliverable-3/main.synctex.gz diff --git a/report/deliverable-3/main.tex b/report/deliverable-3/main.tex index dce9106..ee3a4b0 100644 --- a/report/deliverable-3/main.tex +++ b/report/deliverable-3/main.tex @@ -1,4 +1,25 @@ -\input{preamble} +\documentclass{article} + +\usepackage[margin=1in]{geometry} +\usepackage{a4wide} + +\usepackage{graphicx} +\graphicspath{{./graphics/}} + +\usepackage{float} +\usepackage{listings} +\usepackage{cite} +\usepackage{hyperref} +\hypersetup{ + colorlinks=true, + linkcolor=blue, + filecolor=magenta, + urlcolor=cyan, +} + +\urlstyle{same} + +\def\file{\texttt} \input{title} @@ -13,21 +34,19 @@ \newpage \input{texts/aims} + \input{texts/work} \input{texts/scrum} + \input{texts/code} \input{texts/conversion} - % \input{texts/protocol} - % \input{texts/auth} - \input{texts/logging} - \input{texts/process-management} + \input{texts/files} \input{texts/testing} - \input{texts/typings} + \input{texts/process-management} \input{texts/conclusion} + \input{texts/contributions} \appendix \newpage \input{appendix/scrumboard} - \newpage - \input{appendix/minutes} \clearpage diff --git a/report/deliverable-3/preamble.tex b/report/deliverable-3/preamble.tex index 14787a9..b28b04f 100644 --- a/report/deliverable-3/preamble.tex +++ b/report/deliverable-3/preamble.tex @@ -1,13 +1,3 @@ -\documentclass{article} -\usepackage[margin=1in]{geometry} -\usepackage{a4wide} -\usepackage{graphicx} -\graphicspath{{./graphics/}} -\usepackage{float} -\usepackage{listings} -\usepackage{cite} - -\def\file{\texttt} diff --git a/report/deliverable-3/texts/aims.tex b/report/deliverable-3/texts/aims.tex index e1da3ee..3543313 100644 --- a/report/deliverable-3/texts/aims.tex +++ b/report/deliverable-3/texts/aims.tex @@ -1,7 +1,7 @@ -\section{Aims for submission 2} -From our first submission, we now had a working server that allowed a user to access our own mock user interface to log in and access data based on their level of authorisation. Following this we set up a meeting to lay out goals for ourselves that would act as requirements for the second submission. +\section{Aims for Final Submission} +As we already had most of the basic implementation working since our second submission, our main task for the final deadline was resolving numerous issues, extending the test coverage and completing file conversion. Several meetings were organised between groups to check the compatibility between our back-end system and HCI and machine-learning groups. \begin{description} - \item[Define Specific Protocol] Now that we had a working server, we next wanted to define specific protocol in order to demo our progress using work from another Junior Honours HCI groups. - \item[Manage Filetype Conversions] A main part of this submission was creating a file converter for all the required file types that would be needed. - \item[Testing] As our code was getting more complicated we wanted to make sure that extensive testing was implemented to create a more secure and consistent system. + \item[Extend Test Coverage] Verification and validation of our server's functionality became the focus of our last submission. + \item[File Upload, Download and Conversion] One of the last remaining tasks for this submission was implementing the serving of files through our server. + \item[Intra-group Collaboration] The key to ensuring the success of our system was testing the compatibility of our server with the work of other groups. \end{description} diff --git a/report/deliverable-3/texts/code.tex b/report/deliverable-3/texts/code.tex new file mode 100644 index 0000000..6fe316b --- /dev/null +++ b/report/deliverable-3/texts/code.tex @@ -0,0 +1,6 @@ +\section{Code Quality} +\subsection{Linter} +To ensure code clarity and quality, we decided to use the linter `ts-lint'. This did not only help us create professional-style code but also aided in avoiding bugs early by catching out common errors. The linter was integrated with our editors as well as yarn as to automate its work-flow. + +\subsection{Scripts} +Several scripts were created to automate the installation and execution process.
\ No newline at end of file diff --git a/report/deliverable-3/texts/conclusion.tex b/report/deliverable-3/texts/conclusion.tex index 0e40979..45e2f85 100644 --- a/report/deliverable-3/texts/conclusion.tex +++ b/report/deliverable-3/texts/conclusion.tex @@ -1,5 +1,14 @@ \section{Conclusion} -As a group a lot of progress was made 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. Scrum is essential in our progress as it helps to manage time and organise the team work and so this process will be used for the duration of the project. Having now combined our work with the HCI group we are looking forward to working with teams focused on machine learning to tie together all 3 sections of the application to create the desired system set out by the project owner. +As a group, we are very pleased with the process and outcome of this group project. Our final product consists of substantial contributions from all our team members. It was tested and integrated with the systems produced by ML and HCI groups, completes all of the tasks initially identified and the development relied heavily on our use of scrum. + +For the final deadline we successfully combined all parts of the system into one final server, completing any remaining tasks which included file management, file conversion and testing. Our system was integrated both with our assigned ML and HCI groups, as well as with other groups, thus ensuring the compatibility of our contribution to the whole pathology system. + +\subsection{Future Development} +The submitted project has potential for future improvements, especially regarding system security and file-conversion. + +One substantial flaw of our system is that we rely on the security of all the node-modules including postgres as well as their inter-compatibility. Comprehensive vulnerability scanning as well as penetration testing of our system would be required to ensure security of patients' confidential data. Research into security standards required by law would be necessary. + +Similarly, it might prove useful to encrypt data on the server-side as well as combine the ML server and the BE server into one software package, thus reducing the number of components involved. + +Also, image file conversion could be explored further, as conversion of *TODO* into png is not yet supported -\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/deliverable-3/texts/contributions.tex b/report/deliverable-3/texts/contributions.tex new file mode 100644 index 0000000..dcf7591 --- /dev/null +++ b/report/deliverable-3/texts/contributions.tex @@ -0,0 +1,12 @@ +\section{Individual Contributions} +\subsection{Tom Harley} +\subsection{Josh Lee} +\subsection{Calum Duff} +\subsection{Johannes Weck} +Throughout the development of our back-end server, I was responsible for thorough testing, which involved writing unit tests with mocha and chai, running integration tests through Postman as well as identifying and fixing bugs. One of the main challenges in this respect was understanding code written by other team-members. Clear and frequent communication between all members proved essential to this process. + +During the last sprint I worked closely with Hafeez using pair-programming to resolve a range of issues flagged by the tests. Furthermore, I worked with Tom and Callum, finalizing server-side file-management. I was mostly involved with the file-system part of file storage, integrating the node-module `multer' with our server. `multer' was later swapped out for the package `body-parser' to allow compatibility with our assigned ML and HCI groups. +\subsection{Hafeez Abdul-Rehaman} +My role in the development of the server, involved producing the authentication system and providing security to each of the routes in the RESTful API. This was done through node.js libraries including \textit{passportjs} and \textit{jsonwebtokens}. I also tested the functionality of this after implementation to ensure it was working using tools such as Postman and curl. Whilst also conducting tests for authentication, I assisted Johannes in running and resolving test issues found in other parts of the implementation. By using more than one team member on larger tasks, it took less time to solve these problems. This took a considerable amount of time during the last sprint, as testing was required to be much larger and thorough for the fully implemented system. During the later sprints, I was also designated as scrum master. This meant I was responsible for organising tasks and managing time, and removing obstacles the team may face. + +As a team member, I did not feel that there were any major obstacles which impeded the development of the system. However, there were some issues regarding time and managing work set out by other modules within the Computer Science course. Some sprints clashed with other pieces of coursework that also needed to be completed. Therefore, additional care was needed when organising tasks related to the project and planning was required for an extended period of time which would overlap other upcoming coursework deadlines. This way as a team we could plan around other unrelated submissions.
\ No newline at end of file diff --git a/report/deliverable-3/texts/files.tex b/report/deliverable-3/texts/files.tex new file mode 100644 index 0000000..e1aa40a --- /dev/null +++ b/report/deliverable-3/texts/files.tex @@ -0,0 +1,18 @@ +\section{File Management} +File handling was one of the last unimplemented parts of our server. Integration testing proved essential for ensuring full functionality according to the agreed protocol. File upload and download involved overcoming a range of challenges which arose as additional features were implemented. + +\subsection{Directory Structure} +File storage on the server-side consists of two parts - storage of physical data on the file-system and storage of meta-data in the database. + +The directory structure inside projects consists on a purely conceptual level in the database, as directories are stored entirely as entities in postgres. On the file-system, files are stored in the folder ``files'' which contains a folder named after the project which contains folders named after the file-uuid. This last folder contains all the `views of that file as well as the original upload. The ``raw'' view contains the original data. If tabular data is uploaded, for example, the server recognises this and will start conversion into the ``tabular '' view. + +The conceptual directory structure, although not obvious to system admins viewing files through a file-viewer on the server, is always enforced to clients connecting to the server endpoint. + +\subsection{File Upload and Download} +When uploading files to the server, a POST request may be issued to the endpoint mentioned in the protocol. Once this request arrives at the server the node library `*TODO*' automatically saves the data to a temporary directory called ``files-temp''. + +Next a function is called which parses the path from the request and attempts to find the file given the directory structure. Any part of the path that does not yet exist is created. At this stage the desired action is determined, as we allow for the copying, deleting, moving, truncating, overwriting and writing from an offset. Furthermore large files may be chunked, thus data is added incrementally to the file. The final chunk has the `final' parameter set to true, thus indicating that file-upload is complete. + +Once the file status is set to `pre-processing', which is done when the corresponding parameter is set on file-upload, file conversion is initiated. File conversion runs asynchronously separate from the node server. Once file conversion is done, the file status in the database will change to `ready'. The file status may be reviewed by retrieving file meta-data. + +Files may be retrieved from the server either by supplying the file uuid or the path. diff --git a/report/deliverable-3/texts/logging.tex b/report/deliverable-3/texts/logging.tex deleted file mode 100644 index d0a7255..0000000 --- a/report/deliverable-3/texts/logging.tex +++ /dev/null @@ -1,38 +0,0 @@ -\section{Logging} -Server logging has now been formalised: the functionality is imported into -a file and can then be used to log messages at the selection of urgencies -specified in Protocol BE01~\cite{protocol}. - -These outputs have many configuration options, which ideally will be -incorporated into a global configuration handler in future development. - -\subsection{Standard Logging} -By default, the standard logger logs to three places: -\begin{enumerate} - \item Colourised, human-readable messages are printed to the console. - Any error- or critical-level messages are printed through stderr. - \item More verbose JSON editions of messages are written to a basic - logfile. - \item Critical-level messages are additionally written to an extra - logfile. -\end{enumerate} - -\subsection{SQL Query Logging} -A separate logger has been designed for logging the output of -Sequelize~\cite{sequelize}. Since Protocol BE01 does not specify that they -should be retreivable, the output queries can be stored with less associated -metadata. In addition, Sequelize can output the total required time to -process the query, which is stored in the log for future use as profiling -data. - -\subsection{Motivation} -Since basic server functionality has been implemented, the errors produced -will likely be caused by difficult-to-debug problems, such as edge-cases or -data races. With a verbose and thorough logging system, these problems -should be much easier to detect and rectify. - -In addition, Protocol BE01~\cite{protocol} requires of the backend support -for receiving and storing logs from other services. The introduction of a -well-implemented logging system abstracts this from the common use-case of -logging while keeping powerful functionality of forwarding and fetching logs -available for when it is needed. diff --git a/report/deliverable-3/texts/minutes.tex b/report/deliverable-3/texts/minutes.tex deleted file mode 100644 index 55aab2a..0000000 --- a/report/deliverable-3/texts/minutes.tex +++ /dev/null @@ -1,72 +0,0 @@ -\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/deliverable-3/texts/scrum.tex b/report/deliverable-3/texts/scrum.tex index ca724c8..8e2006c 100644 --- a/report/deliverable-3/texts/scrum.tex +++ b/report/deliverable-3/texts/scrum.tex @@ -1,5 +1,5 @@ \section{Continued use of Scrum} -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. One of the changes that was made for this sprint was the change in roles between team members. The change in responsibility allows team members to complete new and different jobs. In general the size and the time taken of each individual task was a lot more varied when comparing to the last submission, however, there were certain tasks which were larger in terms of hours put in. These large tasks included creating a logger system and a file converter. +Group work, especially pair-programming was very important to bring the individual code contributions together. However, the hours of work time spent on the last submission were not distributed as evenly as was the case for the previous submissions as the number of hours increased exponentially during the last 2 weeks before the deadline. \subsection{Sprints} \begin{figure}[h] @@ -7,11 +7,6 @@ The scrum process was continued as we found this very useful in terms of clearly \includegraphics[width=0.6\textwidth]{burndown} \caption{A Burndown Chart for the past 14 days.}\label{fig:burn} \end{figure} - -As a team, it was decided that there would only be 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. All the tasks that was set for this sprint were completed within the required time frame. +The short time period of 3 weeks meant that we decided to have only 1 sprint and no more role-rotations until the final deadline. During these 3 weeks we met up often to discuss individual task assignments, asses our sprint progress and work on tasks jointly. Although the tasks identified from the initial specifications were not completed to their entirety as discussed earlier, all feasible work was completed in time and progress was made throughout the time period of the sprint. \subsection{Scrum board} -Again, the scrum board was used to outline and track the completion of each task. The same whiteboard in the John Honey main computer lab was used in order to maintain consistency. This gave a clear visual representation of the objectives. During the sprint, the main jobs required for completion were to further enhance the testing unit to increase its coverage across the implemented systems, implement a simple file converter and introduce a logging system for the server. Much experience was gained from completing previous sprints and so using this experience we were better equipped to handle larger tasks. Examples of the board in use can be found in Appendix \ref{app:board}. - -\subsection{Meetings} -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. An example of a major decision being made during the discussion was the change of language of the file converter implementation. It was decided that the more appropriate language to use would be C as there would more extensive libraries for this particular operation and would also have the advantage of greater efficiency. 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 Appendix \ref{app:meet}. +Unfortunately our previous scrum board was demolished during the srping break, which meant that all user stories had to be redrawn. Appendix \ref{app:board} contains the state of the scrum board at 3 different times - the start of the sprint, the middle and near the deadline. A whiteboard in the John Honey main computer lab was used in order to maintain consistency.
\ No newline at end of file diff --git a/report/deliverable-3/texts/testing.tex b/report/deliverable-3/texts/testing.tex index 2717b9b..7842f9f 100644 --- a/report/deliverable-3/texts/testing.tex +++ b/report/deliverable-3/texts/testing.tex @@ -1,16 +1,10 @@ \section{Testing} -Testing was a key process in the development of the final product just as it was in previous submissions. Testing was particular important to determine whether the final system meets the requirements initially set. As well as testing each module individually, further tests were done upon completing the system through integration with the front-end and machine learning systems. +Testing was a key process in the development of the final product just as it was in previous submission. Testing was particular important to determine whether the final system meets the requirements initially set. As well as testing each module individually, further tests were done upon completing the system through integration with the front-end and machine learning systems. - -\subsection{Using Mocha} -The JavaScript framework Mocha was still used in the testing process for modules and -%tbc... +\subsection{Using Mocha and Postman} +The JavaScript framework Mocha was still used in the testing process for modules. The test-suite for our project had some major work done since the last submission, allowing tests to run on the Gitlab server as well as addressing bugs in the test-suite and implementation. Whilst also using Mocha for Unit tests, it was used to test the individual routes and their response whilst comparing them to a template. The same method was applied to test requests. This automation increased the efficiency of production, however, the small amount of routes to test allowed us to be more thorough by manually sending requests to the server using Postman. Postman is a API development tool which allows requests to be sent through an easily manageable user interface. By doing this, expected values were easy to match with actual values, and further bugs could be caught even when the templates had matched previously. +>>>>>>> report \subsection{Integration Testing} -\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} -\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. +Once the system had been fully implemented and tested, it was necessary to integrate with the rest of the system such as user interface and the machine learning servers. This allowed us to determine whether specific protocols were implemented correctly and to ensure that all the requirements set by the client were met. To begin the integration process, the server was hosted through the St Andrews web service which allows content to be hosted through the web. This was done by configuring an \textit{nginx} proxy that would allow binding of the loopback address and port number. Using \texttt{tmux}, the session was hosted persistently as it allows terminal sessions to be detached and run in the background. The server runs on the domain \textit{har4.host.cs.st-andrews.ac.uk}. From here, it was possible for other teams to send requests to the running server. +\subsubsection{CORS} +Integration testing also gave the opportunity to find additional errors specifically caused by the linking of servers. An example of this is the realisation of the lack of Cross-Origin support. The running server could not function properly as content requests were being sent to different origins and for security reasons this is not permitted. To fix this additional features were required to be implemented to support CORS. Specifically certain headers were added to permit different origin access. diff --git a/report/deliverable-3/texts/typings.tex b/report/deliverable-3/texts/typings.tex deleted file mode 100644 index 36297b7..0000000 --- a/report/deliverable-3/texts/typings.tex +++ /dev/null @@ -1,27 +0,0 @@ -\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:pms}) 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}. diff --git a/report/deliverable-3/texts/work.tex b/report/deliverable-3/texts/work.tex new file mode 100644 index 0000000..92b9058 --- /dev/null +++ b/report/deliverable-3/texts/work.tex @@ -0,0 +1,45 @@ +\section{Completed Work} +Looking back on the tasks set out from the initial specifications we are very satisfied with the amount of work completed and the percentage of the user stories covered in our final submission. The following points are summaries from the specifications supplied by the school and the specifications decided by the student body. + +\begin{description} +\item[Web-based application] We used NodeJS and typescript to deploy our server to the school host servers, where it is accessible both from within and outside the university network. +\item[Conceptual structures for file, project and user management] The data models for these items developed into very sophisticated objects - containing hierarchies, permission groups, project contributors and much more. A mode of user authentication is provided using oauth tokens. +\item[Files may be uploaded to specific projects] Files can only be associated to a specific project. Folder hierarchies are stored on the database, while data is stored in the file-system. +\item[Files upload should be agnostic of file type] The server does not discriminate files based on type. All files have associated meta-data stored in a database, which contains information like file-type. On the server, files and directories are identified by their uuid and filestypes are divided into the categories `tabular', `image' and `generic'. +\item[Allow conversion of images and tabular data] Our current system allows fluent transition between czi input files and tiled png output *todo*. Tabular data is handled in csv format, giving the server a good understanding of the data. +\item[Robustness to user input] A reasonable attempt was made to catch out invalid input and close collaboration with the HCI groups ensured a distribution of responsibility for the preservation of dependencies and cleaning of user input. +\item[Ensure compatibility between groups] A common api was decided by the student body to ensure seamless communication between systems. As part of our testing we integrated with several other HCI and ML groups. +\item[Follow an agreed protocol for intergroup communication] We implemented the entire protocol \url{https://github.com/CS3099JH2017/cs3099jh/blob/master/protocols/BE01.md} +\end{description} + +\subsection{Endpoints} +as specified by the agreed protocol +\begin{description} +\item[post /oauth/token] Allows authentication, issuing a token. +\item[get /\_supported\_protocols\_] Returns the supported protocols +\item[get /log] Allows retreiving of logs (requires admin privileges)\\ +optional url parameters: \texttt{before=<datetime>\&after=<datetime>\&level=<level>} +\item[post /log] Allows viewing of logs (requires logging permission) +\item[get /properties] Returns the server configuration +\item[post /properties] Allows changing of the server configuration +\item[get /user\_privileges] Returns all available privileges +\item[get /users] Returns all users +\item[get /users/:username] Returns information on a specific user +\item[post /users/:username] Allows adding, deleting and changing of user (information)\\ +url parameters: \texttt{action=create} or \texttt{action=update} or \texttt{action=delete} +\item[get /users/:username/properties] Returns additional configuration options on a specific user +\item[get /current\_user] Returns information of the authenticated user +\item[post /current\_user] Allows changing of information for the authenticated user +\item[get /project\_roles] Returns all project roles +\item[get /projects] Returns all projects +\item[get /projects/:project\_name] Returns information of a specific project +\item[post /projects/:project\_name] Allows changing of information of a specific project\\ +url parameters: \texttt{action=create} or \texttt{action=update} or \texttt{action=delete} +\item[get /projects/:project\_name/properties] Returns additional configuration options of a specific project +\item[get /projects/:project\_name/files/] Returns all files and folders at the base level of the project (non-recursive) +\item[get /projects/:project\_name/files/:path] Returns a file\\ +optional url parameters: (default) \texttt{view=meta} or \texttt{raw} or other views depending on the file type +\item[post /projects/:project\_name/files/:path] Uploads a file\\ +optional url parameters: \texttt{action=set\_metadata, mkdir, delete, move, copy}, \texttt{overwrite=true, false}, \texttt{offset=int}, \texttt{truncate= true, false} and \texttt{final=true, false} +\item[get /projects/:project\_name/files\_by\_id/:id] Returns a file +\end{description}
\ No newline at end of file diff --git a/report/deliverable-3/title.tex b/report/deliverable-3/title.tex index 4406ef6..2303625 100644 --- a/report/deliverable-3/title.tex +++ b/report/deliverable-3/title.tex @@ -1,4 +1,4 @@ -\title{Report \\ Juniour Honours Project \\[0.5ex] Submission 2} +\title{Report \\ Juniour Honours Project \\[0.5ex] Final Submission} \author{Hafeez Abdul-Rehaman \\[1ex] Johannes Weck \\[1ex] Josh Lee \\[1ex] Calum Duff \\[2ex] Tom Harley} \date{\today} |
