Font Size: a A A

Research On Java Program Slicing With Exception-handling Constructs

Posted on:2006-01-28Degree:MasterType:Thesis
Country:ChinaCandidate:P F WangFull Text:PDF
GTID:2168360155962100Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
Program slicing is a technique which can be used to analyze and understand a program. By analyzing dependence relations of statements, it can decompose the source program automatically. Program slicing has many applications in software engineering such as program understanding, debugging, maintenance, testing and reverse engineering. Java System Dependence Graph (JSDG) represents a Java program, in which vertices represent statements and predicates, and edges represent control and data dependences. Slices can be computed efficiently using the JSDG.Exception is a kind of specific object for error handling in Java, which is created when errors occur and also provides a mechanism of "try/catch/finally" to throw out, detect and handle run-time errors. Current program-slicing algorithms do not correctly and efficiently deal with exception-handling constructs, because they do not account for the additional control and data dependences introduced by exceptions.In this paper, we discuss the effects of exception occurrences and exception-handling constructions on the data and control dependences of a program and present a new approach to deal with exception-handling constructions. The new approach treats try/catch/finally block as a method and treats the callsite that may throw out an exception object as a predicate. Thus, the approach can represent the additional data and control dependence introduced by exception-handling constructions and construct JSDG of the Java program with exception-handling constructions. This paper also presents another approach to deal with exceptions; that is to add a normal-exit node for every method and to add exception-exit nodes for every method that may throw out exception objects, to add a normal-return node for every callsite and to add exit-return node for the callsite that may throw out or accept exception objects. This approach also treats return nodes of those callsites that may receive exception objects as predicates. The JSDG is more precise than the former using this approach. Then this paper provides a series of proper and relevant algorithms to construct JSDG.This paper also presents a framework for program analysis that can analyze a common program for Java language, which generates Java grammar parser and visitor using JavaCC and JTB tools and performs the information abstract from Java source programs. We also define a series of hierarchy class constructs to preserve the information of programs. What's more, those class constructs can preserve the hierarchy and organization of the original program including the relation between two classes, the relation between a class and its methods, the relation between a method and...
Keywords/Search Tags:software analysis, data dependence, control dependence, system dependence, exception handling, control flow, data flow, program slicing
PDF Full Text Request
Related items