Monday, May 28, 2012

Equivalence Partitions

When we deal with a lot of data, it seems to be ever increasing to test and exhaust. Let us take a simple courier management application. Typical inputs are - from address, to address, weight of the packet to be couriered, any insurance to be used for the parcel. Based on these, the price is calculated by the system. Imagine you are the tester for this application, what kind of test conditions you will write?

Let us divide the problem into different segments. See the conditions below.
  1. Sending a packet from your home to another house in the same street
  2. Sending a packet from your home to another house in same zip code or area code
  3. Sending a packet from your home to another house in another city, but within the same state
  4. Sending a packet from your home to another house in another city, but outside the state
  5. Sending a packet from your home to another house in another city, but outside the country
Do you see a pattern? We try to get a sample of each business scenario that can happen in real time. One sample is a representative of a lot of similar data. The trick is to identify as many number of good samples, as possible. Another set of samples would be based on the weight of the packet. Usually the charges would be x1 for 10-100 grams,  x2 for 101-250 grams, x3 for 251-500 grams, x4 for 501-1000 grams and so on. If we need to get samples for these different slabs of the packets, what values should I choose? Should I take 4 packets with weights 10, 101, 251, 501 grams each or 100, 250, 500, 1000 grams each? There is no hard an fast rule here - but the boundary values will always be taken care in your BVA test conditions. When it comes to Equivalence Partition, it is advised to take the middle values when it comes to numbers. So if I need to give 4 samples based on weight of the packet, I would choose 50, 175, 375, 750 grams each. These 4 samples clearly represent the 4 slabs of the packet weights.

Let us take a bank that takes deposits. There are many parameters that determine the interests on deposits - but let me take 2 key parameters - Interest Type - Compound or Simple,  and the other one is Deposit Period Tag - Daily, Monthly, Yearly. If we alter these 2 parameters, the interest varies. Look at the following options:
  1. Simple interest, applied on Daily basis
  2. Simple interest, applied on Monthly basis
  3. Simple interest, applied on Yearly basis
  4. Compound interest, applied on Daily basis
  5. Compound interest, applied on Monthly basis
  6. Compound interest, applied on Yearly basis
If we carefully look at the above samples, 2 parameters with 2 and 3 different values, resulted in 6 combination samples. Thus, when the number of parameters and values of the parameters keep increasing, the number of samples you have to choose will also keep increasing.


Exercise: Take a travel booking site. From city, to city, round trip/one way, adults/children count, accommodation required etc. will appear on the screen as input parameters. Arrive at the combinations of these as test samples based on equivalence partition technique.


For recorded sessions on software testing, visit us at www.openmentor.net.



Monday, May 7, 2012

Boundary Value Analysis (BVA)

By pushing one to the limits, you can see a totally different behavior from that person. Stretching a system to extremes will bring out its funny behavior. Usually this is applicable to all fields on the user interface. Always remember, most of the problems to our body happens due to bad input, name it bad food, or bad water or bad air. Same way, a system if it accepts bad inputs, it is in potential danger zone.


Let us take a simple voltage stabilizer that we connect to TV or fridge. Usually they give the range 190-240 volts 50 to 60 hertz input, output will be constant at 220 volts. If this needs to be tested, we need to look at some good and bad extremes.


  1. Connect to 190 volts
  2. Connect to 240 volts
  3. Connect to 189 volts
  4. Connect to 241 volts
In the above, we arrived at 4 conditions - be at the lowest boundary, be at the highest boundary, go below the lowest boundary and go beyond the highest boundary. We just varied one parameter - voltage. 


But there is one more parameter we have - cycles in Hertz. For that, keep a valid voltage and push that cycles to extremes.
  1. Connect to 220 volts 50 Hz
  2. Connect to 220 volts 60 Hz
  3. Connect to 220 volts 49 Hz
  4. Connect to 220 volts 61 Hz
