B
B
Blumfontein2016-02-12 16:01:56
Software testing
Blumfontein, 2016-02-12 16:01:56

What is the name of testing the method of a real request to the backend?

What is the name of testing, in which a real automated HTTP request is made to the backend, and then it looks, firstly, the response from the server, and secondly, the state of the storages. For example, we make a request to create a new comment on an article. Then we check, firstly, that the response has the correct HTTP status and the correct response body, and secondly, we climb into the database and check that the commentary was really created there, in one copy, to the desired article, with the desired text, etc. .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2016-02-12
@Blumfontein

This is not a unit test!
This is an integration test.
A unit test tests one aspect of one part.
The integration test will check several parts .
You have several parts:
1. The part of the backend that understands HTTP
2. The part of the backend that gets into the database
3. The part of the backend that generates the response
4. The part of the backend that sends the response via HTTP
Roughly speaking, if the test cannot clearly say where exactly it went wrong and only gives a direction where just dig, then you observe the integration.
see two tests:
1.
test_sum_a_and_b() - Failed
2.
test_login() - Failed
In which of these two will you quickly figure out where to fix and what to fix and why to fix?

D
Dimonchik, 2016-02-12
@dimonchik2013

unit tests are called
xs, however, as with the state of storages, usually when testing code, instead of bases, there are stubs everywhere, but real bases are not possible in production

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question