44. Refactoring the Selenium Automation Code





Refactoring refer to the process of changing the structure of the code without changing the basic behavior (i.e. The code should solve the purpose even after Refactoring it. ).

Example

Suppose you have written some Selenium Automation code to open the www.google.com, enter  'Selenium-By-Arun' text into the Search Text Box and click on 'Search' Button.

So you have written Selenium Automation Code to perform the above, but the code you have written is not structured but will work.

So you Refactored the code(i.e. changed the structured of the code) to make it more Readable, Simple, Maintainable etc.

Even after changing the structure of the code our Selenium Automation code should open the www.google.com, enter 'Selenium-By-Arun' text into the Search Text Box and click on 'Search'  Button.

This is called as Refactoring (i.e. The process of changing the structure of the code without changing the basic behavior ).

Now Lets Understand the objectives of Refactoring:

As I have already mentioned above that the objectives of Refactoring the code is to:
  1. Make the code Readable
  2. Make the code Simple
  3. Make the code Maintainable
I will explain all these objects practically in the next upcoming posts.

In order to understand this concept in a more practical way, lets identify few real time tests first.

Please comment below to feedback or ask questions.

Identifying  few sample real time tests for implementing the Refactoring concept will be explained in the next post.

Followers

Labels