Static Prediction of Runtime Errors by Learning to Execute Programs with External Resource Descriptions

03/07/2022
by   David Bieber, et al.
0

The execution behavior of a program often depends on external resources, such as program inputs or file contents, and so cannot be run in isolation. Nevertheless, software developers benefit from fast iteration loops where automated tools identify errors as early as possible, even before programs can be compiled and run. This presents an interesting machine learning challenge: can we predict runtime errors in a "static" setting, where program execution is not possible? Here, we introduce a real-world dataset and task for predicting runtime errors, which we show is difficult for generic models like Transformers. We approach this task by developing an interpreter-inspired architecture with an inductive bias towards mimicking program executions, which models exception handling and "learns to execute" descriptions of the contents of external resources. Surprisingly, we show that the model can also predict the location of the error, despite being trained only on labels indicating the presence/absence and kind of error. In total, we present a practical and difficult-yet-approachable challenge problem related to learning program execution and we demonstrate promising new capabilities of interpreter-inspired machine learning models for code.

READ FULL TEXT

page 10

page 18

page 19

page 20

research
06/04/2022

Fault-Aware Neural Code Rankers

Large language models (LLMs) have demonstrated an impressive ability to ...
research
09/13/2018

Bounded Symbolic Execution for Runtime Error Detection of Erlang Programs

Dynamically typed languages, like Erlang, allow developers to quickly wr...
research
02/10/2023

C-rusted: The Advantages of Rust, in C, without the Disadvantages

C-rusted is an innovative technology whereby C programs can be (partly) ...
research
03/23/2016

Debugging Machine Learning Tasks

Unlike traditional programs (such as operating systems or word processor...
research
12/13/2020

Fine-Grained Lineage for Safer Notebook Interactions

Computational notebooks have emerged as the platform of choice for data ...
research
01/29/2022

Using Dynamic Binary Instrumentation to Detect Failures in Robotics Software

Autonomous and Robotics Systems (ARSs) are widespread, complex, and incr...
research
09/07/2015

C3: Lightweight Incrementalized MCMC for Probabilistic Programs using Continuations and Callsite Caching

Lightweight, source-to-source transformation approaches to implementing ...

Please sign up or login with your details

Forgot password? Click here to reset