mercredi 15 mars 2017

Testing web app client-side: what if server response format changed?

I've just recently started to write tests for a web app I'm working on. And I've realised that I will have a lot of problems with my unit tests if a data, with which server responds, will change. Because all response data is mocked in app client-side tests, the tests should pass.

According TDD I should write tests first and only after that change the code.

Well, if I could quickly change all mocked data in my tests according to new data format, then it would be fine (I could see where tests fails). But what if I cannot do it quickly, what if there are many places where I need to do that and I just don't know where to look at?

So here is my question: is this problem comes down to the fact that I need to write tests in such a way as to be able easily change (or check) mocked data format in all of my tests? Or there are other solutions on that?

Aucun commentaire:

Enregistrer un commentaire