By doing this, we make the system to go thru positive boundaries and negative boundaries. Withing the positive boundaries, the system must work; the system must stop working when it is put under negative boundaries.

Better to apply one parameter and push that to extreme, when we deal with multiple parameters. Else if the system fails, we may not be able to isolate the reason of failure.

In software, imagine you see a field that takes the date of journey in a travel portal. How can we apply the BVA technique in that field? Ask these questions and take a call.

  1. Can I book a ticket for today?
  2. Can I book a ticket for yesterday?
  3. Can I book a ticket for a day 180 days from now? (usually travel sites may allow upto 6 months)
  4. Can I book a ticket for a day 181 days from now?

This list may go as per the restrictions given by that portal. Same way, let us take a US zip code field. How can I apply BVA on a zip code field? A zip code is usually 5 digits such as 95014 or 5 digits hyphen 4 digits such as 95014-2367.


A few home work questions for you to apply BVA.

  1. Write BVA tests for USA social security number
  2. Write BVA tests for the interest rate field in a banking simple interest calculation screen. (interest rate is a percentage value)
When you deal with boundaries, there are 2 kinds of boundaries. Size boundary and value boundary. Value boundaries are the ones we discussed before. Size boundary indicate the number of characters that I can type in a field. You could have seen that many websites registration pages restrict the passwords to be minimum 6 characters and maximum 10 characters. In such cases, we need to test for 5 character password, 6 character password, 10 character password and 11 character password. 

Now is the twist - if a field has both size and value boundaries defined, you end up doing at least 8 tests for that one field alone! Good luck.

For more details, please refer to Open Mentor portal.



Monday, March 12, 2012

Writing Test Cases

After writing test conditions, this is the next logical item one must go thru in a project. A test condition tells "WHAT" to test. A test case tells "HOW" to test. That means, we must provide step by step details in test case. This is like a recipe - you miss one vital step, the execution of test may go wrong.

Simple mantra you must follow when you write test cases - think that you are giving instructions to test the software, to an 8th grade kid. The kid knows English and knows how to operate computer; but does not know anything on how to test your application.

Is it really possible to make a kid to test my application? Yes it is, provided the instructions are clear and simple. Have you ever called a customer support help desk to resolve a problem in your laptop? You might have observed that the help desk person asking a series of simple short questions and solving your problems in minutes. The trick is clear and simple document. Look at this following example.

  1. Open firefox browser.
  2. Navigate to www.openmentor.net
  3. Click on Word Games link.
  4. Click on the link that says "Click Here to start"
  5. Choose 4 from the list box shown.
  6. Click Go.
If we give instructions like this, don't you think that you can make another person to test a software? This is the holy trick of getting work done by vendors and that too relatively junior testers, thus reducing the cost. If we do not do this kind of clear step details, we may require senior testers, who are costly. Every management would like to reduce the cost. If that needs to happen, a good set of test cases must be drafted.

In the industry, a test case is written in a document or in a spreadsheet with the following details.

Test case Id: A unique identifier for this test case, across the project or company.
Test case name: Usually this will be the test condition that you wrote before.
Pre-condition: The pre-requisite that must exist before we do this test.
Test Steps: Simple step by step such as clicks, types, navigation etc to carry out the test.
Test Data: The data yo must choose or type in any forms.
Expected Results: What is the expected outcome when we do these steps with the given data.

Usually people ask me this question - why should we write this much, when I know how to do it? Remember, you or any other person in the project, may be moved to a different project tomorrow. In that case, should other person re-invent the wheel? So better put all the things you remember in testing this product, in a paper. Also, you be the thinker that adds more value; let the test execution be done by other juniors. It also helps in assessing whether we have missed any permutation or combination in testing. If everything is just remembered by you, no one knows how many tests you remember and how many you do not. So better to document every test case.

