Compartilhar via


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

Comments

  • Anonymous
    December 31, 2007
    Hey John, If you are really interested in holes in Napkin Math, check out some of my old communications with the team about it and then ping me directly. I found lots of holes in the beta time frame..,, (Just what you wanted to hear :) ) Kathy

  • Anonymous
    December 31, 2007
    money times money = more money :) since it is napkin maths, I would expect Onenote to understand that what i want is not $ squared but simple $ . Mathematical rigor should be left for Matlab. I am sure most users of Onenote wouldn't bother to do rigorous maths in it ... Anirudh

  • Anonymous
    January 01, 2008
    I would think about $1.502.00€ as well ;) No.. honestly it's not $ squared in this scenario but it is in 3cm3cm = 9cm^2 So OneNote has to detect such inputs. But just as a question: Isn't it possible to use the math systems of Excel for this? You wouldn't have much problems then I think.. ;) Greetings, Andreas

  • Anonymous
    January 01, 2008
    apologies for off topic question: When sending Outlook 2007 emails to OneNote - a link back to the original email is not created - as it is when sending Outlook Contacts. Am I missing something obvious, or is no link created? Is there a power toy that does this? Thanks, Ian

  • Anonymous
    January 02, 2008
    No problem for "off topic."  No, ON does not create a link to the mail item.  Mail items typically aren't kept around like contacts or calendar items - they get deleted much more often. No addin I know does this.  It should not be too hard to create, though.  Testing what would happen if you linked to an item in the inbox and then deleted it before opening the link from OneNote would be interesting... John

  • Anonymous
    January 02, 2008
    Thanks John. I don't build these addins myself - but if you know people who do, I'd be very grateful for someone taking up the challenge :-).

  • Anonymous
    February 14, 2008
    The comment has been removed

  • Anonymous
    February 14, 2008
    Well, the general concensus in computer science worlds is to weigh / and * equally, and parse from left to right.  In this case, the "proper" result is equivalent to (1/2) * 4 = 0.5*4 = 2. Of course, pure mathematicians are free to define whatever rules they want.  If they want * to always trump /, then 0.125 would be correct. There is no formal, defined standard which applies 100% of the time.  OneNote should obey the general concensus of * and / being equal in precedence since we are designed to be a lightweight, non-rigorous app. John