Achieving Automation Success: Using Action Based Testing in TestArchitect

Achieving success with automated testing can be difficult. With the combination of Action Based Testing and TestArchitect, success is possible.

Avoiding something because it’s difficult will never get you anywhere in today’s day and age. Even though making automated testing successful in terms of both scalability and long-term maintainability is often regarded as a challenge, the Automated testing has become a must-have for Agile and CI/CD. With the arrival of highly automated build and release pipelines, the demand on Automation reliability has increased, because if the automated test breaks the pipeline breaks.

The good news is that technologies and processes have greatly improved. For example, there is much more room for cooperation in the agile approach; it has become more common to do a large part of testing at the API and unit test levels where Automation tends to be easier to create and maintain than testing via the user interface.

In particular, to make Automation successful in a CI/CD pipeline, our approach at LogiGear is a combination of a specific methodology, Action Based Testing (ABT), and a fitting toolset to support that methodology. ABT integrates the Automation focus into the test design, rather than just automating manual tests. ABT is a keyword-driven modular approach to automated testing, supported by our comprehensive product suite, TestArchitect™ (TA), that integrates test development, Automation, and test management in one package.

ABT and TA differs from many other Automation approaches available in that they place their main focus on test designs. Test designs play an important role as the driver to Automation success. The main goals for test design include: 

  • Simplicity
  • Efficiency
  • Manageability
  • Maintainability
  • Depth
  • Coverage

Having a good test design not only makes tests more effective, it also makes them easier to understand, and maintain to fit them into CI/CD pipelines.

The image below shows an example of a test design that is not suitable for efficient and maintainable Automation. The test has many steps and verifies many outcomes but it is also hard to read and is sensitive to changes in the application under test. Even an experienced Automation Engineer will have a hard time automating tests like this. When you have tens of thousands of lines, or more, like the ones shown in the picture below, scalability becomes a problem.

Actions, Test Modules

In the Action Based Testing approach, tests are written as a sequence of keyword driven “actions” in a spreadsheet-like editor.

Each action has a name (action word) and any number of arguments. Actions are easy to work with and allows testers to quickly create a domain specific language for their tests. The actions can be implemented in code and with a sequence of other actions. In TestArchitect, we have a set of over 400 built-in actions as a starting point.

The purpose of a test defines what kind of actions to use. Most projects will have “business tests” and “interaction tests.” The business tests have a higher level of abstraction and the actions used are typically domain specific. Lower level steps are encapsulated in the actions. Interaction tests work with the details of dialogs or API’s and will use lower level actions that are not domain specific, often just simply the TA built-in actions.

Business tests focus on the functionality. In a business test, one should not expect navigational actions like “select menu item” or “click button.” By keeping interaction details like these navigational actions out of a test, these tests become more stable even if the system undergoes major maintenance. It also matters what aspect of a business is being tested. For example, a test module testing calculations for billing should not also test credit card processing.

An interaction test looks to see if a user, or another system, can interact with the application under test. In the example above, we check whether the OK button in a login dialog gets enabled when a username and password have been entered.

Interaction tests can be as varied as business tests. For example, one test might verify mandatory and optional fields while another might check if a dropdown box has the right values. When testing dropdown boxes, it’s common to not need to vary data much as long as the dropdown box has the right values and they are in the right order.

How to Use Action Based Testing in TestArchitect

Actions are easy to use and have an elegant expression power. Complex tasks, such as checking graphics or having multiple tests communicate with each other, are just a few tasks that can comfortably be expressed with actions. Such actions might not always be easy to implement and Automation engineering is an important task in the team. But once the technical challenge has been overcome, the resulting action can be re-used as many times as the tests demand.

In addition to using keyword-driven actions, ABT and TA take a modular approach to test design. Testers are encouraged to organize their tests into “test modules,” with each test module having a clearly defined and well-differentiated scope. The scope determines what actions to use and what checks to perform. Each module has a section for “test objectives,” or verbal statements that detail the scope of the module. Making test objectives is part science and part art. It’s possible to make and follow guidelines but you will have to analyze underlying requirements and specifications well and try to design test requirements that are both easy to access and easy to test. The rest of the test modules consist of test cases that address the objectives. Unlike what is common elsewhere, the core products in ABT are test modules, not test cases. In ABT, test cases are the outcome of the test creation process, not the input. The test cases in a test module form a narrative in which each test case leaves behind the pre-conditions for the next one.

A recommended way is to identify the test modules for a project early in the life-cycle. This can, for example, be done in a group session with Testers, Automation Engineers, Developers, product owners, and domain experts. The test modules thus forms a pre-structure that can be a guideline. In a Scrum project, the test modules will usually be developed and automated in the sprints. Sprint teams may make changes to the original test module line-up, which are not meant to be more than a guideline.

Let’s Take a Closer Look at How to Use ABT in TestArchitect

This is an example application of a music library. Clicking a song in the left-hand tree displays some information about that song on the right.