Writing test cases will take more time. Agreed. But it is usually for one set of test cases; after that, you copy-paste the same text and make modifications in steps or data and expected results. It is not usually all text in all test cases are typed fully by you. Once a pattern of test is identified and typed, rest is all making minor modifications to that text.

In the next posting, we will see examples of test cases and a few techniques like boundary value analysis etc.

Monday, January 16, 2012

What does one need to get job?

Hundreds of job hunters send emails to us asking whether we have any positions open. Every company needs people, all the time. Very rarely, they freeze hiring. But what the applicant does not know or does not care to know, is whether he/she is ready for that position. Everyone feels that they are ready to do the job; but every business leader claims that 80% of the students who pass out in India, are not readily employable. Hence there is a big fight to grab the qualifying ones, by so many companies - the result is the inflated salary levels.

Where and when will it end?

First thing. Whatever is the industry to which one applies for a job, that person must have a good analytical reasoning ability. If one is not able to solve a simple aptitude question, that person is not fit to get an entry. During interviews, we had seen people who do not know how to apply the fundamental principles of simple and compound interests, but applying to a banking position.

Second thing. Be confident. Almost 90% of the people who come for interview at fresh level are submissive. They feel like servants and are afraid of answering in clear loud tone. This attitude must change. Many times we see people pleading ta the end of the interview that they have family commitments and this job is an absolute necessity to them. This will not help.

Third. Communicate clearly in simple way. One need not be a great orator or writer. Simple words, clear sentences will make the interviewer happy. But unfortunately, people try to throw jargons and try to show off their knowledge. But when a practical question is thrown at them, they fail to apply concepts and start blabbering. This wastes a lot of time. Better communication can compensate many other negative points.

Fourth. Unreasonable Expectations. Everyone thinks that they are worth minimum 3 lacs per annum salary. They never care about the job profile or the size of the company. People do not even see the website of the company to which they had applied for a job. For the first 2-3 years, learning is the asset one must look for and not money.

Fifth. 100% job guarantee by training institutes. Do IIT and IIM claim that they can 100% guarantee job to every student? It must be knowledge and skill guarantee and not a job guarantee. Only yourself can guarantee a job for you, based on practice. Any institute that does good training and guidance, will help you; but it is ultimately you, who can make the difference. Lack of self belief is the root cause of this; always people need external factors to help them.

When 50,00,000 students graduate from 22000 arts colleges every year, and 10,00,000 students come out of 3000 engineering colleges every year, only the knowledge and practice can help every fresher. Nothing else.

In worst case scenario, if you do not have a job and someone says work is there but no pay, please take it in a short term at least. That is the intellectual money you can earn; that time will never come back, if you refuse that option also. Sorry, this may sound harsh, but this is reality in India.

Thursday, January 5, 2012

Top 100 Test Scenarios for Online Shopping Apps

I have been seeing a lot of ads for online shopping portals. What do they really do? Sell items right from shoes to iPhones. A few product companies asked us to educate their testers in testing their product. We first educated the testers in the business flow of ecom portals.

