I model separate state transitions to
error conditions/messages that should show up.
Sometimes I will model various data
conditions as different states. Other times I will put guards (that check state
variables) on transitions out of a state. As to picking additional states or guards,
I use whatever appears to be easier to maintain in whatever tools I’m
using.
So I might have two different transitions
in my model for your submit button: one for when it should be enabled and one
for when it should be disabled; both with the appropriate end states.
So my short answer is that I model negative
testing just like happy path testing. I model how I understand it should work,
then run tests and refine my model and/or get code fixed.
Ben Simo
From:
model-based-testing@yahoogroups.com
[mailto:model-based-testing@yahoogroups.com] On
Behalf Of Ofer Rivlin
Sent: Friday, December 12, 2008
3:19 AM
To:
model-based-testing@yahoogroups.com
Subject: [model-based-testing]
Negative testing with MBT?
Hi,
I would appreciate some help with how to go about negative testing
with MBT methodology?
For instance:
There is a text-box where a user enters some data and then clicks the
'submit' button. In the specs the submit button should be grayed-out
and not enabled until the entered data is correct. In the model this
is easy to do through the enabling condition (guard) for the 'submit'
action. But now all the generated test-cases don't try to click
'submit' when the data is wrong.
I would like to get such a generated test-case that tries to click
'submit' even if the entered data is wrong and that the test is marked
as failed if the IUT actually enables the 'submit' action.
I would appreciate a general MBT way which does not necessarily
related to a specific tool.
Thanks in advance for any help.
Ofer
The information contained in this message is intended only for the recipient, and may be a confidential attorney-client communication or may otherwise be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, please be aware that any dissemination or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify us by replying to the message and deleting it from your computer. The McGraw-Hill Companies, Inc. reserves the right, subject to applicable local law, to monitor and review the content of any electronic message or information sent to or from McGraw-Hill employee e-mail addresses without informing the sender or recipient of the message.