My Life purpose is to…Learn


 

learning

(Image source: http://pjmcclure.com/blog/learn-love-learning/)

This post has been in my drafts for almost 2 years.. I don’t even know what took it so long. It took me time to understand, but I have found it. My life purpose. That was also around the time when I left my first job. I knew it was no longer helping with my life purpose. I love to learn new stuff whether it is new skills or other people’s view points, or maybe just getting on in the world. That’s why I love reading books and blogs. That’s why I want to travel and see other people of other cultures live their lives. That’s why I consider every life experience and every person I come across as a learning. I was reading Carol Adrienne’s “The Purpose of your life just before I found my life purpose. So, I attribute two things in my life to that book. First, finding my life purpose, and second, finding the courage to walk out of the job I had started to almost hate. Have you found your life purpose? What is it?

Testing Auto Suggest functionality


auto_suggest_list

Testing AutoSuggest functionality – Verification of Autosuggest list:

I am taking an example of a text box that will suggest city names from a list of cities according to inputs entered by user. Suggestions displayed are list entries that start with the string given as input. The maximum display limit of suggestions will be 10. The list of suggestions should be displayed in ascending alphabetical order.

 

1. Enter 1 character in the autosuggest field for which values are not present in the auto suggest list.

Eg. Enter “x” when there is no city name in the list that starts with ‘x’
>> No suggestions should be given to the user
>> On replacing the “x” with a character that is the first letter of a city in the list (like “n”), suggestions will be given to user accordingly (cities whose name starts with ‘n’)

2. Enter 1 character in the autosuggest field for which values are present more than the max display limit of auto suggest list. (Max limit + 1)

For example, there are 11 cities with names starting with “h” in our database. So, we enter “h” in the input field, and check the suggestion list
>> All city names displayed in the list should start with the letter “H”
>> Suggestion list should display only 10 out of the 11 available cities.
>> Confirm which 10 of the records should be displayed, and which 1 city should be ignored (should be mentioned in the requirements)
>> Check the sorting order of display of the suggestions. (According to given requirement, the list of suggestions should be displayed in ascending alphabetical order.)

3. Enter 1 character in the autosuggest field for which count of values present is exactly equal to the max display limit of auto suggest list. (Max limit)

For example, there are 10 cities with names starting with “L” in our database. So, we enter “L” in the input field, and check the suggestion list
>> All city names displayed in the list should start with the letter “L”
>> Suggestion list should display all the 10 available cities.
>> Check the sorting order of display of the suggestions. (According to given requirement, the list of suggestions should be displayed in ascending alphabetical order.)

4. Enter 1 character in the autosuggest field for which count of values present is exactly 1 less than the max display limit of auto suggest list. (Max limit – 1)

For example, there are only 9 cities with names starting with “E” in our database. So, we enter “E” in the input field, and check the suggestion list
>> All city names displayed in the list should start with the letter “E”
>> Suggestion list should display all the 9 available cities.
>> Check the sorting order of display of the suggestions. (According to given requirement, the list of suggestions should be displayed in ascending alphabetical order.)

5. Enter 1 character in the autosuggest field for which count of values present is exactly 1.

For example, there is only one city that has its name starting with “Y” in our database.
So, we enter “Y” in the input field, and check the suggestion list
>> Only the city name starting with the letter “Y” should be displayed in the list
>> Suggestion list should display the city name that starts with “y”.

6. Check for case-sensitivity
>> Suggestions provided for “H” should be the same as those provided for “h”
>> If suggestions are not provided for “x”, they should not be provided for “X”
>> If records are displayed, the input string should be highlighted in the records that are displayed in the suggestion list.

7. Assuming, cities exist whose names start with “H”
Enter “H”. Remove the character using backspace. Enter “h” (or vice-versa; replacing “h” with “H”)
>> Suggestions provided for “h” should be the same as those provided for “H”
(I found a bug in Google search with this test case)

autocomplete issue in google search

8. Verify that user is able to select any value from autosuggest list
Assuming, at least 3 cities exist whose names start with “H”.
>> After user enters “H”, user should be able to select any value using only the keyboard (up & down keys)
>> After user enters “H”, user should be able to select any value by clicking on it
>> User should be able to select the first displayed suggestion
>> User should be able to select a suggestion in between extremes (the 2nd one)
>> User should be able to select the last displayed (3rd) suggestion

9. Enter 1 character in the autosuggest field for which values are present in the auto suggest list. Then, replace it with another character for which values are present.

Eg. Assuming cities starting with letters ‘s’ & ‘t’ exist in the test list
Enter “s”. Remove the character using backspace. Enter “t”
>> On entering “s”, suggestions should be displayed with city names that start with “s”
>> On pressing backspace, the displayed suggestions should be removed (hidden from view)
>> On replacing the “s” with “t”, suggestions will be given to user accordingly (only cities whose name starts with ‘t’)

10. Enter 1 character in the autosuggest field for which values are present in the autosuggest list. Then, replace it with another character for which values are not present.

Eg. Assuming cities starting with letter ‘s’ exist in the test list, and there are no city names that start with “x” in the list.
Enter “s”. Remove the character using backspace. Enter “x”
>> On entering “s”, suggestions should be displayed with city names that start with “s”
>> On pressing backspace, the displayed suggestions should be removed (hidden from view)
>> On replacing the “s” with “x”, no suggestions should be given to the user

11. Enter 2 letters such that city names starting with 1st letter exist, but city names starting with the 2 letter combination don’t.
For eg., we have cities that have names starting with “s”. But, there is no city name that starts with “sd”.
Enter “sd”, and check the displayed suggestions.
>> No suggestions should be given to the user

12. Enter 2 letters such that city names starting with 2nd letter exist, but city names starting with the 2 letter combination don’t.
For eg., we have cities that have names starting with “d”. But, there is no city name that starts with “kd”.
Enter “kd”, and check the displayed suggestions.
>> No suggestions should be given to the user

13. Enter a 2 letter combination such that the count of city names starting with the 2 letter combination is more than the max display limit of auto suggest list. (Max limit + 1)

For example, there are 11 cities with names starting with “ha” in our database. So, we enter “ha” in the input field, and check the suggestion list
>> All city names displayed in the list should start with the string “Ha”
>> Suggestion list should display only 10 out of the 11 available cities.
>> Confirm which 10 of the records should be displayed, and which 1 city should be ignored (should be mentioned in the requirements)
>> Check the sorting order of display of the suggestions. (According to given requirement, the list of suggestions should be displayed in ascending alphabetical order.)

14. Enter a 2 letter combination such that the count of city names starting with the 2 letter combination is exactly equal to the max display limit of auto suggest list. (Max limit)
For example, there are 10 cities with names starting with “Le” in our database. So, we enter “Le” in the input field, and check the suggestion list
>> All city names displayed in the list should start with the string “Le”
>> Suggestion list should display all the 10 available cities.
>> Check the sorting order of display of the suggestions. (According to given requirement, the list of suggestions should be displayed in ascending alphabetical order.)

15. Enter a 2 letter combination such that the count of city names starting with the 2 letter combination is 1 less than the max display limit of auto suggest list. (Max limit – 1)

For example, there are only 9 cities with names starting with “Ed” in our database. So, we enter “Ed” in the input field, and check the suggestion list
>> All city names displayed in the list should start with the string “Ed”
>> Suggestion list should display all the 9 available cities.
>> Check the sorting order of display of the suggestions. (According to given requirement, the list of suggestions should be displayed in ascending alphabetical order.)

16. Verify that user is able to select any value from autosuggest list after entering a 2 letter combination.
Assuming, at least 3 cities exist whose names start with “Hu”.
>> After user enters “Hu”, user should be able to select any value using only the keyboard (up & down keys)
>> After user enters “Hu”, user should be able to select any value by clicking on it
>> User should be able to select the first displayed suggestion
>> User should be able to select a suggestion in between extremes (the 2nd one)
>> User should be able to select the last displayed (3rd) suggestion

17. Enter 2nd,3rd, 4th char (and so on..), and verify the values displayed in the autosuggest list.
>> Suggestions should keep getting updated according to the newest letter added as input
>> The input string should be highlighted in the records that are displayed in the suggestion list.
>> If we have a city “Ahmedabad” in our list, and there is no other record that starts with the string “Ahmedabad”. When we enter “Ahmedabad” as our input, only one suggestion of the city should be displayed (duplicates should not be present, and full name should narrow down the suggestion list).

18. Copy-Paste should work.
Assuming cities starting with letter ‘Si’ exist in the test list
Copy the string “Si”, and paste it into the text box
>> All city names displayed in the list should start with the string “Si”
>> Suggestion list should not display more than 10 cities.
>> Check the sorting order of display of the suggestions. (According to given requirement, the list of suggestions should be displayed in ascending alphabetical order.)

19.Enter first character as special character and verify the autosuggest list.
Eg. Assuming cities starting with letter ‘s’ exist in the test list.
Enter any special character (like +,_,*,$,etc…), and then enter “s”
>> Confirm requirements. One of the two results might occur:
i) No suggestions should be given to the user
ii) Special characters should be ignored while checking inputs, and suggestions should be displayed to you for city names that start with “s”

