\documentclass[a4paper]{article}

\usepackage[british]{babel}
\usepackage[british]{isodate}
\usepackage{geometry}

\title{Program Analysis with \emph{PREfast} and \emph{SAL}}
\date{\printdate{21.9.2016}}
\author{Mart Lubbers (s4109503)}

\begin{document}
\pagenumbering{gobble}
\thispagestyle{empty}
\clearpage
\maketitle
\begin{enumerate}
	\item\emph{PREfast tries to check annotations at compile time. Suppose that
		we have a way to check the annotations at runtime. (Actually, it is not
		so straightforward to do this at runtime, for all annotations, but
		let's assume it is possible.) Name one advantage and two disadvantages
		of doing these checks at runtime instead of doing them at compile-time.
		(Hint: there are very generic advantages and disadvantages when it
		comes to runtime vs compile-time checking.)}

		An advantage is that you can inspect the actual value of the variable
		and check whether the buffer is big enough. (Assuming the tool keeps
		track of the buffersize).
		A disadvantage would be the overhead that is added to the program.
		Checking all these things at runtime costs processor time and will
		result in slower programs.
		Lastly, another disadvantage is that it is difficult to check all
		runtime configurations when using dynamic buffer sizes, so that will
		mean that you require a very big testset which you have to design then.
		In other words; you have to the same work twice, once while annotating
		and once writing a testset.
	\item\emph{Sometimes PREfast only warns about problems \textbf{after} you
		add annotations. For example, the tool does not complain about
		\texttt{zero()} until after you add an annotation about the size of
		\texttt{buf}.  An alternative tool design would be to produce a warning
		about \texttt{zero()} if there are no annotations for it. (The warning
		would then not so much be that there is a potential buffer overflow
		problem, but rather that the tool does not have enough information to
		determine whether there is a buffer overflow or not.) Can you give a
		plausible explanation why PREfast has been designed so that it does not
		complain about such unannotated methods?}

		It might very well be that a lot of the functions handling buffers are
		not in any way in danger of causing a buffer overflow and therefore the
		tool will spew out way to many warnings and it then forces the user to
		do excessive annotating just to get rid of warning that are not
		dangerous in the first place.
\end{enumerate}

\end{document}
