Tests are written to assure the correctness and quality of the solution they examine. Engineers write tests at different stages of the development cycle, starting at unit tests up to e2e tests. In fact, for every line of production code, multiple lines of test code is written.
Writing tests is no different from writing production code. In order to keep it running correctly and assist in detecting issues, it needs to be written in a way that can stand the test of time, provide the needed information on failures and be maintained for the project lifetime.
This talk presents test best practices which can be applied at all test stages. The practices are focused to help write good tests and provide the needed information for debugging and troubleshooting the issues detected.
While each language and test framework may present different properties and challenges, the practices are agnostic to a specific language/tool.
Examples will be given in Golang using Ginkgo/Gomega and in Python using PyTest.
The talk will cover: - Test structure - Test isolation - Test fixtures vs test body - Assertion - Traceability - Shared resources - Dead test (code) - Skipping, xfailing or not running - Parallel tests
The talk is based on the following blog post: https://ehaas.net/blog/tests-best-practices/
Software and Networking specialist, currently focusing on virtualization and container technologies. Experienced with data path optimization and acceleration.Consider code as an art and keeping it clean as a must.
Thursday February 18, 2021 3:30pm - 3:55pm CET
Session Room 3