20. Enter a city name that contains a special character. Check for all possible special characters.
Eg. “St. Louis”, “New Delhi”, “Chittur-Thathamangalam”, “Daman & Diu”,”O’ Valley”
>> Proper suggestions should be displayed to user if the cities exist in the list

21. Check what happens when you enter names with non-english special characters.
Eg. “Orléans”
>> Confirm requirements

22. Without entering anything in the search text box, click Search icon or hit enter key
>> Confirm requirements. If city is mandatory, user should be displayed an error, otherwise, results should be displayed according to default.

23. Without selecting anything from suggestion list, hit enter key or click search icon
Eg. Enter a full city name like “New Delhi”, and hit enter key or click search icon.
>> If requirements require selection, an error should be displayed to the user
>> Otherwise, results should be displayed for the city “New Delhi”

24. Enter a city name that is not present in the suggestion list, and hit enter key or click search icon
Eg. Assuming “Paris” is not in our list, and hence will not be displayed as a suggestion in any case.
Enter “Paris”, and hit enter key or click search icon.
>> An error should be displayed to the user

25. Check scenario where a city name contains more than 1 word.
Eg. If “New Delhi” is in the test list,
Enter “New” and check auto suggest list. Enter “Delhi” and check auto suggest list.
>> If users are likely to enter a word other than the first for the city name, entering the contained words (other than 1st word) should also display the city name in suggestions.
As in India, people are as likely to call the city “Delhi” as they are to call it “New Delhi”, the suggestion list should display “New Delhi” when either of the “New” or “Delhi” is typed by the user.

