HASLab
Permanent URI for this community
This service produces reliable software systems in contexts where correctness, responsiveness, robustness and security are essential. It develops integrated research in three lines: formal methods for software development, reliable distributed systems and information security.
Browse
Browsing HASLab by Author "5597"
Results Per Page
Sort Options
-
ItemE-Debitum: managing software energy debt( 2020) Marco Linhares Couto ; Rui Alexandre Pereira ; João Alexandre Saraiva ; Maia,D ; 6187 ; 5974 ; 5597This paper extends previous work on the concept of a new software energy metric: Energy Debt. This metric is a reflection on the implied cost, in terms of energy consumption over time, of choosing an energy flawed software implementation over a more robust and efficient, yet time consuming, approach.This paper presents the implementation a SonarQube tool called E-Debitum which calculates the energy debt of Android applications throughout their versions. This plugin uses a robust, well defined, and extendable smell catalog based on current green software literature, with each smell defining the potential energy savings. To conclude, an experimental validation of E-Debitum was executed on 3 popular Android applications with various releases, showing how their energy debt fluctuated throughout releases. © 2020 ACM.
-
ItemEfficient Embedding of Strategic Attribute Grammars via Memoization( 2023) João Alexandre Saraiva ; José Nuno Macedo ; 5597 ; 7004
-
ItemEfficient Embedding of Strategic Attribute Grammars via Memoization( 2023) João Alexandre Saraiva ; José Nuno Macedo ; 5597 ; 7004
-
ItemEnergy Refactorings for Android in the Large and in the Wild( 2020) João Alexandre Saraiva ; João Paulo Fernandes ; Marco Linhares Couto ; 5631 ; 6187 ; 5597
-
ItemEnergy wars - Chrome vs. Firefox: which browser is more energy efficient?( 2020) Aloísio,J ; João Alexandre Saraiva ; Rui Alexandre Pereira ; Gonçalves,N ; Macedo,Jd ; 5974 ; 5597
-
ItemExpressing disambiguation filters as combinators( 2020) João Alexandre Saraiva ; José Nuno Macedo ; 7004 ; 5597
-
ItemFraming Program Repair as Code Completion( 2022) Ribeiro,F ; Abreu,R ; João Alexandre Saraiva ; 5597
-
ItemGreenSource: A large-scale collection of android code, tests and energy metrics( 2019) Rui António Rua ; João Alexandre Saraiva ; Marco Linhares Couto ; 6187 ; 5597 ; 7075This paper presents the GreenSource infrastructure: a large body of open source code, executable Android applications, and curated dataset containing energy code metrics. The dataset contains energy metrics obtained by both static analysing the applications' source code and by executing them with available test inputs. To automate the execution of the applications we developed the AnaDroid tool which instruments its code, compiles and executes it with test inputs in any Android device, while collecting energy metrics. GreenSource includes all Android applications included in the MUSE Java source code repository, while AnaDroid implements all Android's energy greedy features described in the literature, GreenSource aims at characterizing energy consumption in the Android ecosystem, providing both Android developers and researchers a setting to reason about energy efficient Android software development. © 2019 IEEE.
-
ItemGreenspecting Android virtual keyboards( 2020) Fraga,T ; João Alexandre Saraiva ; Marco Linhares Couto ; Rui António Rua ; 5597 ; 6187 ; 7075
-
ItemInDubio: A Combinator Library to Disambiguate Ambiguous Grammars( 2020) João Alexandre Saraiva ; Macedo,JN ; 5597To infer an abstract model from source code is one of the main tasks of most software quality analysis methods. Such abstract model is called Abstract Syntax Tree and the inference task is called parsing. A parser is usually generated from a grammar specification of a (programming) language and it converts source code of that language into said abstract tree representation. Then, several techniques traverse this tree to assess the quality of the code (for example by computing source code metrics), or by building new data structures (e.g, flow graphs) to perform further analysis (such as, code cloning, dead code, etc). Parsing is a well established technique. In recent years, however, modern languages are inherently ambiguous which can only be fully handled by ambiguous grammars. In this setting disambiguation rules, which are usually included as part of the grammar specification of the ambiguous language, need to be defined. This approach has a severe limitation: disambiguation rules are not first class citizens. Parser generators offer a small set of rules that can not be extended or changed. Thus, grammar writers are not able to manipulate nor define a new specific rule that the language he is considering requires. In this paper we present a tool, name InDubio, that consists of an extensible combinator library of disambiguation filters together with a generalized parser generator for ambiguous grammars. InDubio defines a set of basic disambiguation rules as abstract syntax tree filters that can be combined into more powerful rules. Moreover, the filters are independent of the parser generator and parsing technology, and consequently, they can be easily extended and manipulated. This paper presents InDubio in detail and also presents our first experimental results. © 2020, Springer Nature Switzerland AG.
-
ItemJava Stream Fusion: Adapting FP mechanisms for an OO setting( 2019) Pardo,A ; João Alexandre Saraiva ; Francisco José Ribeiro ; 7074 ; 5597In this paper, we show how stream fusion, a program transformation technique used in functional programming, can be adapted for an Object-Oriented setting. This makes it possible to have more Stream operators than the ones currently provided by the Java Stream API. The addition of more operators allows for a greater deal of expressiveness. To this extent, we show how these operators are incorporated in the stream setting. Furthermore, we also demonstrate how a specific set of optimizations eliminates overheads and produces equivalent code in the form of for loops. In this way, programmers are relieved from the burden of writing code in such a cumbersome style, thus allowing for a more declarative and intuitive programming approach.
-
ItemjStanley: placing a green thumb on Java collections( 2018) Simão,P ; Rui Alexandre Pereira ; Cunha,J ; João Alexandre Saraiva ; 5597 ; 5974
-
ItemA large-scale empirical study on mobile performance: energy, run-time and memory( 2024) João Alexandre Saraiva ; 5597Software performance concerns have been attracting research interest at an increasing rate, especially regarding energy performance in non-wired computing devices. In the context of mobile devices, several research works have been devoted to assessing the performance of software and its underlying code. One important contribution of such research efforts is sets of programming guidelines aiming at identifying efficient and inefficient programming practices, and consequently to steer software developers to write performance-friendly code.Despite recent efforts in this direction, it is still almost unfeasible to obtain universal and up-to-date knowledge regarding software and respective source code performance. Namely regarding energy performance, where there has been growing interest in optimizing software energy consumption due to the power restrictions of such devices. There are still many difficulties reported by the community in measuring performance, namely in large-scale validation and replication. The Android ecosystem is a particular example, where the great fragmentation of the platform, the constant evolution of the hardware, the software platform, the development libraries themselves, and the fact that most of the platform tools are integrated into the IDE's GUI, makes it extremely difficult to perform performance studies based on large sets of data/applications. In this paper, we analyze the execution of a diversified corpus of applications of significant magnitude. We analyze the source-code performance of 1322 versions of 215 different Android applications, dynamically executed with over than 27900 tested scenarios, using state-of-the-art black-box testing frameworks with different combinations of GUI inputs. Our empirical analysis allowed to observe that semantic program changes such as adding functionality and repairing bugfixes are the changes more associated with relevant impact on energy performance. Furthermore, we also demonstrate that several coding practices previously identified as energy-greedy do not replicate such behavior in our execution context and can have distinct impacts across several performance indicators: runtime, memory and energy consumption. Some of these practices include some performance issues reported by the Android Lint and Android SDK APIs. We also provide evidence that the evaluated performance indicators have little to no correlation with the performance issues' priority detected by Android Lint. Finally, our results allowed us to demonstrate that there are significant differences in terms of performance between the most used libraries suited for implementing common programming tasks, such as HTTP communication, JSON manipulation, image loading/rendering, among others, providing a set of recommendations to select the most efficient library for each performance indicator. Based on the conclusions drawn and in the extension of the developed work, we also synthesized a set of guidelines that can be used by practitioners to replicate energy studies and build more efficient mobile software.
-
ItemMemoized zipper-based attribute grammars and their higher order extension( 2019) Martins,P ; Viera,M ; João Alexandre Saraiva ; Pardo,A ; João Paulo Fernandes ; 5597 ; 5631Attribute grammars are a powerfull, well-known formalism to implement and reason about programs which, by design, are conveniently modular. In this work we focus on a state of the art zipper-based embedding of classic attribute grammars and higher-order attribute grammars. We improve their execution performance through controlling attribute (re)evaluation by means of memoization techniques. We present the results of our optimizations by comparing their impact in various implementations of different, well-studied, attribute grammars and their Higher-Order extensions. © 2018 Elsevier B.V.
-
ItemOn energy debt: managing consumption on evolving software( 2020) Maia,D ; Rui Alexandre Pereira ; João Alexandre Saraiva ; Marco Linhares Couto ; 5597 ; 5974 ; 6187
-
ItemOn energy debt: managing consumption on evolving software( 2020) Marco Linhares Couto ; 6187
-
ItemOn Understanding Contextual Changes of Failures( 2021) Francisco José Ribeiro ; Abreu,R ; João Alexandre Saraiva ; 5597 ; 7074
-
ItemPyAnaDroid: A fully-customizable execution pipeline for benchmarking Android Applications( 2023) João Alexandre Saraiva ; Rui António Rua ; 5597 ; 7075This paper presents PyAnaDroid, an open-source, fully-customizable execution pipeline designed to benchmark the performance of Android native projects and applications, with a special emphasis on benchmarking energy performance. PyAnaDroid is currently being used for developing large-scale mobile software empirical studies and for supporting an advanced academic course on program testing and analysis. The presented artifact is an expandable and reusable pipeline to automatically build, test and analyze Android applications. This tool was made openly available in order to become a reference tool to transparently conduct, share and validate empirical studies regarding Android applications. This document presents the architecture of PyAnaDroid, several use cases, and the results of a preliminary analysis that illustrates its potential.Video demo: https://youtu.be/7AV3nrh4Qc8 © 2023 IEEE.
-
ItemSPELLing out energy leaks: Aiding developers locate energy inefficient code( 2020) Carcao,T ; João Alexandre Saraiva ; João Paulo Fernandes ; Cunha,J ; Rui Alexandre Pereira ; Marco Linhares Couto ; 5597 ; 6187 ; 5974 ; 5631Although hardware is generally seen as the main culprit for a computer's energy usage, software too has a tremendous impact on the energy spent. Unfortunately, there is still not enough support for software developers so they can make their code more energy-aware. This paper proposes a technique to detect energy inefficient fragments in the source code of a software system. Test cases are executed to obtain energy consumption measurements, and a statistical method, based on spectrum-based fault localization, is introduced to relate energy consumption to the source code. The result of our technique is an energy ranking of source code fragments pointing developers to possible energy leaks in their code. This technique was implemented in the SPELL toolkit. Finally, in order to evaluate our technique, we conducted an empirical study where we asked participants to optimize the energy efficiency of a software system using our tool, while also having two other groups using no tool assistance and a profiler, respectively. We showed statistical evidence that developers using our technique were able to improve the energy efficiency by 43% on average, and even out performing a profiler for energy optimization. © 2019 Elsevier Inc.
-
ItemUnifying Parsing and Reflective Printing for Fully Disambiguated Grammars( 2020) Ko,HS ; Hu,ZJ ; João Alexandre Saraiva ; Martins,P ; Zhang,YZ ; Zhu,ZR ; 5597Language designers usually need to implement parsers and printers. Despite being two closely related programs, in practice they are often designed separately, and then need to be revised and kept consistent as the language evolves. It will be more convenient if the parser and printer can be unified and developed in a single program, with their consistency guaranteed automatically. Furthermore, in certain scenarios (like showing compiler optimisation results to the programmer), it is desirable to have a more powerful reflective printer that, when an abstract syntax tree corresponding to a piece of program text is modified, can propagate the modification to the program text while preserving layouts, comments, and syntactic sugar. To address these needs, we propose a domain-specific language BiYacc, whose programs denote both a parser and a reflective printer for a fully disambiguated context-free grammar. BiYacc is based on the theory of bidirectional transformations, which helps to guarantee by construction that the generated pairs of parsers and reflective printers are consistent. Handling grammatical ambiguity is particularly challenging: we propose an approach based on generalised parsing and disambiguation filters, which produce all the parse results and (try to) select the only correct one in the parsing direction; the filters are carefully bidirectionalised so that they also work in the printing direction and do not break the consistency between the parsers and reflective printers. We show that BiYacc is capable of facilitating many tasks such as Pombrio and Krishnamurthi's 'resugaring', simple refactoring, and language evolution.