Alessandro Midolo

Dr. Alessandro Midolo

orcid

Research Focus & Metrics

Academic Career Length

4Years (2023-Present)

(Calculated once Scilit publication data is synced: current year − year of first publication + 1)

Representative Publications

View All Publications
20 December 2024 in Information
Verified
Journal Article
Open access
PDF file
LBLuana Bulla
Luana Bulla
AMAlessandro Midolo
Alessandro Midolo
MMMisael Mongiovì
Misael Mongiovì
Emiliano TramontanaEmiliano Tramontana
Emiliano Tramontana
Distinguishing whether some code portions were implemented by humans or generated by a tool based on artificial intelligence has become hard. However, such a classification would be important as it could point developers towards some further validation for the produced code. Additionally, it holds significant importance in security, legal contexts, and educational settings, where upholding academic integrity is of utmost importance. We present EX-CODE, a novel and explainable model that leverages the probability of the occurrence of some tokens, within a code snippet, estimated according to a language model, to distinguish human-written from AI-generated code. EX-CODE has been evaluated on a heterogeneous real-world dataset and stands out for its ability to provide human-understandable explanations of its outcomes. It achieves this by uncovering the features that for a snippet of code make it classified as human-written code (or AI-generated code).

7 December 2023 in Technologies
Verified
Journal Article
Open access
PDF file
DMDaniele Marletta
Daniele Marletta
AMAlessandro Midolo
Alessandro Midolo
Emiliano TramontanaEmiliano Tramontana
Emiliano Tramontana
The detection of photovoltaic panels from images is an important field, as it leverages the possibility of forecasting and planning green energy production by assessing the level of energy autonomy for communities. Many existing approaches for detecting photovoltaic panels are based on machine learning; however, they require large annotated datasets and extensive training, and the results are not always accurate or explainable. This paper proposes an automatic approach that can detect photovoltaic panels conforming to a properly formed significant range of colours extracted according to the given conditions of light exposure in the analysed images. The significant range of colours was automatically formed from an annotated dataset of images, and consisted of the most frequent panel colours differing from the colours of surrounding parts. Such colours were then used to detect panels in other images by analysing panel colours and reckoning the pixel density and comparable levels of light. The results produced by our approach were more precise than others in the previous literature, as our tool accurately reveals the contours of panels notwithstanding their shape or the colours of surrounding objects and the environment.

7 May 2025 in Future Internet
Verified
Journal Article
Open access
PDF file
DMDaniele Marletta
Daniele Marletta
AMAlessandro Midolo
Alessandro Midolo
Emiliano TramontanaEmiliano Tramontana
Emiliano Tramontana
A high level of data integrity is a strong requirement in systems where the life of people depends on accurate and timely responses. In healthcare emergency response systems, a centralized authority that handles data related to occurring events is prone to challenges, such as, e.g., disputes over event timestamps and data authenticity. To address both the potential lack of trust among collaborating parties and the inability of an authority to clearly certify events by itself, this paper proposes a blockchain-based framework designed to provide proof of integrity and authenticity of data in healthcare emergency response systems. The proposed solution integrates blockchain technology to certify the accuracy of events throughout their incident lifecycle. Critical events are timestamped and hashed using SHA-256; then, such hashes are stored immutably on an EVM-compatible blockchain via smart contracts. The system combines blockchain technology with cloud storage to ensure scalability, security, and transparency. Blockchain technology provides the advantage of eliminating a trusted server, providing timestamping and reducing costs by forgoing such a service. The experimental results, using publicly available incident data, demonstrated the feasibility and effectiveness of this approach. The system provides a cost-effective, scalable solution for managing incident data while keeping a proof of their integrity. The proposed blockchain-based framework offers a reliable, transparent mechanism for certifying incident-related data. This fosters trust among healthcare emergency response system actors.

12 September 2025 in Future Internet
Verified
Journal Article
Open access
PDF file
AMAlessandro Midolo
Alessandro Midolo
Emiliano TramontanaEmiliano Tramontana
Emiliano Tramontana
Java 8 brought functional programming to the Java language and library, enabling more expressive and concise code to replace loops by using streams. Despite such advantages, for-loops remain prevalent in current codebases as the transition to the functional paradigm requires a significant shift in the developer mindset. Traditional approaches for assisting refactoring loops into streams check a set of strict preconditions to ensure correct transformation, hence limiting their applicability. Conversely, generative artificial intelligence (AI), particularly ChatGPT, is a promising tool for automating software engineering tasks, including refactoring. While prior studies examined ChatGPT’s assistance in various development contexts, none have specifically investigated its ability to refactor for-loops into streams. This paper addresses such a gap by evaluating ChatGPT’s effectiveness in transforming loops into streams. We analyzed 2132 loops extracted from four open-source GitHub repositories and classified them according to traditional refactoring templates and preconditions. We then tasked ChatGPT with the refactoring of such loops and evaluated the correctness and quality of the generated code. Our findings revealed that ChatGPT could successfully refactor many more loops than traditional approaches, although it struggled with complex control flows and implicit dependencies. This study provides new insights into the strengths and limitations of ChatGPT in loop-to-stream refactoring and outlines potential improvements for future AI-driven refactoring tools.

8 September 2023 in Future Internet
Verified
Journal Article
Open access
PDF file
AMAlessandro Midolo
Alessandro Midolo
Emiliano TramontanaEmiliano Tramontana
Emiliano Tramontana
Sequential programs can benefit from parallel execution to improve their performance. When developing a parallel application, several techniques are employed to achieve the desired behavior: identifying parts that can run in parallel, synchronizing access to shared data, tuning performance, etc. Admittedly, manually transforming a sequential application to make it parallel can be tedious due to the large number of lines of code to inspect, the possibility of errors arising from inaccurate data dependence analysis leading to unpredictable behavior, and inefficiencies when the workload between parallel threads is unbalanced. This paper proposes an automatic approach that analyzes Java source code to identify method calls that are suitable for parallel execution and transforms them so that they run in another thread. The approach is based on data dependence and control dependence analyses to determine the execution flow and data accessed. Based on the proposed method, a tool has been developed to enhance applications by incorporating parallelism, i.e., transforming suitable method calls to execute on parallel threads, and synchronizing data access where needed. The developed tool has been extensively tested to verify the accuracy of its analysis in finding parallel execution opportunities, the correctness of the source code alterations, and the resultant performance gain.

12 April 2026
Verified
Conference Paper
Open access
AMAlessandro Midolo
Alessandro Midolo
AGAlessandro Giagnorio
Alessandro Giagnorio
FZFiorella Zampetti
Fiorella Zampetti
RTRosalia Tufano
Rosalia Tufano
GBGabriele Bavota
Gabriele Bavota
MPMassimiliano Di Penta
Massimiliano Di Penta
Large Language Models (LLMs) are extensively used nowadays for various software engineering tasks, primarily code generation. Previous research has shown how suitable prompt engineering can help developers improve their code-generation prompts. However, so far, there are no specific guidelines guiding developers in writing suitable prompts for code generation. In this work, we derive and evaluate development-specific prompt optimization guidelines. We use an iterative, test-driven approach to automatically refine code-generation prompts, and we analyze the results of this process to identify prompt improvement items that lead to test passes. We use such elements to elicit 10 guidelines for prompt improvement, related to better specifying I/O, pre/post conditions, providing examples, various types of details, or clarifying ambiguities. We conducted an assessment with 50 practitioners, who reported their use of the elicited prompt improvement patterns and their perceived usefulness. Our results have implications not only for practitioners and educators, but also for those creating LLM-aided software development tools.