26. Check by entering input with a preceding space character
Eg. Assuming cities starting with letter ‘s’ exist in the test list.
Enter a space character (” “), and then enter “s”.
>> Preceding space character should be ignored, and suggestions should be displayed to you for city names that start with “s”.
>> Suggestion list should not display more than 10 cities.
>> Check the sorting order of display of the suggestions. (According to given requirement, the list of suggestions should be displayed in ascending alphabetical order.)
>> The matching text should be highlighted in the auto-suggest list

27. Check by entering input with a succeeding space character
Eg. Assuming cities starting with letter ‘s’ exist in the test list.
Enter “s”, and then enter a space character (” “).
>> Succeeding space character should be ignored, and suggestions should be displayed to you for city names that start with “s”.
>> Suggestion list should not display more than 10 cities.
>> Check the sorting order of display of the suggestions. (According to given requirement, the list of suggestions should be displayed in ascending alphabetical order.)
>> The matching text should be highlighted in the auto-suggest list

28. Check handling of input to be entered that can be called by different names (different spellings).
Eg. In our example of city names, a city can have an old name, and a new name. The name of a city called “Baroda” was changed “Vadodara”. A user is likely to type in any of the two names.
>> Confirm requirement on whether the user should be displayed the new name in suggestion list when typing old name, or whether both the names are to be treated as independant & separate records.

29. Enter some characters, select a value from the auto suggest list, delete the value from the text box, then enter a different input and select from auto suggest list.
Eg. Assuming “Mumbai” and “Chandigarh” are in the test list.
Enter “Mum”. Select “Mumbai”. Clear the input text box, and then type “Cha”. Select “Chandigarh”
>> The last selected value (“Chandigarh”) should be displayed as selected. On hitting enter key or clicking button, results should be displayed according to input = “Chandigarh”

30. If values in auto suggest list come from more than one categories, check display of the list values on entering input
>> Confirm requirements on the sorting order of values to be displayed from across categories.
>> Check that all related values from across categories are displayed in the auto suggest list. None of the available categories should get missed out

31. Check that the auto suggest functionality works as expected across various browsers and their different versions. (Cross Browser compatibility check)

32. In all pages where the auto suggest is implemented, check that existing functionality of page is working properly. At times, javascript errors occur, or the new code starts interfering with the existing functions.

33. Check widening of suggestion list when characters are removed from input field.
Eg. Assuming there are 11 cities with names starting with “ha” in our database, and there are 6 cities with names starting with “hal” in our database.

Enter “HA”. Enter “L”. Remove “L”.
>> On entering “HA”, 10 cities should be displayed in the suggestion list (max. limit)
>> When “L” is added to make it “HAL”, suggestion list should be updated to display only the 6 cities that start with “HA”
>> When “L” is removed to make the input “HA” again, suggestion list should be updated to display the same 10 cities that were being displayed earlier (before typing “L”).

