3 ms·
One fault with TDD that I have heard mentioned is that people tend to write tests and then code only for those tests, ignoring the big picture. Then of course
by Periodic 17y ago
One fault with TDD that I have heard mentioned is that people tend to write tests and then code only for those tests, ignoring the big picture. Then of course there is the other end of the spectrum where people write the app, then use that as the spec to create tests to avoid breaking things.
This is closer to the latter and very sloppy. He's creating a test to fit the data. I feel that tests should embody properties of the perfectly working app, they should be developed almost in isolation, then the code can be modified until it produces the desired output.
But all that said, testing with large data sets and random data sets is a very good way to find your edge cases and work towards more robust code.