If the following program is sliced \josep{aqui podria colar no decir qué algoritmo usas (el de Horwitz, con su cita), pero en el paper no colará. Ponlo ya, no hace falta que lo expliques aún, pero así eres preciso.}\added{with respect to}\deleted{in}\added{(}line 17, variable \texttt{x}\added{)}, the
slice is incomplete, as it lacks the \texttt{catch} block from lines 4-6.
\label{exa:program-slicing2}
\begin{center}
\begin{minipage}{0.49\linewidth}
\begin{lstlisting}[stepnumber=1]
void f(int x) {
try {
g(x);
} catch (RuntimeException e) {
System.err.println("Error");
}
System.out.println("g() was ok");
g(x);
}
void g(int x) {
if (x < 0) {
throw new RuntimeException();
}
System.out.println(x);
}
\end{lstlisting}
\end{minipage}
\begin{minipage}{0.49\linewidth}
\begin{lstlisting}[stepnumber=1]
void f(int x) {
try {
g(x);
}
g(x);
}
void g(int x) {
if (x < 0) {
throw new RuntimeException();
}
System.out.println(x);
}
\end{lstlisting}
\end{minipage}
\end{center}
\end{example}
2019-11-18 14:49:48 +01:00
\josep{Explicar mejor el ejemplo. Ser generoso dando detalles, la ejecución, la diferencia, incluso el grafo de dependencias si hace falta... El motivating example es la parte mas importante de un paper. :-) Determina si van a seguir leyendote o no.}
\added{If we consider the initial call {\tt f(0)}, then the execution history of the initial program is:
{\tt 1,2,3,13,14,15,4,5,6,7,8,9,10,13,14,15} (line 17 is never executed and {\tt f} returns with an exception).
In contrast, the execution of the slice is:
{\tt 1,2,3,13,14,15} (line 17 is never executed and {\tt f} returns with an exception).}
\josep{Si no me he equivocado con esto anterior, este es un mal ejemplo, porque no se ejecuta el CS en ninguno de los dos programas (luego son equivalentes con respecto a ese punto con la informacion que das)}
\josep{Lo siguiente me suena raro (el ingles). De hecho, no aparece ni una ocurrencia en Google. Reescribelo, please. Es dificil de entender.}As big a problem as this one is, it \added{does not}\deleted{doesn't} occur in all cases, because of how
As most slicing tools ignore side effects and focus exclusively on the code and
some \texttt{catch} blocks are erroneously removed, which leads to incomplete
slices, which end with an error that is normally caught.
\section{Contributions}
2019-11-18 14:49:48 +01:00
The main contribution of this paper is a complete \added{technique}\deleted{solution} for program slicing
in the presence of exception handling constructs for Java\added{. This technique extends the previous technique by Hortwitz et al. \cite{pending}. It considers all cases considered in that work, but it also provides a solution to cases not considered by them.}
\added{For the sake of completeness and in order to understand the process that leaded us to this solution, firstly,} we
will \added{briefly} present a history of program slicing, specifically those changes that