Miracle-dz/UniFAR-FTUs huggingface dataset:
HyperAST: Enabling Efficient Analysis of Software Histories at Scale

Abstract Syntax Trees (ASTs) are widely used beyond compilers in many tools that measure and improve code quality, such as code analysis, bug detection, mining code metrics, refactoring. With the advent of fast software evolution and multistage releases, the temporal analysis of an AST history is becoming useful to understand and maintain code. However, jointly analyzing thousands versions of ASTs independently faces scalability issues, mostly combinatorial, both in terms of memory and CPU usage. In this paper, we propose a novel type of AST, called HyperAST, that enables efficient temporal code analysis on a given software history by: 1/ leveraging code redundancy through space (between code elements) and time (between versions); 2/ reusing intermediate computation results. We show how the HyperAST can be built incrementally on a set of commits to capture all multiple ASTs at once in an optimized way. We evaluated the HyperAST on a curated list of large software projects. Compared to Spoon, a state-of-the-art technique, we observed that the HyperAST outperforms it with an order-of-magnitude difference from × 6 up to × 8076 in CPU construction time and from × 12 up to × 1159 in memory footprint. While the HyperAST requires up to 2 h 22 min and 7.2 GB for the biggest project, Spoon requires up to 93 h and 31 min and 2.2 TB. The gains in construction time varied from to and the gains in memory footprint varied from to . We further compared the task of finding references of declarations with the HyperAST and Spoon. We observed on average precision and recall without a significant difference in search time.
Building recommenders for modelling languages with Droid

Recommender systems (RSs) are increasingly being used to help in all sorts of software engineering tasks, including modelling. However, building a RS for a modelling notation is costly. This is especially detrimental for development paradigms that rely on domain-specific languages (DSLs), like model-driven engineering and lowcode approaches. To alleviate this problem, we propose a DSL called Droid that facilitates the configuration and creation of RSs for particular modelling notations. Its tooling provides automation for all phases in the development of a RS: data preprocessing, system configuration for the modelling language, evaluation and selection of the best recommendation algorithm, and deployment of the RS into a modelling tool. A video of the tool is available at https://www.youtube. com/watch? v=VHiObfKUhS0.
Does my glucose level tell how energetic I feel?

Nowadays, many organisations steadily have to face new challenges due to an increasing competition, new technologies and manpower shortage. While dealing with this growth of challenges and confronting employees with higher demands, organizations have to pay attention to employees’ personal resources that are connected to their well-being and health. Human energy is a psychological construct connected to different states of experiencing e.g. vigor and vitality, or otherwise fatigue. The subjective experience of human energy varies during the working day. In order to promote employees’ health and well-being, an objective measure to determine human energy levels is needed. In this paper, we report on first insights from a pilot study with 12 healthy participants investigating if human’s glucose concentration can serve as an objective measure of human energy. We analyse the possible interplay between subjective human energy perception during work and sensor-based blood sugar levels, assessed by a continuous glucose monitoring (CGM) system in healthy adults.
A Middleware for Automatic Composition and Mediation in IoT Systems

This paper presents Hetero-Genius, a middleware architecture that enables construction and mediation in Internet of Things (IoT) systems. IoT systems are deployed across physical spaces such as urban parks, residential areas, and highways. The services provided by such IoT deployments are constrained to specific devices and deployment contexts. While existing interoperability solutions enable the “design time” development and deployment of IoT systems, it is often essential to dynamically compose systems that consist of other “small scale” IoT systems. To achieve this, post-deployment composition is needed, i.e., runtime composition of diverse IoT devices and capabilities. Hetero-Genius supports system and service discoverability, as well as automatic composability. We demonstrate this using a real-world Internet of Vehicles (IoV) scenario. Our experimental evaluation shows that developers can save up to 47% of their time when using Hetero-Genius, as well as improve code correctness by 55% on average.
Next Syntactic-Unit Code Completion and Applications

Code completion is an important feature in an IDE to improve developers’ productivity. Existing code completion approaches focus on completing the current code token, next token or statement, or code pattern. We propose AstCC, a code completion approach to suggest the next syntactic unit via an AST-based statistical language model. AstCC learns from a large code corpus to derive the next AST subtree representing a syntactic unit, and then fills in the template with the concrete variables from the current program scope. Our empirical evaluation shows that AstCC can correctly suggest the next syntactic unit in 33% of the cases, and in 62% of the cases, it correctly suggests within five candidates. We will also explain the potential applications of AstCC in automated program repair, automated test case generation, and syntactic pattern mining.
Enabling IoT-enhanced Transportation Systems using the NGSI Protocol

