uber / NullAway

A tool to help eliminate NullPointerExceptions (NPEs) in your Java code with low build-time overhead
MIT License
3.62k stars 290 forks source link

Refactored data clumps with the help of LLMs (research project) #960

Closed compf closed 2 months ago

compf commented 3 months ago

Hello maintainers,

I am conducting a master thesis project focused on enhancing code quality through automated refactoring of data clumps, assisted by Large Language Models (LLMs).

Data clump definition A data clump exists if 1. two methods (in the same or in different classes) have at least 3 common parameters and one of those methods does not override the other, or 2. At least three fields in a class are common with the parameters of a method (in the same or in a different class), or 3. Two different classes have at least three common fields See also the following UML diagram as an example ![Example data clump](https://raw.githubusercontent.com/compf/data_clump_eval_assets/main/data_clump_explained.svg)

I believe these refactoring can contribute to the project by reducing complexity and enhancing readability of your source code.

Pursuant to the EU AI Act, I fully disclose the use of LLMs in generating these refactorings, emphasizing that all changes have undergone human review for quality assurance.

Even if you decide not to integrate my changes to your codebase (which is perfectly fine), I ask you to fill out a feedback survey, which will be scientifically evaluated to determine the acceptance of AI-supported refactorings. You can find the feedback survey under https://campus.lamapoll.de/Data-clump-refactoring/en

Thank you for considering my contribution. I look forward to your feedback. If you have any other questions or comments, feel free to write a comment, or email me under tschoemaker@uni-osnabrueck.de .

Best regards, Timo Schoemaker Department of Computer Science University of Osnabrück

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

msridhar commented 2 months ago

Also note that I merged in the latest main branch so best to pull before making further changes

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 83.05085% with 10 lines in your changes missing coverage. Please review.

Project coverage is 85.88%. Comparing base (c4aed81) to head (bbedf7b).

Files Patch % Lines
.../uber/nullaway/handlers/MethodAnalysisContext.java 44.44% 10 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #960 +/- ## ============================================ - Coverage 85.94% 85.88% -0.07% - Complexity 2047 2051 +4 ============================================ Files 81 82 +1 Lines 6765 6806 +41 Branches 1305 1312 +7 ============================================ + Hits 5814 5845 +31 - Misses 537 547 +10 Partials 414 414 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.