Finished task 2

This commit is contained in:
Michael Chen 2022-05-04 21:48:33 +02:00
parent 5a4e12e7bd
commit 0cebf35e25
No known key found for this signature in database
GPG Key ID: 1CBC7AA5671437BB
4 changed files with 73 additions and 7 deletions

View File

@ -1,5 +1,7 @@
Solution_Phase*_*.pdf
Solution_Phase*_*.zip
*.result.txt
output.txt
## Core latex/pdflatex auxiliary files:
*.aux

View File

@ -4,8 +4,9 @@ name = MichaelChen
solutionname = Solution_Phase$(phase)_$(name)
target = $(solutionname)_V$(version).zip
package = $(solutionname).pdf
package = $(solutionname).pdf Phase02_Task2_ACTS_System.txt Phase02_Task2_ACTS_System.result.txt
latexmkflags =
actspath = "C:\\Program Files (x86)\\ACTS\\acts_3.2.jar"
.PHONY : all dev
@ -19,3 +20,6 @@ $(target) : $(package)
%.pdf : %.tex
latexmk -jobname="$*" $(latexmkflags) -pdf $<
%_System.result.txt : %_System.txt
java -Xmx8192M -jar $(actspath) $< $@

View File

@ -0,0 +1,27 @@
[System]
Name: IsDivisible
[Parameter]
A_VAL (enum) : [NORMAL], MINIMUM, MAXIMUM
B_VAL (enum) : [NORMAL], MINIMUM, MAXIMUM
A_SIGNED (enum) : POSITIVE, NEGATIVE, ZERO
B_SIGNED (enum) : POSITIVE, NEGATIVE, ZERO
DIVISABLE (bool) : TRUE, FALSE
a (int) : 0, 1, -1, 4, 5, 20, 21, 21474836, -21474836
b (int) : 1, -1, 4, 5, 20, 21, 21474836, -21474836 ; 0
[Constraint]
A_VAL = "MINIMUM" => a = -21474836
A_VAL = "MAXIMUM" => a = 21474836
B_VAL = "MINIMUM" => b = -21474836
B_VAL = "MAXIMUM" => b = 21474836
A_SIGNED = "POSITIVE" => a > 0
A_SIGNED = "NEGATIVE" => a < 0
A_SIGNED = "ZERO" => a = 0
B_SIGNED = "POSITIVE" => b > 0
B_SIGNED = "NEGATIVE" => b < 0
B_SIGNED = "ZERO" => b = 0
(DIVISABLE = true) => a % b = 0
(DIVISABLE = false) => a % b != 0

View File

@ -5,6 +5,9 @@
\usepackage{listings}
\usepackage{enumitem}
\usepackage{subcaption}
\usepackage{amsmath}
\usepackage{float}
\usepackage{hyperref}
\usepackage{pgf}
\usepackage{tikz}
@ -135,32 +138,62 @@
\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]
See table~\ref{tab:characteristics}.
\begin{table}
\centering
\begin{tabular}{llll}
\hline
Characteristic & Eq-Class 1 & Eq-Class 2 & Eq-Class 3 \\
\hline
$q_1 = \text{"\texttt{int} values"}$ & $\{a,b=\texttt{int.Max}\}$ & $\{a,b=\texttt{int.Min}\}$ & remaining \\
$q_2 = \text{"signedness"}$ & $\{a,b>0\}$ & $\{a,b<0\}$ & $\{a,b=0\}$ \\
$q_3 = \text{"valid \texttt{mod}"}$ & $\{b\neq{}0\}$ & $\{b=0\}$ \\
$q_4 = \text{"divisor"}$ & $\{(a \mod b) = 0\}$ & $\{(a \mod b) \neq 0\}$ \\
\hline
\end{tabular}
\caption{Equivalence classes for different characteristics}
\label{tab:characteristics}
\end{table}
\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]
A simple invalid block combination is the valid modulo operation in combination with the signedness of $b$. We can mitigate that by disallowing $b$ to be zero. Also, when $a$ or $b$ is fixed at the maximum or minimum integer value we cannot combine this with all $q_4$ blocks.
\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]
See table~\ref{tab:testvalues}.
\begin{table}
\centering
\begin{tabular}{llll}
\hline
Characteristic & Val-Class 1 & Val-Class 2 & Val-Class 3 \\
\hline
$q_1 = \text{"\texttt{int} values"}$ & $(\texttt{int.Max},b)$ & $(\texttt{int.Min},b)$ & $(1,b)$ \\
$q_2 = \text{"signedness"}$ & $(1,b)$ & $(-1,b)$ & $(0,b)$ \\
$q_3 = \text{"valid \texttt{mod}"}$ & $(5,1)$ & $(5,0)$ \\
$q_4 = \text{"divisor"}$ & $(20,5)$ & $(21,5)$ \\
\hline
\end{tabular}
\caption{Examplary test values for different characteristics}
\label{tab:testvalues}
\end{table}
\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]
See \texttt{Phase02\_Task2\_ACTS\_System.txt} file.
\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]
ACTS generated $81$ tests covering $411$ tuples in $0.6$ seconds.
\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]
Now ACTS generated $83$ tests covering $312$ tuples in $12.9$ seconds and due to the constraints more than $50$ tuples were forbidden.
\end{answer}
\end{enumerate}