Have you ever noticed the look on a child’s face when he gets a new toy? It is priceless and he is like at the top of the world. But if we notice, he will lose interest in the toy after a few days and there will be a time where he does not even look at the toy, which once he held as a treasure.
Like this scenario, there are multiple examples that we would be able to see in industries where people embrace new technology with open arms and excitement with the passion of learning and deploying something new, face many trials and hardships in implementing them.
Automation Testing is something promising, that most of the companies now look forward with lots of interest as it would ease tester’s time and do fast execution checks before deployment. This would help the team to deploy projects with confidence. But as the project expands through many iterations, the initial euphoria will lessen, and the team’s confidence will start to lose as scripting and maintaining the automation seems to be less effective and many switches back to Manual Testing.
What causes Test Automation to start positively and slowly deteriorate, what makes the tester feels it is easy to perform manual testing than maintain and test automation scripts.
It takes hard work and continuous improvement to bring forth a good test script.
Here are 5 steps to building a good automation test script.
- Code simplification: One of the main issues is that the organization of the teams spend less time in simplifying the code/optimizing it. The team entirely focuses on completing the tasks and finishing it in the deadline and they skip the most important part of -making it simple. The simpler the code, the better the performance and efficiency of the test. If code simplification is not done, as the project expands, the harder it will become to maintain the scripts and because of this behaviour, they end up spending more time in code analysis.
- Code Review: There are many developers with their own style of coding based on their skill level and experience in the industry. It is highly recommendable to review their script before testing. Let’s say that person A has written a function, but this is unaware to person B as he could use that same function which could be helpful to him in both saving time and testing, as that was already tested and proved functional by Person A. The person reviewing the code should be aware of the codes and would need to maintain an index of common methods which could be helpful to his team.
- Testing the scripts: Always test your test scripts. If your script hasn’t failed even once, then do not trust it. If it fails, make sure it has failed for the right reason.
- Refactoring the code: Automation engineers should always refactor their scripts from time to time as they need to ask this question — is this code still reliable and valuable (in the sense that it saves time.) Analyze the scripts done 6 months ago to see that this is still reliable and is there a better way to do this. Remove codes that are not needed. This plays a huge role in the testing.
- Planning:
a) Choosing the right tool.
b) What all needs to be automated, and whatnot.
c) Identifying a good design and a good process regarding test data and its environment.
Automation engineers should always bring some interesting techniques occasionally into the test scripts to keep the passion alive.
I am working towards that vision. Are you?