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