dimanche 12 mars 2017

Where to write tests for a Frontend/Backend application?

I want to write a web application with a simple Frontend-Backend(REST API) architecture. It's not clear to me where and how to write tests.

Frontend: should I write tests mocking API responses and testing only UX/UI? Backend: should I write here API call testing and eventually more fine grained unit testing on classes?

But in this way I'm afraid that Frontend testing is not aware of real API response (because it's mocking independently from the backend). On the other side if I don't mock API response and use real response from backend, how can the Frontend client prepare the DB to get the data he wants?

It seems to me that I need 3 kind of testing types: - UX/UI testing: the Frontend is working with a set of mock responses - API testing: the API is giving the correct answers given a set of data - Integration testing: The Frontend is working by calling really the backend with a set of data (generated by who?).

There are framework or tools to make this as painless as possible? It seems to me very complicated (if API spec changes I must rewrite a lot of tests)

any suggestion welcome

Aucun commentaire:

Enregistrer un commentaire