Litcius/Paper detail

RustSmith: Random Differential Compiler Testing for Rust

Mayank Sharma, Pingshi Yu, Alastair F. Donaldson

202327 citationsDOIOpen Access PDF

Abstract

We present RustSmith, the first Rust randomised program generator for end-to-end testing of Rust compilers. RustSmith generates programs that conform to the advanced type system of Rust, respecting rules related to borrowing and lifetimes, and that are guaranteed to yield a well-defined result. This makes RustSmith suitable for differential testing between compilers or across optimisation levels. By applying RustSmith to a series of versions of the official Rust compiler, rustc, we show that it can detect insidious historical bugs that evaded detection for some time. We have also used RustSmith to find previously-unknown bugs in an alternative Rust compiler implementation, mrustc. In a controlled experiment, we assess statement and mutation coverage achieved by RustSmith vs. the rustc optimisation test suite.

Topics & Concepts

CompilerRust (programming language)Computer scienceGenerator (circuit theory)Test suiteProgramming languageSuiteParallel computingTest caseMachine learningArchaeologyRegression analysisPower (physics)PhysicsQuantum mechanicsHistorySoftware Testing and Debugging TechniquesSoftware Engineering ResearchSoftware Reliability and Analysis Research