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