News for hackers. Stuff that matters.
Re:Is TDD Dead? (2014) by bmh100 on Wednesday August 26, 2020 @01:16PM (#24284624)
I used this strategy when developing a client library for a web socket API. It was hugely helpful. I could just include the string of the response in my tests, instead of needing a live server or even a mock server for testing. Tests were much simpler to write and faster to execute.
Re:Is TDD Dead? (2014) by danenania on Wednesday August 26, 2020 @01:28PM (#24284816)
This is great until the API response changes and you have to painstakingly update all your string fixtures to match.
Re:Is TDD Dead? (2014) by jschwartzi on Wednesday August 26, 2020 @02:50PM (#24285853)
One would argue that you should change your string fixtures to match and verify that the new API response doesn't break anything with your existing API client. Then you change the API client and verify that all the old tests still work as expected.

Better yet is if you keep the old fixtures and the new fixtures and ensure that your API client doesn't suddenly throw errors if the API server downgrades to before the new field was added.

Re:Is TDD Dead? (2014) by hinkley on Wednesday August 26, 2020 @02:17PM (#24285454)
The mocks have the same fixtures, plus a bunch of plumbing you have to sort out with every major and some minor version number upgrades.

You pay a bigger tax on the mocks down the road.