CONTEXT Many researchers rely on the R programming language to perform their statistical analyses and visualizations in the form of R scripts. However, recent research and experience show, that many of these scripts contain problems. From being hard to comprehend by combining several analyses and plots into a single source file to being non-reproducible, with a lack of analysis tools supporting the writing of correct and maintainable code. OBJECTIVE In this work, we address the problem of comprehending and maintaining R scripts by proposing flowR, a program slicer and static dataflow analyzer for the R programming language, which can be integrated directly into Visual Studio Code. Given a set of variables of interest, like the generation of a single figure in a script, flowR automatically reduces the program to the parts relevant for the output of interest, like the value of a variable. METHOD First, we use static program analysis to construct a detailed dataflow graph of the R script. The analysis supports loops, function calls, side effects, sourcing external files, and even redefinitions of R’s primitive constructs. Subsequently, we calculate the program slice by solving a reachability problem on the graph, collecting all required parts and presenting them to the user. RESULTS Providing several interactive ways of slicing the program, we require an average of 16ms to calculate the slice on a given dataflow graph, reducing the code by around 94% of tokens.
Tue 29 OctDisplayed time zone: Pacific Time (US & Canada) change
16:30 - 17:30 | Program analysis 1Research Papers / Tool Demonstrations at Compagno Chair(s): Mugdha Khedkar Heinz Nixdorf Institute at Paderborn University | ||
16:30 15mTalk | Parf: Adaptive Parameter Tuning for Abstract Interpretation Research Papers Zhongyi Wang Zhejiang University, China, Linyu Yang Zhejiang University, Mingshuai Chen Zhejiang University, Yixuan Bu Zhejiang University, Zhiyang Li Zhejiang University, Qiuye Wang Fermat Labs, Huawei Inc., Shengchao Qin Fermat Labs, Huawei, Xiao Yi Fermat Labs, Huawei Inc., Jianwei Yin Zhejiang University | ||
16:45 15mTalk | Discovering Likely Program Invariants for Persistent Memory Research Papers Zunchen Huang , Srivatsan Ravi University of Southern California, Chao Wang University of Southern California | ||
17:00 10mTalk | flowR: A Static Program Slicer for R Tool Demonstrations | ||
17:10 10mTalk | Slicer4D: A Slicing-based Debugger for Java Tool Demonstrations Sahar Badihi University of British Columbia, Canada, Sami Nourji The University of British Columbia, Julia Rubin The University of British Columbia Pre-print |