16 research outputs found

    Program Analysis Scenarios in Rascal

    Get PDF
    Rascal is a meta programming language focused on the implementation of domain-specific languages and on the rapid construction of tools for software analysis and software transformation. In this paper we focus on the use of Rascal for software analysis. We illustrate a range of scenarios for building new software analysis tools through a number of examples, including one showing integration with an existing Maude-based analysis. We then focus on ongoing work on alias analysis and type inference for PHP, showing how Rascal is being used, and sketching a hypothetical solution in Maude. We conclude with a high-level discussion on the commonalities and differences between Rascal and Maude when applied to program analysis

    Towards Multilingual Programming Environments

    Get PDF
    Software projects consist of different kinds of artifacts: build files, configuration files, markup files, source code in different software languages, and so on. At the same time, however, most integrated development environments (IDEs) are focused on a single (programming) language. Even if a programming environment supports multiple languages (e.g., Eclipse), IDE features such as cross-referencing, refactoring, or debugging, do not often cross language boundaries. What would it mean for programming environment to be truly multilingual? In this short paper we sketch a vision of a system that integrates IDE support across language boundaries. We propose to build this system on a foundation of unified source code models and metaprogramming. Nevertheless, a number of important and hard research questions still need to be addressed

    Large-scale semi-automated migration of legacy C/C++ test code

    Get PDF
    This is an industrial experience report on a large semi-automated migration of legacy test code in C and C++. The particular migration was enabled by automating most of the maintenance steps. Without automation this particular large-scale migration would not have been conducted, due to the risks involved in manual maintenance (risk of introducing errors, risk of unexpected rework, and loss of productivity). We describe and evaluate the method of automation we used on this real-world case. The benefits were that by automating analysis, we could make sure that we understand all the relevant details for the envisioned maintenance, without having to manually read and check our theories. Furthermore, by automating transformations we could reiterate and improve over complex and large scale source code updates, until they were “just right.” The drawbacks were that, first, we have had to learn new metaprogramming skills. Second, our automation scripts are not readily reusable for other contexts; they were necessarily developed for this ad-hoc maintenance task. Our analysis shows that automated software maintenance as compared to the (hypothetical) manual alternative method seems to be better both in terms of avoiding mistakes and avoiding rework because of such mistakes. It seems that necessary and beneficial source code maintenance need not to be avoided, if software engineers are enabled to create bespoke (and ad-hoc) analysis and transformation tools to support it

    High-fidelity metaprogramming with separator syntax trees

    Get PDF
    Many metaprogramming tasks, such as refactorings, automated bug fixing, or large-scale software renovation, require high-fidelity source code transformations-transformations which preserve comments and layout as much as possible. Abstract syntax trees (ASTs) typically abstract from such details, and hence would require pretty printing, destroying the original program layout. Concrete syntax trees (CSTs) preserve all layout information, but transformation systems or parsers that support CSTs are rare and can be cumbersome to use. In this paper we present separator syntax trees (SSTs), a lightweight syntax tree format, that sits between AST and CSTs, in terms of the amount of information they preserve. SSTs extend ASTs by recording textual layout information separating AST nodes. This information can be used to reconstruct the textual code after parsing, but can largely be ignored when implementing high-fidelity transformations. We have implemented SSTs in Rascal, and show how it enables the concise definition of high-fidelity source code transformations using a simple refactoring for C++

    Static, lightweight includes resolution for PHP

    Get PDF
    International audienceDynamic languages include a number of features that are challenging to model properly in static analysis tools. In PHP, one of these features is the include expression, where an arbitrary expression provides the path of the file to include at runtime. In this paper we present two complementary analyses for statically resolving PHP includes, one that works at the level of individual PHP files and one targeting PHP programs, possibly consisting of multiple scripts. To evaluate the effectiveness of these analyses we have applied the first to a corpus of 20 open-source systems, totaling more than 4.5 million lines of PHP, and the second to a number of programs from a subset of these systems. Our results show that, in many cases, includes can be either resolved to a specific file or a small subset of possible files, enabling better IDE features and more advanced program analysis tools for PHP

    Parsing for agile modeling

    Get PDF
    In order to analyze software systems, it is necessary to model them. Static software models are commonly imported by parsing source code and related data. Unfortunately, building custom parsers for most programming languages is a non-trivial endeavour. This poses a major bottleneck for analyzing software systems programmed in languages for which importers do not already exist. Luckily, initial software models do not require detailed parsers, so it is possible to start analysis with a coarse-grained importer, which is then gradually refined. In this paper we propose an approach to "agile modeling" that exploits island grammars to extract initial coarse-grained models, parser combinators to enable gradual refinement of model importers, and various heuristics to recognize language structure, keywords and other language artifacts

    Vues et transformations de programmes pour la modularité des évolutions

    Get PDF
    La maintenance consomme une grande partie du coût de développement des logiciels ce qui rend l optimisation de ce coût parmi les enjeux importants dans le monde du génie logiciel. Dans cette thèse nous visons à optimiser ce coût par rendre ces maintenances modulaires. Pour atteindre cet objectif, nous définissons des transformations des architectures des programmes qui permettent de transformer le programme à maintenir vers une architecture qui facilite la tâche de maintenance voulue. Nous nous concentrons plus sur la transformation entre les architectures à propriétés de modularité duales tels que les patrons de conception Composite et Visiteur. Dans ce contexte, nous définissons une transformation automatique et réversible basée sur le refactoring entre un programme structuré selon le Composite et sa structureVisiteur correspondante. Cette transformation est validée par la génération d une précondition qui garantit statiquement sa réussite. Elle est aussi adaptée afin qu elle prenne en compte la transformation de quatre variations du patron Composite et est validée sur le programme JHotDraw qui comporte ces quatre variations. Nous définissons aussi une transformation réversible au sein du patron Singleton afin de pouvoir bénéficier de l optimisation par l introduction de ce patron et la souplesse par sa suppression selon les exigences de l utilisateur du logiciel.Maintenance consumes a large part of the cost of software development which makes the optimization of that cost among the important issues in the world of software engineering. In this thesis we aim to optimize this cost by making these maintenances modular. To achieve this goal, we define transformations of program architectures that allow to transform a program to maintain into an architecture that facilitates the maintenance tasks required. We focus on transformation between architectures having dual modularity properties such as Composite and Visitor designpatterns. In this context, we define an automatic and reversible transformation based on refactoring between a program structured according to the Composite structure and its corresponding Visitor structure. This transformation is validated by generating a precondition which guarantees statically its success. It is also adapted to take into account the transformation of four variations of Composite pattern and it is then applied to JHotDraw program in which these four variations occur. We define also a reversible transformation in the Singleton pattern to benefit from optimization by introducing this pattern and flexibility by its suppression according to the requirements of the software user.NANTES-ENS Mines (441092314) / SudocSudocFranceF
    corecore