A Controlled Experiment on the Effect of Ownership Rules and Mutability on Localizing Errors in Rust in Comparison to Java

Lukas Poos, Stefan Hanenberg, Stefan Gries, Volker Gruhn

2025

Abstract

The programming language Rust introduces language constructs such as ownership rules and mutability whose effect is, that undesired side-effects can be detected by the compiler. However, it is relatively unknown what the effect of such constructs on developers is. The present work introduces an experiment, where Rust and Java code was given to ten participants. The code, that consisted of ten function calls, contained one function that performed an undesired side-effect which led to an error in the main function. The participants’ task was to identify the function that caused this effect. The experiment varied (in the Rust code) the number of calls where a parameter was passed as mutable (which is inherently the case in languages such as Java). Such variation had a strong (p < .001) and large (η 2p = .459) effect on participants. On average, it took the participants 29% more time to identify the function in Java. However, this number varied between -4.3% and 117%, depending on how many parameters where passed as mutable. Altogether, the experiment gives evidence that an explicit passing of variables as mutable has a positive effect on developers under the experimental conditions.

Download


Paper Citation


in Harvard Style

Poos L., Hanenberg S., Gries S. and Gruhn V. (2025). A Controlled Experiment on the Effect of Ownership Rules and Mutability on Localizing Errors in Rust in Comparison to Java. In Proceedings of the 20th International Conference on Software Technologies - Volume 1: ICSOFT; ISBN 978-989-758-757-3, SciTePress, pages 410-421. DOI: 10.5220/0013647500003964


in Bibtex Style

@conference{icsoft25,
author={Lukas Poos and Stefan Hanenberg and Stefan Gries and Volker Gruhn},
title={A Controlled Experiment on the Effect of Ownership Rules and Mutability on Localizing Errors in Rust in Comparison to Java},
booktitle={Proceedings of the 20th International Conference on Software Technologies - Volume 1: ICSOFT},
year={2025},
pages={410-421},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0013647500003964},
isbn={978-989-758-757-3},
}


in EndNote Style

TY - CONF

JO - Proceedings of the 20th International Conference on Software Technologies - Volume 1: ICSOFT
TI - A Controlled Experiment on the Effect of Ownership Rules and Mutability on Localizing Errors in Rust in Comparison to Java
SN - 978-989-758-757-3
AU - Poos L.
AU - Hanenberg S.
AU - Gries S.
AU - Gruhn V.
PY - 2025
SP - 410
EP - 421
DO - 10.5220/0013647500003964
PB - SciTePress