This is a blog sharing insights from Episode 5 of the Community Conversation series ‘Enabling Open Science Through Research Code’.
In the world of research software development, ensuring that code runs correctly and produces reliable results is crucial. However, software testing is often overlooked, particularly in academic settings where researchers may lack formal training in programming best practices. This challenge was a central theme in the recent discussion during episode 5 of our six-part series “Enabling Open Science Through Research Code”, where experts from diverse backgrounds shared their experiences and insights on making software testing accessible and effective.
During the session, panellists emphasised that while research software development is often self-taught, adopting best practices such as software testing can improve both individual efficiency and collaboration. One of the mantras that continuously came up in the different episodes is that
We should be our own best collaborators first.
Episode 5 once again showed how good coding practices can benefit the coder as much as other contributors, collaborators, and users. This post summarises the discussion, highlighting practical tips for beginners and more advanced strategies for experienced developers.
Our wonderful speakers included:
If you’re new to coding or research software development, software testing may seem like an advanced topic. However, as our panellists suggest, starting with simple practices can make a big difference in the reliability of your code.
assert
statements in Python.nbval
can help validate Jupyter Notebooks by checking that expected outputs remain consistent, an approach that Abhishek recommended.assert 2 + 3 == 5
is a great first step.pytest
is a lightweight and easy-to-use testing framework, whereas in R, testthat
provides a simple way to implement tests within research code.usethis}
package simplifies the workflow setup, automating repetitive tasks (for both R packages as well as non-package projects), as suggested by Saranjeet. She also recommended using the {fusen}
package for anyone new to R package development (and also for experienced developers while they are prototyping functions) as it involves writing the function as well as its documentation and unit tests in the same file, avoiding the risk of forgetting crucial steps.For those already familiar with software development, a more structured approach to testing can improve reproducibility and collaboration. The panellists discussed key strategies for advanced users, including:
hypothesis
in Python to test code with a range of inputs, uncovering unexpected behaviours. Abhishek noted this as particularly useful for numerical research software.final_version_revised_final_final.py
, which is a nightmare to maintain.”tox
or nox
(Python) allow testing across multiple versions of a language. Abhishek highlighted that CI workflows, once set up, eliminate the need to manually ask colleagues to test code on different platforms.pandera
in Python, a tool that helps verify data integrity and data schemas before analysis.scipy.stats
can confirm that distributions match expected properties, an approach recommended for data-intensive projects.targets
package helps manage computational workflows efficiently, only re-running necessary parts of the code. Saranjeet recommended this as a time-saving approach for researchers handling large datasets.Software testing is not just for professional developers—it is an essential practice for research reproducibility and collaboration. While beginners can start with simple assertions and unit tests, advanced users can implement continuous integration, property-based testing, and automated data validation to ensure code reliability.
As Anelda concluded,
Testing is not just about making research more open; it’s about being your own best > collaborator.
By integrating these testing strategies into research software development, we can move toward a more open, transparent, and reliable scientific ecosystem.
📢 Explore More:
Access our Resource Sheet, which contains numerous valuable resources shared by the panellists, facilitators, and participants.
View the session recording on YouTube.
The first draft of this blog post was created with ChatGPT from the edited video transcript.
The next episode in the series, “Research Software Funding” will take place on March 20, 2025, at 08:30 UTC. Be sure to register here and join the conversation!
This series is an excellent opportunity to learn, connect, and grow as we work together to enable open science - one line of code at a time.
This meetup series is a collaboration between Talarify, RSSE Africa, RSE Asia, AREN, and ReSA.
For more information and to join upcoming events, visit:
For attribution, please cite this work as
Grobbelaar (2025, March 20). RSE Asia Association: Enabling Open Science Through Research Code: Insights from Episode 5 - Testing Research Code. Retrieved from https://rse-asia.github.io/RSE_Asia/
BibTeX citation
@misc{grobbelaar2025enabling, author = {Grobbelaar, Anelda van der Walt, Jyoti Bhogal, Saranjeet Kaur Bhogal, Abhishek Dasgupta, Sheena O’Connell, Mireille}, title = {RSE Asia Association: Enabling Open Science Through Research Code: Insights from Episode 5 - Testing Research Code}, url = {https://rse-asia.github.io/RSE_Asia/}, year = {2025} }