na een hoop ruzie met latex is er nu een checklist!
[tt2015.git] / a2 / 1cases.tex
1
2 \pagebreak
3 \begin{table}
4 \subsection{Preflight checklist}
5
6 Before actual certification is commenced we perform a manual test using a
7 checklist.
8 If any of the checks fail we immediately reject the product.
9 The checklist is given in the table below.
10
11 \begin{tabularx}{\linewidth}{| l | X|}
12 \hline
13 Check 1 & Get the SUT in a workable state. \\\hline
14 Course of action & \begin{enumerate}
15 \item Import the VirtualBox image into VirtualBox.
16 \item Boot the vm.
17 \item Verify the SUT booted succesfully and the network module(s) are loaded.
18 \end{enumerate} \\\hline
19 Passed & \textit{Yes/No} \\\hline \hline
20 Check 2 & Verify the SUT is complete. \\\hline
21 Course of action & \begin{enumerate}
22 \item Use the course of action for \emph{Check 1} in order to boot the SUT.
23 \item Verify the loopback device exists using \emph{ifconfig}
24 \item Verify the \emph{echo-server} is present on the system.
25 \item Verify \emph{Scrappy} is present on the system.
26 \item Verify all scripts used for testing are present on the system.
27 \end{enumerate} \\\hline
28 Passed & \textit{Yes/No} \\\hline \hline
29 Check 3 & Initialize the testing environment. \\\hline
30 Course of action & \begin{enumerate}
31 \item Boot the SUT (see \emph{Check 1}).
32 \item Setup iptables by executing \emph{./scripts/setup/iptables.sh}
33 \item Setup ... by executing \emph{./scripts/setup/...}
34 \end{enumerate} \\\hline
35 Passed & \textit{Yes/No} \\\hline
36 \end{tabularx}
37 \end{table}
38
39 \begin{table}
40 \begin{tabularx}{\linewidth}{| l | X |}
41 \hline
42 Check 4 & Test the tool environment. \\\hline
43 Course of action & \begin{enumerate}
44 \item Boot and initialize the SUT (see \emph{Check 4})
45 \item Execute the \emph{./scripts/tests/case0-helloworld.sh} script.
46 \item Execute the command \emph{cat logs/case0.log}.
47 \item Verify the console displays a success message.
48 \end{enumerate} \\\hline
49 Passed & \textit{Yes/No} \\\hline \hline
50 Check 5 & All test inputs and scripts are present. \\\hline
51 Course of action & \begin{enumerate}
52 \item Boot the SUT (see \emph{Check 1})
53 \item Execute the command \emph{ls scripts/tests}
54 \item Verify that there is a file named case$X$ for each test case $X$
55 \item Use \emph{ls packets}
56 \item Verify that there is a file named \emph{single.pcap} and \emph{multi.pcap}.
57 \end{enumerate} \\\hline
58 Passed & \textit{Yes/No} \\\hline
59 \end{tabularx}
60 \end{table}
61
62 \newpage
63
64 \subsection{Testing of SUT}
65
66 The SUT is a series of services for other computer programs with no end-user
67 facing
68 interface. Therefore the SUT will be tested solely by calling it's services
69 through various automated scripts. An automated test suite will be available
70 which executes all these automated scripts and aggregates their results to
71 asses whether or not the SUT has passed the test.
72
73 The implementation of the SUT is tested using black box testing techniques. A
74 series of tests asses the correctness of the implementation with regards to the
75 TCP specification. These tests are specified in Table~\textbf{referentie naar
76 tests-tabel}. The test cases aim to cover the most interesting parts of the
77 TCP specification.
78
79 To cover the TCP specification as complete as possible while still maintaining
80 a feasible test suite the tests are divided into equivalence partitions. Below
81 these partitions are given.
82
83 \begin{enumerate}
84 \item \emph{Number of packets} in request\footnotemark
85 \footnotetext{A request is considered establishing a connection
86 (handshake) and any n number of payloadpackts}
87 \begin{enumerate}
88 \item 0 payload packets
89 \item 1 payload packet
90 \item n=small payload packets
91 \item n=big payload packets
92 \end{enumerate}
93 \item Correct or Incorrect \emph{source port}
94 \item Correct or Incorrect \emph{Destination port}
95 \item Bits flipped in \emph{Payload}
96 \begin{enumerate}
97 \item Correct payload
98 \item Payload with even number of bits flipped
99 \item Payload with odd number of bits flipped
100 \end{enumerate}
101 \item Correct or Incorrect \emph{checksum}
102 \item Packets received in or out of order, or missing packets
103 \end{enumerate}
104
105 \textbf{hier iets over waarom deze partities relevant zijn! Waarom odd en
106 even number of bits flipped bijv interessant?}
107 \bigskip
108
109 Partitions 2 to 6 are tested using pairwise testing to keep the number of test
110 cases feasible. The pairs are then all *except some where it does not make sense
111 to do so) tested with the different request sizes of partition 1.
112
113 This is expressed in Table~\ref{table:testpairs}.
114
115 \begin{table}
116 \begin{tabular} {p{2cm} | l | p{2cm} | l | p{1cm} || c | c | p{1.3cm} | p{1.3cm}}
117 \textbf{Payload} & \textbf{checksum} & \textbf{destination port} & \textbf{order} & \textbf{source port} & \textbf{payload 0} & \textbf{payload 1} & \textbf{payload small} & \textbf{payload big} \\ \hline \hline
118 Correct & Correct & Correct & In order & Correct & \cmark & \cmark & \cmark & \cmark \\ \hline
119 Correct & Incorrect & Incorrect & Missing packet & Incorrect & \xmark & \xmark & \cmark & \cmark \\ \hline
120 odd\# of bits flipped & Correct & Incorrect & Out of order & Incorrect & \xmark & \xmark & \cmark & \cmark \\ \hline
121 odd\# of bits flipped & Incorrect & Correct & Missing packet & Correct & \xmark & \xmark & \cmark & \cmark \\ \hline
122 even\# of bits flipped & Correct & Incorrect & Missing packet & Correct & \xmark & \xmark & \cmark & \cmark \\ \hline
123 even\# of bits flipped & Incorrect & Correct & Out of order & Incorrect & \xmark & \xmark & \cmark & \cmark \\ \hline
124 odd\# of bits flipped & Incorrect & Incorrect & In order & Incorrect & \cmark & \cmark & \cmark & \cmark \\ \hline
125 even\# of bits flipped & Incorrect & Incorrect & In order & Incorrect & \cmark & \cmark & \cmark & \cmark \\ \hline
126 Correct & Incorrect & Incorrect & Out of order & Correct & \xmark & \xmark & \cmark & \cmark \\
127 \end{tabular}
128 \caption{Combinations of test cases}
129 \label{table:testpairs}
130 \end{table}
131
132 \subsection{Quality, completeness and coverage of tests}
133
134 The network packets used in testing are constructed from prerecorded, known to
135 be correct, network traffic. These packets are then modified with well used and
136 field tested tools. Due to this the chance of errors in the test cases is quite
137 low. However, no formal proof of correctness of the test cases is present, this
138 means that any defects found might not be the result of a fault in the SUT.
139 Therefore detected defects should only indicate there is a high chance that
140 there is a fault in the SUT and can not result directly in the conclusion that
141 there actually is one.
142
143 \bigskip
144
145 Due to the nature of black-box testing coverage of the code in the
146 implementation of the SUT is unknown. However completeness of the tests over
147 the specification of the SUT can be assessed.
148
149 \bigskip
150
151 Due to the clear and exhaustive specification of TCP the completeness of the
152 test suite can be clearly assessed.
153
154 As always, $100\%$ completeness is not feasible, therefore test cases are
155 carefully selected to cover the most interesting parts of the TCP specification
156 to ensure a test suite.
157
158 To further decrease the number of tests needed test cases are divided into
159 equivalence partitions and the combination of cases as described in
160 Table~\ref{table:testpairs} ensures that all partitions are
161 covered and the number of individual tests is still feasible.
162
163
164 %
165 % wat ik ook probeer ik krijg de eerste collum
166 % zijn tekst niet verticaal gecentered
167 %
168 \begin{table}
169
170
171 \subsection{Test cases}
172
173 \begin{tabularx}{\linewidth}{| l | X|}
174 \hline
175 Nr & 1 \\\hline
176 Title & Single valid request. \\\hline
177 Input & Pcap file with prerecorded valid packets. \\\hline
178 Expected output & Pcap file with valid response to request. \\\hline
179 Course of action & \begin{enumerate}
180 \item Execute \emph{./scripts/tests/case1-single-valid.sh}
181 \item Load \emph{output/case1.pcap} with ...
182 \end{enumerate} \\\hline
183 Valid trace & \begin{enumerate}
184 \item \textbf{Hier packets benoemen?}
185 \end{enumerate} \\\hline
186 \end{tabularx}
187
188 \begin{tabularx}{\linewidth}{| l | X|}
189 \hline
190 Nr & 2 \\\hline
191 Title & Single request with corrupted checksum. \\\hline
192 Input & Pcap file used as \emph{test-case 1} input. \\\hline
193 Expected output & No response from SUT, logs with rejected packets. \\\hline
194 Course of action & \begin{enumerate}
195 \item Load input pcap file into ....
196 \item Corrupt checksum of loaded packets.
197 \item Save resulting packets as pcap file.
198 \item Load new pcap file into ...
199 \item Replay new pcap file.
200 \item Record SUT response using...
201 \item Extract log with rejected packets.
202 \item Save recorded packets as a pcap file.
203 \item Analyze packets in resulting file.
204 \end{enumerate} \\\hline
205 Valid trace & \begin{enumerate}
206 \item \textbf{Aangeven welke packets corrupted zijn?}
207 \end{enumerate} \\\hline
208 \end{tabularx}
209 \end{table}
210
211 \newpage