Test Design Studio Helps Improve Your Code!
The rich integrated development environment allows automation engineers to reach new levels of productivity. With the introduction of new features in v2.0, you can now reach new levels of quality in the code you are creating.Watch It In Action
Code quality, as it pertains to automated tests, is often thought to be a subjective measurement of the following key code characteristics:
How easily can your code be maintained when the AUT is modified or new functionality is required?
Similar to readability, how easily can someone comprehend the purpose of your code?
There are three key features of Test Design Studio that will help improve the quality of your code:
Helps you identify syntax errors and potential logic errors quickly, as they are created
We all make mistakes, but Test Design Studio helps you find them before your save your work
Helps you objectively measure the complexity and maintainability of your code
Test Design Studio identifies errors and warnings in real time, as you type! All items of concern are underlined in the editor so that you can quickly identify the problem and fix it. Not sure why something is underlined? Just hover your mouse over the item and a tooltip will tell you.
Unified Functional Testing performs syntax checking as well, but only when you save a file or think to check it manually, but Test Design Studio is constantly analyzing your code for immediate feedback.
Syntax checking, however is only half the story, and this is where Test Design Studio really shines and does something you won't find in Unified Functional Testing. Syntax checks only ensure you follow the basic syntax of the language. Other errors are typically not revealed by Unified Functional Testing until you try to execute your tests. Why? Because they are syntactically correct even if the code was dead wrong.
These are the most time-consuming errors to fix because it is only during execution that you discover these mistakes, many of which could have been easily avoided. Common oversights include:
Option Explicitis used
When these issues are discovered at run-time, it usually means a significant loss of productivity. Tests have to be re-executed and application state must be restored.
New users, in particular, have trouble with these errors because they simply aren't familiar with the basics of VBScript.
Try to find the errors or potential code problems in the image to the right. Can you see them? There is absolutely nothing wrong with the syntax, so don't expect any help from Unified Functional Testing. If you give up or want to check how you did, click the 'Show Errors' button to see the same screen shot with errors/warnings displayed.Watch It In Action
Can you see all the errors in the code below?Show Errors »
MyFunctionWarning that the function never set a return value. Should this be a Sub?
neverUsedWarning that a parameter was declared and never used. Forget something?
fsoWarning that a variable was declared and never used. Forget something?
Reporter.ReportEventThis method takes 3 arguments, not 2.
micFailedOops, should be 'micFail'
Test Design Studio has many built-in rules for analyzing code and reporting potential issues. The most common rules are listed below, and we can always expand this list to include more. Have an idea for a new rule? Just let us know and we'll see about adding it to the rules engine.
You can even use a powerful rules engine to define naming conventions for your framework to make sure all code contributors are following guidelines for your organization.
Finding all these errors and warnings has not benefit if the user doesn't see them. That's why all the files in your project are checked for issues and displayed in a single Error List Tool Window.
You can toggle the visiblity of warnings or errors and even filter the results to only show the file you're working on. We make it easy for you to see everything you want to see and nothing you don't.
Code Metrics are a useful tool implemented by Test Design Studio to provide an objective analysis of the complexity of your code. Higher code complexity typically leads to higher defect rates and decreased maintainability. The following metric values are calculated for major language elements including entire tests, class declarations, functions, and properties:
For) increases the number of paths.
This information is presented in a hierarchical format where test engineers can quickly locate code that might be hard to maintain or overly complex. Taking time to refactor the code can result in fewer errors and improved maintainability.