Why as a Tester, I’m loving Python

A Tester has to juggle between lot of activities: understand the system under test, learn the domain for which the system is designed, design tests, execute tests, find bugs, report bugs, prepare meaningful testing reports, plan testing, prepare test data, prepare test environment, deploy system under test and so on.

If you look at the above list, it can be categorized in two blocks. First being intellectual or human work that includes learning, designing, planning etc. The other block is the dirty work that every job comes with and doesn’t consume much of your brain cells. The things that I mentioned earlier as Test supporting activities. These are the things that you should try to put them on ‘auto’. With the understanding that tools fit into your testing strategies and not define them, believe me Python is the best tool to do that.

To get you an idea of what tasks I’m exactly talking about, in our current project we have written Python scripts to do the following:

  • Download build from the ftp server. The task is scheduled and looks every few hours to check for the latest build. The script downloads it, unzips it, places it at desired location and sends email to all the team members.
  • Upload the testing results on SharePoint server. When some of our testing tasks finish, we hand over the results to this script which massages data, makes them more ‘management-friendly’ and uploads at a desired location on SharePoint server so that all can see it.
  • Regression testing tasks. One of the required regression for our project is to make sure that latest build works well with existing data. So we have ~250 different type of models that we pass to the build and see if it all goes well. This is again done through a Python script.
  • … You get the idea.

LovePython

(the original image is here)

Now your could argue that any scripting language can be used to achieve the above, so why I’m loving/promoting Python. To be honest, in some earlier endeavors I’ve used VBscript, AutoIt and C# projects to accomplish the above. So all are good but since life is short, these things make Python more loveable are:

  • Batteries included. Yes it comes with all you need to play with. Test supporting activities have a lot of a variation to be able to work with XML, Excel, SharePoint, Batch files and so on. Python has a solution for all.
  • It’s Portable. The same scripts that run on Windows are running on Mac and on Linux for us. The modern world is so more complex and so more wide that portability is gem of a feature.
  • It’s easy. If I can learn and use it, any tester should be able to learn it. And it is also backed up by very active development community that would share code samples and answer your questions if you run into trouble.

Do you have a list of support activities? Have you put them on ‘auto’ and how?

Tags: ,

7 responses to “Why as a Tester, I’m loving Python”

  1. Zafar Raja says :

    Many thanks for sharing this article. Very well written and explained in a very simplistic way.

    Like

  2. Farrukh Latif says :

    Applicable to almost all test engineers. Thanks for compiling it.

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s