Automating RPA code review to enable faster, defect-free bots
Reviewing the code of robotic process automation bots before moving it into production is very critical for any RPA center of excellence. This is required to minimize post-shipment defects and to ensure standardization in all the bots deployed.
Traditionally, RPA bot code review is a manual process. A typical bot code is very complex consisting of multiple workflows. Each of these workflows, in turn, consist of hundreds of variables, arguments, message boxes and logic for exception handling, custom logging, queues and credential management.
This approach requires manually reviewing code line-by-line, analyzing every property, examining the entire list of variables and arguments and reporting all the deviations. But this process is crippled with challenges as it is:
- Erroneous – Automation scripts developed by business users are highly error-prone and often does not comply with standards.
- Time-consuming - Reviewing a code requires validating each element line-by-line and therefore is very daunting and takes few hours to few days.
- Late identification of missing validations - Missing some of the validations during code review leads to defects being identiﬁed in UAT and some of them are captured once the bot is in production.
- Hotfixes – Post-implementation defects and non-compliance to standards lead to root cause analysis and hotﬁxes during the stabilization period.
To overcome these challenges and to make this process more efficient, it is recommended to automate this process by developing a ‘code reviewer bot.’
Code reviewer bot – most eﬃcient tool to address code review challenges in bot development
A code reviewer bot should have the following capabilities:
- Should be a reusable component with functionality accessible across business units and processes.
- Should be a standalone bot without dependency.
- Tool agnostic - able to work on bot code of any RPA tool.
- Ease of use - should be usable by RPA developers with minimal experience.
- Should ensure adherence to organization’s bot development standards.
- Ability to run in the background.
It works on the bot code’s XML file. From a bird’s eye view, this is how it functions:
It handles the following major functions of code review:
1. Analyze data - Analyze semi-structured XML document to extract data from elements and metadata from attributes. It extracts:
- Variables, arguments and activity details.
- Details of logging parameters in workﬂow.
- Details of other important validation parameters which is not limited to queues, framework and conﬁguration ﬁles.
2. Categorize data - Categorize the details extracted from the analyze-phase and group them into:
- The information to be sent for validation logics.
- Dissect the information needed for both detailed and summary report.
- Classify to group the extracted information to data items, activities, standards, and properties.
3. Validate data - Compare classiﬁed data with a set of rules and standards. This is required to identify deviations and errors. The parameters validated are:
- Name, type and naming convention of variables and arguments.
- Usage of comments.
- List of all activities, log messages and logging levels.
- Usage of conﬁguration ﬁles.
- Validation of hardcoded passwords and parameters.
- Usage of custom log ﬁelds.
4. Transform data – The code reviewer bot should transform the data into 2 following reports in an understandable format:
- Detailed report – It consists of separate sheets for each workﬂow/script with a detailed list of variables, arguments, activities, delays, hardcoded passwords, usage of queues, exception handling and messages logged to visualization databases along with their logging levels.
- Summary report – This is an easy to understand summary report categorizing each deviation and their severity
These reports provide highly accurate visibility into the deviations which is difficult to achieve manually.
Beneﬁts of using a bot in code review process:
- Deviation identification efficiency can be increased by 30 percent.
- Time-saving of almost 99% can be achieved in comparison to manual review:
Manual code review
Automated code review
- Ensures 100 percent compliance with standards.
To make the critical step of bot code review more efficient, automating it by RPA is the most optimal solution. The automated approach involves developing code reviewer bot which should analyze, categorize, validate and transform data. This code reviewer bot not only makes review process more effective by identifying deviations but also does so in approximately 99 percent lesser time. Adherence to compliance and standards is an added advantage.