5 research outputs found

    Chopping: A generalization of slicing

    Get PDF
    A new method for extracting partial representations of a program is described. Given two sets of variable instances, source and sink, a graph is constructed showing the statements that cause definitions of source to affect uses of sink. This criterion can express a wider range of queries than the various forms of slice criteria, which it subsumes as special cases. On the standard slice criterion (backward slicing from a use or definition) it produces better results than existing algorithms. The method is modular. By treating all statements abstractly as def-use relations, it can present a procedure call as a simple statement, so that it appears in the graph as a single node whose role may be understood without looking beyond the context of the call

    A survey of program slicing techniques

    Get PDF

    A program slicing method for a wide spectrum language

    Get PDF
    This thesis describes the implementation of a program slicer for WSL - a Wide Spectrum Language - which is a language that allows different levels of abstraction to coexist in the same program. WSL contains constructs not found in conventional languages, e.g. action systems (which model a segment of code with GOTOs and labels) and non deterministic constructs. Program slicing is a method for restricting a program to a specified behaviour of interest. Usually this behaviour of interest is expressed in terms of a variable or a set of variables. The method used in the thesis to slice a program is different from the classical ones in that slices do not need to be computed from an output statement, and in that slices are computed on a wide spectrum language closer to a functional language, instead of being computed on a more conventional, procedural language. A slicer for a subset of WSL has been designed and implemented based on the data flow analysis techniques for while-programs of Bergeretti and Carré [10]. It has been necessary to modify the algorithm to permit incremental slicing. Modifications of their algorithm were also needed to accommodate the specific WSL constructs mentioned above. The implementation has been developed using a rapid prototyping approach. The prototype has provided new ideas and enhancements for a more comprehensive sheer which could be implemented in the future. The slicer has assisted the maintainer using ReForm - a reverse engineering project developed at Durham University - in understanding and debugging a program by decomposing it. At the end of this thesis results showing how slicing has helped the maintainer are presented. Conclusions on the method used, the validity of the tool, and its engineering are also summarized

    Inter-module code analysis techniques for software maintenance

    Get PDF
    The research described in this thesis addresses itself to the problem of maintaining large, undocumented systems written in languages that contain a module construct. Emphasis is placed on developing techniques for analysing the code of these systems, thereby helping a maintenance programmer to understand a system. Techniques for improving the structure of a system are presented. These techniques help make the code of a system easier to understand. All the code analysis techniques described in this thesis involve reasoning with, and manipulating, graphical representations of a system. To help with these graph manipulations, a set of graph operations are developed that allow a maintenance programmer to combine graphs to create a bigger graph, and to extract subgraphs from a given graph that satisfy specified constraints. A relational database schema is developed to represent the information needed for inter-module code analysis. Pointers are given as to how this database can be used for inter-module code analysis

    A combined representation for the maintenance of C programs

    Get PDF
    A programmer wishing to make a change to a piece of code must first gain a full understanding of the behaviours and functionality involved. This process of program comprehension is difficult and time consuming, and often hindered by the absence of useful program documentation. Where documentation is absent, static analysis techniques are often employed to gather programming level information in the form of data and control flow relationships, directly from the source code itself. Software maintenance environments are created by grouping together a number of different static analysis tools such as program sheers, call graph builders and data flow analysis tools, providing a maintainer with a selection of 'views' of the subject code. However, each analysis tool often requires its own intermediate program representation (IPR). For example, an environment comprising five tools may require five different IPRs, giving repetition of information and inefficient use of storage space. A solution to this problem is to develop a single combined representation which contains all the program relationships required to present a maintainer with each required code view. The research presented in this thesis describes the Combined C Graph (CCG), a dependence-based representation for C programs from which a maintainer is able to construct data and control dependence views, interprocedural control flow views, program slices and ripple analyses. The CCG extends earlier dependence-based program representations, introducing language features such as expressions with embedded side effects and control flows, value returning functions, pointer variables, pointer parameters, array variables and structure variables. Algorithms for the construction of the CCG are described and the feasibility of the CCG demonstrated by means of a C/Prolog based prototype implementation
    corecore