A Static Analysis Framework for the R Programming Language
Oliver Gerstl
I am interested in program analysis of software from the data science domain to identify possible errors in, for example, R programs. To analyze data science programs, I am exploring the usage of abstract interpretation for data science software to automatically infer code constraints for certain program aspects by soundly abstracting the concrete semantics of the program. Furthermore, I am interested in linting data science code to statically identify code smells and potential bugs in data science code. To this end, I am working together with Florian Sihler on , an open-source static code analyzer for the R programming language.
Research Projects
A Serious Game to Teach Programming Concepts to Novices
Teaching
Besides my research, I assist in teaching in the following courses:
| Lecture | Semesters |
|---|---|
| Current Topics in Software Engineering from Research and Practice (Master) | WiSe 2025, WiSe 2026 |
| Web Engineering (Bachelor/Master) | SoSe 2026 |
Topics for Theses and Projects
Static Program Analysis
Context
R is a programming language that is used in research for statistical computing and mostly by people without a background in computer science. Almost every value in the R programming language can carry attributes (metadata) like names, dim, or class that are silently attached to values and fundamentally changes how they behave (see the chapter on in Advanced R [2]). A plain numeric vector becomes a matrix just by setting its dim attribute, a class attribute decides which function is actually called when using S3 dispatch (e.g., whether print(x) produces a table or a summary), and a factor is "just" an integer vector with levels. Yet, these attributes are assigned dynamically (e.g., with attr(x, "dim") <- c(2, 3), structure(...), or class(x) <- "my-class"), can be dropped unexpectedly by many operations, and are invisible when just reading the code. For a static analysis this is a problem, as without knowing the class of a value we do not know which method a call dispatches to, and without knowing dim or names we cannot judge whether an access like x[, "score"] is even valid.
Within this work we want to statically infer the attributes of R values, making this hidden metadata explicit and available to further analyses!
Problem
You have an R script together with the statically inferred data and control flow graph, and a general abstract interpretation framework that performs fixpoint iteration to infer code constraints.
The challenges are to
- design abstract domains [1] that represent the attributes a value may carry at a given program point (e.g., its potential classes, its dimension, or the names of its elements),
- track how attributes are created, propagated, modified, and dropped across assignments, function calls, and vector operations (respecting R's ), and
- use the inferred attributes to improve downstream analyses (e.g., resolving S3 method dispatch, detecting invalid accesses, or flagging unintentionally lost attributes).
Of course, the specific scope of these challenges as well as the focus depends on whether you want to do this as a bachelor's or master's thesis as well as your personal preference.
Tasks
- Enrich [3], a static analyzer for the R programming language, to infer attributes for values in R using the existing abstract interpretation framework [4]
- Start with a sensible subset of attributes (e.g.,
class,dim, andnames) and model how common functions (attr<-,structure,class<-,dim<-, arithmetic operators, subsetting, ...) affect them - Use the inference to answer concrete questions, such as which S3 method a call dispatches to [5], and evaluate the precision and performance of your analysis on real-world R scripts
Related Work and Further Reading
- ()
If you want to, you can have a first look at flowR for yourself:
Contact and More
If you are interested and/or have any questions, feel free to contact me any time. We can discuss the topic further and try to adapt it to your personal preferences.
Publications
2026
Towards Automatically Inferring Constraints to Identify Implicit Assumptions in Data Analysis
2026 IEEE/ACM 48th International Conference on Software Engineering (ICSE-NIER ’26)
2026
| DOI: |
2025
Tracking the Shape of Data Frames in R Programs Using Abstract Interpretation
Master's Thesis
August 2025
| DOI: |
Institute of Software Engineering and Programming Languages
Albert-Einstein-Allee 11