Sunday, July 12, 2020

Mathematics in Software Testing!!!!

Role of Mathematics in Software Testing.....🔢🎲🧮!!!!!


                As we all know that Mathematics plays very important role in our day to day life. Even in Software Testing also Mathematics plays a key role actually. To understand the role of Mathematics in Software Testing, it is very important to understand “What is Software Testing?”.

In Broader terms,

Software Testing = Verification + Validation

Verification = Ensure system meets the specification and has been built as per that specification.

Validation = Ensure system meets the overall purpose of the end user.

Mostly Software Testers end up in testing Web, APIs, front end and backend applications and combinations also….

Software Testing does not relate directly to Mathematics, but we use Mathematics in Software Testing. It does not required to know Mathematics at pro level but indirectly we use Basic Mathematics.

We use Basic Mathematics concepts like Arithmetic operations, Simple Interest, Compound Interest, Percentage, Excel Operations, Probability, Algebra etc.

Let us take an example of simple E-commerce application,

When user orders an item and clicks on “Buy Now” button, assume user has some amount in Wallet & user wants to use that Wallet amount to purchase.

Let us assume total cost of the item is X, user has Y amount in his wallet and rest of the amount user wants to pay using net banking.

To test this , we need to prepare test data, to prepare we need Mathematics skills.

X-Y=Z
where X is total cost of the item, Y is Wallet amount and Z is the amount that needs to be deducted through Net Banking. To test this scenario, we need to prepare test Data using Mathematical skills like Addition, Subtraction.

To this even developer need Mathematical skills, it means Software Engineering needs Mathematical skills not only Software Testers.

Let us take another example of Bank Application,

Assume X person has taken a loan of amount Y with interest having 10.5 % per annum for a tenure of 4 years. He will repay the amount in monthly EMIs and he will track it in Bank application.
 Here to test this scenario, we need to prepare test data to verify and validate. For that we need Mathematical skills like Simple Interest, Compound Interest, percentage.

Even though Mathematics is not required but basics of Mathematics is a must for Software Testing I can say. Mathematics is a one of many fields actually. Software Testers need mathematical & logical thinking skills. Software Testing requires very basic mathematical skills & logical skills, particularly proof based mathematics.

Most of the Software Engineering concepts do not directly use mathematics, they certainly use it.

Here are some of the mathematical skills which is very basic & used by the Software Testers:
  • Checking totals and arithmetic operations--- For calculating tax etc.
  • Percentage calculations---when testing promotional sales and discount operations.
  • Calculating averages and Standard deviations---for salary and few operations like rating related operations.
  • Calculating conversions ---hours/minutes/seconds to decimal time
  • Currency conversions--- Rupee to Dollar...etc.
  • Calculating Simple Interest, Compound Interest for Bank related operations.
  • Algebra ---for Cyclomatic complexity and Robustness testing. 
Below are few of the Basic Mathematical formulae used by testers:

1. Average formula:
    Let a1,a2,a3,...........so on till n be a set of numbers, average=(a1+ a2+ a3+......n)/n
    Percentage to fraction: x%=x/100
    Percentage formula: Rate/100=Percentage/base
    Rate: The percent
    Base: The amount you are taking the percentage of.
    Percentage: The answer obtained by multiplying the base by the rate.

2. Percentage: 
    Discount rate=discount%MRP Price
    Sales Tax=Price of item*Tax rate
    Interest=Principal*rate of interest*time

3. Consumer Mathematical formulas:
    These are used in Ecommerce applications mostly
    Discount =MRP Price* discount rate
    Price after Discount=MRP Price-Discount

4. Cyclomatic Complexity=L-N+2*P
     where L=No of Edges in flow graph
     where N=No of nodes in flow graph
     where P=No of Nodes that have exit point

5.   Conversion of time:
    1.  Converting hours to minutes: Minutes=Hours*60
    2. Converting minutes to hours: Hours=Minutes/60

6.  Simple Interest:
Simple Interest= P*T*R/100 
Amount = P(1+R/100)T
Where P=Principal
             T=Time (in years)
             R=Rate of Interest

This is the very brief article but it should be enough to give an basic idea of where mathematical skills are used in the Overall Software Testing.

      As Paul Halmos said “The only way to learn maths is to do maths”, in the same way we can say that “The only way to learn Software Testing is by testing the Software”.

I hope you liked my article …!!!
Happy Software Testing…!!!!

Thanks for reading my article.




4 comments:

  1. I’ve been surfing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before. Denver to Vail Car Service

    ReplyDelete
  2. Square kilometers, on the other hand, is used for measuring areas. It is the arithmetical result that you get by multiplying an area's length and width. This particular formula however is used in decimal system. If you want to convert metric kilometers to decimal measurements, meters to feet

    ReplyDelete