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
The anatomy of the refactoring-resistent tests i was refering to above is basically this: | |
Arrange | |
- Setup dependencies by mostly using actual prod code, including actual instance of db, mocks/stubs only for external services i don't control | |
- Get system to a state required to execute the behavior i want to test by using public api of the system (e.g. when i register a user i need for the test, i execute the same code that would be executed when a user would register by using the actual software, i don't fake the state with stubs or take shortcuts by adding prepared data to db directly) i want the software to get to the desired state by running the actual production code | |
Act | |
- Execute operation i want to test | |
Assert |