Improving our software testing strategies with a workshop
Recently, my team got together to brainstorm better ways to test the digital product we’re working on. We were encountering some challenges in making the front end testing process smooth and effective, so we decided to do some research and put together a plan for mitigating the problem. The idea was born in a Retrospective meeting and soon after we scheduled a testing workshop to come up with solutions. In this article, we’ll share with you what ideas were generated in that workshop and how our testing strategies have improved as a result.
The project’s testing context
My team is composed of 10 people, a team leader, the developers and designers, all dedicated to a project for a client that has been an Octobot partner for over a year now. The client, VES-Artex, is a company that provides solutions for dairies that want to design the best environment for their animals. Their team of veterinarians, dairy experts, engineers and other professionals work together to create optimal barn conditions using lighting, ventilation, heat and various sensors that control the environment and make sure cows are comfortable.
Besides engineering the physical equipment used to accomplish this goal, VES-Artex also offers their clients a software solution to manage barn devices, tracking key production metrics, and also monitoring market and climate information. This is the product we’ve been working on.
Users can access the Dairy-BOS app from any device. It’s available in many languages and its dashboard is easy to customize, so farm managers and other stakeholders can know what’s going on at the barn at all times. Our team, divided into back and front end sub-teams, works with React and Django. After a successful first launch in November, we continued working on product improvements and now we’re polishing the app’s dashboard, adding new graphic options and data visualization features.
Prioritizing the testing phase
Since the project’s inception, we decided to give the software testing the importance it deserves. We understand testing is a critical step during the development process and should be prioritized from day 1. By testing, we prevent and correct errors as early as possible, resulting in a reliable, high-quality product that provides users with an impeccable experience. It’s also necessary in order to keep evolving the product without compromising previous versions; every time we launch a new functionality, we test to make sure the old ones are still working as intended.
For the front end testing, which is our focus of this article, we used two libraries:
- React Testing Library (a lightweight library designed for testing React applications).
React Testing Library
Our solution is based on React Boilerplate, which already comes with these testing tools as default. Our team didn’t have a lot of experience with the React Testing Library, but after researching it we felt confident it was the best option, especially because it operates under the following guiding principle: “The more your tests resemble the way your software is used, the more confidence they can give you.”
This means that React Testing Library does not provide methods to test components’ implementation details, but rather forces us to test the component from the point of view of user interactions. For example, you cannot check in a test that a component’s state was changed, but you can test that an element changes color or that a list of items is shown.
To make sure we prioritized testing in our development process, we decided to include the unit tests as essential parts of the tasks planned for the sprint. If you’re wondering, our work methodology is SCRUM and our sprints last 2 weeks. From the very first day, we made sure the testing was contemplated every step of the way, from the smallest components to the most complex UIs.
Also, our continuous integration practices automatically run testing and linting in each pull request and they can only be merged when the tests fulfill a determined percentage of code coverage. Another good practice is that when someone is reviewing a PR, the acceptance criteria says the task must include its own tests to be validated.
We also discussed testing in episode 13 of our podcast, Octobot Tech Talks.
How to improve testing efficiency with a workshop
Even though we established ground rules from the start, the team’s learning curve for mastering the testing process with this library was higher than expected. At some point, we realized that implementing the tests was taking more time than developing the features. Each one of the developers was facing these difficulties on their own, until we discussed the issue in a Retrospective and decided to find a solution as a team.
A workshop seemed like the best place to talk about these challenges, share solutions, and determine common ground for implementing the tests successfully. Our team leader was responsible for preparing the workshop’s agenda and a few days later the team got together to perform these activities:
- Insights presentation: the team leader got the meeting started by presenting her own research on the React Testing Library, best practices and recommendations by the library author. Also, tips from other developers found in blog posts and tutorials.
- General discussion: after her presentation, we had an open space to discuss what we liked or disliked about the recommendations and how we envisioned them in our project.
- Learning by doing: then, we selected a component from the app that needed to improve its tests. In groups of two or three devs, we dedicated a few hours to create the testing step-by-step for this component.
- Making decisions: next, each group presented their ideas. After exchanging thoughts and acknowledging the positive aspects of each group’s content, the team leader was tasked with unifying all of the tests, collecting from every group. Later, we applied this common process to the whole project.
The workshop changed the way we were facing the testing process and everyone on the team felt more confident and enthusiastic as a result. Together, we learned insightful use cases of the React Testing Library and standardized our testing implementation. This unification made our tests similar, allowing us to help each other more and to evolve our game as a team. After we understood how best to use the library and set an approach for implementation, the testing became simpler, faster and more productive.
As of today, we continue to look for improvements and better ways to test our solution. We also plan to add a QA tester to the team. This role will support our testing practices and improve them even more. Having a professional dedicated to quality assurance, who will be testing the product in a more profound and comprehensive way, will be positive both for the team and the final solution.
Download our testing good practices ebook
We want to tell software development teams out there that they shouldn’t be discouraged by testing challenges. We found that testing improves with practice and teamwork, so feel free to reach out if you’d like more tips for creating your team’s own workshop. This experience reinforced our belief that tests are very important, and we should incorporate them into planning and estimating to make sure they are a priority.
Last but not least, if you want to know more about our best practices for using React Testing Library and Jest, feel free to download our team’s testing guidelines here:
TL;DR: Listen to our podcast
Recently, my colleagues and I participated in the Octobot Tech Talks talking about the workshop and our experience with testing in software development. If you speak Spanish, you can listen to it here: