@ -209,3 +209,20 @@ For the group project we can keep the psychological aspects of testing in mind.
### repetition
The testing pyramid consists of four levels. The closer to the ground the level the cheaper tests of that category are and the more you should have of them. At the bottom are unit tests, above that component or contract tests followed by integration tests with gui or end to end tests at the top.
## lecture 19th December 2023
### takeaway
- reasons for automated tests
- environment needs to support it
- application/module tests vs unit tests
- unit tests -> executable documentation preventing unwanted changes
- FIRST RTFM
- following clean code rules makes writing unit tests easier
- stub vs fake vs mock
### perception
For the group project we can keep in mind that in order to write proper unit tests we need to follow clean code best practices. Otherwise the code can be come difficult to test as the isolation of different units gets impossible. Programming against apis and avoiding instantiating the needed dependencies is part of the way to testable code.
### repetition
Unit tests have to be independent. As a result, there shall be not state spanning across multiple tests. The order of execution should never matter for unit tests. Every unit test can basically be seen as its own program.