Wednesday, July 29, 2015

Basics of Software Testing - Part-VII : Software Testing with example

A little background about this - Each person may have their own way of testing or finding issues. They may not necessarily find my method helpful to understand the basics, this is something i'm trying to generalize for the newcomers in software/ firmware testing.  My intention is to make a series out of it, if i can and get enough motivation to write the basic stuffs.


So far we know what is a software, environment, SDLC, STLC, different types of software testing. Now, we will see how to test a software with example.

Lets start a test for the Student loan program or sometimes call calculator. What is does is, it gives the amount of how much you need to pay per month as well as how much it will cost you through out the year. You can also see how making extra payments will affect your pay off date. You can google search it and practice it on any of them.


So we will be doing a functional testing on a project. I usually starts from the Home screen. In our example, above is the home screen.
Testing steps:

  1. This is one of the quickest way to find issues is to perform a data validation using the following criteria for the sample project. For positive data it should accept the amount, for negative / invalid data it should handle it and display proper error message.  

  1. Make sure the required field are either marked or on submit application displays error messages on required fields .
StudentLoan_validation02.png

  1. Make sure the entered Loan amount is okay using the validation criterias.

  1. Confirm that if for example the loan amount can not take a negative value, it should display error message stating that and should not blow up. User need to know the min and max value. It could be mentioned with the error message or it could be mentioned as a label.
StudentLoan_validation01.png

  1. For loan term, it can be either year or month. If we enter a year, it will display the corresponding month and if we enter a year it will display the corresponding month. Make sure that it behaves this way.  

  1. Confirm that if for example the loan term month can not take decimal value then it should display error message.
StudentLoan_validation1.png
  1. As label indicates, Interest rate value would be a percent number. That means it will be later divided by 100. Make sure it passes the data validation  criteria.

  1. For the Loan start date, depending on how it designed according to the Specs, i would assume it should be forward date. I can’t be sure whether it was designed this way or not, it looks like it allows previous dates/ years.

  1. Finally, when all data inputs are okay and values are valid, then clicking on Calculate button will display the value on Monthly Payment.

StudentLoan_validation04.png
  1. Verify the Calculate button displays the correct value for per month. Verify it using the following formula in excel or manually. We need to make sure the calculation is right. For excel you can write the formula on B6 field as “=PMT(B4/B5, B3*B5, -B2)” to get the monthly payment.  

StudentLoan_validation03.png

  1. Make sure that, even the Monthly Payment field is a text fields which looks similar to input field it should not allow entering any value on this field. This will be a GUI testing. Check with Specs. 
  2. Also notice that the amount field text box is not aligned with all other text box for a prefix of “$”. I would double check with the UI specs for this as well.
  3. Check for any default values. On this particular case, it was displaying an example format on each text box. As soon as user starts typing on those fields, they were disappeared which was expected. Confirm that the application calculates based on the amount you entered, not the default amounts.
  4. Check the spelling of all the labels.

Data Validation Criteria
Field Name
Criteria
Common/ All
  1. Null / empty / blank space  as  input and thus check for the Required fields.
  2. Check for the Min field length.
  3. Check for the Max field length.
  4. Check the data type and determine the possible invalid inputs.
  5. Enter single quote ( ‘  ) to check whether database can handle it.
  6. Enter valid input combinations
Loan Amount
  1. Negative amount - It should display error message.
  2. Amount with decimal point up to max input.
  3. Amount with single point decimal point.
  4. Long number up to max input allowed.
  5. Enter String instead of numeric value.
  6. Enter different characters instead of numeric value.
  7. Enter commas with a numeric entry.
  8. Try with valid ranges, should accept the data without any complain.
Loan Term
  1. From above snapshot, it looks like it can take real numbers as number of years and numeric for months. Number of years should also allow to accept whole numeric numbers.
  2. For loan term in year, enter min and max allowed real number.
  3. For loan term in month, enter min and max allowed numeric number.
  4. For loan term in month, enter a number with decimal point. It should display error message as decimal number in month is not allowed.
  5. Try the negative numbers in both year and month. Should not be allowed.
  6. Try with valid ranges, should accept the data without any complain.
Interest Rate
  1. Enter values ranging from min (0) to  max(99).
  2. Enter values below and above the min and max correspondently.
  3. Enter whole number .
  4. Enter number with decimal points.
Loan Start Date
  1. Allows to select Year, Month, Day from the dropdown list.
  2. Should not allow to write anything on these fields.

Now where do you get these things? If you are lucky enough to work with a structure company, chances are you will get this document right away. Else, you will have to prepare it by yourself. Most of the times, it is basically a one time document, you just add them according to project and new fields.


So far we have done the functionality testing. Now we need to test few other things for this web application:

  1. Make sure this web application is accessible using other browsers.
  2. Make sure the loan term month and years auto calculation script works.
  3. Make sure web browser session & cookies does not expire while you  are working on it. Testing cookies (sessions) are deleted either when cache is cleared or when they reach their expiry.
  4. Make sure every time you visit this page, should always come as blank form.
  5. Make sure multiple load is handled correctly.
  6. Make sure concurrent entry does not create any issue.
  7. Make sure the refresh or F5 works properly. It should update the page correctly. Any changes made on the page and submit button was not pressed, refreshing the screen should discard that entry and refresh the page with original entry.
  8. Make sure browser back button and forward button works properly. When the back button is pressed and then the forward button is pressed, make sure it comes with blank page/ session. It should not just keep the previous entries.
  9. Make sure web application does not allow to take input using the URL submission. For example, whatever the name of the website and application, try appending the word “?amount=234560” without the quotes. If it accepts the value and changes the value of the amount field then this could possibly be vulnerable to the BOSS people (hackers).

             

http://www.someweb.com/calculators/college-planning/loan-calculator.aspx?amount=234560


  1. Make sure it can distinguish between an entry from human vs entry from automated bot. Using the Captcha it protects entry from bots. Otherwise, at any point, any bot can keep entering the values and thus creating load on the site. Other people may not be able to access it at certain point.
  2. Check all other links on the web page. It should not display any dead link on the page.

Other observation
If you search for Student loan calculator you will find links. Click on them and you will get a webpage that will display the student loan amortization details. Many of them used to be open like the one i have chosen. Then after getting bombarding by the testing tutorial classes, they put it under user registration. This site should also have done it, otherwise, they are vulnerable to many points like steps 7, 8 if not many more. Also they were not using the Https as well!

If we summaries it then you will see, through out these steps we have performed, 
  • Functional Testing,
  • Usability Testing,
  • GUI Testing,
  • Compatibility Testing,
  • Load Testing, 
  • Performance Testing, 
  • Security Testing and 
  • some other common web application properties testing.
Few things we did not do here as they were not applicable. For example, Database testing - as no database was involved, Web service connectivity - single page calculates value. This is how you need to correlate the theory of testing and implement and perform it as needed on software.

This is how i would try to test this project. This was a very narrow function example. I would say, a software is consist of such small functions and once we identify the features, we will be able to perform testing on each individual pieces. 

Next, may be i'll try few more examples to give more idea. I'll also try to include at least one example for firmware testing in future. . And I would urge people to excuse my mistakes during writing up this series. I test other works, does not necessiarily means that I can’t make mistakes

Everybody has their own way of doing it and I respect all of them as long as it covers everything.

No comments:

Communication - it's very important in recruiting people

One of the common part of our professional life is we get mails from recruiters time to time regardless whether you are looking for job o...