Time is precious,
Roboyo Senior Automation Engineer Sava Tomov shares how Unit Testing can save you time when navigating the trickier parts of RPA development
As a developer, you know that RPA (robotic process automation) is not exactly like most software. Because its sole purpose is to take away tedious repetitive tasks with no personal added value, it can free up the one resource that is truly priceless: time. That, of course, is beyond measure: we can try to put KPIs behind it, or put a price tag on it, but it is time that everyone values the most.
But just as RPA frees capacity in other aspects of our professional lives, it is important to save time as developers when we come to build the automation.
If you have ever been involved in developing RPA bots, of course, you’ll know the path is not always straightforward. At some point when developing a bot, everyone gets stuck on some tricky issue.
In such situations, it’s helpful to get someone else to take a look. If they can’t provide a direct solution, at least they can offer some insight we may have missed. In that situation, we need to feel that we are neither alone, nor stupid.
If you’re familiar with RPA, you’ll know that describing the issue usually begins with showing your helper the (in)famous Main.
The Main is exactly as it sounds – it is the main core of every process, it is the alpha and omega, the one thing that in the end must run. If the Main fails, we lose time. If it runs successfully, we save time. This is true both during development and during productive runs. So to better understand and demonstrate the underlying issue, we would typically choose to debug the Main – in other words, to test RPA code in real time, and see what’s going wrong in detail, step by step.
But just as debugging shows a lot of details where there is a problem, so it shows a lot of details where there is no problem at all. And that means it takes time to reach the pain point, because we have to navigate through every single part of the automation that is running OK.
Often, this means debugging involves a lot of steps that we just have to patiently (and painfully) wait out. And even more often, the problem is hidden behind specific conditions that are hard to reproduce and involve manual adjustments, or even intrusions, as we debug.
Breakpoints in RPA code
To help solve the problem, as developers we may choose to add breakpoints in the code – ‘stops’ that we build in so that we can take a detailed look under the hood. These breakpoints allow us to analyze what is going on, and perform RPA debugging.
That said, most people actively involved in developing RPA solutions have uttered phrases similar to the following:
“Dear colleague willing to spend some time and help me, I have an issue with my RPA code.”
“Let me show you, I will just debug the Main.”
“No worries, it takes only a few seconds to come to the breakpoint I just set to show you.”
“Hmm … it seems I forgot to add transaction items for the bot to process. Let me add some transaction items …”
“Ah, yes, I have around 25 other breakpoints, let me quickly remove them.”
“How silly of me, I do indeed need a few other breakpoints …”
“Oh boy, I have to click through ALL these activities and warnings in the code!”
“Sorry, this exact transaction item does not reach the problematic part of the logic. We have to wait …”
“I guess it takes … more like 15 minutes for me to show the exact problem.”
The conversation may even end with the following sentence:
“Hey, come back! You said you were going to help!”
Unit Testing: A way to extract parts of code
Enter unit testing in UiPath – a process that allows us to extract parts of the code, and run them independently from everything else.
Unit testing allows us to show a given problem to someone, without needing to wait for all the code preceding it. It’s like being able to take out a part of the car’s engine to show that it’s broken, without having to drive the car on the highway at 133kph.
Of course, this requires us to build the engine in such a way that every part of it can be taken out, analyzed independently from the rest (as a single unit), and then put back in the engine.
If there is unit testing in RPA development, your side of the conversation would be more like this:
“Dear colleague willing to spend some time and help me, I have an issue with my RPA code.”“Let me show you. Instead of debugging the Main, I have a unit test for that functionality.““There, it took only a few seconds for the code to reach the problem.”“Ah, thank you! You are right, I did indeed miss that, now it seems to be working.”
If you are involved in RPA development, the message is loud and clear: implement unit testing! It will make people collaborate more willingly with you. It will make you believe more in your own solutions. It will make you recognize issues much more efficiently.
And by making testing easier, it can help you make RPA projects a success – because automation is nothing unless you test it.
Save your own time as well as that of others
You might consider that the above dialogues are exaggerated. If so, remember this: each dialogue is, more often than not, a monologue – and one we have hundreds of times during development.
In other words, as developers, we are the ones who help ourselves to find solutions to issues in our own code – provided the code is structured in an appropriate way, and we ‘surround’ the developed code blocks with unit tests which allow us to focus our attention on a single functionality.
So, implementing unit testing during development will save our own precious time. Heck, it will even free up a few spare minutes to spend on much more pleasant tasks, such as writing blog posts.
Of course, as with everything, it is easier said than done – and the principles and requirements of unit testing in RPA are the subject of another, more technical, story.
How can Roboyo help?
At Roboyo, we can help implement unit testing in your RPA development to help improve your code. But of course, unit tests are just one option – check out our Test Automation page for more information and book a meeting with one of our experts to discuss the many ways we can turbo charge your testing strategy.
Never miss an insight. Sign up now.