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