summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2017-06-28 16:48:59 +0200
committerDavid Runge <dave@sleepmap.de>2017-06-28 16:48:59 +0200
commitf451e0a5670231d4d3dfd6bc1fe55dd6354ae11a (patch)
treed8b398aeea464ad6fc8ef2aa66519edc2dbefa68
parente2464696f66706e55dac46f7c14ccffddf39ab9d (diff)
downloadmaster-thesis-f451e0a5670231d4d3dfd6bc1fe55dd6354ae11a.tar.gz
master-thesis-f451e0a5670231d4d3dfd6bc1fe55dd6354ae11a.tar.bz2
master-thesis-f451e0a5670231d4d3dfd6bc1fe55dd6354ae11a.tar.xz
master-thesis-f451e0a5670231d4d3dfd6bc1fe55dd6354ae11a.zip
thesis/thesis.tex: Adding information on tests (mainly robustness tests). Adding subsection Status messages for Discussion section. Adding ID glossary entry. Switching to 12pt.
-rw-r--r--thesis/thesis.tex122
1 files changed, 116 insertions, 6 deletions
diff --git a/thesis/thesis.tex b/thesis/thesis.tex
index 643c579..2b6c4ff 100644
--- a/thesis/thesis.tex
+++ b/thesis/thesis.tex
@@ -1,4 +1,4 @@
-\documentclass[11pt, a4paper, oneside, titlepage, listof=totoc, headinclude,
+\documentclass[12pt, a4paper, oneside, titlepage, listof=totoc, headinclude,
open=right, glossaries=totoc, captions=tableheading, final, BCOR=10mm,
parskip=never]{paper}
\usepackage[english]{babel}
@@ -78,7 +78,12 @@ parskip=never]{paper}
\newglossaryentry{sclang}{
name={sclang},
description={Name of the SuperCollider programming language and the
- interpreter executable of the SuperCollider programming language}
+ interpreter executable of the SuperCollider programming language.}
+}
+\newglossaryentry{id}{
+ name={ID},
+ description={A name or number, that identifies an object.},
+ plural=IDs
}
\makeglossaries
@@ -1389,10 +1394,112 @@ ssr-aap -N “server” -C “127.0.0.1:50002”
\subsection{Automated tests}
\label{subsec:automated_tests}
To probe the \gls{osc} interface's robustness automatically, a set of
- tests were written (as there exists no test framework for the \gls{ssr}
- itself) in \gls{sclang}, to use all of the available messages (especially when
- they should not be allowed - in the case of not being a subscribed client
- or a setup server).
+ tests were written in \gls{sclang}. The \gls{ssr} was developed without
+ the help of a test framework, which is responsible to test its
+ components, after they have been changed (usually before compiling the
+ source to binary). This means, that internal (e.g.\ the \gls{pubsub}
+ interface), or external (e.g.\ the \gls{ip} or \gls{osc} interface)
+ functionality might or might not work as expected.\\
+ The tests are divided into those probing robustness of the \gls{osc}
+ interface and others probing its functionality. The robustness tests
+ further divide into server and client specific tests, where authorized
+ and unauthorized access is tried. The functionality tests are grouped by
+ tests for general operability, i.e.\ testing certain features or
+ workflows once and long-running tests, where features are tried
+ repeatedly.\\
+ Listing~\ref{lst:ssr-tests-sclang-unsubscribed-controls-server}
+ and~\ref{lst:ssr-tests-sclang-subscribed-controls-server} describe
+ server-side tests for robustness. While the first will not lead to any
+ processed action by the server, the latter will. This is explained by
+ \gls{sclang} not being a subscribed client with a \textit{MessageLevel}
+ of \textit{SERVER} or higher in the first case. In the second test
+ however \gls{sclang} subscribes to the \gls{ssr} server instance, which
+ is why the \gls{osc} messages are evaluated in this case.\\
+
+ \begin{listing}[!htb]
+ \begin{mdframed}
+ \inputminted[numbers=left, firstline=145, lastline=158,
+ fontsize=\footnotesize]{supercollider}{../../ssr/supercollider/tests.scd}
+ \end{mdframed}
+ \caption{supercollider/tests.scd: \gls{sclang} (unsubscribed) tries to
+ control a \gls{ssr} server}
+ \label{lst:ssr-tests-sclang-unsubscribed-controls-server}
+ \end{listing}\\
+
+ \begin{listing}[!htb]
+ \begin{mdframed}
+ \inputminted[numbers=left, firstline=160, lastline=183,
+ fontsize=\footnotesize]{supercollider}{../../ssr/supercollider/tests.scd}
+ \end{mdframed}
+ \caption{supercollider/tests.scd: \gls{sclang} (subscribed) tries to
+ control a \gls{ssr} server}
+ \label{lst:ssr-tests-sclang-subscribed-controls-server}
+ \end{listing}\\
+
+ The tests described in
+ Listing~\ref{lst:ssr-tests-sclang-controls-client-unpolled}
+ and~\ref{lst:ssr-tests-sclang-controls-client-polled} are client-side
+ tests for robustness, that work in a similar fashion to the
+ aforementioned server-side tests. While in the first case, the sent
+ \gls{osc} messages are not evaluated, because \gls{sclang}, mimicking a
+ server instance (see~\ref{para:server_mimicry}), did not poll the
+ \gls{ssr} client instance up front, in the second case the messages are
+ evaluated, because it did poll the client first.
+
+ \begin{listing}[!htb]
+ \begin{mdframed}
+ \inputminted[numbers=left, firstline=185, lastline=197,
+ fontsize=\footnotesize]{supercollider}{../../ssr/supercollider/tests.scd}
+ \end{mdframed}
+ \caption{supercollider/tests.scd: \gls{sclang} tries to control a
+ \gls{ssr} client (without polling it)}
+ \label{lst:ssr-tests-sclang-controls-client-unpolled}
+ \end{listing}\\
+
+ \begin{listing}[!htb]
+ \begin{mdframed}
+ \inputminted[numbers=left, firstline=199, lastline=214,
+ fontsize=\footnotesize]{supercollider}{../../ssr/supercollider/tests.scd}
+ \end{mdframed}
+ \caption{supercollider/tests.scd: \gls{sclang} tries to control a
+ \gls{ssr} client (with previously polling it)}
+ \label{lst:ssr-tests-sclang-controls-client-polled}
+ \end{listing}\\
+
+ In all tests for robustness, the attempt is made to break the
+ implementation of the \nameref{subsubsec:message_interface}. This is
+ achieved by purposely using ranges of data types for messages, that are
+ not allowed, or not defined in the \gls{ssr}'s internal implementation.\\
+ Two examples for weak spot exploitations are the use of negative integers
+ for \glspl{id} in source related messages (only non-zero, non-negative
+ \glspl{id} are allowed internally) or supplying an empty string as
+ hostname or port number for subscription messages.\\
+ The first example will lead to undefined behavior, if the range is not
+ checked in the implementation, as a \textit{static\_cast} is used
+ internally to cast the value of the message data type (\textit{unsigned
+ int}) to the one expected by the \gls{ssr}'s Controller implementation
+ (\textit{signed int}) and the outcome of said operation is implementation
+ dependant (depending on the \gls{os} in use).\\
+ The second example, if not checked for empty string, would lead to the
+ \gls{osc} interface trying to send poll messages out to a possibly
+ defective address.\\
+
+ \begin{listing}[!htb]
+ \begin{mdframed}
+ \inputminted[numbers=left, firstline=216, lastline=225,
+ fontsize=\footnotesize]{supercollider}{../../ssr/supercollider/tests.scd}
+ \end{mdframed}
+ \caption{supercollider/tests.scd: \gls{sclang} controls a \gls{ssr}
+ client (with previously polling it), creating several sources and
+ moving them}
+ \label{lst:ssr-tests-sclang-sources}
+ \end{listing}\\
+
+ The test described in Listing~\ref{lst:ssr-tests-sclang-sources} is a
+ test for functionality, which also serves as a long-running stress test
+ for the \gls{ssr}. It creates 20 sources, that are then moved around
+ randomly for 100 seconds, every 100ms, which on a Lenovo W540, with an
+ Intel i7-4700MQ and 16Gb RAM creates less than 50\% of \gls{cpu} load.\\
\cleardoublepage
@@ -1437,6 +1544,9 @@ ssr-aap -N “server” -C “127.0.0.1:50002”
\subsection{Implementing AlienLoudspeaker}
\label{subsec:implementing_alienloudspeaker}
+ \subsection{Status messages}
+ \label{subsec:status_messages}
+
\subsection{Assigning inputs on the fly}
\label{subsec:assigning_inputs_on_the_fly}