Tuesday, April 28, 2015

Best Practices for Mobile Test Automation

Best practices learnt by experience for Mobile Test Automation are:

  • Scope decision for Mobile Test Automation in highly agile workflow should be based on the following priority levels i.e. Top -> Smoke Tests, Medium -> Regression Tests, Low -> Features Related Tests
  • Which Test Automation Tool Programming Language has to be used? This decision should be made on the following: 
  1. Does automation of smoke tests or basic functionality require any API/Backend support that is designed in some specific language (hence that preferred should be used for test automation preferably to easily extend or reuse the existing architecture)
  2. Does novice testers needs to be trained for automation which have manual testing exposure or comes from non-engineering background? In this case natural language based or record/play type of tools and supporting languages should be used. (Don't want to quote specific examples here)
  • Which test automation tool to be used? 
  1. This decision depends on several factors that a combined decision or understanding can answer this. For example how big is test automation requirement if it is not huge and apps are completely native plus no specific requirements are on the design patterns to be used then native UIAutomation tools can be used. One advantage in using native UIAutomation tools is that they get direct support from the mobile platform owners and is usually robust. 
  2. If there is large number of tests to be automated and the application is relatively complex then the tests should be based on a design pattern and can use pretty advanced third party test automation tools
  3. In case the test automation has to be parallelized and integrated with Continuous integration systems then we should use design patterns, third party tools and also cloud based test automation environments along with a solid CI solution which is difficult to find currently but yes whatever is available solves the purpose
  • An effective test automation tool should always have a solid reporting mechanism based on the organization requirements.
  • Test Automation Coverage should also be tracked in order to derive useful metrics and efficiency/productivity derivations.
  • Tests should be independent of any device/simulator and should have conditions to tackle runs on all types of mobile test environments.
  • All test automation should majorly focus on two aspects first is to help in shipping faster and secondly reduce manual test dependencies.
  • Tests should always avoid explicit waits at any point and have sufficient retries and conditions to avoid these.
  • 3 phases of test automation should go in parallel for a highly agile workflow else test automation is bound to fail i.e. development, execution and maintenance. In order to avoid failure prioritization and scope has to be define in pretty solid terms beforehand.
  • Page Object Pattern is generally the most efficient design pattern for mobile test automation.
  • Agile process should include suitable workflows for inclusion of test automation enabling accessibility labels/ids.
  • Reusable methods/functions should be designed to reduce redundant test steps as much as possible.
  • Use of human readable function/variable/method/class/abstract method names should be used. 
  • Code with complex logic handling be marked with suitable justifying comments to avoid fellow test automation QAs understand your logic.
  • Tests should be written such that failure of one does not affect any other test running in parallel to fail. Sequential test run model should be avoided unless absolutely necessary. Parallelization is the key to test automation success!
  • Each part of a test should be configurable for user/data inputs. No hard coded values are appreciated in the real coding world.
  • In the end all genuine code review comments should be acknowledged and be used as learning points for future test designs.
  • The best teacher for test automation is your self do as much as you can and you will see that you are innovating and passing all hurdles with ease.

Thanks all for the read, I will keep sharing the goodness as and when I will learn more by experience and by hands-on!

Bad practices for a Software Test Engineer

People mostly talk about the good and the best practices but it is also important to know the worst or the bad practices which a Software ...