Skip to content

Commit 6717639

Browse files
committed
Clean up
1 parent 61cc907 commit 6717639

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

recipes/automated-testing.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Types of Automated Tests
44

5-
There are different approaches to testing and depending on the level of the
5+
There are different approaches to testing, and depending on the level of the
66
entry point, we can split tests into following categories.
77

88
- **Unit Tests**
@@ -18,8 +18,8 @@ internal purposes, this should be considered the naming convention.*
1818

1919
These are the most isolated tests that we can write. They should take a specific
2020
function/service/helper/module and test its functionality. Unit tests will
21-
usually require mocked data, but since we're testing that specific input produces
22-
specific output, the mocked data set should be minimal.
21+
usually require mocked data, but since we're testing the case when specific
22+
input produces specific output, the mocked data set should be minimal.
2323

2424
Unit testing is recommended for functions that contain a lot of logic and/or branching.
2525
It is convenient to test a specific function at the lowest level so if the logic
@@ -36,7 +36,7 @@ tests for the publically available endpoints.
3636

3737
**TODO**: do we want to write anything about mocking the DB data/seeds?
3838

39-
In these tests we should cover *at least* the following:
39+
In these tests we should cover **at least** the following:
4040
- **authorization** - make sure only logged in users with correct role/permissions
4141
can access this endpoint
4242
- **success** - if we send correct data, the endpoint should return response that
@@ -57,27 +57,29 @@ produces the expected result.
5757

5858
Usually, these tests will cover a large portion of the codebase with least
5959
amount of code.
60-
Because of that, they can be the first tests to be added to a project that
60+
Because of that, they can be the first tests to be added to existing project that
6161
has no tests or has low test coverage.
6262

6363
These tests should not cover all of the use cases because they are the slowest to
64-
execute. If we need to test edge cases, we should try to implement those at a
65-
lower level, like integration or unit tests.
64+
run. If we need to test edge cases, we should try to implement those at a lower
65+
level (integration or unit tests).
6666

6767
### Performance Tests
6868

69-
These types of tests will reproduce a usual user scenario and then simulate a group
70-
of concurrent users and measure the server's response.
69+
These types of tests will reproduce a typical user scenario and then simulate a
70+
group of concurrent users and then measure the server's response time and overall
71+
performance.
7172

7273
They are typically used to stress test the infrastructure and measure the throughput
73-
of the application.
74+
of the application. They can expose bottlenecks and identify endpoints that need
75+
optimization.
7476

7577

7678
### Visual Tests
7779

7880
The type of test where test runner navigates to browser page, takes screenshot
7981
and then compares the future screenshots with the reference screenshot.
8082

81-
These types of tests will cover a lot of ground with the least effort and
82-
can indicate a change in the app. The downside is that they're not very precise
83+
These types of tests will cover a lot of ground with the least effort and can
84+
easily indicate a change in the app. The downside is that they're not very precise
8385
and the engineer needs to spend some time to determine the cause of the error.

0 commit comments

Comments
 (0)