Once I refactored some stringly typed C# code to use an enum with values Prod and Test instead of the two strings "Prod" and "Test".
I was relying on expressions like
mode == "Test"
to fail to type-check to spot all the places that I needed to update.Sadly some parts of the codebase weren't very idiomatic and had some
"Test".Equals(mode)
This caused a bit of involuntary testing in production and thought me not to trust anything while refactoring.