We can create a test module for the application in TestArchitect, in which we click a tree node, and then check some fields. The actions for example, check and click tree node, are built into the TestArchitect framework. See the image below for an example:

Looking closer at the test module above, however, notice that although the test is easily run, maintainability can become an issue. In particular, the tree path is hard-coded and could easily be different in a future version of the application. In the ABT methodology, details that do not fit in the scope of a test module are hidden.

By using a TA action definition, we can generalize this node path, making the test maintainable over time. Let’s create a new action that checks the bitrate field for a given song. The artist and song names are used to determine the node path, hiding it from the test that calls the action.

By doing this, the action now makes the focus of the test module functional, easy to read, maintainable, and easy to manage. The test lines abstract from their navigation and now this can be tied to the UI, but also to a service call, a database query, etc.

Sprints and Pipelines

A keyword-driven modular approach like ABT, supported by TA, can achieve two of the main challenges in Agile and DevOps:

1. Getting testing and Automation “done” at the end of a sprint so it can stay in sync with the rest of the team efforts

2. Planning and organizing the execution of tests in the pipeline

To get all testing done within a sprint takes commitment and cooperation in a team. A lot of ground can be covered by having test modules planned and using keywords as a practical means of communication and test expression. The test development will typically start with business tests, since they usually don’t need details of dialogs and navigation. Implementation of actions and the creation of interaction tests will come later, when UI and API developments are far enough along to know Automation details like internal names of screen elements and rough outlines of navigation. When available and within the same sprint, automated tests can also help drive development and even deepen the understanding of the functionality under test.

Depending on how many tests that need to be executed and in how many configurations, testing can become a bottleneck in a CI/CD pipeline, challenging the team with questions like what tests to run in each step of the pipeline and against which configurations. The modular approach of ABT can help make this determination, supported by a TA tool called “TAQueue” that can dispatch test modules for execution to available machines with a fitting configuration.

In addition, the slight differences in navigation and screen element identification that tend to come with different versions or configurations can be made transparent by a TA feature called “variations,” a feature applicable to actions and interface mappings.

To summarize, in order to achieve Test Automation success, both a good methodology and a proper tooling are necessary. A good focus on test planning, design, and close cooperation between project participants can lead to stable automated tests and an efficient, seamless execution of the tests in the pipeline.

Get TestArchitect Team Free





Hans Buwalda
Hans Buwalda, CTO of LogiGear, is a pioneer of the Action Based and Soap Opera methodologies of testing and automation, and lead developer of TestArchitect, LogiGear’s keyword-based toolset for software test design, automation and management. He is co-author of Integrated Test Design and Automation, and a frequent speaker at test conferences.

The Related Post

LogiGear Corporation   LogiGear Corporation provides global solutions for software testing, and offers public and corporate software-testing training programs worldwide through LogiGear University. LogiGear is a leader in the integration of test automation, offshore resources and US project management for fast and cost-effective results. Since 1994, LogiGear has worked with hundreds of companies from the ...
The best part of Action-Basted Testing is that it is for thinking people. It is intelligent and creative. It is a much saner way to evolve a testing project. All testers and quality engineers hear about Action-based testing (ABT) or keyword-driven testing somewhere. There are automation tools focused on keywords and actions. Maybe people have ...
Introduction Keyword Based Testing is gaining ground. More and more organizations see this model, in which tests are not scripted but written as a series of keywords with arguments, as a valuable alternative to record and playback, or scripting of tests. A good theoretical basis for keywords can be found in the well known Automation ...
ABT and Keyword-driven testing – Similarities and Differences Both Keyword-driven testing and Action Based Testing (ABT) use a test authoring approach that separates much of the programming work of test automation from the actual test design. This allows tests to be developed earlier and aids in tests maintenance.
To address the challenges and fears of implementing Automation in Agile projects, LogiGear CTO Hans Buwalda presents Action Based Testing as the answer.
Agile methods are becoming more and more popular and successful for developing IT systems. Typical properties of an Agile method, like Extreme Programming, involve continuous user involvement and emphasize on the testing role (‘Users’ may be the actual users of the system you are creating, customers, or business analysts who provide the requirements on behalf ...
Two powerful test methods for fast-paced development organizations As development teams have been pushed faster and into tighter scrum sprints, testing has burst through old development paradigms. Developers are being pressed to do more unit testing. Automated smoke tests are essential parts of CI (continuous integration) and full, automated regression suites are being run across ...
Joe LuthyJoe Luthy has over 15 years product marketing experience in technology and Internet services for major companies including AT&T and Verisign. TestArchitect for Visual Studio is a keyword authoring platform extension designed specifically to enhance coded UI test automation in Visual Studio 2012. Microsoft’s Visual Studio’s ALM solution helps organizations manage the entire lifespan ...

Leave a Reply

Your email address will not be published.

Stay in the loop with the lastest
software testing news

Subscribe