Skip to content

Commit

Permalink
Pre proof reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Noor Buchi committed Apr 6, 2022
1 parent 335ab2b commit 4b76de2
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 18 deletions.
28 changes: 20 additions & 8 deletions chapters/ch01_introduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ \subsection{Spectrum-Based Fault Localization}

\textbf{N$_{CS}$}: number of passed test cases that execute/cover the element

\textbf{N$_{US}$}: number of passed test cases that do not execute/cover the element
\textbf{N$_{US}$}: number of passed test cases that do not execute/cover
the element

Where an element is a unit of code such as a statement or a block.
\includegraphics[width=7cm]{contingency_table.png}
\caption{\label{fig:contingency_table} Variables in SBFL}
\end{center}
Expand All @@ -119,8 +122,6 @@ \subsection{Spectrum-Based Fault Localization}
equation choices is further discussed in Related Works, however, this section
will give an overview of how each looks like.

% TODO: clearly define element here

\subsubsection{Tarantula}
\label{subsubsec:Tarantula}
\begin{figure}[!htb]
Expand Down Expand Up @@ -170,8 +171,6 @@ \subsubsection{DStar}
weight to \textbf{N$_{CF}$} and can be set to any number. However, the
researchers suggested that * is set to 2 or 3.

% TODO: create personal example and develop an explanation for it with
% individual examples of plugging in data
\subsection{SBFL in Action}
\label{subsec:SBFLinAction}

Expand All @@ -183,12 +182,12 @@ \subsection{SBFL in Action}
\end{figure}

With the discussed equations and techniques to calculate suspiciousness in mind,
the following example will demonstrate and discuss how AFLuent will utilize unit
the following example demonstrates and discusses how AFLuent utilizes unit
test and coverage data to locate faults in a program.
Figure \ref{fig:sbfl_example}
shows a sample python program to find the middle value
from three integers. The program contains a bug on line 9 where the wrong middle
number is detected. The figure also shows six different test cases that pass
from three integers. The program contains a bug on line 6 where the wrong maximum
value is detected. The figure also shows seven different test cases that send
various inputs to the function and check whether the actual output matches the
expected. The results of each test is found on the last row of the table.
Additionally, the large dots under the Input Tests column illustrate the concept
Expand All @@ -199,6 +198,19 @@ \subsection{SBFL in Action}
highlighted in warmer colors. Overall, all three equations are able to detect
that line 9 is the most suspicious and is likely the cause of the test failure.

The suspiciousness were calculated for each line by plugging values into the
equations shown on Figures \ref{fig:tarantulaEquation},
\ref{fig:ochiaiEquation}, and \ref{fig:dstarEquation}. For example, the scores
for line 5 were calculated as follows:

\begin{center}
\textbf{$Tarantula(5) = \frac{\frac{1}{1}}{\frac{6}{6} + \frac{1}{1}}$}

\textbf{$Ochiai(5) = \frac{1}{\sqrt{(1 + 0) \cdot (1 + 6)}} = \frac{1}{\sqrt{7}}$}

\textbf{$DStar(5) = \frac{1^3}{6 + 0}$}
\end{center}

\subsection{SBFL Criticism}
\label{subsec:Criticism}

Expand Down
11 changes: 6 additions & 5 deletions chapters/ch02_relatedwork.tex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ \section{Automated Fault Localization}
and reviews key literature that contributes show the benefits and drawbacks of
each approach.

% TODO: talk about the other lit review
Another insightful survey paper is by Idrees Sarhan et. al \cite{sarhan2022Challenges}
where he analyzes the main challenges in SBFL and some of
the major obstacles that other literature attempts to tackle. AFLuent addresses
two of the issues listed in this survey study, specifically element ties and
division by zero. But many other challenges such as test flakiness, single vs.
multiple bugs, and many others remain unaddressed.

\subsection{SBFL Approaches}
\label{subsec:sbfl}
Expand Down Expand Up @@ -320,7 +325,6 @@ \section{Existing Tools}
\end{center}
\end{figure}

