software-testing/project_task_sheets/phase_04/project_phase04_tasks/project_phase04_template.tex
2022-06-08 11:08:26 +02:00

209 lines
8.8 KiB
TeX

\documentclass[a4paper]{scrreprt}
\usepackage[left=4cm,bottom=3cm,top=3cm,right=4cm,nohead,nofoot]{geometry}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{listings}
\usepackage{enumitem}
\usepackage{subcaption}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\usepackage{xparse}
\usepackage{multirow}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setlength{\textfloatsep}{16pt}
\renewcommand{\labelenumi}{\alph{enumi})}
\renewcommand{\labelenumii}{\arabic{enumii}) }
\newcommand{\baseinfo}[5]{
\begin{center}
\begin{tabular}{p{15cm}r}
\vspace{-4.5pt}{ \Large \bfseries #1} & \multirow{2}{*}{} \\[0.4cm]
#2 & \\[0.5cm]
\end{tabular}
\end{center}
\vspace{-18pt}\hrule\vspace{6pt}
\begin{tabular}{ll}
\textbf{Name:} & #4\\
\textbf{Group:} & #5\\
\end{tabular}
\vspace{4pt}\hrule\vspace{2pt}
\footnotesize \textbf{Software Testing} \hfil - \hfil Summer 2022 \hfil - \hfil #3 \hfil - \hfil Sibylle Schupp / Sascha Lehmann \hfil \\
}
\newcounter{question}
\NewDocumentEnvironment{question}{m o}{%
\addtocounter{question}{1}%
\paragraph{\textcolor{red}{Task~\arabic{question}} - #1\hfill\IfNoValueTF{#2}{}{[#2 P]}}
\leavevmode\\%
}{%
\vskip 1em%
}
\NewDocumentEnvironment{answer}{}{%
\vspace{6pt}
\leavevmode\\
\textit{Answer:}\\[-0.25cm]
{\color{red}\rule{\textwidth}{0.4mm}}
}{%
\leavevmode\\
{\color{red}\rule{\textwidth}{0.4mm}}
}
\newcommand{\projectinfo}[5]{
\baseinfo{Project Phase #1 - Submission Sheet}{#2}{#3}{#4}{#5}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\name{[Add name here]}
\def\group{[Add group here]}
\begin{document}
\projectinfo{4}{Software Testing - Logic Coverage\small}{\today}{\name}{\group}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Task 1 %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{question}{Answer basic questions on Logic Coverage}[3]
\begin{enumerate}[topsep=0pt, leftmargin=*]
\item Define the following terms in your own words:
\begin{enumerate}
\item \textit{Predicate}, \textit{Clause}, \textit{Literal}, and \textit{Term}
\begin{answer}
[TODO: Add answer here]
\end{answer}
\item \textit{Unique True Point} and \textit{Near False Point}
\begin{answer}
[TODO: Add answer here]
\end{answer}
\item \textit{Prime Implicant} and \textit{Redundant Implicant}
\begin{answer}
[TODO: Add answer here]
\end{answer}
\end{enumerate}
\item What is the difference between \textit{Semantic} and \textit{Syntactic Logic Coverage}? Explain both approaches, as well as \textit{one} concrete criterion for each of them.
\begin{answer}
[TODO: Add answer here]
\end{answer}
\item Explain the terms \textit{Reachability} and \textit{Controllability}. What are their consequences for a source-code based logic coverage approach?
\begin{answer}
[TODO: Add answer here]
\end{answer}
\item Both \textit{Active Clause Coverage} (ACC) and \textit{Inactive Clause Coverage} (ICC) feature a \textit{General} and a \textit{Restricted} version of their concepts. Briefly describe the changes that both variations introduce to the basic concept.
\begin{answer}
[TODO: Add answer here]
\end{answer}
\end{enumerate}
\end{question}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Task 2 %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{question}{Apply Logic Coverage criteria to a sample program}[5]
\begin{enumerate}[topsep=0pt, leftmargin=*]
\item Name and briefly describe the specific lines that (directly or indirectly) influence the boolean results of the predicates and clauses in line \textit{10}, \textit{12}, \textit{17}, \textit{20}, \textit{22}, \textit{30}, and \textit{32}.
\begin{answer}
[TODO: Add answer here]
\end{answer}
\item To which extent are the predicates influenced by internal states? Which conclusions do you draw for the application of logic coverage criteria to source code in general?
\begin{answer}
[TODO: Add answer here]
\end{answer}
\item Provide a set of tests that cover the following predicates and clauses:
\begin{enumerate}
\item \texttt{(start < 0) || (end < 0) || (start > end) || (end > s.length())} (l.12) based on the \textit{Correlated Active Clause Coverage} (CACC) criterion
\begin{answer}
[TODO: Add answer here]
\begin{lstlisting}[language=Java,belowskip=-0.8\baselineskip]
/* Add code here */
\end{lstlisting}
% or: \lstinputlisting[language=Java,belowskip=-0.8\baselineskip]{file_name.java}
\end{answer}
\item \texttt{newCount > value.length} (l.20) for an evaluation to both \textit{true} and \textit{false}
\begin{answer}
[TODO: Add answer here]
\begin{lstlisting}[language=Java,belowskip=-0.8\baselineskip]
/* Add code here */
\end{lstlisting}
% or: \lstinputlisting[language=Java,belowskip=-0.8\baselineskip]{file_name.java}
\end{answer}
\item \texttt{newCapacity < 0} (l.30) and \texttt{minimumCapacity > newCapacity} (l.32) for an evaluation to \textit{true}. Which requirement(s) does \texttt{value} have to meet so that \texttt{newCapacity < 0} will be satisfied?
\begin{answer}
[TODO: Add answer here]
\begin{lstlisting}[language=Java,belowskip=-0.8\baselineskip]
/* Add code here */
\end{lstlisting}
% or: \lstinputlisting[language=Java,belowskip=-0.8\baselineskip]{file_name.java}
\end{answer}
\end{enumerate}
\end{enumerate}
\end{question}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Task 3 %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{question}{Application to software project}[8]
\begin{enumerate}[topsep=0pt, leftmargin=*]
\item Pick a method of your given project which contains at least \textbf{2} predicates, with one of these predicates containing at least \textbf{3} clauses. If you cannot find a three-clause-predicate in your code, you can decide to take a nested structure of \textit{if-else} and/or nested \textit{while} expressions instead (at least \textbf{2} levels of nesting). In that case, explain the differences for the application of your logic coverage criteria for nested structures as compared to "flat" predicates.
\begin{answer}
[TODO: Add answer here]
\end{answer}
\item Using the \textit{EclEmma} tool from phase 03, measure and note down the \textit{instruction}, \textit{branch} and \textit{line coverage} values of the existing test suite regarding your selected method.
\begin{answer}
[TODO: Add answer here]
\end{answer}
\item Create a set of tests that satisfy \textit{three} of the following logic criteria (pick one concrete criterion from each of your three selected bullet points):
\begin{itemize}
\item \textit{Predicate Coverage} (PC), \textit{Clause Coverage} (CC), \textit{Combinatorial Coverage} (CoC)
\item \textit{Active Clause Coverage} (ACC), \textit{General Active Clause Coverage} (GACC), \textit{Restricted Active Clause Coverage} (RACC), \textit{Correlated Active Clause Coverage} (CACC)
\item \textit{Inactive Clause Coverage} (ICC), \textit{General Inactive Clause Coverage} (GICC), \textit{Restricted Inactive Clause Coverage} (RICC)
\item \textit{Implicant Coverage} (IC)
\item \textit{Multiple Unique True Point Coverage} (MUTP), \textit{Unique True Point and Near False Point Pair Coverage} (CUTPNFP), \textit{Multiple Near False Point Coverage} (MNFP)
\end{itemize}
\begin{answer}
[TODO: Add answer here]
\begin{lstlisting}[language=Java,belowskip=-0.8\baselineskip]
/* Add code here */
\end{lstlisting}
% or: \lstinputlisting[language=Java,belowskip=-0.8\baselineskip]{file_name.java}
\end{answer}
\item Document for each individual test the coverage criterion / criteria it contributes to.
\begin{answer}
[TODO: Add answer here]
\end{answer}
\item Finally, recheck your method with the new, extended test suite regarding the \textit{instruction}, \textit{branch} and \textit{line coverage} criteria, and explain \textit{how} their values have / have not changed.
\begin{answer}
[TODO: Add answer here]
\end{answer}
\end{enumerate}
\end{question}
\end{document}