Skip to content
Book Open access

RustGTC: Constraint-Guided Test Generation for Rust APIs via Comment Analysis and Code Context

Oct 2026 · Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering · pp. 2985-2996 · 0 citations · 36 references

TL;DR

Results show that RustGTC uses documented constraints to guide Rust API test generation and reveal comment-code inconsistencies around boundary cases and reveal comment-code inconsistencies around boundary cases.

Abstract

Manually crafting test cases for Rust APIs is labor-intensive and error-prone, especially because of Rust’s advanced features and complex trait system. Recent advances in large language models (LLMs) have shown promise in automated test generation; however, existing approaches often underuse documented input requirements embedded in API comments. We present RustGTC, a framework that uses API comments to guide Rust API test generation. RustGTC extracts documented parameter constraints from comments, constructs tests around boundary cases, and repairs generated tests to improve compilability. We evaluate RustGTC on 12 Rust crates, achieving high coverage and uncovering 41 defects. Additionally, we submitted 132 test cases; 123 were accepted, 9 were rejected. These results show that RustGTC uses documented constraints to guide Rust API test generation and reveal comment-code inconsistencies around boundary cases.

Read PDF

Similar papers

Open access Oct 2026

RICE: Harnessing LLMs and Historical Issues to Discover Internal Rust Compiler Errors

Rust is a modern system-level programming language that emphasizes safety, concurrency, and performance. Ensuring the reliability of the Rust compiler is critical, as undetected compiler defects, particularly internal compiler errors (ICEs), can lead to runtime crashes or undefined behavior in system software. Existing...

Lang-Yi Lu, Wei You, Bin Liang et al. · 0 citations
Book Open access Sep 2026

Validating Rust Compilers with Trait-Type Constraint Graph

This work proposes a validation methodology based on a novel concept of Trait-Type Constraint Graph (TTCG), a graph that captures semantic relationships between traits and types and enables the derivation of the Trait Constraint Space (TCS) for systematic exploration.

Xin Lai, Ming Wen, Xiao-Fei Liao et al. · 0 citations
#software testing Preprint Sep 2026

How effective are traditional test criteria at detecting bugs in large language models generated code?

An empirical study involving 5 Large Language Models and 4 benchmarks evaluates the effectiveness and efficiency of 3 widely used adequacy criteria: statement coverage, branch coverage, and mutation testing, finding that mutation testing only marginally outperforms traditional coverage criteria in both triggering and d...

Asma Hamidi, Michael Konstantinou, R. Degiovanni et al. · 0 citations
Open access Aug 2026

Rust’s Type Checker Implementation Is Unsound: An Empirical Study on Soundness Bugs in rustc

An empirical study of 30 issues that report potential soundness bugs in rustc, collected from the GitHub issue tracker between January 1, 2022 and September 1, 2025, indicates that certain soundness bugs, typically triggered by implied bounds or trait objects, compromise memory safety.

Yusung Sim, Sukyoung Ryu, Jaemin Hong · 0 citations
Book Open access Oct 2026

Beyond Benchmarks: A Case Study of LLM-Generated Verus Specification Failures on Asterinas Vostd

Large language models (LLMs) have recently shown promise in automating formal specification generation, but their effectiveness has mainly been demonstrated on self-contained benchmark tasks. This paper examines the changes that occur when LLM-generated specifications are applied to an industrial verification project....

Du-Gang Liu, Ding Wang, Chao Jiang et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.