34. Check how drag-drop of text is being handled by the input text box
Eg. Assuming city “Pune” is present in our database, and the page containing the auto suggest functionality input box also has the text “Pune” written somewhere in it.

Drag-drop the text “Pune” from the page into the input text box
>> “Pune” should be displayed in the suggestion list to the user
Along with my own list of test cases, I also used the list in given link as guidance material. A very big thanks to the writer! 🙂

Aside

Follow your passion


If you follow your passion, the money and happiness will follow.

But if you just follow the route to make money, without paying heed to your heart and passion, happiness will get lost somewhere on the way.

That is why it is so important to follow your passion.

Our teachers, parents, and elders are so wary of unconventional jobs that they get scared when their kids try to make a living in a way that is “not normal”.

But, one has to learn that when the children follow their passion, they work hard on it because they are passionate about what they do. This eventually makes them an expert in the field, and experts are always looked up to for guidance. There can always be a way to make a living out of what you love if you are just courageous enough to follow your heart.

Anyone out there who’s followed their passion, instead of the ‘conventional’ jobs their parents wanted them to take up? I would love to hear your story.

Image

(Image source: http://zenpencils.com/comic/98-alan-watts-what-if-money-was-no-object/ )

Why do you need testers


A very, very common question by people who cannot understand why developers can’t find or prevent bugs in their own code. Maybe they are managers who haven’t been developers. Maybe they are developers who are finding it hard to admit that they can also make mistakes.

So, I was asked what I would do if I was told that the project would be taken live without testing, and that testing was not required.
I replied I would let them take it live without testing, and then let them face the music from the customers themselves. That would be the practical way. Because experience is the best teacher, and the best way to let someone know something’s importance is to let them have a lack of it.

No amount of debating can convince a person who has made up his mind that testing is not required. He has to be either forced into accepting it as a part of work life, or he has to be made to face the consequences of its lack to realise the importance.

But, if you need the theory behind why testing is required,  here’s why.

1. The most important point. There’s a difference between a developer’s attitude (creation), and a tester’s attitude (destruction).

A developer wants to show that the code is working. Because of this, he/she subconsciously selects such test inputs that have low probability of causing errors. It’s in the psychology, one cannot help it.

A tester wants to show that the code doesn’t work. Not that they are against it or anything. They just break it so that it can go all patched up, and smooth, into the customers hands.
Testers love to be the only ones who break it, so that the team doesn’t ever have to face a red-faced customer demanding they fix the issue that very moment. Errors can take days to resolve at times, but when the problem is at the customer’s end, every minute counts.

2. People say every thing was fine and smooth, even before the tester stepped in. Are you sure?
There was no tester before who would have told you that some very critical problems had been left hidden beneath the illusory smooth surface of the code. You know, developers are human, and they can make mistakes too. One needs to make sure that at least the severe mistakes don’t land in the hands of the customer.

Very few Customers tell you about the problems they face. Most of them just get irritated, try to work around, and stick to you only until a better service/software comes in the horizon. Then, suddenly, your user base just stops being yours, and shifts to your competitor who cared more about finding the quality issues and fixed them. (Wanna know more?)

3. Have you heard of the game ‘Chinese whisper’?
People sit around in a circle. One person whispers something into the neighbour’s ear, who whispers the message into the next person’s ear. The message is passed until it reaches back to the person who had started the chain. When the chain ends, the message always gets drastically twisted into something else.

Now, consider the learning from the game above into the software development cycle. When a software is developed, a number of teams and people are working together.  The requirements are passed on in a chain and might have passed through many levels until they finally reach the developer who will work on it. Imagine how distorted the requirements might have become till they reach the end of the chain.

The tester being in the process since the beginning (requirements phase) will be able to inform you about the misunderstanding of the requirements. Also, testers make it a point to understand the bigger picture and are at a better position to ascertain quality than the developer who has knowledge only about the part of the code he/she is working on.

4. The later the stage when the bug is found, the higher is the cost of fixing it.
As the bugs reported by a customer maybe vague due to their lack of knowledge about the code, it would be even harder and more time consuming for the developer to isolate the exact line of code that is causing the issue. And what worse experience than a customer shouting at the other end, while you’re desperately trying to find the cause of the elusive bug just reported to you, with immense pressure to resolve the bug immediately. You are at the brink of pulling your hair out because here you have not even understood where the problem is, and you are being asked to deliver a solution within an hour. You just want to stand up and shout curses in the air, just because the issue was not found earlier when you had an option to not deliver a software with such critical problems without solving them. If the bug had been found earlier, you would have worked with a calmer state of mind too, thus helping you to work faster.

5. Code might work perfectly fine as an individual unit, but might break when two separate units are integrated together.
You have website that works fine in itself. You have a backend portal that works perfectly fine in itself too. Maybe, the two softwares were made by two different teams who don’t have much idea about the other team’s software. Now, you integrate the two softwares through an API. But, things go wrong. Data collection gets wrong, and reports are incorrect, because they realised too late that the softwares had not been integrated properly. Maybe a variable was required to be passed but wasn’t due to some misunderstanding of specifications. Maybe the value passed was not the same as expected. And this integration error, that none of the teams could have found themselves without first taking weeks, or months, to go through the entire code of the other team, causes a huge loss in revenue.

But, if people, even after the practical/theoretical knowledge of the importance of testing, think they can do without testers in their team, I’m really curious to know what their game plan is to reach the #1 spot. Or if they are already #1, I’d like to know their game plan for maintaining their spot. Because, as far as I know, it’s just not possible.

The Tester to Developer ratio


This seems to be a very common question faced by many test managers. “What do you think should be the ratio of testers to developers?”. But, there is no correct answer to this question. Rather, it depends on various factors including the job profile of testers in the project, the complexity and size of the project.

Since I was the first tester in my current company, it was part of my job to decide how many more (a minimum number of) testers were required for proper testing of our products. The minimum ratio I came up with was a 1 tester for 3 developers ratio. I thought the ratio would be optimal for our company – meaning some over-time, but not so much for our testers. Also, the ratio was decided by considering we will spend very less time on documentation, and will concentrate mostly on bug hunting and quality determination.

Then, I came across this document today which I found very informative. It states that optimal ratios may vary according to the projects and tasks required to be taken care of by the testers.
And, also that one should give proper thought to the ratio decision and resource allocation for good results.
http://kaner.com/pdfs/pnsqc_ratio_of_testers.pdf

How use of Regular Expressions affects Website Performance


A few months back, I inadvertently came across a bug related to regular expressions. It was a new learning for me that improper regular expressions can cause catastrophic performance problems.

Let me first give you more details about the bug I found.

The form I was testing had a text box “Special Note” with maximum character limit set as 500.
When the form was submitted by the user, a regular expression was used to check that the text did not contain any Email address.
Everything worked fine when I entered strings with short words.
The problem started occurring when I entered a long character string (eg. “asdfghjiklasdfsdfsdkjhdfseds”) in the Special Note field, and then submitted the form. The software stopped responding to user input in this scenario.

The Performance was getting adversely affected when trying to match the regex pattern with the entered long character string.

To find out more about the issue I had faced, I researched online about how regular expressions can affect performance. I found that the performance issue occurs because of  backtracking. I also found  Microsoft’s example of a regex for email address that can cause performance issues. The linked articles provide more detail on backtracking, and on how the issue occurs if the regular expression used is not optimized.

So, when you are required to test a text field that uses a regular expression, always include the following test cases in your testing:

1. Different possibilities of text that matches the regular expression pattern.

2. Different possibilities of text that does not match the regular expression pattern.

3. Different possibilities of text that almost matches the regular expression pattern –  Including, a long string of characters, with no whitespace in between, that nearly (but not completely) matches the regular expression.

Assuming no one will find that bug is a very bad idea!!


Rodney recently posted an article  on incorrect policies of some companies, where they assume that not telling anyone about their security flaws will somehow protect them.
Such companies can not last very long because they incorrectly assume that they are the only intelligent people in the planet.
Someone with malicious intent can always find out your security flaws without you telling him/her. So it’s crucial to remove those flaws instead of trying to hide them.

On a similar note, I want to tell you to never make assumptions about any bug.
Eg. When I am telling you of a server error that occurs in your website, don’t just ignore it by assuming the scenario I told you about will rarely occur. Users are not 100% predictable. No human is. So, your assumption – that only a tester would get such a server error and users would not – is wrong.

Also, if the “rare” bugs you chose to ignore are a lot in number, there is more probability of a user coming across at least some of them. Each bug a user finds has a cumulative effect on driving the user away from you.
If by chance, a user comes across such an error, he/she will be confused and frustrated, and you might lose your audience to someone else who took the time to fix their bugs.

And you wouldn’t want that, would you?

Dilbert Software Quality