Testing all but given actions RRS feed

  • Question

  • Hi,

    My interface has actions, say Start(), B(), C(), D(), End().

    I want to generate tests that start with Start() and ends with End(). In between Start and End, I want B() or D() but not C(). How do I specify this in my cord without declaring "except" in the config. Of course, I do not want to explicitly enumerate all actions in my cord.

    Any thoughts?



    Thursday, August 16, 2012 3:30 PM

All replies

  • Hi Dharma,

    you could try this

    ( (_)* |?| !call C()*) || Model)

    Hope it helps.

    Friday, August 17, 2012 1:00 PM
  • Hi Bububa,


    How do we make sure "start" is the first action and "end" is the last action. Moreover, start and end do not appear more than once.

    Should I have to put !call start and !call end in your expression, and put "start" in the beginning and "end" in the end?

    Friday, August 17, 2012 6:13 PM
  • Hi Dharma,

    Exactly, that's how you can do it.
    The definition can be composed from it's components, in case the model is getting more complex
    (model is a composition of sub-models). E.g.:

    machine AllSubModel() : All 
        (_*) |?| (!call C*)	
    machine AllInitEnd() : All 
        (_*) |?| (!call End* |?| !call Start*)
    machine AllModel() : All
        (_*) |?| AllInitEnd() |?| AllSubModel()
    machine Program() : All
        (Start;AllModel;End) || Model

    So no effort to handle big models.
    Monday, August 20, 2012 3:31 PM