pict icon indicating copy to clipboard operation
pict copied to clipboard

Feature suggestion: Add arithmetic operations to constraints

Open j-hoeppner opened this issue 3 years ago • 0 comments

As a user I would like to use arithmetic operations on parameters in a constraint to further increase the possibility to create test cases alongside more complex business logic.

e.G. in case of the insurance domain: IF [AmountFireDamages] + [AmountPipeWaterDamages] > 5 THEN [Coverage] = "Basic Coverage" ELSE "Extended Coverage";

I tried to fit it into the constraints grammar by adding it in the term and introducing the new ArithmeticOperation (only valid for Numerical Parameters):

Term          :: =
  ParameterName Relation Value
| ParameterName LIKE PatternString
| ParameterName IN { ValueSet }
| ParameterName Relation ParameterName
| ParameterName ArithmeticOperation ParameterName

ArithmeticOperation :: = 
  + 
| - 
| *
| /

As I'm not deep enough into C++ coding, I unfortunately couldn't add a pull request for now, in case this is needed, I would actually try to come up with something, but this could take some time. In case needed I would be happy to get a hint where I would need to change some things. From a first screening I would have guessed somewhere in generator.h and exclusion.cpp?

j-hoeppner avatar May 31 '21 09:05 j-hoeppner