% TODO: requires more expansion
\section{Usability and Accessibility}
\label{sec:usability_accessibility}

Expand Down Expand Up @@ -358,6 +362,3 @@ \section{Usability and Accessibility}
very valuable to incorporate in AFLuent, especially that AFLuent is only able to
conclude that there is an error and where it's possibly located. PABLO provides
another layer of fault localization that can only enhance the user experience.

% TODO: section about complexity metrics and tie breaking is needed with
% extensive literature review
9 changes: 5 additions & 4 deletions chapters/ch03_method.tex
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ \subsection{File Report}

Aside from the reports produced in the console, AFLuent can create report files
of the rankings in both JSON and CSV formats. Additional reporting of per-test
coverage is also possible. The command line arguments \code{-report} and
\code{-per-test-report} enable this feature. Producing these reports facilitates
coverage is also possible. The command line arguments \code{--report} and
\code{--per-test-report} enable this feature. Producing these reports facilitates
the evaluation of AFLuent by allowing the storage of rankings in a file for
further analysis later on. In general, the standard report contains the rankings
of the lines using the approach requested by the user. Additionally, other
Expand Down Expand Up @@ -696,7 +696,8 @@ \subsection{Cyclomatic Complexity}

One of the available ways to break ties between elements is to use cyclomatic
complexity as a secondary score to consider when sorting. This score is proposed
by McCabe \cite{cyclomatic_complexity} and can be easily calculated using the Radon library. It measures the number of available paths that execution
by McCabe \cite{cyclomatic_complexity} and can be easily calculated using the Radon library.
It measures the number of available paths that execution
cold go through in a function. Since this type of score only applies to whole
functions and not to individual elements, lines inherit the cyclomatic
complexity score of the function they live in when being ranked.Essentially, if
Expand All @@ -710,7 +711,7 @@ \subsection{Mutant Density: Logical Set}
\label{subsec:tiebreak_mutant_density_logical}

Another metric used to break ties between suspicious statements is mutant
density. More specifically, this score indicates how error prone the statement
density \cite{Parsai_2020}. More specifically, this score indicates how error prone the statement
is by calculating the number of all possible mutants. For example, a statement
that has many mathematical and logical operators to perform a calculation is
more error prone that a statement that only has one or two of these operations.
Expand Down
Binary file modified images/SFL_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/SFL_example2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 23 additions & 1 deletion preamble/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,26 @@ @INPROCEEDINGS{exam_scores
pages={42-51},
doi={10.1109/ICST.2008.65}}

@ARTICLE{cyclomatic_complexity, author={McCabe, T.J.}, journal={IEEE Transactions on Software Engineering}, title={A Complexity Measure}, year={1976}, volume={SE-2}, number={4}, pages={308-320}, doi={10.1109/TSE.1976.233837}}
@ARTICLE{cyclomatic_complexity, author={McCabe, T.J.}, journal={IEEE
Transactions on Software Engineering}, title={A Complexity Measure},
year={1976}, volume={SE-2}, number={4}, pages={308-320},
doi={10.1109/TSE.1976.233837}}

@article{sarhan2022Challenges,
title={A Survey of Challenges in Spectrum Based Software Fault Localization},
author={Sarhan, Qusay I and Besz{\'e}des, {\'A}rp{\'a}d},
journal={IEEE Access},
year={2022},
publisher={IEEE}
}

@inproceedings{Parsai_2020,
doi = {10.1145/3387940.3392210},
url = {https://doi.org/10.1145%2F3387940.3392210},
year = 2020,
month = {jun},
publisher = {{ACM}},
author = {Ali Parsai and Serge Demeyer},
title = {Mutant Density},
booktitle = {Proceedings of the {IEEE}/{ACM} 42nd International Conference on Software Engineering Workshops}
}

0 comments on commit 4b76de2

Please sign in to comment.