This paper presents a model-based approach to facilitate the development of IoT applications in Transportation Systems. Existing public transportation services are provided by relying on standard data models such as GTFS. However, such models are limited in representing IoT-based infrastructures and the locations that IoT devices cover (e.g., bus seating areas). We introduce a context-aware publish/subscribe IoT platform that supports synchronous data requests, asynchronous notifications and analytics applications. Data requests are created using the system’s context, which in our case is based on a transport bus system. Both static and dynamic context properties are modeled by extending the NGSI smart data models. We then introduce a GTFS-to-NGSI mapping tool to enable the enhancement of existing GTFS-based transportation systems with IoT capabilities. We develop a prototype of our platform and we demonstrate the applicability of our approach using open data from the Roma Mobilità bus transportation system.
Studying pedestrians´ crossing behavior during automated vehicle interactions: A Wizard of Oz study

As a substitute for communication with a human driver, additional communication cues for AVs have been proposed [1]. To analyze their effect on traffic flow, preceding studies captured pedestrians´ crossing decision in an unnatural manner, e.g., via data collection devices (e.g., [2]). In this paper, we explored the applicability of two optical tracking systems to capture crossing behavior more naturally in real-world conditions. In a Wizard of Oz study, N = 35 participants encountered a simulated AV. They were instructed to show natural crossing behavior, which was recorded with a light barrier and a SMARTTRACK3/IF. Results showed that both optical tracking systems can be utilized to capture pedestrians´ crossing behavior while interacting with AVs. The light barrier recorded the movement more often validly. Still, the correlation between recordings of both tracking systems was high which indicated a high convergence of measurement results.
CBMC-SSM: Bounded Model Checking of C Programs with Symbolic Shadow Memory

Dynamic program analysis tools such as Eraser, TaintCheck, or ThreadSanitizer abstract the contents of individual memory locations and store the abstraction results in a separate data structure called shadow memory. They then use this meta-information to efficiently implement the actual analyses. In this paper, we describe the implementation of an efficient symbolic shadow memory extension for the CBMC bounded model checker that can be accessed through an API, and sketch its use in the design of a new data race analyzer that is implemented by a code-to-code translation. Artifact/tool URL: https://doi.org/10.5281/zenodo.7026604 Video URL: https://youtu.be/pqlbyiY5BLU
Multi-objective Optimization-based Bug-fixing Template Mining for Automated Program Repair

Template-based automatic program repair (T-APR) techniques depend on the quality of bug-fixing templates. For such templates to be of sufficient quality for T-APR techniques to succeed, they must satisfy three criteria: applicability, fixability, and efficiency. Existing template mining approaches select templates based only on the first criteria, and are thus suboptimal in their performance. This study proposes a multi-objective optimization-based bug-fixing template mining method for T-APR in which we estimate template quality based on nine code abstraction tasks and three objective functions. Our method determines the optimal code abstraction strategy (i.e., the optimal combination of abstraction tasks) which maximizes the values of three objective functions and generates a final set of bug-fixing templates by clustering template candidates to which the optimal abstraction strategy is applied. Our preliminary experiment demonstrated that our optimized strategy can improve templates’ applicability and efficiency by 7% and 146% over the existing mining technique, respectively. We therefore conclude that the multi-objective optimization-based template mining technique effectively finds high-quality bug-fixing templates.
Graph based Incident Extraction and Diagnosis in Large-Scale Online Systems

With the ever increasing scale and complexity of online systems, incidents are gradually becoming commonplace. Without appropriate handling, they can seriously harm the system availability. However, in large-scale online systems, these incidents are usually drowning in a slew of issues (i.e., something abnormal, while not necessarily an incident), rendering them difficult to handle. Typically, these issues will result in a cascading effect across the system, and a proper management of the incidents depends heavily on a thorough analysis of this effect. Therefore, in this paper, we propose a method to automatically analyze the cascading effect of availability issues in online systems and extract the corresponding graph based issue representations incorporating both of the issue symptoms and affected service attributes. With the extracted representations, we train and utilize a graph neural networks based model to perform incident detection. Then, for the detected incident, we leverage the PageRank algorithm with a flexible transition matrix design to locate its root cause. We evaluate our approach using real-world data collected from the WeChat online service system, the largest instant message system in China. The results confirm the effectiveness of our approach. Moreover, our approach is successfully deployed in the company and eases the burden of operators in the face of a flood of issues and related alert signals.
On the Naturalness of Bytecode Instructions

