Author:
Test⚓︎
Types of Tests⚓︎
There are four major types of tests. You can see their relations in the diagram below:
Definitions
- Formula: \(A\)
- Explanation: test the function of the smallest functional unit
A. Each unit is independent. - Note:
Code coverage: for quantity, measure how much of the original code has been tested.
- Formula: \(A\supset B\) or \(A\rightarrow B\)
- Explanation: test the function of the parent function
AincludingB. - Note: Test
Aindividually needsdependency injection. TestBindividually can just useunit test.
- Formula: \(A\supset B + C\)
- Explanation: test object: Some system function from frontend
Cto backendA. - Note: The
system testis the same asUI test, which focuses on some system functions.
- Formula: \(U_{Frontend} + U_{Backend}\)
- Explanation: End to end tests. From frontend to backend for all the system functions.
- Note: One specific
E2E testor a fewE2E testsspecific to some feature is classified intosystem tests.
- Formula: \(\forall \{A|A\in U_{Frontend}\} + \{C|C\in U_{Backend}\}\)
- Explanation: manual and arbitrary tests from customers or maintainers.
Syntax of Tests⚓︎
Tests syntax
- Given: setup & assumptions
- When: thing that actually be tested
- Then: assertions (what do you expect)

