Mindset shift #2: Test everything, all the time
Skillset required: In addition to the skillsets needed for automated testing, we also need a good understanding of DevOps tools and approaches. This includes iterative and continuous improvement based on the constant and quick feedback from the tests.
Typical focus: Tests need to be integrated into pipelines and we need to relentlessly follow up on failing tests. A zero tolerance for failing tests is the only way to stay on top. Tests need to be redesigned to be more resilient and the dialogue with the developers ‘intensifies’.
Improvements: The tests become an active monitoring tool. They now tell us much more than if the application is functionally working. Now we can see how stable the application or application landscape is, we validate our data, we can see how the system behaves at any time. Videos, screenshots, and log files are collated on each execution and saved in our test management tool. We can create dashboards that we can offer to any level in the project management in order to see exactly how stable the system really is.
Tools required: Now the technical landscape starts to look a lot more complex:
- Continuous Integration Tool - With a continuous testing framework, the trigger is typically the continuous integration tool, i.e. Jenkins;
- Code Repository - The test code is stored in the code repository, it should be treated with the same respect as product code, under version control;
- Test Automation - The tests then begin (you can use CAST, a systematic tool for test automation at scale, or ForeCAST an AI-based autonomous test generation tool)
- Test Management - All tests and results should be pushed to the Test Management tool (this goes without saying that Xray is the right tool here);
- Task Management - Of course, the beauty of Xray is that it natively integrates with Jira for our task and project management;
- Test Environment - The tests execute in a test environment;
- Target System - The test system is our proxy to the actual system under test;
- Log monitoring tool - For example, ElasticStack where the results are pushed to a central dashboard, where we also collect all the application logs and drill down into each failing test, see failure patterns and have one objective view on the health of our application;
- Wiki - Confluence (if we need it).
Challenges: A typical anti-pattern that arises is that the same iterative waterfall pattern continues. The testing still begins after the development begins and only when the feature ‘stabilizes’ does the test automation begin.
As illustrated in the diagram, test automation at the end of the development process makes test automation expensive, fragile, and provides the least value to the team.
So we have one more step to make, to go from continuous testing to test first.
Mindset shift #3: Shift left to automate, integrate, and collaborate
Skillset required: Every member of the team is a stakeholder in quality. We need a mix of technical and business skills, domain knowledge, and of course DevOps.
Typical focus: Testing the requirements and not the code. This means creating tests upfront and making this the standard way of doing things. The ‘plumbing’ of the continuous testing framework needs to be maintained at all times. Tests can run red until they run green, then they always run green.
Improvements: Now we have really turned the lights on. The tests are now living documentation, they extend the requirement docs to be a complete specification. The living documents are validated every time the tests execute. Now we get fast feedback on each cycle.
This feedback loop helps us know two things:
- For a new feature, we find out immediately if the feature is ‘done’
- If we have broken something because each living document is automatically converted into our regression suite.
Tools required: We already have everything that we need from a tools perspective, but we need to be able to test and define all layers of the application, including:
- Front End
- Back End
- Everything in-between (msg queues, database, log files)
The tool we are going to use to automate our tests needs to be:
- Easy to Use
- We have to enable non-technical and technical members to be able to contribute fully
- Technically complete
- We have to support full-stack development
- If you have full-stack development then you need to support full-stack testing
- Fully integrated into the existing DevOps tools
- We want to leverage the existing DevOps tools, not compete with them.
- We should be leveraging the relationship between the tests and the requirements to derive full coverage
Finally, we have to build up the surrounding ecosystem to make the tests effective.
- Data
- Our approach to managing test data needs to be resilient and flexible
- Environments
- We need to have full control of the test environments
- Visible
- We need to make sure that our efforts are understood and can be viewed by all project stakeholders.
This is hard work to maintain and it needs a disciplined approach to keep it up to date and working properly. The benefits are huge, with massive improvements in speed and quality.
Challenges: As the number of tests increases, it's no longer possible to run all the tests, all the time. Therefore we also need to ‘Shift Right’. By implementing staged quality gateways, the first sets have a bias towards speed and minimal but sufficient info, then we can test the functionality in an increasingly exhaustive manner, then move on to the non-functional tests; performance, load, disaster recovery, security, etc.
It's hard work, but if we do this right then any code that comes out the other side of our pipelines is a shippable, fully validated piece of code that is ready to release.
To prioritize test automation, we must change our mindset
With any kind of change, its success is determined by tools, processes, and mindset. The mindsets we described are not absolute and they can coexist in a project. If you try to achieve the more advanced mindsets then the benefits are very tangible, meaning quicker, cheaper, and better quality.
Less tangible, but no less important, is the improvement in the flow in the software development team. This means less friction in the processes which results in less frustration and more fun at work.
Maybe you don’t need to be testing everything, all the time, but with a test-first mentality supported by continuous testing then the quality and speed of your software will improve substantially.