Component design of retargetable program analysis tools that reuse intermediate representations (original) (raw)

Designing for Retargetability of a Program Analysis Tool by Reusing Intermediate Representations

1999

An interactive program analysis tool is most useful if it can be easily adapted to different source languages. How- ever, these tools are often tailored to one particular representation of programs, making adaptation to a new language costly. An inexpensive way of achieving adaptability is to introduce an intermediate abstraction—an adaptation layer—between an existing language representation and the program analysis tool that translates the tool's queries into queries on the particular representation. We experimented with this approach in making our StarTool program analysis tool retargetable. The approach proved successful, resulting in low-cost retargets for C, Tcl/Tk, and Ada. However, some unanticipated adjustments to the approach were required, providing insights for making a client retargetable. First, the adaptation layer exports two interfaces, a representation interface that supports queries on the represented program and a language interface that the client queries t...

A DSL for Reducing the Accidental Complexities of using Program Transformation Engines

2015

Many software evolution and maintenance problems can be addressed through techniques of program transformation. To facilitate development of language tools assisting software evolution and maintenance, we created a Domain-Specific Language (DSL), named SPOT (Specifying PrOgram Transformation), which can be used to raise the abstraction level of code modification. The design goal is to automate source-tosource program transformations through techniques of code generation, so that developers only need to specify desired transformations using constructs provided by the DSL while being oblivious to the details about how the transformations are performed. The paper provides a general motivation for using program transformation techniques and explains the design details of SPOT. In addition, we present a case study to illustrate how SPOT can be used to build a code coverage tool for applications implemented in different programming languages.

Re-targetability in software tools

Applied computing review, 1999

Software tool construction is a risky business, with uncertain rewards. Many tools never get used. This is a truism: software tools, however brilliantly conceived, well-designed, and meticulously constructed, have little impact unless they are actually adopted by real programmers. While there are no sure-fire ways of ensuring that a tool will be used, experience indicates that retargetability is an important enabler for wide adoption. In this paper, we elaborate on the need for retargetability in software tools, describe some mechanisms that have proven useful in our experience, and outline our future research in the broader area of inter-operability and retargetability.

CIRL/PIWI: A GUI toolkit supporting retargetability

Software: Practice and Experience, 1993

Writing applications that are easily moved to various computer platforms with different graphical user interfaces (GUIs) is a complex task. Yet this concept is important for the creator of commercial software, as it is not likely to be clear for many years whether one or two GUIs will survive and become industry 'standards' or whether the growth in GUIs will continue because of new developments in human-computer interfaces. Providing a user interface abstraction that maps into all toolkits seems to be an appropriate way to proceed, but is fraught with difficulty. For example, ditrerent GUIs present a different look-and-feel that often causes system-specific information to be embedded in an application. This paper surveys the problems inherent in designing a user interface abstraction, and describes the experiences gained from a specific implementation called CIRL/PIWI.* The user interface abstraction contains a knowledge base that allows many components of the user interface to be defined independent of look-and-feel thereby increasing the portability of an application. KEY WORDS Software User interfaces Languages Markup languages Retargetability User interface resources * CIRL and PIWI are acronyms for Coordinate Independent Resource Language and Presentation-Independent Windowed Interface.

An architecture for interoperable program understanding tools

2002

Program understanding tools are currently not interoperable, leading researchers to waste significant resources reinventing already existing tools. Even commercial environments that have been designed to support the construction of program understanding tools have serious flaws in this regard. This paper discusses CORUM (Common Objectbased Re-engineering Unified Model), an architecture to support interoperability between program understanding tools, and it provides several examples of CORUM's use in the construction of new tools for concept recognition and program visualization. 1 Introduction Many tools that support program understanding focus on extracting or visualizing code abstractions. These abstractions include design concepts, as in Map-CSP [53, 38],

A Language Processing Tool for Program Comprehension

2006

Program Comprehension is a Software Engineering discipline which aims to understand computer code written in a high-level programming language. Program Comprehension is useful for reuse, inspection, maintenance, reverse engineering and many other activities in the context of Software Engineering. In this paper we define a set of techniques to extract static and dynamic information from the target program. These techniques are based on the inclusion of inspection functions and control statements in the system's source code. The first are intended to show the functions actually used. The second are necessary to reduce the number of functions recovered for a better administration. We show a possible implementation of this approach using a language processor generator very useful and easy to use. Our strong motivation was to support the understanding of routing algorithms, available in EAR a routing algorithms evaluation system. To assist the program comprehension task, we generate different views that use the information extracted by our strategy, such as the routing algorithm output (that can be seen as a problem domain view), or the sequence of called functions, and their source and object code (examples of program domain views). Although specific, we intend to generalize this approach.

Example-based program transformation

Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 2008

Software changes. During their life cycle, software systems experience a wide spectrum of changes, from minor modifications to major architectural shifts. Small-scale changes are usually performed with text editing and refactorings, while large-scale transformations require dedicated program transformation languages. For medium-scale transformations, both approaches have disadvantages. Manual modifications may require a myriad of similar yet not identical edits, leading to errors and omissions, while program transformation languages have a steep learning curve, and thus only pay off for large-scale transformations. We present a system supporting example-based program transformation. To define a transformation, a programmer performs an example change manually, feeds it into our system, and generalizes it to other application contexts. With time, a developer can build a palette of reusable medium-sized code transformations. We provide a detailed description of our approach and illustrate it with examples.

Generation of visitor components that implement program transformations

ACM SIGSOFT Software Engineering Notes, 2001

The visitor pattern is appealing to developers of program-analysis tools because it separates the design of the data structures that represent a program from the design of software that traverses these structures. Unfortunately, the visitor pattern is difficult to apply when the analysis involves transformation logic that involves multiple program fragments simultaneously. We encountered this problem in our work on the Amalia project and discovered a novel way to use multiple cooperating visitor objects to systematically implement such functions when they are specified via a set of transformation rules. This paper introduces our curried-visitor framework and illustrates how we applied it to implement a key component in the Amalia framework. We are working on a code generator that will automatically synthesize curried-visitor frameworks from a description of a program's abstract syntax and a set of patternmatching transformation rules.

An integrated environment for reuse reengineering C code

1998

The paper presents an integrated environment implemented in Prolog for reuse reengineering existing C systems. Different tools developed in the RE2 project are integrated in the environment through sharing a fine-grained representation for C programs, the Combined C Graph (CCG). Different views of a system can be abstracted and visualised from the data-base of Prolog facts implementing its CCG representation.