Wednesday, June 18, 2025

Monetary Value Round Off -- A Legal and Business Problem

 

I read a blog post from Gaurav Khurana suggesting on round off of a number having decimals.  This is the post.  What made me curious is that number and what it meant.  It was a discount money having decimals.  Here, the number of decimals was not restricted to two.

Gaurav, said, it is a better experience if that discount amount is restricted to two decimals and rounded up.  Initially, I see, this is a fair expectation.

Here is the pic of a bill which Gaurav has shared.  I'm using it here on his permission.


I woke all of a sudden at 2:18 AM today, and I relooked into the post and that value whose decimal is not restricted.  I said myself there is something which cannot be rounded up or rounded down here and I could interpret it for a context.


Interpretation of the Value and its Meaning

  1. The "Bank Discount" showed the below amount
    • - 450.90999998999996
  2. The amount is in Indian Rupees
  3. This amount tells, it is the discount offered by the Bank on that transaction
  4. On round up, it will be,
    • - 450.91
  5. If I use the round up value, then the "Balance Paid" amount will be,
    • 4,058.18
  6. If I do not use the round up value, then the "Balance Paid" amount is still,
    • 4,058.18
  7. If I do not use the decimal values in "Bank Discount", then Balance Paid is,
    • 4,059.09
      • That is, I will have to pay 0.91 rupee (91 paisa) more.
    • In this case, someone is at loss.  Who?
      • Business?
      • Customer?
        • In the context of this bill, it is, customer who is paying.
        • Customer will pay 91 paisa, which is, almost one rupee more.
          • Now, imagine, the profit which business makes from all its customers for not having that decimal values in the amount!
        • Is this right?
The meaning and value of Balance Paid is not affected, in both cases, that is,
  • When I use Bank Discount value as is with decimals.
  • Or, When rounded up with two decimals.

My question is,
We should have check on decimals shown and used.  But, should we round up the number when it is of monetary significance and value?


Why I have this question?

  • Refer to the below examples.
    • 450.35
      • On round up, it will be 450.5
    • 450.55
      • On round up, it will be 451
If observed, on round up, the amount discounted is in excess by 0.15 rupee, that is, 15 paisa; and, in the case-2, it is in excess by 0.5 rupee, that is, 50 paisa.

If the bank loses these paisa for each transactions of same customer and other customers, won't the bank is shelling out the money?  Is this good?

Likewise, if I have to pay 0.15 paisa and 0.50 paisa, am I not paying more?  Then, imagine the big amount that business is making by rounding up a monetary number and making its customer pay in excess.


My Thoughts on Monetary Value Round Off

  1. The monetary value should not be rounded up or rounded down.  
    1. But, it can have a decimals and limited to two or to what business sees manageable.
      • As Gaurav said, decimal to two digits makes life easier for all is my understanding.
    2. The customer need to see this monetary value.
  2. The generated bill or transaction should have this detail.
  3. When making a payment, the billing system, can show a round off value.
    1. And, the business should decide upon, should the amount be round up or round down
May be to avoid such arguments and discussions in the billing counter, today, the bill amount will be a whole number and not a number with decimal.

Such round up instances can turn to a legal problems for the business.

I have noticed, the business offering round down on a monetary value, at times.  Also, I have noticed, certain consumer mobile apps showing rounded up number without breaking down the bill details.



Whatever, as a Test Engineer, I and you, have to create a report [ticket] for product's reference; keep the stakeholders informed of such behavior in the system by explaining the impact to business in monetary and legal aspects.





Monday, June 16, 2025

Solution Approach - How to Automate to Use the Magic Link for Login?

 

The question asked in The Test Chat community on 14th June 2025 22:42,

Hi All,
Has anyone implemented test automation for an application that uses a magic link for login?
If yes, could you please share the approach you followed?
Thanks in advance🙏🙏


My Analysis and Understanding

  1. The question asked is around automation.
  2. That is, how to automate to use the link (hypertext) generated for login.
  3. There are several ways to approach this, via
    1. GUI
    2. API
    3. Combination of GUI and API
  4. I prefer to use it in combination of GUI and API for first without using any email client services and app.
    • Why?
      • I want to keep it simple, quick and not to complicate the testing problems much more.


Solution and Approach

I see, it is not a complicated Test Engineering problem unless the project and floor do not support.


I understand, it is about using a link (hypertext) to login into a application via automation.

How do you get this hypertext?
  • It should be generated somewhere within the system's boundary.
  • Can you get that generated hypertext without using any mail client and its service points? How?
    • Do you have an endpoint that generates this hypertext?
    • If so, then this endpoint should also have some means to share the generated hypertext for login request?
    • Pick this generated hypertext via an API request in your automation.
  • This should work!  Unless the test goal in the automation is not to open some configured mail client and read the received mail.
    • But, how many times will you do this in automation, if the goal is to open configured mail client?
    • Is this a good use of automation?
If there is an endpoint to GET that generated hypertext (POST), it is a fair simple task.  

Say, there is no endpoint with GET request to give the generated hypertext. Then, look at the response payload of POST request that generates the login hypertext.   Consume this hypertext now and use it in GUI automation to login.  Say, there is no response payload in POST request.  Ask your team to build a GET request to consume internally and maintain it securely so that no external access is allowed.

Let us keep the testing problems simple!