arrow
返回

A study of common bug fix patterns in Rust

delete2024-02-12
delete2
PRE
AI
M
Mohammad Robati Shirzad *
P
Patrick Lam
DOI:10.1007/s10664-023-10437-1delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Rust is a relatively new programming language which allows programmers to write programs that have low-level control over resources while still ensuring high-level safety guarantees (for programs written in safe Rust). Rust's ownership framework enables programs to meet these two seemingly-contradictory goals. The Rust compiler's Borrow-Checker component enforces the ownership framework requirements that ensure Rust's safety guarantees. Rust is popular: as of 2022, it has ranked first, for the seventh consecutive year, in Stack Overflow's annual Developer Survey as the most-loved programming language. The number of Rust developers is growing as the need for faster and safer software increases. Yet, to our knowledge, no research has sought to identify the most pervasive bug fix patterns within Rust programs. In this project, we introduce Ruxanne, a tool for analyzing and extracting fix patterns in Rust. Ruxanne implements a novel embedding of Rust code into fixed-sized vectors. Using Ruxanne, we mined the top 18 most-starred Rust projects in GitHub to discover the most common bug fix patterns committed to their repositories. We analyzed 87,726 code changes drawn from 57,214 commits across these 18 projects. After clustering the code changes, and conducting a manual analysis, we identified 20 groups of cross-project bug fix patterns, which we categorize as (1) general patterns and (2) borrow-checker-related patterns. Among the general patterns, the most frequently observed pattern is when the user either adds or removes struct fields. In the case of borrow-checker-related patterns, the most common pattern we encountered is when the user removes a clone() call. We describe all detected patterns and their implications to automated program repair.
Keyword:
Bug patterns
Pattern mining
Bug fix changes
Rust

期刊

Empirical Software Engineering 封面图
Empirical Software Engineering
IF:
3.6
论文数:
2.0K
被引数:
5.3K

机构

U
University of Waterloo
学者数:
2.2W
论文数: 2.3W
被引数: 3.3W
引用论文

引用论文

err分享
err收藏
A Survey on Software Fault Localization软件故障定位研究综述
err2016-08-01
err741
errOAAI
errWong, W. Eric; Gao, Ruizhi; Li, Yihao; Abreu, Rui; Wotawa, Franz
err分享
err收藏
err
IF0
err
err0
PREAI
err
err分享
err收藏
err分享
err收藏
Ultra-low-temperature cooling of two-dimensional electron gas
err2000-05-01
err0
PREAI
errJ.S Xia; E.D Adams; V Shvarts; W Pan; H.L Stormer; D.C Tsui
err分享
err收藏
Ca2+ Activated K Channels-New Tools to Induce Cardiac Commitment from Pluripotent Stem Cells in Mice and Men
err2011-10-26
err0
PREAI
errMartin Müller; Marianne Stockmann; Daniela Malan; Anne Wolheim; Michael Tischendorf; Leonhard Linta; Sarah-Fee Katz; Qiong Lin; Stephan Latz; Cornelia Brunner; Anna M. Wobus; Martin Zenke; Maria Wartenberg; Tobias M. Boeckers; Götz von Wichert; Bernd K. Fleischmann; Stefan Liebau; Alexander Kleger
err分享
err收藏
On the Naturalness of Software论软件的自然性
err2016-04-26
err164
PREAI
errHindle, Abram; Barr, Earl T.; Gabel, Mark; Su, Zhendong; Devanbu, Premkumar
err分享
err收藏
学者 查看更多内容