Hi,
I have not found any example where fMBT actions are specified with
parameters.
(Only as hardcoded in the action name)
E.g in a phone app an action: "establish_call" could take parameters
call_rate and call_prot Where call_rate can be any value between 64
kbps and e.g 1.000 kbps call_prot can be e.g 'sip' or 'h323'
Is there a way to specify parameters (and their valuespace) for an
action?
fMBT does not support action parameters. At the moment best practices
for parameterizing actions would be the following alternatives:
1. List all value combinations that you wish to cover. Example:
input "call 64 sip"
"call 64 i323"
"call 1000 sip"
"call 1000 i323" {
adapter { mylib.make_call(*input_name.split()[1:]) }
}
With this alternative you can easily make sure that generated
test covers all interesting variable combinations. But it may
be infeasible due to too large number of combinations.
2. Use separate setters for variables. Example:
input "set proto=sip"
"set proto=i323" {
body { proto = input_name.split("=")[1] }
}
input "set rate=64"
"set rate=1000" {
body { rate = input_name.split("=")[1] }
}
input "call" {
adapter { mylib.make_call(proto, rate) }
}
This allows test generator pick up certain value combinations
to be covered. With smarter guards you can make sure that
setters are always called before "call" and they are always
executed in the same order. This avoids testing the same
value combinations many times.
3. Completely hide variable values from the test generator.
input "call" {
adapter { mylib.make_call(mydata.proto(), mydata.rate()) }
}
This allows using your own data generator for variables. Of course
you can still pass hints like "invalid data", "lower bounds",
"upper bounds", etc. from the action name to the data generator.
I hope at least one of the alternatives suits your needs.
Yours,
Antti