What you see here is a slice from the testing checklist.

  1. View the hot promotion plans on home page
  2. View top level categories of products on home page
  3. View the order of sub categories of products under each category
  4. View top products list under each category-sub category
  5. View products as grid
  6. View products as thumbnails
  7. View small and large images of products with short and long descriptions
  8. Search for a product with brand name
  9. Search for a product with a model name or number
  10. Search for a product below certain price
  11. Search for a product within a price range
  12. Search for a product with some keywords in description
  13. Search for a product of certain color
  14. Search for a product in specific store
  15. Search for a product in a specific geography
  16. Search for a product that are referred by many community people
  17. Search for a product for a range of user ratings
  18. Search for a product with multiple combinations of above
  19. Sort product search results based on price
  20. Sort product search results based on store
  21. Sort product search results based on buyer rating
  22. Add a product to cart
  23. Add multiple products to cart from same search results
  24. Add multiple products to cart from different search results
  25. Remove a product from cart
  26. Add the same product to cart after removing it
  27. Add the same product multiple times to cart
  28. Alter quantity of products after adding to cart
  29. Alter quantity to zero in the cart
  30. Provide payment details to buy product
  31. Provide payment details and cancel it
  32. Provide wrong credit card details and try to buy
  33. Purchase product thru corporate purchase plans
  34. Provide shipping address same as user’s registered address
  35. Provide shipping address different from the user’s registered address
  36. Register new user with valid details
  37. Register new user with invalid details
  38. Register same user with same emailed and userid
  39. Provide same credit card details to two different users
  40. View the registration email contents for new users
  41. Change password for a registered user
  42. View change password email content
  43. Do not use account for 60 days and login after that time period
  44. Login as user, add a product, logout and login again
  45. Use correct promotion code for correct product
  46. Use wrong promotion code for a product
  47. Use a valid promotion code to a product but after its expiry date
  48. Use a promotion code more than once for purchase
  49. User a private promotion code of another registered user
  50. Track the purchase order for delivery
  51. Rate a product for its quality
  52. Join a group purchase and confirm purchase
  53. Join a group purchase and cancel after an hour or day
  54. Join a group purchase for more than once
  55. Define alert to notify when product price falls into certain range
  56. Purchase a product whose price is more than your credit card limit
  57. Purchase a product when the product is out of stock
  58. View product details from a different country settings
  59. File a complaint as a buyer
  60. View complaint tracking email content
  61. View complaint status on the buyer portal
  62. View past order history for a user
  63. Modify the user profile after a few purchase transactions
  64. Add products in wish list
  65. Manage different lists as part of user profiles
  66. Comment on a product
  67. Comment on a purchase
  68. Provide feedback on a purchase
  69. Refer a product to another user in the community
  70. Use one time shipping plan for a purchase
  71. subscribe to annual shipping plans and do a purchase
  72. Subscribe to newsletters
  73. Unsubscribe to newsletters

  1. Freeze a user account
  2. Unfreeze a user account
  3. Set transaction limits for users
  4. Generate reports for today’s purchase
  5. Generate reports for purchase for specific products
  6. Generate reports for purchase in specific geographies
  7. Generate reports for shipping status
  8. Generate reports for customer complaints
  9. Generate reports on purchase feedback
  10. Upload stores details who act as suppliers
  11. Upload price details from various stores
  12. Upload products and price details from stores in different formats such as xml, csv, Excel etc.
  13. Upload products and price details from stores with erroneous records
  14. Upload product image contents with static images
  15. Upload product image contents with animated images
  16. Create survey to selected users
  17. Publish a poll to all users
  18. Create product promotion codes and publish to selective users or geography
  19. Manage shipping and handling charges and terms
  20. Manage group purchase settings and products
  21. Extend a promotion offer
  22. Configure prizes for buyers on specific purchase criteria such as 100000th buyer etc.
  23. Configure corporate purchase accounts
  24. Manage out of stock alert settings
  25. Manage different payment gateway settings
  26. Configure SMS alerts to users
  27. View whether purchase details reflect in the CRM thru synchronization

For recorded training programs and online tests, visit us at http://www.openmentor.net

Sunday, December 11, 2011

Five angles to look at everything

Test must be looked at both science and art. There must be some structured way to test and there must be ways that are beyond imaginations.

