Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2013-01-04T05:38:38Z by RichaM
Love_k1
Love_k1
11 Posts
ACCEPTED ANSWER

Pinned topic Code Coverage Problem

‏2012-12-27T10:14:28Z |
Hi Everyone,

I am using Rhapsody 7.6.1.2 . I created a class having a statechart in it with two states.
Then i created test architecture on this class.
I am not able to get code coverage for the statechart, and when i am debugging the project the control goes to the states. For reference i am attaching my sample project here.
I want to get coverage for lines of code written in the statechart.

Could anyone tell me how can i solve this problem. ?

Thanks in Advance
Love Kumar
Updated on 2013-01-04T05:38:38Z at 2013-01-04T05:38:38Z by RichaM
  • RichaM
    RichaM
    70 Posts
    ACCEPTED ANSWER

    Re: Code Coverage Problem

    ‏2012-12-28T06:18:28Z  in response to Love_k1
    I want to add to this query .Even I am facing the same issue.

    Enviroment - MSVC9
    Assertion based testing in testconductor.

    Whenever i fire an event from my test application which is being processed by Statechart of SUT,it is getting processed and our test case also passes

    But in code coverage, processEvent is not getting covered.
  • pathfinder_hartmut
    pathfinder_hartmut
    49 Posts
    ACCEPTED ANSWER

    Re: Code Coverage Problem

    ‏2013-01-02T06:52:46Z  in response to Love_k1
    Hi,

    can you please try removing the cg-directory and update/build/execute the TestCases again?

    Regards, Hartmut
    • pathfinder_hartmut
      pathfinder_hartmut
      49 Posts
      ACCEPTED ANSWER

      Re: Code Coverage Problem

      ‏2013-01-03T12:57:24Z  in response to pathfinder_hartmut
      Hi again,

      @love_k1 I can't find any statechart in your attached model. Possibly, you attached the wrong model?

      @RichaM it is sometimes necessary to introduce additional time intervals at TestComponentInstances' life line in order to ensure, that the application isn't terminated before relevant parts of the behavior could be observed. E.g. if you only trigger the SUT with, say, evA() and evB(), then TestConductor will terminate the application after these events have been sent, regardless of SUT processing them. If you want the SUT to process these events (and, hence, rootState_processEvent() to be covered, then it will delay termination if you add a time interval with for example '>1sec' to the driving instance in the sequence diagram after sending the second event.

      Regards, Hartmut
      • RichaM
        RichaM
        70 Posts
        ACCEPTED ANSWER

        Re: Code Coverage Problem

        ‏2013-01-04T05:38:38Z  in response to pathfinder_hartmut
        Thanks Hartmut

        Adding timer to TestComponentInstance lifeline helps. We are able to do code coverage for statechart as well.