
\chapter{Conclusion}\label{ch:conclusion}

The primary goal of this work was to support the Operating Systems course by providing a practical and reliable way to automatically test students' C programs.
Exercises in this course often involve low-level concepts such as semaphores, sockets, and shared memory, which are difficult to test automatically with conventional approaches.
The motivation was therefore to develop a technique that allows intercepting function calls in order to verify whether students invoked the correct functions with appropriate arguments and in the correct order.

To address these challenges, this work presented \texttt{intercept.so}, a shared object file intended to be preloaded using \texttt{LD\_PRELOAD}, which may be used to intercept function calls on Linux systems.
Furthermore, a supporting Python program, \texttt{intercept}, was presented to make the shared object easier to use.
By using preloading to hook or intercept function calls, the overhead and performance degradation remain negligible for the purpose of testing student submissions.
To make use of intercepted function calls, some techniques of automatic testing of simple C programs were discussed.

In addition, the work has shown that creating an automated testing tool for the Operating Systems course assignments is both feasible and practical.
The evaluation indicates that performance overhead is negligible and therefore not a hindrance to real-world use.
Finally, since the approach relies on standard and portable mechanisms, the solution can be considered future-proof and adaptable to other environments.

The source code of the programs developed in this work is attached below.
(Not all PDF viewers may open/download attachments.)

\texttt{intercept.so}:
\textattachfile[mimetype=text/plain]{../proj/intercept/src/intercept.c}{\textcolor{blue}{\texttt{intercept.c}}} (source code), and
\textattachfile[mimetype=text/plain]{../proj/intercept/Makefile}{\textcolor{blue}{\texttt{Makefile}}}.

\textattachfile[mimetype=text/plain]{../proj/intercept/intercept}{\textcolor{blue}{\texttt{intercept}}} (Python program).

Automatic testing:
\textattachfile[mimetype=application/zip]{src/attachments/auto-test.zip}{\textcolor{blue}{\texttt{auto-test.zip}}} (zipped Python programs).
