Learning to Blame: Localizing Novice Type Errors with Data-Driven Diagnosis

08/25/2017
by   Eric L. Seidel, et al.
0

Localizing type errors is challenging in languages with global type inference, as the type checker must make assumptions about what the programmer intended to do. We introduce Nate, a data-driven approach to error localization based on supervised learning. Nate analyzes a large corpus of training data -- pairs of ill-typed programs and their "fixed" versions -- to automatically learn a model of where the error is most likely to be found. Given a new ill-typed program, Nate executes the model to generate a list of potential blame assignments ranked by likelihood. We evaluate Nate by comparing its precision to the state of the art on a set of over 5,000 ill-typed OCaml programs drawn from two instances of an introductory programming course. We show that when the top-ranked blame assignment is considered, Nate's data-driven model is able to correctly predict the exact sub-expression that should be changed 72 higher than the state-of-the-art SHErrLoc tool. Furthermore, Nate's accuracy surpasses 85 consider the top three.

READ FULL TEXT
research
10/07/2022

Novice Type Error Diagnosis with Natural Language Models

Strong static type systems help programmers eliminate many errors withou...
research
07/13/2023

Ill-Typed Programs Don't Evaluate

We introduce two-sided type systems, which are a particular kind of sequ...
research
04/05/2019

Generate, Filter, and Rank: Grammaticality Classification for Production-Ready NLG Systems

Neural approaches to Natural Language Generation (NLG) have been promisi...
research
04/29/2021

SYNFIX: Automatically Fixing Syntax Errors using Compiler Diagnostics

Beginning programmers struggle with the complex grammar of modern progra...
research
02/12/2021

Data-Driven Synthesis of Provably Sound Side Channel Analyses

We propose a data-driven method for synthesizing a static analyzer to de...
research
08/28/2020

Effectiveness of Annotation-Based Static Type Inference

Benefits of static type systems are well-known: they offer guarantees th...
research
10/14/2019

Learning Lenient Parsing Typing via Indirect Supervision

Both professional coders and teachers frequently deal with imperfect (fr...

Please sign up or login with your details

Forgot password? Click here to reset