Does it work? How do you know?
Arjoonn Sharma (~arjoonn) |
Description:
I want to build a story around testing / verification / CICD and how a person might grow a project's testing needs gradually.
I'll fill this description out as I find time but here are some ideas I want to cover:
- Making things reproducible. Use docker / git.
- Run tests often.
- On file save.
- On commit using git hooks.
- On CICD on push.
- On cross-project pushes.
- On schedule because things can break at midnight.
- Be as explicit as possible, without tiring yourself out too much. Use types / immutable structures.
- Try to design in the problem space, instead of the solution space. Use fuzz testing / property testing.
- Write down things as you code. You assumptions. Use deal if you want. At least use assertions.
Techniques
- Run things on your local before commit/push.
- Run things on git commit/push automatically.
- Run things in CI.
- Run things periodically in CI.
- Run fuzz tests with larger parameters overnight.
- Cross project dependencies should be tested when they change.
- Test against your UAT site /testing/staging site while it's live.
Testing in python
- Testing by simply running your code
- Use coverage.py to find out what all never ran
- Using pytest to run your code
- Using hypothesis to generate test cases for you
Approaches
- Writing pure-ish functions. These are WAY easier to test
- Using a
mixins
approach. Auto-discover the usage of the mixin and run a single test for the mixin behavior wherever it is used. - Use hypothesis to generate test cases for you
Speaker Info:
Hi I'm Arjoonn. I run midpathsoftware.com and we do consultation across tech stacks / problem statements.
I'm very interested in improving the quality of code via developer process / automation.
Speaker Links:
https://arjoonn.com/