X

The Visual Builder Cloud Service Blog

Simplified Test Driven Development With Oracle Visual Builder

Shay Shmeltzer
Director of Product Management - Oracle

A unique new capability of Oracle Visual Builder, added in the March 2020 release, is streamlined creation of tests for action chains. With this capability developers can easily define test cases for business logic and run them to monitor their app and identify code changes that break functionality. Visual Builder helps by removing the need to manually code the test cases, instead generating possible test result suggestions that can be added to test suites. In addition Visual Builder reports the percentage of code coverage for the tests that developers create. With these new capabilities test driven development becomes much more approachable to everyone as you can see in the demo video below.

TDD - A Good Practice, Not Often Used

Test Driven Development (TDD) - is the practice of defining expected results from your business logic, and then making sure those results are matched whenever your code (or code you depend on) changes. Incorporating tests into your development cycle helps identify breaking code-changes earlier, making it easier to detect the offending code and fix it. Overall, test driven development results in better and more stable applications.

Despite the proven benefits of TDD, many developers skip the creation of tests since this can be a tedious task, preferring to focus their efforts on other tasks. The new test generation capabilities of Visual Builder are aiming to remove such roadblocks and help your team adopt TDD.

Visual Builder - To the Rescue

A new "Tests" tab is available in the action chain area of Visual Builder where you can define your tests and execute them. Visual Builder automatically identifies the variables that the action chain depends on, and prompt you to specify sample data for them. VB also identifies REST calls that are part of your chains, and provides the ability to define mock samples that represent responses from those calls.

Visual Builder then automatically provides you with suggestions for test results you can evaluate. Visual Builder does this by simulating the execution path of your logic based on the input you provided.  You can then pick up these suggestions and add them to your test definition, as you do this Visual Builder gives you a visual indication of which parts of your business logic have tests defined for them (turning the icons in the diagram blue).

Multiple tests can be defined for each action chain, using different combinations of values for variables and REST calls to get alternative test results. This way you'll build a set of tests for your action chains that will cover all the possible results you expect to get. You can run an individual test or all the tests - and get a report on the success rate and any failures will be highlighted.

While you are defining your test cases, Visual Builder keeps track of your code coverage. Any point in the action chain that is covered by a test will turn blue, until you achieve 100% code coverage. This helps you eliminate situations where you have untested code in your business logic.

In the video below we show you an example scenario of creating multiple tests for an action chain in an application that involves variables, REST calls, and JavaScript functions.

Check it out:

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.