summaryrefslogtreecommitdiff
path: root/assignments/assignment3/assignment3.tex
diff options
context:
space:
mode:
Diffstat (limited to 'assignments/assignment3/assignment3.tex')
-rw-r--r--assignments/assignment3/assignment3.tex22
1 files changed, 17 insertions, 5 deletions
diff --git a/assignments/assignment3/assignment3.tex b/assignments/assignment3/assignment3.tex
index e3e655f..ec64ee7 100644
--- a/assignments/assignment3/assignment3.tex
+++ b/assignments/assignment3/assignment3.tex
@@ -6,6 +6,7 @@
\usepackage[hidelinks]{hyperref}
\usepackage{minted}
\setminted{fontsize=\small,breaklines,breakanywhere,tabsize=4}
+\newmintinline[hs]{haskell}{style=bw}
\usepackage{caption}
\newenvironment{longlisting}{\captionsetup{type=listing}}{}
\usepackage{tikz}
@@ -28,12 +29,23 @@ QuickCheck\footnote{\url{http://www.cse.chalmers.se/~rjmh/QuickCheck/}} is a pro
Given that our SUT is a Haskell library and that QuickCheck is recommended in the assignment, using QuickCheck is nothing but a logical consequence.
\section{Modelling}
-As mentioned above QuickCheck is a property based testing tool.
-A property based testing tool, like QuickCheck, can test if certain specifications (a list of properties) of a program/function hold.
-This testing is done through generating a large sample of test cases, based on a class known as \mintinline{text}{Arbitrary}.
+We decide to test the move verification functionality and not the parser.
+The reason for this is that the parser is less well-defined, as we saw in our previous assignment.
+Also, it seems relatively easy to break the parser, so we would prefer to fix the obvious problems before applying automated testing.
+Lastly, the move verification functionality is more interesting because of the larger search space and complexity.
+
+As mentioned above, QuickCheck is a property based testing tool.
+A property based testing tool can test if certain specifications (a list of properties) of a program/function hold.
+This is done through generating a large sample of test cases.
+
+In QuickCheck, test cases are generated with the \hs{Arbitrary} class.
+This class implements has two members, \hs{arbitrary :: Gen a} and \hs{shrink :: a -> [a]}.
+The first generates random, usually large, test cases.
+When a counter-example is found, QuickCheck uses \hs{shrink} to find a minimal counter-example by shrinking the known counter-example while preserving the inconsistency.
The above implies that a model of the system is given using a specification.
-In our case, like we did in the first assignment, we generate games that are fed to the parser.
-However, unlike the first assignment, the PGN games that are generated this time, are generated by QuickCheck and are thus completely random.
+In our case, the model is a collection of predicates which should hold.
+We compile a test program with \texttt{chesshs} and QuickCheck and run it.
+So, unlike in assignment 1, we do not use a wrapper.
\end{document}