written by Eric J. Ma on 2016-03-15
In the software development world, I learned about the importance of writing tests for one’s software. Since then, I have incorporated this habit in my own work, where as part of my more recent work, I write tests for the software I write to conduct scientific research.
This has got me thinking about why tests are such an effective tool. I think there’s got to be at least a few reasons.
py.test, the test suite is automatically run from start to finish. This reduces the cognitive load of running the tests one-by-one, and reinforces the cohesiveness of the code logic.Okay, so what exactly do I mean by tests? Here’s a few thoughts.
While it takes time, I think computational scientists should write tests for their code as a matter of routine practice. Not sure if good test writing is enforceable, but it should definitely be done more.
@article{
ericmjl-2016-tests-enabled-science,
author = {Eric J. Ma},
title = {Tests-Enabled Science},
year = {2016},
month = {03},
day = {15},
howpublished = {\url{https://ericmjl.github.io}},
journal = {Eric J. Ma's Blog},
url = {https://ericmjl.github.io/blog/2016/3/15/tests-enabled-science},
}
I send out a newsletter with tips and tools for data scientists. Come check it out at Substack.
# TODO(eric): learn how to learn anything. feb 2027.
If you would like to sponsor the coffee that goes into making my posts, please consider GitHub Sponsors!