I think it would be simple enough just to
make the Submit button enabled for a least one condition where it shouldn’t
be, that will allow the illegal stimulus.
Then in the test action you simply check
to see if the illegal condition was present or not present when Submit
clicked. If illegal then failed.
Good Luck!
Pete Lakey
From:
model-based-testing@yahoogroups.com
[mailto:model-based-testing@yahoogroups.com] On
Behalf Of Ofer Rivlin
Sent: Friday, December 12, 2008
4: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