From 578e52aa0b1def5ba33f32ea5c153da9f95a8081 Mon Sep 17 00:00:00 2001 From: Josep Silva Date: Tue, 3 Dec 2019 23:18:52 +0000 Subject: [PATCH] --- Secciones/motivation.tex | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Secciones/motivation.tex b/Secciones/motivation.tex index 42df18f..a673802 100644 --- a/Secciones/motivation.tex +++ b/Secciones/motivation.tex @@ -67,13 +67,13 @@ settings. \sergio{Inside all this slicing problems, there is } An area that has been investigated, \sergio{but? (por evitar el yet ... yet)}yet does not have a definitive solution yet\sergio{,} \deleted{is}\josep{el is no hay que borrarlo} exception handling. Example~\ref{exa:program-slicing2} -demonstrates how, even using the latest developments in \sergio{exception handling slicing }program +demonstrates\josep{shows} how, even using the latest developments \josep{to handle exceptions in} in \sergio{exception handling slicing }program slicing~\cite{AllH03}, the sliced version does not include the catch block \sergio{this approach is not able to include the catch block in the obtained slice}, and therefore does not produce a correct slice. \begin{example}[Program slicing with exceptions] - \added{Consider}\deleted{If} the following program \deleted{is} sliced using Allen and Horwitz's proposal~\cite{AllH03} with respect to (line 17, variable \texttt{a})\added{. As can be appreciated, t}\deleted{, t}he - slice is incomplete, as it lacks the \texttt{catch} block from lines 4-6. + \added{Consider}\deleted{If} the following program \josep{on the left that has been sliced (on the right) using}\deleted{is} sliced using Allen and Horwitz's proposal~\cite{AllH03} with respect to (line 17, variable \texttt{a})\added{. As \josep{it} can be appreciated, t}\deleted{, t}he + slice is incomplete, \josep{because}as it lacks the \texttt{catch} block from lines 4-6. \label{exa:program-slicing2} \begin{center} \begin{minipage}{0.49\linewidth} @@ -123,29 +123,31 @@ void g(int a) throws Exception { \end{center} \sergio{Captions? para referirnos a ellas por separado como programa original (izquierda) y slice (derecha)?. Indicar en ella el SC en negrita en el codigo o de otro color o algo para destacarlo.} - When the program is executed as \texttt{f(0)}, the execution log \sergio{hay que decir que esto es la lista de instrucciones que se ejecutan y en el orden en el que lo hacen.} would be: \texttt{1, 2, 3, 13, 14, 15, 4, 5, 8, 10, 13, 14, 17}. In the only execution of line \texttt{17}, variable \texttt{a} has value 1 in that line. However, in the slice produced, the execution log is \texttt{1, 2, 3, 13, 14, 15}. The exception thrown in \texttt{g()} is not caught in \texttt{f()}, so it returns with an exception and line \texttt{17} never executes. + When the program is executed \josep{from the call}as \texttt{f(0)}, the execution log \sergio{hay que decir que esto es la lista de instrucciones que se ejecutan y en el orden en el que lo hacen.}\josep{en program slicing se llama execution history, y puedes poner una cita a Corel y Lasky} would be: \texttt{1, 2, 3, 13, 14, 15, 4, 5, 8, 10, 13, 14, 17}. In the only execution of line \texttt{17}, variable \texttt{a} has value 1 in that line. However, in the slice produced, the execution log is \texttt{1, 2, 3, 13, 14, 15}. The exception thrown in \texttt{g()} is not caught in \texttt{f()}, so it returns with an exception and line \texttt{17} never executes. - The problem in this example is that the \texttt{catch} block in line \texttt{4} is not included, because ---according to the dependency graph shown below--- it does not influence the execution of line \texttt{17}. Two kinds of dependencies among statements are considered: data dependence (a variable is read that may have gotten its value from a given statement) and control dependence (the instruction controls whether another executes). - In the graph, the slicing criterion is marked in bold, the nodes that represent the slice are filled in grey, and dependencies are displayed as edges, with control dependencies in black and data dependencies in red. Nodes with a dashed outline represent elements that are not statements of the program. + The problem in this example is that the \texttt{catch} block in line \texttt{4} is not included, because ---according to the dependency graph \josep{computed by \cite{} and} shown \josep{in Figure~\ref{}}below--- it does not influence the execution of line \texttt{17}. Two kinds of dependencies among statements are considered: data dependence (a variable is read that may have gotten its value from a given statement) and control dependence (\josep{an} the instruction controls whether another \josep{instruction} executes). + In the graph, the \josep{node associated with the} slicing criterion is marked in bold, the nodes that represent the slice are filled in grey\josep{demasiado clarito. En mi ordenador no se ve}, and dependencies are displayed as edges, with control dependencies in black and data dependencies in red. Nodes with a dashed outline represent elements that are not statements of the program. \begin{center} \includegraphics[width=\linewidth]{img/motivation-example-pdg} + \josep{transforma todas las figuras en figuras reales (referenciables) y con caption} + \josep{Yo ver\'ia m\'as claro el grafo conectando llamada y llamado} \end{center} \end{example} -Example~\ref{exa:program-slicing2} showcases an important error in the current slicing procedure for programs that handle errors with exceptions; because the \texttt{catch} block is disregarded. The only way a \texttt{catch} block can be included in the slice is if a statement inside it is needed for another reason. However, Allen and Horwitz did not encounter this problem in their paper~\cite{AllH03}, as the values outputted by method calls are extracted after the \texttt{normal return} and each \texttt{catch}, and in a typical method call with output, the \texttt{catch} is included by default when the outputted value is used. This detail makes the error much smaller, as most \texttt{try-catch} structures are run to obtain a value. \sergio{Anyadir el nodo \textit{out} para que lo que has explicado aqui quede mas comprensible. Viendo que existe el nodo \textit{out}, pero que nadie el SC no lo necesita.} +Example~\ref{exa:program-slicing2} \josep{is a contribution of this work because it} showcases an important error in the current slicing procedure for programs that handle errors with exceptions\josep{\deleted{; because}\added{where}} the \texttt{catch} block is disregarded. The only way a \texttt{catch} block can be included in the slice is if a statement inside it is needed for another reason. However, Allen and Horwitz did not encounter\josep{tackle? account for?} this problem in their paper~\cite{AllH03}, as the values outputted by method calls are extracted after the \texttt{normal return} and each \texttt{catch}, and in a typical method call with output, the \texttt{catch} is included by default when the outputted value is used. This detail makes the error much smaller, as most \texttt{try-catch} structures are run to obtain a value. \sergio{Anyadir el nodo \textit{out} para que lo que has explicado aqui quede mas comprensible. Viendo que existe el nodo \textit{out}, pero que nadie el SC no lo necesita.} -\added{There is also another }\deleted{A} notable case where a method that may throw an exception is run and no value is recovered (at least from the point of view of program slicing)\added{. It occurs}\deleted{is} when writing to the filesystem or making connections to servers, such as a database or a webservice to store information. In this case, if no confirmation is outputted signaling whether the storage of information was correct, the \texttt{catch} block \deleted{will be}\added{is} omitted, and the slicer software \deleted{will} produce\added{s} an incorrect result. +\added{There is also another }\deleted{A} notable case where a method that may throw an exception is run and no value is recovered (at least from the point of view of program slicing)\added{. It occurs}\deleted{is} when writing to the filesystem or making connections to servers, such as a database or a webservice to store information. In this case, if no confirmation is outputted signaling whether the storage of information was correct, the \texttt{catch} block \deleted{will be}\added{is} omitted, and the \josep{program} slicer \josep{\deleted{software}} \deleted{will} produce\added{s} an incorrect result. \section{Contributions} -The main contribution of this paper\sergio{paper?research?work?} is a -\added{new approach for program slicing with exception handling for Java programs.} \deleted{complete technique for program slicing programs in the presence of exception handling constructs for Java}. \added{Our approach}\deleted{This technique} extends the previous technique \added{proposed} by Allen et al. \cite{AllH03}. It \added{is able to properly slice}\deleted{considers} all cases considered in \deleted{that}\added{their} work, but it also provides a solution to \sergio{some other} cases not \deleted{considered}\added{contemplated} by them. +The main contribution of this paper\sergio{paper?research?work?}\josep{work o research} is a +\added{new approach for program slicing with exception handling for Java programs.} \deleted{complete technique for program slicing programs in the presence of exception handling constructs for Java}. \added{Our approach}\deleted{This technique} extends the previous technique \added{proposed} by Allen et al. \cite{AllH03}. It \added{is able to properly slice}\deleted{considers} all cases considered in \deleted{that}\added{their} work, but it also provides a solution to \sergio{some other} cases not \deleted{considered}\added{contemplated}\josep{considered} by them. -For the sake of completeness and in order to understand the process that leaded us to this solution, we will present a brief history\sergio{background?} of program slicing \added{terminology}, specifically those changes that have affected exception handling.\sergio{delving deeper in the progress of program slicing techniques related to exception handling.?} Furthermore, we provide a summary of the +For the sake of completeness and in order to understand the process that leaded us to this solution, we \josep{\deleted{will present}\josep{first summarize the fundamentals o background}} a brief history\sergio{background?} of program slicing \added{terminology}, specifically those changes that have affected exception handling.\sergio{delving deeper in the progress of program slicing techniques related to exception handling.?} Furthermore, we provide a summary of the different contributions each author has made to the field. -The rest of the paper is structured as follows: chapter~\ref{cha:background} summarizes the theoretical background required in program slicing and exception handling, chapter~\ref{cha:incremental} will analyze each structure used in exception handling, explore the already available solution and propose a new technique that subsumes all of the existing solutions and provides correct slices for each case. -Chapter~\ref{cha:state-art} provides a bird's eye view of the current state of the art, chapter~\ref{cha:solution} provides a summarized description of the new algorithm with all the changes proposed in chapter~\ref{cha:incremental}, and finally, chapter~\ref{cha:conclusion} summarizes the paper\sergio{work?} and explores future avenues of work\sergio{possible improvements?}. +The rest of the paper is structured as follows: chapter~\ref{cha:background} summarizes the theoretical background required in program slicing and exception handling, chapter~\ref{cha:incremental} \josep{analyzes}will analyze each structure used in exception handling, explore\josep{s} the already available solution and propose\josep{s} a new technique that subsumes all of the existing solutions and provides correct slices for each case.\josep{frase demasiado larga} +Chapter~\ref{cha:state-art} provides a bird's eye view of the current state of the art, chapter~\ref{cha:solution} provides a summarized description of the new algorithm with all the changes proposed in chapter~\ref{cha:incremental}, and finally, chapter~\ref{cha:conclusion} \josep{concludes?}summarizes the paper\sergio{work?} and explores future avenues of work\sergio{possible improvements?}. % vim: set noexpandtab:tabstop=2:shiftwidth=2:softtabstop=2:wrap