I’ve had multiple run-ins with developers in the last couple months on teams that were struggling with flakey tests. One suggestion to fix the problem was to change the app in a way that would make it more testable, usually by exposing some extra piece of information or providing a hook that would let tests see when the appropriate time to check an assertion is.
In each case, developers on the team flat out refused, saying they were totally against changing the app just for testing.
Why are some developers so fundamentally opposed to changing an app to make it more testable? What have you done to address this view?