vendredi 12 mars 2021

How to test frontend and APIs?

intro: i'm currently taking a course at my university where we do TDD and BDD. We haven't learned anything about how to do frontend test except that we should never do BDD or TDD by testing the view layer since any changes to this layer would mess up all the tests. We've only worked in java and within the business logic layer (we've not even learned about persistence).

question(s): I am working on an application using BDD methodologies. The BDD helped me implement the business logic. I am using hibernate ORM and mysql for the persistence. And it seems safe to assume any malfunctions in the persistence layer would also make the tests for the business logic fail. Is that correct to assume or is it also necessary to write tests for a database even though the business layer tests would fail if something is wrong in the persistence layer?

if i were to implement an API in the application layer and have a frontend written in react. Should i then do modular tests of the components and write a seperate test for the API (application layer)? the software written in the api that's using the business logic could be wrong and therefore i assume it would be a good idea also to test this part.

I've searched a lot on the internet and here and it seems like there are tools for testing frontend (jest) and selenium or postman for API tests. I assume i can reuse my feature description for all the layers but isn't there some easier way to test all layers? and is this really the best and easiest way to test an application?

Aucun commentaire:

Enregistrer un commentaire