Added testing paris
[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
7 \begin{enumerate}
8 \item Is the product complete?
9 \item Does the product come with a manual or quick start guide?
10 \item Is it possible to get the product in a usable state?
11 \item Can we use the product to initiate a connection in a corruption
12 free environment?
13 \end{enumerate}
14
15 \textbf{DIT MOET VERANDERD WORDEN, HET PRODUCT ZOU AFGEKEURD WORDEN!}
16
17 \subsection{Testing of SUT}
18
19 The SUT is a series of services for other computer programs with no end-user
20 facing
21 interface. Therefore the SUT will be tested solely by calling it's services
22 through various automated scripts. An automated test suite will be available
23 which executes all these automated scripts and aggregates their results to
24 asses whether or not the SUT has passed the test.
25
26 The implementation of the SUT is tested using black box testing techniques. A
27 series of tests asses the correctness of the implementation with regards to the
28 TCP specification. These tests are specified in Table~\textbf{referentie naar
29 tests-tabel}. The test cases aim to cover the most interesting parts of the
30 TCP specification.
31
32 To cover the TCP specification as complete as possible while still maintaining
33 a feasible test suite the tests are divided into equivalence partitions. Below
34 these partitions are given.
35
36 \begin{enumerate}
37 \item \emph{Number of packets} in request\footnotemark
38 \footnotetext{A request is considered establishing a connection
39 (handshake) and any n number of payloadpackts}
40 \begin{enumerate}
41 \item 0 payload packets
42 \item 1 payload packet
43 \item n=small payload packets
44 \item n=big payload packets
45 \end{enumerate}
46 \item Correct or Incorrect \emph{source port}
47 \item Correct or Incorrect \emph{Destination port}
48 \item Bits flipped in \emph{Payload}
49 \begin{enumerate}
50 \item Correct payload
51 \item Payload with even number of bits flipped
52 \item Payload with odd number of bits flipped
53 \end{enumerate}
54 \item Correct or Incorrect \emph{checksum}
55 \item Packets received in or out of order, or missing packets
56 \end{enumerate}
57
58 \textbf{hier iets over waarom deze partities relevant zijn! Waarom odd en
59 even number of bits flipped bijv interessant?}
60 \bigskip
61
62 Partitions 2 to 6 are tested using pairwise testing to keep the number of test
63 cases feasible. The pairs are then all *except some where it does not make sense
64 to do so) tested with the different request sizes of partition 1.
65
66 This is expressed in Table~\ref{table:testpairs}.
67
68 \begin{table}
69 \begin{tabular} {p{2cm} | l | p{2cm} | l | p{1cm} || c | c | p{1.3cm} | p{1.3cm}}
70 \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
71 Correct & Correct & Correct & In order & Correct & \cmark & \cmark & \cmark & \cmark \\ \hline
72 Correct & Incorrect & Incorrect & Missing packet & Incorrect & \xmark & \xmark & \cmark & \cmark \\ \hline
73 odd\# of bits flipped & Correct & Incorrect & Out of order & Incorrect & \xmark & \xmark & \cmark & \cmark \\ \hline
74 odd\# of bits flipped & Incorrect & Correct & Missing packet & Correct & \xmark & \xmark & \cmark & \cmark \\ \hline
75 even\# of bits flipped & Correct & Incorrect & Missing packet & Correct & \xmark & \xmark & \cmark & \cmark \\ \hline
76 even\# of bits flipped & Incorrect & Correct & Out of order & Incorrect & \xmark & \xmark & \cmark & \cmark \\ \hline
77 odd\# of bits flipped & Incorrect & Incorrect & In order & Incorrect & \cmark & \cmark & \cmark & \cmark \\ \hline
78 even\# of bits flipped & Incorrect & Incorrect & In order & Incorrect & \cmark & \cmark & \cmark & \cmark \\ \hline
79 Correct & Incorrect & Incorrect & Out of order & Correct & \xmark & \xmark & \cmark & \cmark \\
80 \end{tabular}
81 \caption{Combinations of test cases}
82 \label{table:testpairs}
83 \end{table}
84
85 \subsection{Quality, completeness and coverage of tests}
86
87 The network packets used in testing are constructed from prerecorded, known to
88 be correct, network traffic. These packets are then modified with well used and
89 field tested tools. Due to this the chance of errors in the test cases is quite
90 low. However, no formal proof of correctness of the test cases is present, this
91 means that any defects found might not be the result of a fault in the SUT.
92 Therefore detected defects should only indicate there is a high chance that
93 there is a fault in the SUT and can not result directly in the conclusion that
94 there actually is one.
95
96 \bigskip
97
98 Due to the nature of black-box testing coverage of the code in the
99 implementation of the SUT is unknown. However completeness of the tests over
100 the specification of the SUT can be assessed.
101
102 \bigskip
103
104 Due to the clear and exhaustive specification of TCP the completeness of the
105 test suite can be clearly assessed.
106
107 As always, $100\%$ completeness is not feasible, therefore test cases are
108 carefully selected to cover the most interesting parts of the TCP specification
109 to ensure a test suite.
110
111 To further decrease the number of tests needed test cases are divided into
112 equivalence partitions and the combination of cases as described in
113 Table~\ref{table:testpairs} ensures that all partitions are
114 covered and the number of individual tests is still feasible.
115
116
117 %
118 % wat ik ook probeer ik krijg de eerste collum
119 % zijn tekst niet verticaal gecentered
120 %
121 \begin{table}
122
123
124 \subsection{Test cases}
125
126 \begin{tabularx}{\linewidth}{| l | X|}
127 \hline
128 Nr & 1 \\\hline
129 Title & Single valid request. \\\hline
130 Input & Pcap file with prerecorded valid packets. \\\hline
131 Expected output & Pcap file with valid response to request. \\\hline
132 Course of action & \begin{enumerate}
133 \item Load input pcap file.
134 \item Replay pcap file using ...
135 \item Record SUT response using...
136 \item Save recorded packets as a pcap file.
137 \item Analyze packets in resulting file.
138 \end{enumerate} \\\hline
139 Valid trace & \begin{enumerate}
140 \item \textbf{Hier packets benoemen?}
141 \end{enumerate} \\\hline
142 \end{tabularx}
143
144 \begin{tabularx}{\linewidth}{| l | X|}
145 \hline
146 Nr & 2 \\\hline
147 Title & Single request with corrupted checksum. \\\hline
148 Input & Pcap file used as \emph{test-case 1} input. \\\hline
149 Expected output & No response from SUT, logs with rejected packets. \\\hline
150 Course of action & \begin{enumerate}
151 \item Load input pcap file into ....
152 \item Corrupt checksum of loaded packets.
153 \item Save resulting packets as pcap file.
154 \item Load new pcap file into ...
155 \item Replay new pcap file.
156 \item Record SUT response using...
157 \item Extract log with rejected packets.
158 \item Save recorded packets as a pcap file.
159 \item Analyze packets in resulting file.
160 \end{enumerate} \\\hline
161 Valid trace & \begin{enumerate}
162 \item \textbf{Aangeven welke packets corrupted zijn?}
163 \end{enumerate} \\\hline
164 \end{tabularx}
165 \end{table}
166
167 \newpage