I've been on several projects where we had a significant number of unit tests that would only fail when requirements would change and we had to change the code.
"Look, if it only fails with requirement changes, then maybe we're better off not having them."
This only made people uncomfortable. They just don't like walking down the mental path that leads them to the conclusion that their high coverage unit tests are not worth the tradeoff. Or even that there is a tradeoff present at all.
Meanwhile, PRs constantly ask for more coverage.
Not very often, but sometimes someone will mention: "but unit tests are the specification of the code"
test ShouldReturnOutput {
_mock1.setup( /* complicated setup code returning mock2 */ );
_mock2.setup( /* even more complicated setup code */ );
let output = _obj.Method( 23.5 );
Assert( output == 0.7543213 );
}
/* hundreds of lines above this test case */
setup {
if ( _boolean ) {
_obj = new obj(_mock1);
}
else {
_obj = new obj(new mock());
}
}
I'm just not sure I can get there.