When we want to test any object, look at it from 5 different aspects.

  1. Configuration. This means the physical presence of a part in its right place. If this itself is not satisfied, how can we expect the parts to work in the right way? Imagine the brake and accelerator (gas pedal) are interchanged in their positions! Imagine the steering wheel is fixed so low that touches your knee! So the first visual checks ensure, things are in right place.
  2. Security. Any system must ensure the safety of its operator or user. Before operating any item or system or machinery, the severity features must be tested, to see if those safety measures work. Before lighting a gas stove check there is no gas smell in the room. Before using the lift, ensure that there is an alarm bell in place. Before connecting a new CD player to power plug, ensure that the adapter is the right one to connect to 110 V or 220 V. See if the keypad lock is fine in a mobile phone.
  3. Functionality. This is nothing but the operational feature of any system or item or machinery. Every operation of the system must be tested. When we press the close door button in a list, it must close the door. When we press the ^ button for channels, the TV must switch to the next listener channel.
  4. Performance. Speed, consumption and capacity fall under performance. This is also one kind of functionality, but a special one. What would be the speed of the lift (elevator) when it goes up with full load? What is the fuel consumption of a car, when driven at 70mph? This is a key measure that ensuresthe system can cater to a large set of users, to handle large set of information and to run for a longer time.
  5. Environment. The behavior of a system may vary, depending on the surroundings. Some features of the system affected by some environmental parameters. The behavior of the tennis prayer changes from grass court to clay court. The performance of a runner changes when he runs on a flat surface and when he runs on a slope (uphill).

If we think from the above 5 angle , any object or system can be judged for its quality. As an exercise, list what you can test in

1) a Vending machine

2) TV and Remote control

3) Instant messenger

List at least 5 points in each category discuss among yourselves.

For free recorded learning content, view http://www.openmentor.net.

Wednesday, November 23, 2011

SDLC - Coding, Testing, Implementation, Maintenance Phases

Coding Phase

The LLD document contains all the details for a programmer to convert it into a working program. Designed in the right way, the job of the developer is to convert the pseudo code into a programming language in the specified platform. The developer will be given specific guidelines that tell how to code. This guideline includes the naming convention of procedures, variables, commenting methods etc. As per the guidelines, the developer codes and at the end of the coding, he/she compiles the program unit.

By compiling and correcting the errors, all syntax error and removed. Syntax errors are the easy ones to rectify. The logical errors in the programs are the difficult ones to identify and then rectify. By logical error, we mean, the program behaves in a way, that it is not expected to behave. The role of testers is to identify the logical errors at various stages.

Testing

*This section provides only a shorter version of the testing techniques.

Testing is the process of evaluating a system or application, to check whether the application meets all requirements of the client and to detect the errors.

Generally testing can be classified into static testing and dynamic testing.

Again Dynamic Testing is classified into two types: Structural Testing (or) white box , Functional Testing (or) Black Box testing.

Static Testing

Verification activities fall into the category of Static Testing. Static testing refers to testing something that’s not running. It is examining and reviewing it. i.e., to check whether the work done meets the standards of the organization. Reviews, Inspections and Walk-throughs are static testing methodologies.

Example: The specification is a document and not an executing program. When we read it to find out the issues, it is considered as static testing.

Dynamic Testing

Dynamic Testing involves working with the software, giving input values and checking if the output is as expected. These are the Validation activities. Unit Tests, Integration Tests, System Tests and Acceptance Tests are few of the Dynamic Testing methodologies.

Techniques used are determined by type of testing that must be conducted.

Functional ("black box") testing.

Structural (usually called "white box") testing.

Black box testing involves looking at the specifications and does not require examining the code of a program. Tests that examine the observable behavior of software as evidenced by its outputs without referencing to internal functions is black box testing. It is not based on any knowledge of internal design or code and tests are based on requirements and functionality. Nowadays there are automatic code generation tools and code re-use becomes more prevalent, analysis of source code itself becomes less important and functional tests become more important.

Black box testing is easy as it is based on system’s response for a given user’s input. If we know the business functionality of the product, we can do black box testing. On the other hand, white box testing requires programming knowledge to know the internals of the code. Also it is time consuming. So only a developer can become a white box tester.

Unit Testing

Soon after the program is corrected for syntax errors, the program has to be checked for logical errors, at the unit level. Programs may have simple user inputs or outputs thru screens or reports. The inputs must be validated for their format, data type, boundary conditions etc. Also, the elementary functionality of the program must be verified. In most of the cases, the programmers themselves will do this unit testing. Many inputs will be verified in this way and the program unit will be checked for the basic functionality in this phase.

