Re:In-Memory Filesystems in Rust
by Arch-TK on Monday August 25, 2025 @08:30AM
(#45013137)
Fault injection is much easier if you can mock IO. And you aren't really testing your software if you're not injecting faults.
[ Parent
| on HN ]
Re:In-Memory Filesystems in Rust
by ozgrakkurt on Tuesday August 26, 2025 @11:50PM
(#45035276)
My point is, you can give gibberish data to a processing function if it just takes in-memory data instead of being parameterized by βIOβ.
If you parameterize everything by IO then you have to mock the IO
It's not just about gibberish data. It's read failures, write failures, open failures, for a variety of reasons including permission errors, disk errors, space errors, etc.
You basically want to test your code does something sensical with either every possible combination of errors, or with some random subset of combinations of errors. This can be automated and can verify the behaviour of your program in the edge cases. It's actually not usually that helpful to only test "we read corrupt garbage from the file" which is the thing you're describing here.