From 49d736cd80b7f8a02f3ccb2af38409576c8715e4 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Mon, 9 Dec 2019 22:37:46 +0000 Subject: [PATCH] final change --- Secciones/background.tex | 1 + Secciones/conclusion.tex | 16 +++++++++++++++- paper.tex | 18 ++++++++++++------ 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/Secciones/background.tex b/Secciones/background.tex index 4a0dc77..870e7a6 100644 --- a/Secciones/background.tex +++ b/Secciones/background.tex @@ -268,6 +268,7 @@ In our work we focus on the Java programming language, so in the following, we d \footnotetext{Only available from Java 7 onward. For more details, see \url{https://docs.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html} (retrieved November 2019).} \subsection{Exception handling in other programming languages} +\label{sec:exception-others} In almost all programming languages, errors can appear (either through the developer, the user or the system's fault), and must be dealt with. Most of the diff --git a/Secciones/conclusion.tex b/Secciones/conclusion.tex index b4a4dc8..4465e0c 100644 --- a/Secciones/conclusion.tex +++ b/Secciones/conclusion.tex @@ -5,4 +5,18 @@ \chapter{Conclusions} \label{cha:conclusion} -\carlos{todo: future work (implementacion, mejora de la correcteness para el try-catch), soluciones aportadas (problemas detectados de completitud, de correccion y generalizacion, propuesta solucion de las generalizaciones), valor de la tesis} \ No newline at end of file +Program slicing is a powerful technique to extract subsets of statements from a program, which behave as the original with respect to a slicing criterion. In the past four decades, different techniques have been proposed and matured, among which the system dependence graph is the most popular. The SDG has been implemented for various programming languages and paradigms, but it does not have a definitive complete and correct solution yet. + +Specifically, in the field of exception handling, there have not been significant advances since the beginning of the millennium \cite{AllH03}, as later works have made minimal progress without finding any errors in Allen's proposal. + +In this thesis, we show that the current treatment of exception handling constructs, such as \texttt{try-catch-finally} and \texttt{throw} is correct and complete only for some cases. We identify three distinct problems where the slices generated had lost correctness and completeness. We provide counter-examples to back up the problems, and generalize them to show the conditions necessary for them to surface. + +An important contribution of our work has been the solutions proposed for each of the problems identified. Each exchanges a small amount of performance for an improvement in correctness or completeness. The solutions have been proposed specifically for Java's exception handling system, but are valid for almost any other programming language with a similar exception system (which can be seen in detail on section \ref{sec:exception-others}). + +\section*{Future work} + +\begin{itemize} + \item Implementation of the solutions proposed, so that they can be benchmarked against the previous state of the art, and used to build better program slicers. The implementation could be done in Java or another language with a similar exception-catch system. The solutions that improve correctness at the price of slice speed could be implemented as optional for the user to execute, as to avoid increasing the slicing software's temporal complexity. + \item Improved correctness for the \texttt{try-catch} statement. The solution proposed in chapter~\ref{cha:solution} does solve the lack of completeness in the treatment of \texttt{catch} statements, at the cost of including many more \texttt{catch} statements that are really necessary. This is not the most desirable outcome, but it can be improved by developing and implementing the measures suggested at the end of the solution: make the inclusion of the \texttt{catch} statements conditional upon two dependencies instead of one and represent \texttt{catch} statements multiple times, so that the method calls that throw errors may be selectively included. + \item Redefinition or specialization of control dependence: the system dependence graph is centred around the definitions of control and data dependence. The meaning of control dependence has slowly shifted as more kinds of statements have been included in program slicing, but its definition has remained almost constant for three decades. Unconditional jumps and \texttt{catch} statements introduce a new kind of control dependence which is not the traditional ``$b$ is control dependent on $a$ if the execution of $a$ affects whether or not $b$ executes'', but ``the \textit{presence} of $a$ affects whether or not $b$ executes''. This constitutes a substantial change that has not been reflected, and is the source of many problems when handling both unconditional jumps and \texttt{catch} statements. +\end{itemize} \ No newline at end of file diff --git a/paper.tex b/paper.tex index f6b112a..ed967d1 100644 --- a/paper.tex +++ b/paper.tex @@ -76,7 +76,7 @@ \cleardoublepage \begin{abstract} - Program slicing is an analysis technique that can be applied to practically all programming languages. However, in the presence of exception handling, current program slicing software has a precision problem. This project tackles the problem of program slicing with exception handling, analysing the problem from a general perspective (for any kind of exception system), but focusing our efforts in the object-oriented paradigm, specifically the Java language. The solution is still general enough to be applicable to other paradigms and programming languages. + Program slicing is an analysis technique that can be applied to practically all programming languages. However, in the presence of exception handling, current program slicing software has a precision problem. This project tackles the problem of program slicing with exception handling, analysing the problem from a general perspective (for any kind of exception system), but focusing our efforts in the object-oriented paradigm, specifically the Java language. In this thesis, we study the currently available solutions to the problem, and we propose a generalization that includes at least the \texttt{try-catch} and \texttt{throw} statements. We provide detailed descriptions, generalizations and solutions for two problems that increase the size of slices and one problem that greatly reduces the precision of slices. The solutions we propose produce slices that guarantee completeness and are as correct as possible, given the restrictions set by the exception handling system. @@ -86,16 +86,22 @@ \selectlanguage{spanish} \begin{abstract} - + La fragmentación de programas es una técnica de análisis de programas que puede ser aplicada prácticamente a todos los lenguajes de programación. Sin embargo, en presencia de excepciones, los fragmentadores de programas tienen un problema de precisión. Este proyecto aborda el problema de la fragmentación de programas en presencia de excepciones, analizando el problema desde una perspectiva general (para cualquier tipo de sistema de excepciones), pero concentrando nuestros esfuerzos en el paradigma de la orientación a objetos, más específicamente en el lenguaje Java. + + En esta tesis, estudiamos las soluciones existentes al problema planteado, y proponemos una generalización que incluye por lo menos las instrucciones \texttt{try-catch} y \texttt{throw}. Damos descripciones detalladas, generalizaciones y soluciones a dos problemas que aumentan innecesariamente el tamaño de los fragmentos de programa y un problema que reduce bastante la precisión. + Las soluciones que proponemos producen fragmentos que garantizan la completitud y son tan correctos como es posible, dadas las restricciones marcadas por el sistema de manejo de excepciones. + + El análisis realizado y las soluciones propuestas son específicas para el lenguaje de programación Java y su sistema de manejo de excepciones, pero también son lo suficientemente generales como para poder ser empleadas en otros lenguajes de programación que posean un sistema de excepciones. También son específicas para la fragmentación estática hacia atrás, pero, del mismo modo, son compatibles con otras variantes en la fragmentación de programas. \end{abstract} \selectlanguage{catalan} \begin{abstract} - La fragmentaci\'o de programes es una t\`ecnica que pot ser aplicada practicament a qualsevol llenguatge de programaci\'o. No obstant aix\`o, en pres\`encia de tractament d'excepcions, el sofware actual de fragmentaci\'o de programes presenta problemes de precisi\'o. Aquest projecte aborda el problema de fracmentaci\'o de programes amb tractament d'excepcions, analitzant el problem des d'una perspectiva general (per a qualsevol tipus de sistema d'excepcions), per\`o centrant els nostres esfor\_os en un paradigma orientat a objectes, specificament per al llenguatge de programaci\'o Java. Tot i aix\'i, la soluci\'o es encara suficientment general com per a aplicarla a altres paradigmes i llenguatges de programaci\'o. + La fragmentaci\'o de programes es una t\`ecnica que pot ser aplicada practicament a qualsevol llenguatge de programaci\'o. No obstant aix\`o, en pres\`encia de tractament d'excepcions, el software actual de fragmentaci\'o de programes presenta problemes de precisi\'o. Aquest projecte aborda el problema de fracmentaci\'o de programes amb tractament d'excepcions, analitzant el problem des d'una perspectiva general (per a qualsevol tipus de sistema d'excepcions), per\`o centrant els nostres esforços en un paradigma orientat a objectes, specificament per al llenguatge de programaci\'o Java. Tot i aix\'i, la soluci\'o es encara suficientment general com per a aplicarla a altres paradigmes i llenguatges de programaci\'o. - En aquesta tesi, estudiem les actuals solucions disponibles per al problema, i proposem una generalitzaci\'o que inclueix al menys les instruccions \texttt{try-catch} i \texttt{throw}. Provei\sergio{esta i es con dieresis}m descripcions detallades, generalitzacions i solucions per a dos problemes que incrementen el tamany dels fragments de programa obtinguts i un problema que redueix enormement la precisi\'o dels fragments obtinguts. + En aquesta tesi, estudiem les actuals solucions disponibles per al problema, i proposem una generalitzaci\'o que inclueix al menys les instruccions \texttt{try-catch} i \texttt{throw}. Proveïm descripcions detallades, generalitzacions i solucions per a dos problemes que incrementen el tamany dels fragments de programa obtinguts i un problema que redueix enormement la precisi\'o dels fragments obtinguts. Les solucions que proposem produeixen fragments de programa que garanteixen completitut i que con el mes correctes posibles, donat el conjunt de restriccions del sistema de tractament d'excepcions. - Els an\`alisi realitzat i les solucions proposades son espec\'ifiques per al llenguatge de programaci\'o Java, pero son suficientment generals per a ser exportades sense esfor\_ a altres llenguatges de programaci\'o ambs un sistema de tractament d'excepcions similar. Les solucions tamb\'e son espec\'ifiques per a fragmentaci\'o de programes est\`atica cap arrare, pero son igualment compatibles amb altres variantes de la fragmentaci\'o de programes. + + Els an\`alisi realitzat i les solucions proposades son espec\'ifiques per al llenguatge de programaci\'o Java, pero son suficientment generals per a ser exportades sense esforç a altres llenguatges de programaci\'o ambs un sistema de tractament d'excepcions similar. Les solucions tamb\'e son espec\'ifiques per a fragmentaci\'o de programes est\`atica cap arrare, pero son igualment compatibles amb altres variantes de la fragmentaci\'o de programes. \end{abstract} \selectlanguage{english} @@ -124,7 +130,7 @@ % \end{itemize} \bibliographystyle{plain} -\bibliography{../../../../../Bibliografia/biblio.bib} +\bibliography{../../../../../../Biblio/biblio.bib} \end{document} % vim: set noexpandtab:ts=2:sw=2:wrap