Directory Image
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Privacy Policy.

Test automation – when does it work, where to start, making it robust

Author: Ritesh Mehta
by Ritesh Mehta
Posted: Aug 04, 2017

MAINTAIN AND BOOST SOFTWARE SYSTEMS

In the fast-paced world today, it’s a challenge for any organization to maintain and boost quality and efficiency of software systems continuously. In a lot of software projects, testing is neglected due to cost and time constraints. This leads to less quality of the product, followed by the dissatisfaction of the customer and in the end to increased overall quality expenses.

In software testing, automation is using special software, which is separate from the software being tested, in controlling tests execution and comparing actual outcomes with predicted ones. Test automation could automate some repetitive yet necessary tasks in a formalized process that is in place already, or do further testing that will be hard to do manually. Test automation if vital for continuous testing and delivery.

Test automation works when considering the functionality that one wants to implement and then write a test for it. Unit tests must be as lightweight as possible, so one could run them every time one hits the build button. In designing the test, testing all is impossible. Again, the test should be lightweight enough so they could run on each build and yes, run all of them. This ensures that no dependency in the code is missed that breaks things far away from the point edited. There are a lot of things that could be gained from test automation, such as the following:

  1. Easier, more modular to maintain code since it has to be testable.
  2. Bugs could be found early, meaning they can be fixed more easily.
  3. It builds confidence. Having a code base that’s largely tested provides the confidence that it works as expected and remains as it is.
  4. It takes some effort to be used to using tests but is well worth it, particularly when writing libraries of some kind.

To start test automation, one could begin by recording test scripts with the use of Selenium IDE, then exporting them to the preferred language and to notice what is going on there. With people increasingly becoming acute in automation, the natural requirement is to boost the quality of test automation as well as make tests more robust. The following are some steps to take to make test automation more robust.

  1. Debugging and retries. If a test has already failed three times, consider retrying it yourself. This could boost the run times of the test. However, this is just a quick fix until you take the time to debug, which cause properly. Therefore, this should be done until you achieve a degree of test stability.
  2. Intuitive stack-trace messaging. While making page object models with descriptions such as ‘homepage’ and ‘search box’. This comes in handy in making sure that the descriptions could chain together to then throw in some natural language for making stack-trace messaging more helpful for other testers for debugging. This would be very handy for beginners of automation, who are not familiar with tests, and those who simply find that stack traces too baffling.
  1. Custom exceptions. Make sure that the names of the exceptions’ are revealing enough. Making a class that extends from an exception class enables one to make up one’s own custom exceptions and provide yourself or another running the tests a more information to debug them.
  2. Pre-test checks. Tests that are flaky, are not always the issue themselves. However, the intermittently not-ready environment often is. Building a set of tests for serving as a type of ‘pre-flight’ check is a probable way out. The test suit should be run before integration tests to check all the moving parts that the tests depend on are okay. The check has to be very fast because it has to check only HTTP statutes and the integration tests only run if the tests have passed.
  3. Retrospective fixes. Under a continuous integration setup, one should take into consideration if the tests executed usually should fail the build stopping integration. When one is more than 30 percent test coverage, there likely are some tests that are not considered that relevant to cause the halt. At this point, it is important to investigate after the build goes out to fix the issue retrospectively.
  4. Tests in isolation. The failure of single components testing in end-to-end tests could make the entire suite fail. In this scenario, a good idea would be to write a smaller tests which separately checks out the failing component before running end-to-end tests.
  5. Tags. It would be a good idea to tag the tests so they could specify their run frequency. Furthermore, keep in mind that every test could be added multiple tags.

The above lists may not be an exhaustive list of possible solutions, they are first-aid kit when automated tests lack robustness.

About the Author

Ritesh Mehta is the Sales Director at TatvaSoft Australia, a Software & mobile app development company. For Over 15 years, he has been professionally active in financial management, software development.

Rate this Article
Leave a Comment
Author Thumbnail
I Agree:
Comment 
Pictures
Author: Ritesh Mehta

Ritesh Mehta

Member since: Apr 26, 2017
Published articles: 70

Related Articles