With tight deadlines, developing software around scientific domains can mean that these tools are overlooked, with the developer's eyes focused on achieving a particular task. This post isn't about these tools per se, but how and when to employ them for maximum impact.
Correct
- Test coverage: the proportion of exercised code is calculated
- Test driven design: tests are written before the modules they exercise
- Automated testing: automated build servers
- Functional and integration tests: controller, templates and integrated system tests
- User acceptance testing: working with users to evaluate usefulness
- Code randomization and limit tests: searching for uncaught edge cases
Right
It is easy to put off testing on hearing tall tales of 100% test coverage (required in some companies, unbelievably) or dramatic, comprehensive test facilities, for fear that
writing tests is an all or nothing venture, and opting for nothing. In practice, writing tests should focus on quality in the right place:
- The right scope
Test only what needs testing: avoid testing methods already in place elsewhere. - The right scale
Building far reaching helpers or complex mocking is typically avoidable for most modules - The right time
The earlier the better!
Review
Building a review period into a development timeline is a great way to evaluate current practices to highlight what's working, and what isn't. This is the place
to think about ramping up a test framework to more advanced approaches as necessary, rather than never getting going because the scale of doing things 'correctly' is too vast.
"Agile" vs agile
A common misconception is that 'agile' development is a millstone: loaded down with jargon and heavyweight academic practices that
fail to translate into the real world. However, by focussing less on doctrine and more on pragmatic use and review, modern tools and techniques
can add tremendous value whist reducing risk and costs of scientific software projects.
