Money times money = ?

 

Over on the OneNote Discussion Group, there is a comment about Napkin Math and its order of operations.  In short, some users are noticing that simple formulas like:

1/2*4= shows as "0.125" in OneNote and not "2". 

 

Fair enough - it's a bug in OneNote, we are tracking it and hope to have it fixed.

 

But then I started testing napkin math more in depth.  Keeping in mind this is a lightweight feature meant to "not get in the way" when typing on a page and doesn't have the precision of Matlab or Excel, I figured I could probably find a few more logic errors scattered about.  After a little bit of testing, I started testing currency operations and found another bug.

 

Try this:

$5*3=$15.00    Great, this makes sense.  If I have three $5 bills, I have fifteen dollars.

 

Now try:

$4*$10=$40.00 But here's a bug.  I can't have "four dollars" of ten dollar bills - this has no meaning.  Carrying out the arithmetic would give me "dollars squared," which has no meaning.  So what to do?  (Quick note: Excel accepts this formula and removes all currency symbols from the output if you have an unformatted cell for the answer, and leaves the symbol intact if formatted for currency.)

 

As a tester on the OneNote team, I have some tasks I need to complete.  First, I will enter a bug in our database.  In OneNote, I need to assign it to an owner who starts the process of resolving the bug.  Typically, this is the developer of the feature, but in this case, I will assign it to the program manager.  Next, I have to research how this bug wound up in the product and look for holes in the test coverage.  Then, I need to plug those holes.  Last, I need to provide input from the testing realm about the costs of fixing this bug.

 

So I assigned the bug to a program manager rather than a developer.  In my mind, the fact that "dollars squared" has no meaning needs to be balanced against the needs of a user who is just trying to use this feature in OneNote to get a quick answer and move on.  The most likely scenario is that I'm trying to figure out how much some object will cost per pound ($2.25, for instance) and I want to buy some fractional part of a pound (2.5 pounds).  When I enter the equation, I can't remember if it is $2.25 per pound, or $2.50 per pound.  I type in a hurry, introduce a typo, and …. what should happen?

 

The "what should happen" question which needs to be answered is why I assigned the bug to a program manager.  PM gets to weight the necessity of mathematical rigor vs. the intent of the feature (to quickly give me an answer without bogging me down in mathematical rigor).

 

After the bug is entered, I'll look through the automation to see if this type of equation is being tested.  I'll guess not, since the behavior exists :)  And if not, I will add a test for this equation, and examine currency tests in general.  Once we decide to either leave the behavior intact or change it, I can make my verification of the output and check in my automated test. 

 

And the testing cost of fixing this bug will be small.  It's easy to automate and would get run with every automation pass we have.  Barring any conflicting information (a tiny voice in my head is saying "Be sure to expand this for international currency symbols like the pound, Yen and Euro") which may complicate the choice, I can't see a large test cost for making a change. 

 

I still have to give an opinion on fixing this bug report, though.  If I factor out the work of researching the behavior, updating the automation system and potentially dealing with localized currency symbols, it still boils down to mathematical rigor vs. ease and flexibility of getting information onto a page.  Maybe I just gave my opinion away, but if you were a tester in OneNote, what would you decide to do?

 

 

Questions, comments, concerns and criticisms always welcome,

John