If there are any problems while doing this testing, the programmers will debug the program and the bugs will be fixed and will be tested again for the bug fix. While doing the unit testing, that particular unit need not wait for another unit to be completed. It can be tested independently. Unit testing is also termed as component testing. For example, if we need to test a java class and method, even without any screen, the programmer can test the same. Thus any piece of code, that can be independently executed, can be independently tested as well. This is termed as unit testing.

Integration Testing

When all the individual program units are tested in the unit testing phase and all units are clear of any known bugs, the interfaces between those modules will be tested, to establish that they communicate to each other property via the specified APIs and thus they can be integrated into an application. The integration test may be performed by the independent testers or by the development team members.

System Testing

After all the interfaces are tested between multiple modules, the whole set of software is tested to establish that all modules work together correctly as an application or system or package. This is again performed by independent testes. The testers will have to do the system testing as though they are the end users of the application. Systems testing includes special testing methods like performance testing, interoperability testing, stability testing etc.

Acceptance Testing

After the software product is tested by the SDU in 3 different stages (unit, integration and system), the client will test it, in their place, in a near-real-time or simulated environment. This establishes that the software meets the requirements of the end user. This testing is carried out as though they are using the system in their real office, to mimic the real time scenarios.

Implementation Phase/Support

This Phase will provide users with the documentation and training required to use the system effectively. Data Conversion will only occur once, but user documentation will be required. Deployment of the product will be carried out, on the hardware that is going to be used in production (on live systems). Deployment itself requires careful planning. Once the product is deployed, initial data will be populated, user training will happen.

Release to Production and warranty Period

When the clients to the acceptance testing and finds no problems, then they will accept the software and now they have to start using the software in their real office. It may be a real bank for a banking application. During the acceptance testing also, there may be some bug fixed done to the software. Before the software is put into production (real time environment), the SDU must release the latest versions of the software, which has no known bugs to the client. This may be in a CD or tape or an Internet download. The clients will then install the latest software in their production system and will start using. This is called go-live process.

In the same way every product has a guarantee period software also has a warranty period. Normally it will be a 60-day or a 90-day warranty period for most kinds of software. Depending upon the complexity and size of the software the warranty period may be extended or shortened. During this warranty period, in case of any problems, the SDU has the responsibility to rectify the problem, at no charges. Again, it depends upon the contract, whether to charge for the fix or not and may vary from industry to industry.

Maintenance Phase

After the warranty period, the software enters the maintenance phase. During the maintenance phase, 3 things happen to the software. They are :

Bug fixing

Upgrade

Enhancement

During the maintenance phase, because of some untested scenarios, the software may give errors or logical problems. This has to be fixed. This is same as any other bug fixing. This is similar to any repair works done to a vehicle, by its owner.

In the software field, the software versions are constantly changing and the applications may have to keep themselves upgraded to the newer versions of the software. For example, the anti-virus software must be constantly upgraded to address new viruses, which come very day. If the operating system version charges, it may necessitate to introduce some changes in the programs. So, this kind of upgrade works to the existing software applications, because of operating system or environmental changes or hardware changes may have to be incorporated.

Any software is not all complete and there are enough rooms to add new features to an existing software. For example, today the railways reservation system may not be in the internet; but tomorrow there may be a need to go in the internet way. So, new modules are to be added to the existing system to address this. This is enhancement.

After some time, the software may become obsolete and will reach a point that it cannot be used. At that time, it will be replaced by another software which is superior to that. This is the end of the software. The software will reach its end, when the maintenance cost of the software becomes more than the new software available. Software can become obsolete when the company does not upgrade it to work on new environments such as databases or operating systems. When the software becomes incompatible with the environment, users will move on to another software, dumping the existing one.

For recorded training content, please visit http://www.openmentor.net.