Skip to content

Feature suggestion: Add arithmetic operations to constraints #58

@j-hoeppner

Description

@j-hoeppner

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions