\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{2}{Software Testing - Input Space Partitioning\small}{\today}{\name}{\group}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Task 1 %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{question}{Answer basic questions on ISP-Testing}[3]
\begin{enumerate}[topsep=0pt, leftmargin=*]
  \item Define the following terms - related to ISP - in your own words:
  \begin{enumerate}
      \item Input Domain
      \begin{answer}
      [TODO: Add answer here]
      \end{answer}

      \item Domain Partition (include the two criteria a partitions needs to fulfill)
      \begin{answer}
      [TODO: Add answer here]
      \end{answer}

      \item Characteristics
      \begin{answer}
      [TODO: Add answer here]
      \end{answer}

      \item Equivalence Class
      \begin{answer}
      [TODO: Add answer here]
      \end{answer}

  \end{enumerate}

  \item Which testing situations are suitable for the ISP approach?
  \begin{answer}
  [TODO: Add answer here]
  \end{answer}

  \item Name and briefly explain the two main strategies to model the input domain. What are their significant pros and cons?
  \begin{answer}
  [TODO: Add answer here]
  \end{answer}

  \item Using the standard values that may be provided in the specifications is one way to select the actual test values from each partition block. Which other strategies can you consider to derive representative values from a given partition? Name and describe two of them.
  \begin{answer}
  [TODO: Add answer here]
  \end{answer}

\end{enumerate}
\end{question}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Task 2 %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{question}{Apply ISP-Testing to a sample component}[5]
\begin{enumerate}[topsep=0pt, leftmargin=*]
  \item Gather the results of the following sub-tasks as table:
  \begin{enumerate}
    \item The distinction between the minimum, maximum and remaining \texttt{int} values is a possible interface-based partition for the input parameters \textit{a} and \textit{b}. Come up with another interface-based characteristic and the corresponding partition.
    \item The distinction between valid and invalid divisions / modulo operations is a possible functionality-based partition for the input parameters \textit{a} and \textit{b}. Come up with another functionality-based characteristic and the corresponding partition.
  \end{enumerate}
  \begin{answer}
  [TODO: Add answer here]
  \end{answer}

  \item Can you identify any non-valid combinations of blocks from your characteristics? Develop the required constraints that prevent these combinations.
  \begin{answer}
  [TODO: Add answer here]
  \end{answer}

  \item Derive one representative value for each of the blocks of the exemplary and your own characteristics. Which approach did you choose to select the values?
  \begin{answer}
  [TODO: Add answer here]
  \end{answer}

  \item Read the \texttt{acts\_user\_guide} to get a basic understanding of how to create a system for ACTS and how to generate test vector sets of this system.
  \begin{answer}
  [TODO: Add answer here]
  \end{answer}

  \item Create a system named \textit{Phase02\_Task2\_ACTS\_System.txt} based on your characteristics and their representative block values. You can use the \texttt{Enum} type with meaningful names for any characteristics not representable as \texttt{Boolean}, \texttt{Number} or \texttt{Range}. Use ACTS in command line mode to generate the set of test vectors without constraints.
  \begin{answer}
  [TODO: Add answer here]
  \end{answer}

  \item In the \texttt{Constraint} section of your system file, add the constraints you identified for valid combinations of blocks, and generate a new set of test vectors. Compare the number of test vectors of the unconstrained and constrained system. Check if the new set of test vectors still contains non-valid combinations, and adapt your constraints if necessary.
  \begin{answer}
  [TODO: Add answer here]
  \end{answer}

\end{enumerate}
\end{question}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Task 3 %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{question}{Apply ISP-Testing to your software project}[8]
\begin{enumerate}[topsep=0pt, leftmargin=*]
    \item Explain why the selected method is suitable for the input domain model approach (1-2 sentences)
    \begin{answer}
    [TODO: Add answer here]
    \end{answer}

    \item Identify the input domain of your method (2-3 sentences)
    \begin{answer}
    [TODO: Add answer here]
    \end{answer}

    \item Similar to task 2, gather the results of the following sub-tasks as shown in Table~\ref{table:example}:
    \begin{enumerate}
        \item Identify reasonable characteristics of the possible input data
        \item Derive sets of equivalence classes from these characteristics (Note: At least one of your partitions must consist of a number of blocks $\geq 3$. Also make sure that you have enough characteristics and corresponding blocks to derive $12$ distinct tests from them later on.)
    \end{enumerate}
    \begin{answer}
    [TODO: Add answer here]
    \end{answer}

    \item Can you identify any non-valid combinations of blocks from your characteristics? (1-2 sentences)
    \begin{answer}
    [TODO: Add answer here]
    \end{answer}

    \item Derive (at least) one representative value for each equivalence class. Which strategy did you use for the value selection?
    \begin{answer}
    [TODO: Add answer here]
    \end{answer}

    \item Combine the selected values from the partitions of each input argument to complete test vectors. You can decide whether you want to approach this sub-task manually or using \textit{ACTS} (therefore, only the resulting vectors should be documented).
    \begin{answer}
    [TODO: Add answer here]
    \end{answer}

    \item Create JUnit tests for your method, which trigger test runs with the selected test vectors, and assert each individual output. For the submission, merge all these tests into one \texttt{*.java} file.
    \begin{answer}
    [TODO: Add answer here]

    \begin{lstlisting}[language=Java,belowskip=-0.8\baselineskip]
/* Add code here */
    \end{lstlisting}
    \end{answer}

\end{enumerate}
\end{question}

\end{document}