Bytecode is used in software analysis and other approaches due to its advantages such as high availability and simple specification. Therefore, to leverage these advantages in training language models with bytecode, it is important to clearly recognize the characteristics of the naturalness of bytecode. However, the naturalness of bytecode has not been actively explored. In this paper, we experimentally show the naturalness of bytecode instructions and investigate their characteristics by empirically assessing 10 Java open-source projects. Consequently, we demonstrate that the bytecode instructions are more natural than source code representations and less natural than abstract syntax tree representations at a method-level. Furthermore, we found that there is no correlation between the naturalness of bytecode instructions and source code representations at a method-level. Our study supports that researchers need to deal with the characteristics of the naturalness of bytecode instructions in a different view from source code. We expect that these findings will be helpful for future work to study automated software engineering tasks such as automated debugging and vulnerability detection that use bytecode models.
Which Exception Shall We Throw?

Although the exception handling mechanism is critical for resolving runtime errors, bugs inside this process can have far-reaching impacts. Therefore, researchers have proposed various approaches to assist catching and handling such thrown exceptions and to detect corresponding bugs. If the thrown exceptions themselves are incorrect, their errors will never be correctly caught and handled. Like bugs in catching and handling exceptions, wrong thrown exceptions have caused real critical bugs. However, to the best of our knowledge, no approach has been proposed to recommend which exceptions shall be thrown. Exceptions are widely adopted in programs, often poorly documented, and sometimes ambiguous, making the rules of throwing correct exceptions rather complicated. A project team can leverage exceptions in a way totally different from other teams. As a result, even experienced programmers can have difficulties in determining which exception shall be thrown, although they have the skills to implement its surrounding code. In this paper, we propose the first approach, ThEx, to predict which exception(s) shall be thrown under a given programming context. The basic idea is to learn a classification model from existing thrown exceptions in source files. Here, the learning features are extracted from various code information surrounding the thrown exceptions, such as the thrown locations and related variable names. Then, given a new context, ThEx can predict its best exception(s). We have evaluated ThEx on 12,012 thrown exceptions that were collected from nine popular open-source projects. Our results show that it can achieve high f-scores and mcc values (both around 0.8). On this benchmark, we also evaluated the impacts of our underlying technical details. Furthermore, we evaluated our approach in the wild, and used ThEx to detect anomalies from the latest versions of the nine projects. In this way, we found 20 anomalies, and reported them as bugs to their issue trackers. Among them, 18 were confirmed, and 13 have already been fixed.
Exploiting Epochs and Symmetries in Analysing MPI Programs

Communication nondeterminism is one of the main reasons for the intractability of verification of message passing concurrency. In many practical message passing programs, the non-deterministic communication structure is symmetric and decomposed into epochs to obtain efficiency. Thus, symmetries and epoch structure can be exploited to reduce verification complexity. In this paper, we present a dynamic-symbolic runtime verification technique for single-path MPI programs, which (i) exploits communication symmetries by way of specifying symmetry breaking predicates (SBP) and (ii) performs compositional verification based on epochs. On the one hand, SBPs prevent the symbolic decision procedure from exploring isomorphic parts of the search space, and on the other hand, epochs restrict the size of a program needed to be analyzed at a point in time. We show that our analysis is sound and complete for single-path MPI programs on a given input. Using our prototype tool SIMIAN, we further demonstrate that our approach leads to (i) a significant reduction in verification times and (ii) scaling up to larger benchmark sizes compared to prior trace verifiers.
Finding and Understanding Incompleteness Bugs in SMT Solvers

We propose Janus, an approach for finding incompleteness bugs in SMT solvers. The key insight is to mutate SMT formulas with local weakening and strengthening rules that preserve the satisfiability of the seed formula. The generated mutants are used to test SMT solvers for incompleteness bugs, i.e., inputs on which SMT solvers unexpectedly return unknown. We realized Janus on top of the SMT solver fuzzing framework YinYang. From June to August 2021, we stress-tested the two state-of-the-art SMT solvers Z3 and CVC5 with Janus and totally reported 31 incompleteness bugs. Out of these, 26 have been confirmed as unique bugs and 19 are already fixed by the developers. Our diverse bug findings uncovered functional, regression, and performance bugs—several triggered discussions among the developers sharing their in-depth analysis.
Transfer learning of cars behaviors from reality to simulation applications

