Python

How to set default Python version in OS X

Today I ran into the trouble as most of my scripts were failing due to version mis match. The code I had written was Python 3.x compatible but my system had by default set Python2.x as the default version. Following are the steps which i followed to fix the problem:

    • Open ITerm. ( You can use your default mac terminal also.)
    • Open your ~/.bash_profile in vim or any other text editor.
    • Add alias python='python3'
    • Save the file
    • Run source ~/.bash_profile
  • Now try running python -version to see which version is coming up

Let me know in comments if you fail to follow above steps.

Advertisements
Data Structures

What are Linked Lists (Part-1)

I have been asked this question continuously in various technical interviews but I have never been able to give the perfect answer. I will try to jot my understanding of Linked Lists here.

So let us get back to Data Structures. Data Structures are the beautiful and most important topic in the world of Computer science. How to structure your data to save memory and time is what defines a better engineer.  Broadly speaking, they are of two types:

  • Linear Data Structures
  • Non-Linear Data Structures

Linear Data Structures: They can be traversed only sequentially. One of the classic example if of an Array. An array is defined in contiguous memory locations and its memory is fixed. Memory Management is an important aspect of Linear Data Structures. For Adding new data to existing array one needs to copy it and then add the new data. Linked List is also a type of linear data structure.

Non-Linear Data Structures:  They can be traversed in the non sequential way.  Graphs, and Trees are classic examples of this type of data structure.

Let us get started with Linked Lists.

Linked Lists consists of nodes. Starting node is called as HEAD. 

Each node has Two parts. One part consists of Data and other holds the address or memory reference of the next neighboring node. The end of linked list occurs when during traversal a null is encountered.

Linked lists are three types:

  1. Singly Linked Lists: Each node holds the address of only next node.
  2. Doubly Linked Lists: Each node here holds the address of preceding node as well as the node next to it.
  3. Circular Linked Lists: These start and end at the same node called as TAIL.

 

In next blog, we will dive little deeper into how linked lists manage time and space.

 

Jmeter, Software Testing

Setting up WebDriver Sampler for full browser tests in Jmeter

We had an important task to load test the web-app whose front-end is based on Angular-js Framework. JMeter is not a browser. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however, JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it’s possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever viewed at a time).

Owing to this we moved to Webdriver Sampler plugin for handling Client-side Javascript execution — eg. AJAX, JS templates.

Steps to Download and configure Webdriver Sampler:

Prerequisite:

Jmeter 1.8 and above (https://jmeter.apache.org/download_jmeter.cgi) with JRE 1.6.

  1. Download JMeter- Webdriver Sampler plugin from here.
  2. Extract The zipped folders lib files into the lib folder of Jmeter.
  3. Copy the ext files of extracted folder into ext files of Jmeter
  4. Now Open the Jmeter and Add Thread Group.
  5. Right Click on thread group and click on Add > Sampler. Here you should see a new set of samplers added as below:

1_3Pn5-guHbnSIQp5zNMDrhA

Software Testing

Is Automation Testing Really Testing!

Is Automation Testing Really Testing!

Hey there! To all the techie testers there this might be absurd for You that Automation Testing is not really Testing. Lot of testing gurus believe that Automation Testing is not real Testing rather its checking the Application.

Testing involves thorough thinking out of box while as a scripted test will do only what it has been asked to do. I am not against that, my only concern is that what should a real tester focus on?. During my career I have seen techie testers focusing more on modification of the scripts they are developing rather than trying to improve the quality of app they have to test. Also at the end of the day humans are gonna use the app rather than bots or scripts. So for real testing we need real humans that is we.

Automation is helpful for testers when he has to test same functionality again and again. Thereby he can create a regression suite and run it whenever needed. But again that script needs to be maintained whenever new code fixes are done for the app under test.

A good tester should rather think about all the permutations and combinations, try to break the app, think negative ,challenge the app so that quality of app is never compromised.

A good tester should put himself in the boots of the end user and test the app in that perspective, try to increase product knowledge by hook or by crook. At the end of the day Its Quality of the product that is built that matters. Please feel free to comment your thoughts on this.

Thanks, happy testing:)

Remote

Pros of working remotely!

In below paragraphs, I will be discussing the positive vibes regarding working and collaborating with your teams remotely. Gone are the days when one’s physical presence at an office/workplace was important. Now, collaboration via online medium is the fastest and secure way to communicate with your teammates. A lot of companies either startup’s or even MNC’s are moving towards remote working culture. Why?

  1. Save time in office commute: A person can save around 2 hrs of up and down time spent in traveling. Rather, these hours can be used to be more productive at work. Also one feels tired due to long travel, thereby decreasing the productivity of the person.
  2.  Save time in dressing up formal/casual attire: An average person spends around 1 hr daily in getting ready and look best. If you work remotely it doesn’t matter what you wear. You can be comfortable in whatever stuff you like. No hard rules!.
  3.  Be more fit: Research says that sitting at the same place for a long time is bad for health. If you are at an office it’s not possible to get up and roam every one hour. If you work from home, you can take short breaks and relax your muscles thereby declining your stress levels and you turn up to be more productive and healthy.
  4.  Eat healthy and fresh food: If you are in office you either carry your meal home cooked and have it after 4 to 5 hours or you move outside and have food from one of those roadside stalls. This can cause health issues because the food is not fresh and may be prone to infections. If you work remotely you can cook and eat fresh food anytime, thereby boosting your health further.
  5.  24/7 work time: Working remotely, this is the best benefit I have felt. In an office, you have around 8 hours to complete your daily tasks and if you are not able to do you have to come next day and complete it while as if you work from home you have a lot of time to complete your task.