The Fail-fast Principle in Automation Testing
The fail-fast principle is based on the idea that a system should suspend normal operations rather than work around a flaw in its code. A fail-fast system is a software development method that will alert you when an error is likely to occur.
The fail-fast principle facilitates the detection of software bugs earlier in the development cycle. It enables faster code strengthening, reduces the number of bugs that make it into production, and lowers the intrinsic cost of allowing bugs in the code.
To put it another way, failing early on in the development process is preferable to falling once the product is about to be released.
The ability to test early, frequently, and at any point in the development cycle is one of the benefits of test automation. Katalon Studio includes a critical feature to improve your automation cycle’s operational and cost-efficiency – the Fail-fast principle. This allows users to pause Test Suite Executions when a specified failure threshold is reached.
This new feature enables more efficient testing device utilization and lower infrastructure costs, particularly for cloud users.
Applying the Fail-fast Principle with Terminate Execution Conditionally in Studio
New Feature: Terminate Execution Conditionally in Katalon Studio
In Katalon Studio, Terminate Execution Conditionally is a feature that can automatically terminate a test execution by setting a failure threshold after ‘x’ failed tests. This feature detects bugs at the earlier stage, thus reducing the cost for failures in later stages and enhancing release readiness.
Users can terminate the execution of Test Case or Test Suite Collection if a significant number of test cases fail, allowing them to provide feedback earlier in the cycle rather than waiting until the test cycle is complete.
To take advantage of this feature, a new command option, -maxFailedTests=T> was added, which specifies the maximum number of failed tests before the execution is terminated.
Note: Be sure to have Katalon Runtime Engine installed already for this command to generate.
Step 1: To begin, click on Build Command.
Step 2: After, locate the option to set a threshold within the Generated Command for Console Mode dialog box to:
- Specify the level of failure tolerance by checking the box “Terminate the execution once the total number of test failures reaches this threshold”
- Enter a value in the text field
Step 3: Next, generate the CLI command, which will contain the -maxFailedTests= parameter in this case.
Run the command and when it reaches the specified threshold, it will display a message in the CLI indicating that it has followed the rules or condition set.
Step 4: Additionally, you can view the results in the Test Cases Table within the reports that Studio generates.
For more information on how to use this feature in your testing environment, check out the Katalon Studio 8.1 version and its release notes.
Read more: 7 Basic Software Testing Principle with Testautomationresources.com
Reference:
Stop Fail-Fast in Testing by https://www.katalon.com