-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix README-pytest.md, add doc/testing.md: Explain the test strategy
Signed-off-by: Bernhard Kaindl <[email protected]>
- Loading branch information
1 parent
a16f5ca
commit 493e0a2
Showing
2 changed files
with
127 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Testing on three levels | ||
|
||
According to many test automation experts, testing should be done on 3 levels: | ||
Unit tests, Integration tests, End-to-End tests. | ||
|
||
This section provides a definition of the terms, how they relate and policies. | ||
|
||
### The testing pyramid, which is widely used in the testing space: | ||
|
||
[](https://en.wikipedia.org/wiki/Test_automation) | ||
|
||
[](https://semaphoreci.com/blog/testing-pyramid) | ||
References: | ||
- https://semaphoreci.com/blog/testing-pyramid | ||
- https://web.dev/articles/ta-strategies | ||
- https://semaphoreci.com/wp-content/uploads/2022/03/pyramid-progression.webp | ||
|
||
### Unit tests | ||
|
||
The bulk of tests should be unit tests: | ||
- Tests one unit of execution (one function, class, or even method of a class) | ||
- Very easy to write and update (even AI can be used to generate ideas for them) | ||
- Fast to execute (few milliseconds per unit test) | ||
- Can be made to cover all branches of a function | ||
- Mocks can be used, by should be used only outside the test target, | ||
because Mocks are lies to tell “all is fine” and thus may only be used outside | ||
the test target (function, class, or method). | ||
|
||
### Integration tests | ||
|
||
- These test the correct integration of a number of functional units | ||
(functions, classes, methods) | ||
- Still easy to write and update | ||
- Still very fast vast to execute (few milliseconds per unit test) | ||
|
||
### End-to-End Tests | ||
|
||
- These test an entire program end-to-end. | ||
- All tests in XenRT are E2E tests, but XenRT tests are even system tests. | ||
- Any test that runs a program as a whole to test its functionality is an E2E test. | ||
- Using a sufficient test environment, many E2E tests are possible without XenRT. | ||
- The final E2E test for `xenserver-status-report` is to get a bug-report through | ||
the UI of XenCenter. |