diff options
-rw-r--r-- | report/esoteric_project_report.tex | 37 | ||||
-rw-r--r-- | report/images/test_harness_1.png | bin | 0 -> 52058 bytes | |||
-rw-r--r-- | report/images/test_harness_2.png | bin | 0 -> 51950 bytes |
3 files changed, 35 insertions, 2 deletions
diff --git a/report/esoteric_project_report.tex b/report/esoteric_project_report.tex index 4246ec8..7dbeb8e 100644 --- a/report/esoteric_project_report.tex +++ b/report/esoteric_project_report.tex @@ -335,9 +335,17 @@ During our allocated project time, we did four major sprints. Our initial priori \chapter{Testing} -The testing was done in two main stages, first unit tests after each sprint were done in order to check correctness of the additions made, then large scale tests in order to check the compiler works as expected, is Turing complete and can handle any inputs. +The testing for this project was done in two main parts . +Once each sprint was completed, tests on features that had been implemented were run to ensure that the compiler performed as expected. +This tests can be seen in tables 7.1, 7.2 and 7.3. +In addition to this, test Fortran source files were created that made use of all implemented features, and the output was checked to establish that features were behaving correctly.. + \section{Sprint testing} -The testing that occurred after each sprint was done in two main stages. Firstly, the lexical scanner was unit tested independently from the rest of the code, then once we were confident that the scanner was working correctly, we tested the scanner and parser together. Due to the nature of the parsers output, we utilised a simple tree-walk interpreter for the first two sprints, then used the full compiler for the later sprints. The results of each test are shown in the tables below, giving the reason for the test, the input and output, and whether the test was successful. +The testing that occurred after each sprint was done in two main stages. +Firstly, the lexical scanner was unit tested independently from the rest of the code, then once it was established that the scanner was working correctly, we tested the scanner and parser together. +Due to the nature of the parser output, we utilised a simple tree-walk interpreter for the first two sprints, then used the full compiler for the later sprints. +The results of each test are shown in the tables below, giving the reason for the test, the input and output, and whether the test was successful. + \subsection{Sprint 1 testing} \begin{table}[h] \caption[]{Sprint 1 Tests and their results} @@ -377,6 +385,7 @@ The testing that occurred after each sprint was done in two main stages. Firstly \end{center} \end{table} \subsection{Sprint 3 testing} + \begin{table}[h] \caption[]{Sprint 3 Tests and their results} \begin{center} @@ -393,6 +402,30 @@ The testing that occurred after each sprint was done in two main stages. Firstly \end{center} \end{table} +\subsection{Fortran Source File Testing} +Once the compiler was fully implemented, testing was moved to custom harnesses that were written in Fortran. +Each test file was run and the output carefully checked to ensure that the language and compiler were working as expected. +In addition, example source code files were written to demonstrate the capabilities of the implemented Fortran language. +The use of actual source files in testing meant that compiler and program behaviour, as well as that of the implemented IDE could be checked on tandem, thus ensuring that the software worked properly. +Below are some examples of output testing harnesses, run through the IDE program. + +\begin{figure}[h] + \centering + \includegraphics[scale=0.5]{images/test_harness_1.png} + \caption{Mathematical testing} + \label{test_harness_one} +\end{figure} + +\begin{figure}[h] + \centering + \includegraphics[scale=0.5]{images/test_harness_2.png} + \caption{Logical testing} + \label{test_harness_two} +\end{figure} + +As can be seen from the above screenshots, various different mathematical, conditional and logical tests were used to test the functionality of the implemented code. + + \chapter{Discussion, conclusion and future work} Overall we are happy with the end product produced during this project. We have created a working, capable compiler able to work with our modified version of Fortran. From our initial MoSCoW analysis in Chapter 1 we have achieved all the "must have" requirements as the language is Turing Complete and can detect a wide variety of both syntax and runtime errors. From the "should have" section, we have functionally to read from files, and has all of the additional features. However, since we decided to compile to C, we excluded optimisation methods as the C compiler would perform these anyway. Again, from the "must have" section we implemented the additional features described, such as functions, but again decided against direct memory allocation as our language is still reasonably simple, so the memory handing from C suffices. Finally, even though we said the end product would not have a GUI, we decided to implement a simple interface to test the compiler and more clearly show the final product. diff --git a/report/images/test_harness_1.png b/report/images/test_harness_1.png Binary files differnew file mode 100644 index 0000000..a1e5255 --- /dev/null +++ b/report/images/test_harness_1.png diff --git a/report/images/test_harness_2.png b/report/images/test_harness_2.png Binary files differnew file mode 100644 index 0000000..fb4b4c4 --- /dev/null +++ b/report/images/test_harness_2.png |