Coverage for important strings
Coverage for important strings
Posted Oct 29, 2024 19:37 UTC (Tue) by mathstuf (subscriber, #69389)In reply to: Coverage for important strings by iabervon
Parent article: A new approach to validating test suites
Other strings should certainly *not* be permuted into some test string though (e.g., changing `cp` to `rm` in something doing commands sounds…very risky). Alas, even in Rust, strings end up in many places (usually wrapped in some type-scented decoration for type checking during compilation), but mutation of them is probably something needing typed string literals of some kind.
Posted Oct 31, 2024 16:48 UTC (Thu)
by mbp (subscriber, #2737)
[Link] (1 responses)
> Other strings should certainly *not* be permuted into some test string though (e.g., changing `cp` to `rm` in something doing commands sounds…very risky).
Mutating the program is just unavoidably, intentionally, going to cause new behaviors. If you have a function that, for example, takes a path to delete and with "" deletes your home directory, then cargo mutants might cause that to execute, but so might any other bug. For programs containing code that might cause side effects beyond the program's own execution you probably want to run the tests in a container or VM: https://mutants.rs/limitations.html?highlight=delete#caut...
Posted Nov 4, 2024 13:16 UTC (Mon)
by mathstuf (subscriber, #69389)
[Link]
Coverage for important strings
Coverage for important strings
