Automation

What Defines a Good Automated Test?

Lucas Fievet
|
January 23, 2023

To benefit from an automated test the time saving over the lifetime of a given test must be greater than the time invested into its creation and maintenance. Therefore, it is important for an automated test to perform well on the following criteria:

  • Automated: execution requires zero human intervention.
  • Reliability: if the application didn’t change, the test result doesn’t change.
  • Validation: incorrect critical outputs will fail the test.
  • CI/CD ready: fast and stable enough for continuous integration.
  • Interpretable: test scenario is easy to understand.
  • Maintainability: the test requires as little maintenance as possible.
  • Independence: the setup is isolated, and the test can run concurrently without affecting other tests.

Let’s look at these points in detail:

Zero Human Intervention

A semi-automated test that still requires human intervention, for example to input a two-factor authentication code for login, is unlikely to generate a return for your organization. Every step of the test needs to be automated so that the test can be used for monitoring, load testing and regression testing in CI/CD.

Reliability

Is key for your team to trust and prefer the automated test over a manual test. For example, a testthat required at creation to select a date via a date picker is likely to fail within a few days when that exact date can no longer be selected. To make such tests reliable, dynamic inputs (e.g., date) need to be provided and input correctly for the test to execute reliably over time.

Validation

The test needs to fail upon critical bugs. For example, in an e-banking payment scenario, the test needs to fail if the transferred amount is incorrect, a change rate was computed wrongly,or the recipient is not as expected. Otherwise, your organization can suffer reputational or financial damages that the test was intended to prevent.

CI/CD Ready

A flaky test is not CI/CD ready. Flaky meaning that the test will fail for some technical reason while the system under test is functioning correctly. With such a test, your engineering team would waste time repeatedly investigating a potential bug inthe application that does not exist. This will generate significant costs inman-hours and frustration in your team.

Interpretability

Team members need to be able to understand the test scenario quickly and be able to interpret a failure.

Maintainability

Tests that need excessive maintenance cause frustration in the team and over time may cost more then the impact of a potential bug that they may have caught. Hence, evaluate wisely how critical the functionality covered by the test is and if the total cost of maintaining a test is justified.

Independence

Once you accumulated a sizable number of tests covering your application their execution will become uncomfortably long. To speed-up getting results, the tests need to be executable in parallel.To enable this, each test should setup an independent environment (e.g.,project) in your application so it can run in parallel without impacting other tests. Then getting tests results quickly becomes a DevOps effort to run tests concurrently.

How does Astra enable these criteria?

Astra will help you each step along the way of creating good tests cases:

  • The record/replay and editing system enables you to create fully automated tests quickly without programming knowledge.
  • The test will replay exactly as recorded. The parametrization system enables to you quickly replay different data combinations.
  • Validations can quickly be added as visual annotations. Native Selenium assertions of any kind are supported. Network and console logs can as well be asserted easily via the UI.
  • The offered CLI enables you to run your tests from your CI/CD within minutes with the pre-configured snippets.
  • Tests are easy to understand as they are documented with a screenshot at every step and the taken actions are highlighted.
  • Maintenance is done automatically with our machine learning algorithm, removing any repetitive tasks from your daily work.Advanced maintenance cases are easy to edit via our UI.
  • Test independence requires good test design from your side. However, once you have independence, our cloud will enable you to run as many in parallel as you like with a single setting.

Curious to try it out? Astra has a forever free version here.

Want to get a demo? Request one here.

Related Blogs Posts

Bring your productivity to the next level

Reach the automation level you are aiming for

Leverage no-code and write custom code where needed

Visualize your end-user experience all in one place

Make your deployment decisions easy

Get Started