Master Thesis MSTR-2022-17

BibliographyRagavendran, Koushik: NullnessGraphSeq: Learning-based Java nullness inference.
University of Stuttgart, Faculty of Computer Science, Electrical Engineering, and Information Technology, Master Thesis No. 17 (2022).
51 pages, english.
Abstract

Most web-based projects' server-side and android application development use Java programming language. Like most programming languages, Java has a unique \null" value representing a missing value. But, dereferencing of program element pointing \null" value may result in NullPointerException in the run-time. To prevent NullPointerException in run-time null-type annotations were introduced by Java-8. The null-type annotations specify the nullness of a program element as either \can be null" or \never null". Static analyses using these null-type annotations warn developers if the \null" or program element pointing \null" value is sometimes assigned to the \never null" program element. Also, it warns developers if the \can be null" program element is not checked for null before dereferencing. Due to lack of null-type annotations, this thesis presents a learning-based approach for inferring null-type annotation of program elements. We formulate the problem as a Binary Classi cation problem because classifying the program element as \can be null" or \never null" helps IDE suggest null checks only when required. The model predicts nullness for methods, parameters, elds and variables from respective local contexts of identi er, node type, usage, assignment and comment in combination with the global context of data dependency information. The model we train combine Long Short Term Memory, Feed-Forward Network for summarising the local context and Graph Neural Network for passing local context information as messages. We trained our model with 20000 Java les and achieved an accuracy of 0.8174 and F1-scores of 0.8879 and 0.4971 for \can be null" and \never null", respectively. We evaluate our approach by comparing it with the existing tool InferNullity as the baseline by comparing the inference from InferNullity and the approach used in this thesis with the ground truth.

Full text and
other links
Volltext
Department(s)University of Stuttgart, Institute of Software Technology, Software Lab - Program Analysis
Superviser(s)Pradel, Prof. Michael; Bezzubov, Alexander
Entry dateSeptember 16, 2022
   Publ. Computer Science