Streamlining OutSystems Code Review: Tools, Tips, and Best Practices

Has someone just assigned you your first code review? Or maybe you’re already familiar with this practice and are just looking for some tips on how to do it in the OutSystems Platform? Either way, we’ve got you covered. 

Reviewing code is a best practice for a reason: it can dramatically improve the quality of the delivery, increase the team’s technical proficiency, and save some troubles further down the road.

But first, let’s review some of the concepts.


Suggested for You

Learn how OSQuay thoroughly assesses organizations' technology and processes to identify improvement areas toward enhancing performance, minimizing risk, and maximizing resources.


What is code reviewing, and Why Does it Matter?

Every time we change an application, we can add value, increase productivity, and innovate. But with this power comes the responsibility of delivering a technically sound solution. 

Testing is a fundamental part of the process but doesn’t guarantee code quality. Also, it’s possible to sign off a development that apparently works, but it’s not exactly finished and ready to be deployed. Here are some examples: 

  • Hard coding: A hard-coded literal might not work on an upper environment;

  • Architecture violations: Features that in development time do not consider the architecture can compromise the applications and their deployment;

  • Poor performance: A feature that works just fine with test data might perform poorly when used with actual data;

Thus, the importance of reviewing code. Code reviewing is when someone with solid technical expertise analyzes the changes being delivered. It’s an opportunity to evaluate if the best practices were followed and identify undesired impacts.

Although it can be carried out by any development team member, having someone proficient and experienced will provide better results. That’s the reason why a Tech Lead usually does it. 

It should be executed right after the development phase and before handing it over to the testers. Otherwise, feedback from reviewing the code could invalidate all tests done, thus rendering them useless and unproductive.

The OutSystems development environment, Service Studio, has several tools to assist us. We will review the most relevant ones and how you can use them to speed up the process.

How to Code Review?

As simple as it sounds, the primary goal is to double-check all published changes. Doing so makes it possible to identify and solve potential problems before they become an issue. Naturally, there are many ways to do it, and it should vary depending on the nature of the development. So, here are four key topics that are common to all types:

  • Cover all the changes: Similar to testing, reviewing should cover everything created or changed. Especially for larger projects, it’s helpful to add a brief comment summarizing the changes in the issue tracker;

  • Best practices: This should be your main focus when evaluating the code quality. While there are many valid ways of implementing the same functionality, when it comes to best practices, you’re either following them or not. They can also act as a source of truth if there’s a disagreement on an implementation choice;

  • Architecture: Particularly for new features, ensuring that the code was placed in the correct modules and/or applications is essential. Validating newly created references and removing unused ones is a great habit to keep the solution’s architecture in order;

  • Within reason: Is it possible to “over code review”? Yes, it is. There’s a point where you might have valid feedback, but it won’t add much value. If you often report on issues like naming conventions, code indentation, or organization, perhaps it’s time to sit with the team and create coding standards to mitigate this. 

Last but not least, executing the test scenarios is vital. Otherwise, you might have signed off on something that looks good from a technical perspective but has a swapped If statement and will fail immediately.

Code Reviewing in OutSystems

Outsystems has a few tools that can be used to detect and analyze changes, and those will be our focus. But there are a lot more that can be useful.

#1 Merge with Another Version

This is probably the most practical way to verify which changes have been published. It’s a visual tool that will assist you by highlighting the differences between both versions being merged.

 

Image 1 – Highlighted differences between versions being merged

 

This tool not only allows us to compare versions that are uploaded to the server but also with a file. This can be particularly useful to analyze modules from different environments.

#2 Find Usages (F12)

Identifying undesired impacts can be challenging. Two common examples are database changes or server action inputs/outputs. So, you can use an OutSystems helpful feature to find object usages throughout the solution. Just press F12 to check that any changes added to the code did not render a particular object usage corrupt, thus avoiding breaking changes.

 

Image 2 – Checking object usage

 

#3 Widget Tree

The Widget tree provides a detailed view of every element in the page/web block for the UI elements. This way, you won’t miss something that is there but not visible.

 

Image 3 – Widget tree

 

You can also use it to organize your review. Start at the top and work your way down, ensuring that you validate all the elements. For each element, check all its properties or screen action logic.

 

Image 4 – Review all elements in the Widget tree

 

#4 Architecture Dashboard

This one deserves an article on its own, so check the links below for more details. In summary, it’s a tool that automatically analyzes the code quality. It’s very convenient since everyone can autonomously check open warnings with information on how and why to solve them.


Code reviewing is an investment. At first, it might seem unnecessary, but in time, you will reap the benefits. Production bugs, code refactoring, and performance improvements are costly and stressful to handle. Catching these issues during development is the best way to mitigate them. An efficient development process and the OutSystems platform are the perfect combination to get those reviews done quickly and increase productivity. 

Resources

 

Like this article? Share it:

Previous
Previous

An In-Depth Look at the Anatomy of End-User Permissions in OutSystems

Next
Next

Unlock Real-Time Data Updates in OutSystems: A Quick How-To Using WebSocket Connections