Posted by Ben Simo
I plan to model the calculator a piece at a time in a series of blog posts. I welcome your input.
At the highest level, I can partition the Calculator's behavior into two states: running or not running. Next, the calculator has two major modes of operation: standard and scientific. After a little experimentation, I see that if I stop the calculator it will return to the previous mode when it is restarted. These transactions can be modeled as follows:
calc.standard -> calc.scientific
calc.scientific -> calc.standard
calc.standard -> stopped.standard
calc.scientific -> stopped.scientific
stopped.standard -> calc.standard
stopped.scientific -> calc.scientific
start -> detectMode
detectMode (if standard) -> calc.standard
detectMode (if scientific) -> calc.scientific
restart -> detectMode
stop -> stopped
The action table may be viewed here. The MBTE generated the following image for the model. (Click the image for a larger version.)
While I was running a test on this model, my daughter noticed a potential bug in the calculator that I had not noticed before. This model does not yet contain any calculations. Any idea what the bug may be?