Diff-based interactive compiler debugging and testing
Debugging and testing compilers has been an strenuous task. Developers need to create a large number of test cases, invoke the compiler on them, and then verify the results against the expected output. Since compilers have many stages, developers might find it difficult to observe the behavior of a certain stage, let alone debugging the stage. Moreover, introducing new features to the compiler may affect existing components intrinsically in ways that traditional tests cannot reveal.
We propose a new prespective on incorporating interactivity into tests. Each test file is divided into smaller blocks by empty lines. The test program sequentially executes each block and appends the inferred type, evaluation results, diagnostic messages, and debugging information as comments to each block. Because each block inherits the context of the previous block, developers can incrementally compose test files in an interactive manner. Additionally, developers can selectively inspect debugging information from different stages by prepending flags to each test block. By monitoring file changes, the test program reruns modified tests and update comments in situ. Those updates are displayed in editors in real time, which makes composing tests as smooth as using an interactive notebook.
These comments are committed to the version control system and can thus track changes made to the compiler. It relies on the diff operation of version control systems, thus we name this testing method “diff-based testing” because. We have implemented this testing system on the MLscript compiler and developed an interactive editor plugin for exploring debugging information.
Mon 21 OctDisplayed time zone: Pacific Time (US & Canada) change
14:00 - 15:30 | |||
14:00 20mTalk | Run, Build and Grow Small Systems Without Leaving Your Text Editor LIVE | ||
14:20 20mTalk | TAPE: From direct to programmatic and back LIVE Ian Clester Georgia Institute of Technology | ||
14:40 10mTalk | Diff-based interactive compiler debugging and testing LIVE Luyu Cheng Hong Kong University of Science and Technology, Lionel Parreaux HKUST (The Hong Kong University of Science and Technology) Link to publication | ||
14:50 10mTalk | Example-driven development: bridging tests and documentation LIVE Link to publication DOI | ||
15:00 20mTalk | Live Programming a Live Programming Environment: An Experience Report LIVE Elliot Evans Polytope, Philippa Markovics Nextjournal, Martin Kavalar Nextjournal, Andrea Amantini Nextjournal, Jack Rusher Nextjournal |