Featured
- Get link
- X
- Other Apps
Proven Solutions to Five Test Automation Issues

Proven Solutions to Five Test Automation Issues
Write for InfoQ
Key Takeaways
This article discusses 5 conventional problems that save you
groups from automating their sorting out. Teams can remedy those troubles using
API and service simulation.
Over the closing 15 years walking with high-quality software
program groups, I observed that the use of over-the-twine take a look at
doubles, like API and company simulators, is today's exercising on some groups
that already recognize approximately the method. Those are generally agile or
Extreme Programming (XP) teams with TDD and BDD revel in.
Other groups have never used mocks or simulators, specially
because of the fact they have by no means heard approximately them. This
article is for organizations starting their journey with test automation and
shows how numerous each day problems may be solved using simulators.
What is an API or company simulator?
Related Sponsored Content
Using a simulator instead of a actual microservice,
1/three-celebration service, mainframe, or specific software application device
is called API and software program replication. You can also find appellations
like API mocking, company virtualization, over-the-twine take a look at
doubles, and tools for stubbing and mocking HTTP(S) and one-of-a-kind
protocols.
The names of the strategies are not that essential. What is
crucial is they enable thing (System Under Test) sorting out in isolation.
You can simulate APIs, services, or both. I have decided on
to spotlight each names in this newsletter as I have seen with my customers
that precise names are extra familiar to distinct agencies depending on which
continent or united states they'll be in.
I even have additionally observed that, as an instance,
“API” is a famous phrase among builders and testers the use of HTTP, and
“provider” might be extra well-known whilst you are a head of improvement or QA
at a organization jogging with 0.33-birthday celebration service providers.
Let’s paintings with an example microservice architecture
confirmed in Figure 1. It is a trendy scenario in which we have got a net web
page that has a backend of more than one microservices that connect to a
database, a 3rd-birthday party system, and a legacy mainframe.
Figure 1: Sample microservice architecture in production
Figure 2 indicates the improvement and checking out
infrastructure, which has a couple of simulators.
Figure 2: Development and trying out infrastructure with API
and carrier simulators
Automated checking out coverage
As Martin Fowler decided more than a decade inside the past,
measuring test insurance is outstanding for locating untested code but bad as a
high-quality purpose.
I factor out that on the begin, as I use code insurance in
additives of this article as a metric. I desired to make clean what I endorse
by way of manner of “20% code automated test insurance.” It manner, “We know
we've got got 20% of code covered through manner of our specific kinds of
automatic tests, however eighty% of code isn't covered through checks.” It does
no longer mean “code coverage is a awesome metric to assess the excellent of
our deliverables.” There are higher metrics to degree the first-rate of your
software program software transport approach, just like the four key metrics. A
BDD method can also help with check awesome.
Having stated this, understanding that checks cover code is
a superb begin. Code that isn't protected through way of tests could have
issues along side undetected insects or accidental modifications in conduct. In
precise, automated take a look at insurance has the belongings of supplying a
repeatable regression suite or tests (take a look at harness) to help make
certain the conduct of a machine stays regular amongst releases.
Test automation troubles solved by way of the use of the
usage of simulators
During the improvement and testing of a product, builders
and testers can also experience several commonplace issues:
These issues may be solved through using simulators. I will
assessment every scenario in detail beneath.
Figure three highlights how each of those troubles may be
extra difficult when encountered at later degrees of your test automation
journey.
Figure 3: Create computerized tests faster with API and
service simulation
Issue 1: APIs or services not but to be had
If an API or provider you depend on is unavailable, you
could use an API simulator to parallelize teamwork and distribute your product
faster.
But the advantages do not forestall there, as API simulators
will help you with your take a look at automation.
Let us say you're operating on the Purchasing microservice
proven in Figure 1. Following TDD, you want to put in writing checks for a
brand new feature this is based totally on a brand new API in the Payments
microservice. Unfortunately, the bills team remains developing the brand new
Payments microservice API. When you run your assessments for the Purchasing
microservice, they have no API to connect with. If the API is unavailable, your
automated checks will fail until you use a take a look at double, for instance,
an API simulator.
Using an API simulator, you may installation programmatic
take a look at information responses for the brand new, non-existent API and
then run your check. Figure four suggests this workflow. You don’t should
appearance ahead to the bills team and may maintain developing and trying out
your Purchasing microservice.
Figure 4: Automated checks set up the API simulator and test
the microservice
Case test—APIs not but available
I actually have defined a pattern use case wherein 4 groups
going for walks on a trendy platform are running in parallel on exceptional
microservices in the article “Using API-First Progress and API Mocking to Break
Critical Path Dependencies.” It allowed them to reduce time to marketplace
drastically.
The groups used an API simulator tool to create simulators
for non-cutting-edge APIs. The simulators allowed them to run automatic and
guide exploratory exams with out waiting for special teams to complete their paintings.
They have observed a workflow:
Issue 2: Slow or guide strategies in backend or
1/three-celebration systems
Another common problem stopping teams from growing automated
tests is a slow or manual manner that is a part of the check cases.
It is most normal whilst communicating with structured
structures using asynchronous technologies which includes IBM MQ, RabbitMQ,
JMS, ActiveMQ, or AMQP.
For instance, as proven in Figure five, your microservices
will send a request memorandum to a request queue for the backend services to
eat. Backend records processing may additionally want to take minutes or hours
in advance than responding with a response message to the reaction queue.
Figure 5: Request and response message communique with the
backend
In this case, your automated exams ought to wait minutes or
hours for the reaction message from the backend. Waiting for minutes or hours
technique blockading the construct pipeline for mins or hours consistent with
test case. For that reason, you want an opportunity technique to finding out
your microservice. Simulators will update the gradual dependency and reply
internal milliseconds rather than minutes or hours, allowing your checks to
preserve on foot. Figure 6 suggests the creation of a simulator for the backend
factor.
Figure 6: Using simulants in a request and response message
conversation
You will need a comparable method even as there may be guide
request document processing in the backend systems. For example, a
human-in-the-loop situation where finishing a person journey and a take a look
at case requires a human to interact with a backend or zero.33-birthday party
device. A guide device like that constantly takes greater time than acceptable
for computerized checking out, often mins, hours, or days.
Case take a look at—manual strategies in backend or
0.33-party systems
As part of my normal engagements, I consulted for a software
program program house working on a central authority project that favored to
automate their guide regression checks. Their mission changed into that most of
the people character journeys concerned sending IBM MQ messages to a central
authority company for processing. The processing changed into carried out
manually, even inside the authorities test environments. This guide method took
anywhere between 1/2-hour to 2 days. The team used Traffic flow Parrot to
simulate the IBM MQ authorities systems (disclaimer: I represent Traffic
Parrot). Simulators that replied in milliseconds in preference to hours or days
unblocked the man or woman answerable for automating the guide regression
tests.
- Get link
- X
- Other Apps