Object-oriented program slicing - Law, Chun Hung Roberts (ProQuest Dissertations & Theses, 1994)
In academic environments, little lecture time is devoted to debugging. Similarly, training in program debugging is rarely found in the industrial environment. Programmers often find debugging to be a difficult and slow process. Traditional debugging methods include desk reviewing the source code, dynamic tracing with display statements, and ad hoc testing with various inputs. However, programmers are flooded with program entities which are irrelevant to the incorrect behaviour of a program. This problem gets worse as program size grows. In other words, the unrelated information in a program often distracts the programmer from locating a bug during the debugging process. Program slicing is a fault localization technique introduced by Weiser (Weis82, Weis84). The application of program slicing to a computer program can generate a portion of code (called a 'slice') which contains a subset of the original program statements. The statements in a slice are chosen to be relevant to the computation of a particular variable. Studies have demonstrated that program slicing can assist a programmer in locating a bug (Weis84, Lyle84, and Law93). Although object-oriented programming is becoming very popular, there is an absence of effective fault localization tools for object-oriented programming systems. The goal of this dissertation is to investigate the feasibility of incorporating program slicing into object-oriented programming. The concept of Object-Oriented Program Slicing is introduced in this dissertation. Based on this concept, we developed a high level debugging tool called UR$\sb-$OOPS (University of Regina Object-Oriented Program Slicer). UR$\sb-$OOPS can analyze a C++ program and perform a rapid computation of an object-oriented slice with respect to a particular class. This object-oriented slice helps a programmer locate the fault which causes the incorrect behaviour of an instance of a specific class. In this dissertation, the concept of Leaner Object-Oriented Slicing is also introduced in order to perform extra code reduction from an object-oriented slice. This concept was implemented in UR$\sb-$OOPS as well. This concept is important as it further reduces the amount of information that a programmer must examine. UR$\sb-$OOPS is evaluated in two separate but related experiments with human subjects in this dissertation. The evaluations were performed by comparing the debugging performance between visual debugging and debugging using UR$\sb-$OOPS. Experimental results indicate that using UR$\sb-$OOPS for debugging is faster than using visual debugging. Additionally, UR$\sb-$OOPS provides improved assistance to programmers with larger programs in the context of fault localization.