Testability
and failing fast
Quality coding #4
Dan Fitch
2020-11-04
Testability
What does it mean?
Testable by humans
Testable by code!
Failing fast
Why fail?
Can't learn without failing!
Pop quiz
Better bash ways?
set -e
Check value of $?
Unit testing
In general
- Find small pieces or functions
- Write one or more tests to confirm it does what you
think it does
- Run tests whenever you make changes
TDD (test-driven development)
- Write test
- Make sure it fails
- Make it pass
Summary
How to apply to task code?
- E-prime: you can't
- Psychopy: very difficult
- JS frameworks: tricky, but possible
How to apply to glue code and pipelines?
THE END
(discussion)
wheeeeee