A
A
alex4answ2020-09-22 14:59:29
Software testing
alex4answ, 2020-09-22 14:59:29

Is it worth working with a database for integration testing?

Hello, I'm trying to practice writing integration tests.

I'm testing a web application module, CRUD operations.
And then I asked myself whether it is worth using a database for tests or is it enough to use mocks for a library that works with the database, and then check whether its method was called or not.

After all, a third-party library is covered with tests up and down, and in fact I don’t need to write tests to check “whether an entry has been added to the database”.

How to properly approach this issue, check everything from and to, or should we not cover with tests the places that are already covered by unit tests?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-09-22
@alex4answ

Well look. Exactly today I caught the error. Changed the database model, the limitation on the length of the field. The floor model was used in the controller. Moreover, everything passed on the tests, but at the start I see errors. So raise a small base for testing and run absolutely all situations with real data, and write tests based on errors in the bug tracker.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question