© 2019 SourceMedia. All rights reserved.

Automating RPA code review for faster, defect-free bots

Reviewing the code of robotic process automation bots before moving it into production is very critical for an 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.

bad bots.jpg

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 identified 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 hotfixes 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 efficient 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-

chart automating RPA 1.jpg

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 workflow.
  • Details of other important validation parameters which is not limited to queues, framework and configuration files.

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 classified 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 configuration files.
  • Validation of hardcoded passwords and parameters.
  • Usage of custom log fields.

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 workflow/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.

Benefits of using a bot in code review process:

  • Deviation identification efficiency can be increased by 30 percent.
  • Time-saving of almost 99 percent can be achieved in comparison to manual review:

Small process

Medium process

Complex process

Manual code review

3-4 hrs.

5-6 hrs.

6-8 hrs.

Automated code review

~1.5 mins

~2.5 mins

~5 mins

  • Ensures 100 percent compliance with standards.

Summary

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.

For reprint and licensing requests for this article, click here.