Code Refactoring: Why a QA Need to Know About It

Posted By : Kuldeep Sidana | 27-Oct-2018

Introduction to Refactoring
The code required to redesign/cleanup is called the refactoring. 
A practice of improving the code or the database at the time of the maintenance of the existing functionality is known as the code refactoring. The idea behind the refactoring is just to transform the over-complicated and inefficient code to the more easier, efficient and preferably simple code.
Nowadays the Agile Software Development approach is mostly followed by the team. It’s very rare when the development team get the more time to implement the new functionality or maintaining the existing one. 

Code Refactoring



#1) For Unit Testers/Developers

Existing Unit tests may get fail due to the refactoring of the code because while refactoring the new code is being inserted or updated the old one. Therefore the new classes are added and old being updated.

So, for this, the unit test cases will need to be created to cover up the scratches.

#2) For Testers

Being a test engineer, its is very needful to know about the refactoring. Because when functionality is being refactored(considering just updating the existing one, not adding new in it) the major functionality of the feature should remain the same for the end user.

  • According to the tester, roughly estimate of the code refactoring is = regression testing + in-depth testing. And this needs a great effort to verify the all existing workflows to ensure that all functionalities are working fine as worked before. Regression testing of the impacted areas of the application is required to ensure that the updated functionality is not unintentionally breaking the other features of another modules.
  • Before the build being deployed on the release, User acceptance tests play an important role and these tests need to clear before the actual deployment on release server.
  • Additionally, load testing and security testing would also need to be done as it is important and required too.


#3) Automation Test Engineers

Refactoring of code may also lead to failing the non-functional and functional automation scripts.

Following are the reasons for the script fail:

If the page objects get changed at the time of the refactoring effort and if Page object model is being used in the selenium automation scripts, then the existing scripts will fail and update would be required for them.

If the minor changes were done in the refactoring then they also get exposed at the time of redirects and the script will get fail which need to be updated.

It is also recommended that to escape from the rework again and again the functional selenium automation tests scripts should only be set up only once a feature is stable.

To be a developer of selenium automation tests scripts, automation test engineers also thinks like a developer and his aim is also to easily maintain the code and create it clean.

Related Tags

About Author

Author Image
Kuldeep Sidana

Kuldeep Sidana is an orient QA Engineer having dexterity in Core Java and vouched with Automation Testing tool (Selenium Web Driver) and Manual Testing.

Request for Proposal

Name is required

Comment is required

Sending message..