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