Recently I have had quite a few ideas for my next blog post, all aiming at different aspects of testing however time has been a major issue for me due to work commitments. I do promise to get those ideas onto this blog eventually. So watch this space.
An idea which I was pretty excited about sharing, was the idea of bringing your test scenarios close to your Automation code. In fact I worked on a case where it can actually reside on the same repo or code base as your automation scripts. I received a lot of interest on the topic when I tweeted about it a few weeks back.
Ok, ok let me explain by first starting on the problem case or dilemma most testers face with when thinking of converting manual test cases/scenarios to automation scripts and how it would fit into the bigger automation picture.
The case for mind maps
Lets start all the way at Sprint level and your daily standup. For a proper illustration I created a simple example Project Jira board and code project for a dummy e-commerce application to explain my thinking around this concept.
Its Day 1 of your Sprint and your Dev has started working on an API story, in this instance he is working on the Items API story and the get Items API task to be precise. You proceed to define you test scenarios/cases while he is busy developing.
Previously I would have written my test cases in ‘traditional format’ – in a test management tool or document. But after being introduced to mind maps and how it can be used effectively in defining test scenarios/cases, I have found the many benefits of it that facilitate better efficiencies within the Agile process. Some of the advantages of mind map test cases that I have found are the following:-
-greater test coverage
-greater team collaboration
-faster test scenario/case creation
-easier reading/understanding due to visual representation
-more time to focus on exploratory testing, automation and non-functional testing
The above points have been quite evident on my project but as a word of caution there were also some points of caution I had to address to convince my team that mind maps was the best approach for us. Some of the concerns and questions included the following –I have added my answers in italics :-
–what about traceability back to the story/task? Answer: Adding the mind map as an attachment to task (on Jira) worked for us, also a link to a shared drive or address to where it is stored would work.
–only the person who creates the mind map would understand their thinking vs step by step detail of test case. Answer: Fair point however it depends on how the map is created. The easier solution is to have a quick 5 minute pow-wow with your team to give them a brief overview of your thinking. Agile is about collaboration after all, everyone is working on the same product, if they are not on the same page regarding functionality then there are bigger issues. Rather a quick catch-up session with everyone compared to the pain of writing step by step detail which might not even get looked at post sprint.
–what about newbies joining the project at a later stage? how would they understand the test cases? Answer: multiple points come to mind here, 1- you can take the newbie through your mind map collaboratively, they have to learn your system anyway so that initial time to get them on the same wavelength will be worthwhile. 2- why shy away from working on a more efficient way of test scenario definition by worrying about when a newbie starts. How often does that happen? if it does then we deal with it by tackling it with point 1 (above).
-would this totally replace conventional test cases? Answer: It depends, you can if you want to. The whole aim of mind mapping test cases for me is to quickly define or extract test requirements for your system or application which can aid exploratory testing and give you way more coverage than normal. You could if you want highlight the main regression or critical scenarios on the mind map and only do detailed traditional test cases for those scenarios. This way you still defined better test coverage and still keep your normal detailed cases and stats. Your mind map then becomes a tool for you to better create test cases.
Take your mind maps to your automation
Now that I have got the case for using mind-maps out the way lets get back to our e-commerce app example. To keep my example simple I have mapped out a few test scenarios for the get Items API using xMind
I have now been in testing and Automation for 15 years, the big problem I have seen over the years and today is the blank look you get from the testers (including myself) when they have to create Automation scripts. I can imagine the thoughts going through the minds…what do we automate? how does this automation tie back to the story/task? my test cases sit in this system but my automation sits in that repo? This disconnect from Test cases/scenarios to Automation scripts is a problem, consider also a few months or years down the line when your Automation scripts grow massively to a point where nobody even knows what they are covering, unless you go through the lines of code on the script. Well with this concept of bringing ‘Mind maps closer to your Automation Code’ I am hoping to bridge this gap and bring the visual aspect to Automation coverage along with fast and efficient test case creation.
Back to our e-commerce app, the developer has now moved the task over to you for testing and has also thanked you for adding the mind map to the task as this also helped him to create some detailed unit tests covering areas which he would have not generally thought about. Good job he says! You now either execute you test scenarios quickly with the mind map as your reference or you proceed straight to creating your automation api test scripts. Lets assume you do the latter.
I recently (together with the help of my wife 😉 an ex-Tester and now ScrumMaster) found a cool mind-map plug-in for intelliJ. https://plugins.jetbrains.com/plugin/8045-idea-mind-map . How cool, with this plug-in one can create a mind-map directly in intelliJ (hopefully you use intelliJ IDE to create you automation scripts) or you can import a mind-map created from other popular mind-map software like FreeMind and xMind (which is what we use). This is where my concept comes in with the ‘Testing’ context.
Here is how that works.
- Install the mind-map plugin to IntelliJ- https://plugins.jetbrains.com/plugin/8045-idea-mind-map
- Go to your automation code project in IntelliJ
- Under the relevant folder where you would create your automation test script, create new or import the test case mind-map (see screenshot below where I import the xMind mind-map that I created during my test case/scenario definition in-Sprint.)
- In-order to now use your mind-map as a template for your automation script, right click and choose to export the mind-map as a plain-text file
- I now save my file with the name of my intended Automation test script and change the format to a .js file
- I now right click on my folder structure and ‘Synchronize’ the folder to pull in the file created above.
7. And voila, you now have your template to create your automation script in, with all the test scenarios you defined showing up. You now have a 1 to 1 mapping
8. Now you can proceed to create your automation script, which should look something like this (you can comment out the text pulled in from the mind-map)
Points to note and summary:
This concept shows how one can use mind-maps to generate test scenarios from story task level, then import this into your Automation code base repo so that your test scenarios now live side by side with your automation code providing one with an easy transition from manual test definition to automation script. There is now also enhanced documentation of your actual test automation coverage by having these scenarios as a reference living in the same repository.
Happy mapping! Your Automation scripts should not feel alone! 🙂