Re:Coverage is not strongly correlated with test suite effec...
by tharkun__ on Monday September 27, 2021 @09:12PM
(#28678157)
That's because you know how to write good tests but TDD didn't force you to do that.
Simply put, TDD just means you write the assertion first, see it red, then change the code to make it green.
You can do that by specifying a failing test via input/output testing. You can also very easily write a failing test that tests that the YXZ() method is gonna be called on some internal thing that you're replacing with a mock. Add that method and voila, green test, TDD happy. Bad test though.
Simply put, TDD just means you write the assertion first, see it red, then change the code to make it green.
You can do that by specifying a failing test via input/output testing. You can also very easily write a failing test that tests that the YXZ() method is gonna be called on some internal thing that you're replacing with a mock. Add that method and voila, green test, TDD happy. Bad test though.