10.07.2015 Views

Enhancing Source-Level Programming Tools with An Awareness of ...

Enhancing Source-Level Programming Tools with An Awareness of ...

Enhancing Source-Level Programming Tools with An Awareness of ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

the changes in data values and code location. A significantamount <strong>of</strong> research aims at the problem <strong>of</strong> debugging optimizedcode [20, 21, 7, 27, 16, 9, 18]. The proposed solutionsenable source-level debuggers to display the informationabout an optimized program, as if the original (unoptimized)version <strong>of</strong> the code was being debugged.The techniques for debugging optimized code deal <strong>with</strong>the challenges arising as a result <strong>of</strong> optimizing compilerstransforming intermediate code to improve performance.While these transformations can be quite extensive, theyare usually confined to method bodies and do not alterthe debugged program’s semantics. By contrast, structuralenhancement aims at larger-scale program transformationsthat can add new classes and interfaces to a program. Thus,source level debugging <strong>of</strong> structurally enhanced programsrequires different debugging techniques such as the presentedsymbolic undo.Debugging for AOP. Aspect-Oriented <strong>Programming</strong>(AOP) [24] can be viewed as an enhancement technology,and several approaches aim at debugging support forAOP [14, 34, 22]. However, debugging aspect-oriented programsis different from debugging transparently enhancedprograms. AOP provides a domain-specific language forprogramming enhancements such as AspectJ [23], and anAOP debugger traces the bytecode generated by AspectJ toits aspect source file. By contrast, transparent bytecode enhancementshave no source code representation. Thus, theapproaches to debugging AOP s<strong>of</strong>tware cannot be applied todebugging transparently enhanced programs.In addition, AspectJ as a language cannot express all thestructural enhancement transformations. For example, it isimpossible to express in AspectJ that the name <strong>of</strong> a programconstruct (e.g., class, field, or method) be changed. AspectJdoes not provide facilities for removing a program construct,something that program enhancers need to do on a regularbasis. For example, the split class enhancement movesfields from a class to another class, thus removing them fromthe original class. Finally, program enhancers <strong>of</strong>ten generatenew classes and interfaces and reference them in the enhancedprogram. AspectJ is not designed for expressing howto generate a new class, whose structure is based on some existingprogram construct. Thus, we could not have used AspectJinstead <strong>of</strong> SER to represent structural enhancements.5.2 Program Transformation LanguagesSER is a domain-specific language for expressing how bytecodeis enhanced structurally. Other domains also featuredomain-specific languages for expressing program transformations.JunGL [48], a domain-specific language for refactoring,combines functional and logic query language idioms.JunGL represents programs as graphs and manipulates refactoringsvia graph transformations. The language providespredicates to facilitate the querying <strong>of</strong> graph structures.JunGL uses demand-driven evaluation to prevent scriptsfrom becoming prohibitively complex.Sittampalam et al. [39] specify program transformationsdeclaratively and generate executable program transformersfrom specifications. The Prolog language is augmented <strong>with</strong>facilities for incremental evaluation <strong>of</strong> regular path queries.The augmented language is used to specify program transformationsby expressing a program and its transformedcounterpart. The transformations can be combined <strong>with</strong> astrategy script, based on Stratego [49], to specify the traversals<strong>of</strong> a program and the order <strong>of</strong> the transformations.Whitfield and S<strong>of</strong>fa’s code-improving transformationframework consists <strong>of</strong> a case tool and a specification language[50]. The specification language, called Gospel, declaresprogram transformations; the case tool, called Genesis,generates a program transformer given a Gospel specification.A Gospel script consists <strong>of</strong> a declaration section,containing variables declarations, a precondition section,containing code pattern descriptions and control dependenceconditions, and an action section, containing a set <strong>of</strong> transformationoperations.The Coccinelle [41] tool introduces the SmPL languagefor locating and automatically fixing bugs. SmPL programsspecify how in response to some runtime condition, a programshould be transformed to fix a bug and log the changes.FSMLs [10] is a domain specific modeling language fordescribing the framework-provided knowledge, includingframework instantiation, procedures for implementing interfaces,and proper usage <strong>of</strong> framework services. FSMLsbears similarity to our approach in its ability to provide a bidirectionalmapping between framework features and theirabstract representation.JAVACOP [1] introduces a declarative rule languagefor expressing programmer-defined types, called pluggabletypes. The types are described as user-defined rules, whichJAVACOP uses for transforming the abstract syntax tree <strong>of</strong> aprogram.Because these program transformation languages weredesigned specifically for their respective domains, we couldnot have used any <strong>of</strong> them for our purposes. The main designgoal <strong>of</strong> our SER language was to be able to expressstructural enhancements used by bytecode enhancers declarativelyand to provide special constructs for domain-specifictransformations such as adding getter/setter methods.5.3 Program DifferencingSER scripts describe generalized structural program differences.Program differencing is an active research area andseveral new differencing algorithms have been proposed recently.Previtali et al.’s technique [35] generates version differences<strong>of</strong> a class at bytecode level. Their algorithm producesthe information on added, removed, or modified classes.Dmitriev incorporates program change history into a Javamake utility that selectively recompiles dependent sourceAccepted to OOPSLA 2009 14 2009/5/14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!