1,727 research outputs found

    Towards generating transformation rules without examples for android API replacement

    Get PDF
    National Research Foundation (NRF) Singaporeauthors' own version</p

    Learning Code Transformations via Neural Machine Translation

    Get PDF
    Source code evolves – inevitably – to remain useful, secure, correct, readable, and efficient. Developers perform software evolution and maintenance activities by transforming existing source code via corrective, adaptive, perfective, and preventive changes. These code changes are usually managed and stored by a variety of tools and infrastructures such as version control, issue trackers, and code review systems. Software Evolution and Maintenance researchers have been mining these code archives in order to distill useful insights on the nature of such developers’ activities. One of the long-lasting goal of Software Engineering research is to better support and automate different types of code changes performed by developers. In this thesis we depart from classic manually crafted rule- or heuristic-based approaches, and propose a novel technique to learn code transformations by leveraging the vast amount of publicly available code changes performed by developers. We rely on Deep Learning, and in particular on Neural Machine Translation (NMT), to train models able to learn code change patterns and apply them to novel, unseen, source code. First, we tackle the problem of generating source code mutants for Mutation Testing. In contrast with classic approaches, which rely on handcrafted mutation operators, we propose to automatically learn how to mutate source code by observing real faults. We mine millions of bug fixing commits from GitHub, process and abstract their source code. This data is used to train and evaluate an NMT model to translate fixed code into buggy code (i.e., the mutated code). In the second project, we rely on the same dataset of bug-fixes to learn code transformations for the purpose of Automated Program Repair (APR). This represents one of the most challenging research problem in Software Engineering, whose goal is to automatically fix bugs without developers’ intervention. We train a model to translate buggy code into fixed code (i.e., learning patches) and, in conjunction with Beam Search, generate many different potential patches for a given buggy method. In our empirical investigation we found that such a model is able to fix thousands of unique buggy methods in the wild.Finally, in our third project we push our novel technique to the limits and enlarge the scope to consider not only bug-fixing activities, but any type of meaningful code changes performed by developers. We focus on accepted and merged code changes that undergone a Pull Request (PR) process. We quantitatively and qualitatively investigate the code transformations learned by the model to build a taxonomy. The taxonomy shows that NMT can replicate a wide variety of meaningful code changes, especially refactorings and bug-fixing activities. In this dissertation we illustrate and evaluate the proposed techniques, which represent a significant departure from earlier approaches in the literature. The promising results corroborate the potential applicability of learning techniques, such as NMT, to a variety of Software Engineering tasks

    MLCatchUp: Automated Update of Deprecated Machine-Learning APIs in Python

    Get PDF
    Tool PaperInternational audienceMachine learning (ML) libraries are gaining vast popularity, especially in the Python programming language. Using the latest version of such libraries is recommended to ensure the best performance and security. When migrating to the latest version of a machine learning library, usages of deprecated APIs need to be updated, which is a time-consuming process. In this paper, we propose MLCatchUp, an automated API usage update tool for deprecated APIs of popular ML libraries written in Python. MLCatchUp automatically infers the required transformation to migrate usages of deprecated API through the differences between the deprecated and updated API signatures. MLCatchUp offers a readable transformation rule in the form of a domain specific language (DSL). We evaluate MLCatchUp using a dataset of 267 real-world Python code containing 551 usages of 68 distinct deprecated APIs, where MLCatchUp achieves 90.7% accuracy. A video demonstration of MLCatchUp is available at https://youtu.be/5NjOPNt5iaA

    Characterization and Automatic Updates of Deprecated Machine-Learning API Usages

    Get PDF
    International audienceDue to the rise of AI applications, machine learning (ML) libraries, often written in Python, have become far more accessible. ML libraries tend to be updated periodically, which may deprecate existing APIs, making it necessary for application developers to update their usages. In this paper, we build a tool to automate deprecated API usage updates. We first present an empirical study to better understand how updates of deprecated ML API usages in Python can be done. The study involves a dataset of 112 deprecated APIs from Scikit-Learn, TensorFlow, and PyTorch. Guided by the findings of our empirical study, we propose MLCatchUp, a tool to automate the updates of Python deprecated API usages, that automatically infers the API migration transformation through comparison of the deprecated and updated API signatures. These transformations are expressed in a Domain Specific Language (DSL). We evaluate MLCatchUp using a dataset containing 267 files with 551 API usages that we collected from public GitHub repositories. In our dataset, MLCatchUp can detect deprecated API usages with perfect accuracy, and update them correctly for 80.6% of the cases. We further improve the accuracy of MLCatchUp in performing updates by adding a feature that allows it to accept an additional user input that specifies the transformation constraints in the DSL for context-dependent API migration. Using this addition, MLCatchUp can make correct updates for 90.7% of the cases

    Automatic Software Repair: a Bibliography

    Get PDF
    This article presents a survey on automatic software repair. Automatic software repair consists of automatically finding a solution to software bugs without human intervention. This article considers all kinds of repairs. First, it discusses behavioral repair where test suites, contracts, models, and crashing inputs are taken as oracle. Second, it discusses state repair, also known as runtime repair or runtime recovery, with techniques such as checkpoint and restart, reconfiguration, and invariant restoration. The uniqueness of this article is that it spans the research communities that contribute to this body of knowledge: software engineering, dependability, operating systems, programming languages, and security. It provides a novel and structured overview of the diversity of bug oracles and repair operators used in the literature

    API Recommendation Using Domain And Source Code Knowledge

    Get PDF
    The process of migration the old retired API(Application Programming Interface) with new and most to up to date one, know as API migration. Developers need to fully understand the documentation for the retired (replaced) library and the new (replacing) library to do the appropriate migration. This manual process is complex, error-prone, and costly for companies. There have been many studies focused on the automation recommendation between different method mapping for different libraries. These studies focused on the recommendations between methods from different programming languages while non of them focused on the recommendations between methods of libraries that belong to the same programming language. At times, one of the studies indicates automatic recommendation when mapping two different methods libraries that belong to the same programming language by using domain knowledge(method description, method parameters|name). In this thesis, we investigated the mapping between two methods of library migrations by using the domain knowledge and source code documentation. In order to be able to obtain these scenarios, we propose the RAPIM++ machine learning approach which recommends a correct mapping between source and target methods of three-party libraries using domain knowledge and source code knowledge. Our main contribution in this studywas, build a model which depends on existing library changes done manually from previous developers in different open source projects in java programming language then use features related to source code implementation, the similarity between method signatures and methods documentation to predict correct method mapping between two methods level library migration. Our result was RAPIM++ was able to successfully mapping between two methods from different third-party libraries with a rate of accuracy score of 84.4%. Additionally, our approach could able to recommend the libraries that absent the documentations since it relies on the source code knowledge along with the main knowledge. We can conclude from these results that RAPIM++ able to recommend third-party libraries with or without documentation, so though libraries that are not well known and do not belong to popular frameworks, can find comprehensive recommendations when using our model. Furthermore, RAPIM++ provides the research and industry community with a lightweight web service that available publicly to make method mapping between third - part libraries an easy task for developers

    Model-driven generative programming for BIS mobile applications

    Get PDF
    The burst on the availability of smart phones based on the Android platform calls for cost-effective techniques to generate mobile apps for general purpose, distributed business information systems (BIS). To mitigate this problem our research aims at applying model-driven techniques to automatically generate usable prototypes with a sound, maintainable, architecture. Following three base principles: model-based generation, separation of concerns, paradigm seamlessness, we try to answer the main guiding question – how to reduce development time and cost by transforming a given domain model into an Android application? To answer this question we propose to develop an application that follows a generative approach for mobile BIS apps that will mitigate the identified problems. Its input is a platform independent model (PIM), with business rules specified in OCL (Object Constraint Language). We adopted the Design Science Research methodology, that helps gaining problem understanding, identifying systemically appropriate solutions, and in effectively evaluating new and innovative solutions. To better evaluate our solution, besides resorting to third party tools to test specific components integration, we demonstrated its usage and evaluated how well it mitigates a subset of the identified problems in an observational study (we presented our generated apps to an outside audience in a controlled environment to study our model-based centered and, general apps understandability) and communicated its effectiveness to researchers and practitioners.O grande surto de disponibilidade de dispositivos móveis para a plataforma Android requer, técnicas generativas de desenvolvimento de aplicações para sistemas comuns e/ou distribuídos de informação empresariais/negócio, que otimizem a relação custo-benefício. Para mitigar este problema, esta investigação visa aplicar técnicas orientadas a modelos para, automaticamente, gerar protótipos funcionais de aplicações com uma arquitetura robusta e fácil de manter. Seguindo para tal três princípios base: geração baseada no modelo, separação de aspetos, desenvolvimento sem soturas (sem mudança de paradigma), tentamos dar resposta à pergunta orientadora – como reduzir o tempo e custo de desenvolvimento de uma aplicação Android por transformação de um dado modelo de domínio? De modo a responder a esta questão nós propomos desenvolver uma aplicação que segue uma abordagem generativa para aplicações de informação empresariais/negócio móveis de modo a mitigar os problemas identificados. Esta recebe modelos independentes de plataforma (PIM), com regras de negócio especificadas em OCL (Object Constraint Language). Seguimos a metodologia Design Science Research que ajuda a identificar e perceber o problema, a identificar sistematicamente soluções apropriadas aos problemas e a avaliar mais eficientemente soluções novas e inovadoras. Para melhor avaliar a nossa solução, apesar de recorrermos a ferramentas de terceiros para testar a integração de componentes específicos, também demonstramos a sua utilização, através de estudos experimentais (em um ambiente controlado, apresentamos as nossas aplicações geradas a uma audiência externa que nos permitiu estudar a compreensibilidade baseada e centrada em modelos e, de um modo geral, das aplicações) avaliamos o quanto esta mitiga um subconjunto de problemas identificados e comunicamos a sua eficácia para investigadores e profissionais
    corecore