Creating synthetic behaviors of vehicles in simulation applications has always been challenging from a development standpoint. First, it is a real challenge to create a credible and realistic simulation while achieving the required runtime efficiency. Second, the effort required to implement it can add significant cost to the development processes. In this paper, we propose an automated way to design vehicle simulation systems by transfer learning from reality to simulators. Our methods rely on advanced deep learning technologies and datasets commonly used in the field of self-driving cars. To assess how well this approach would work in a simulation environment, experiments using the CARLA simulator are presented in the evaluation. The results show that the proposed transfer learning approach provides good results, both quantitatively and qualitatively, and is suitable for runtime evaluation even in resource-constrained simulation applications such as video games.
A Hybrid Approach for Inference between Behavioral Exception API Documentation and Implementations, and Its Applications

Automatically producing behavioral exception (BE) API documentation helps developers correctly use the libraries. The state-of-the-art approaches are either rule-based, which is too restrictive in its applicability, or deep learning (DL)-based, which requires large training dataset. To address that, we propose StatGen, a novel hybrid approach between statistical machine translation (SMT) and tree-structured translation to generate the BE documentation for any code and vice versa. We consider the documentation and source code of an API method as the two abstraction levels of the same intent. StatGen is specifically designed for this two-way inference, and takes advantage of their structures for higher accuracy. We conducted several experiments to evaluate StatGen. We show that it achieves high precision (75% and 75%), and recall (81% and 84%), in inferring BE documentation from source code and vice versa. StatGen achieves higher precision, recall, and BLEU score than the state-of-the-art, DL-based baseline models. We show StatGen’s usefulness in two applications. First, we use it to generate the BE documentation for Apache APIs that lack of documentation by learning from the documentation of the equivalent APIs in JDK. 44% of the generated documentation were rated as useful and 42% as somewhat useful. In the second application, we use StatGen to detect the inconsistency between the BE documentation and corresponding implementations of several JDK8 packages.
TreeCen: Building Tree Graph for Scalable Semantic Code Clone Detection

Code clone detection is an important research problem that has attracted wide attention in software engineering. Many methods have been proposed for detecting code clone, among which text-based and token-based approaches are scalable but lack consideration of code semantics, thus resulting in the inability to detect semantic code clones. Methods based on intermediate representations of codes can solve the problem of semantic code clone detection. However, graph-based methods are not practicable due to code compilation, and existing tree-based approaches are limited by the scale of trees for scalable code clone detection. In this paper, we propose TreeCen, a scalable tree-based code clone detector, which satisfies scalability while detecting semantic clones effectively. Given the source code of a method, we first extract its abstract syntax tree (AST) based on static analysis and transform it into a simple graph representation (i.e., tree graph) according to the node type, rather than using traditional heavyweight tree matching. We then treat the tree graph as a social network and adopt centrality analysis on each node to maintain the tree details. By this, the original complex tree can be converted into a 72-dimensional vector while containing comprehensive structural information of the AST. Finally, these vectors are fed into a machine learning model to train a detector and use it to find code clones. We conduct comparative evaluations on effectiveness and scalability. The experimental results show that TreeCen maintains the best performance of the other six state-of-the-art methods (i.e., SourcererCC, RtvNN, DeepSim, SCDetector, Deckard, and ASTNN) with F1 scores of 0.99 and 0.95 on BigCloneBench and Google Code Jam datasets, respectively. In terms of scalability, TreeCen is about 79 times faster than the other state-of-the-art tree-based semantic code clone detector (ASTNN), about 13 times faster than the fastest graph-based approach (SCDetector), and even about 22 times faster than the one-time trained token-based detector (RtvNN).
Closure of second‐ and third‐moment rate equations for diffusion in homogeneous turbulence

Essentially exact closures are presented for the second‐ and third‐moment rate equations for diffusion of a pollutant released at a particular time in homogeneous turbulence. The quasi‐Gaussian closure is found to require addition of a down‐gradient diffusion term. Explicit dependence upon the time after release is found to be retained by the highest moment gradient term. The second‐ and third‐moment approaches are therefore concluded to be inherently incapable of accurately solving the general problem of pollutants released at different places at different times.
E-MANAFA: Energy Monitoring and ANAlysis tool For Android

This article introduces the E-MANAFA energy profiler, a plug-and-play, device-independent, model-based profiler capable of obtaining fine-grained energy measurements on Android devices. Besides having the capability to calculate performance metrics such as the energy consumed and runtime during a time interval, E-MANAFA also allows to estimate the energy consumed by each device component (e.g. CPU, WI-FI, screen). In this article, we present the main elements that compose this framework, as well as its workflow. In order to present the power of this tool, we demonstrate how the tool can measure the overhead of the instrumentation technique used in the PyAnaDroid application benchmarking pipeline, which already supports E-MANAFA to monitor power consumption in its Android application automatic execution process. Video demo: shorturl.at/hmyz5