Work

flowR: A Program Slicer for the R Programming Language

Year: 2025
Type: article
Abstract: On Thursday 15th May, we celebrated the ‘Young RSE Award’ winners from 2023, 2024 and 2025 with a presentation from each of them on the research topic that won them the award. We welcome the 2024 Award Winner - Florian Sihler Abstract: Program slicing is an important technique to assist program comprehension. A program slicer identifies the parts of a program that are relevant to a given variable, e.g. a visualization or statistical test. The resulting slice can then help R programmers and researchers to understand the program by reducing the amount of code to be considered. We present flowR, a novel program slicer and dataflow analyzer for the R programming language. Given an R program and a variable of interest, flowR can return the resulting slice as a subset of the program or highlight the relevant parts directly in the input. Currently, flowR provides a read-eval-print loop, a server connection, an extension for Visual Studio Code, RStudio, and Positron. flowR is available as a docker image. flowR uses a five-step pipeline architecture, starting with a parser to convert the program into an abstract syntax tree (AST). After normalizing the AST, the dataflow extraction works as a stateful fold over the AST, incrementally constructing the graph of each subtree. The calculation of the program slice reduces to a reachability traversal of the dataflow graph which contains the uses and definitions of all variables. Finally, the slice is either reconstructed as R code or highlighted in the input. The presentation recording is available on the HiRSE YouTube Channel: https://www.youtube.com/@Helmholtz_Platform_for_RSE/videos?view=0&sort=dd&shelf_id=3https://www.youtube.com/watch?v=kY7aP3tgG6E Learn more about the HiRSE Seminar Series: https://www.helmholtz-hirse.de/series.html
Language: English
Subfield: Software
Open Access status: green
OpenAlex ID: W6893388969
FWCI:
Cites:
Cited by:
Related to: