IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Flow service code coverage

webMethods Community Member

webMethods Community MemberThu June 20, 2013 02:37 PM

webMethods Community Member

webMethods Community MemberWed July 17, 2013 11:44 AM

webMethods Community Member

webMethods Community MemberWed July 17, 2013 02:22 PM

webMethods Community Member

webMethods Community MemberWed July 17, 2013 03:22 PM

webMethods Community Member

webMethods Community MemberMon July 22, 2013 12:11 PM

  • 1.  Flow service code coverage

    Posted Wed June 19, 2013 04:23 AM

    Is there a way to extract code coverage statistics for a flow service? lets say we test a flow service with a set of inputs and i want to see a report that shows the % of code coverage based on the test data. This is basically to identify dead code in the service.

    Is it possible to use some kind of “profiler” for this ? Any inputs would be appreciated.


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Flow service code coverage

    Posted Wed June 19, 2013 11:17 AM

    No there is no way out of box:

    Are you talking about flow code in a HTML page view?


    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Flow service code coverage

    Posted Wed June 19, 2013 04:29 PM

    There is a flag DISABLED=“true” in the flow.xml when a step is disabled in a service that you are trying to find dead code. You will have to build your custom code profiler (to parse XML) that would look up the flow.xml and get the parent XML node or current node when that property is set to true. I believe you could also remove the dead code for a service if you have the first part of the code profiler working (identifying dead code).

    May be you can log a feature request from SAG that they might consider including in future release.

    Ex:

    
    <INVOKE TIMEOUT="" SERVICE="test.pub:deletefiles" VALIDATE-IN="$none" VALIDATE-OUT="$none" DISABLED="true">
    <COMMENT></COMMENT>

    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Flow service code coverage

    Posted Wed June 19, 2013 05:21 PM

    Akshit,

    Thanks for chimming in and further clarification details on this:

    So is this a standard way of editing the flow.xml rather than a extended setting globally? Is this setting usage documented well in the Developers or IS guides any pointers?

    TIA,
    RMG


    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: Flow service code coverage

    Posted Wed June 19, 2013 06:23 PM

    No this is not documented anywhere or at least i could not find anything, i came across this setting a while ago during my research on something similar (BPM models) to what Balachandar needs here. The only reference that i see about this setting is one line sentence in the developers guide “Be aware that disabling a step sets a persistent attribute that is saved in the flow service”. This DISABLED=“true” is not a manual setting, this gets auto generated when you disable a step in the flow.

    In the past i have seen some customers who have used custom Flow code generators which would generate a flow.xml (also node.ndf) file with standard try\catch blocks with the client specific Framework services like logging, error handling service etc. In general these code generators would create the skeleton code on click of a DSP page with the client standards where by the Developer can develop the core logic and use this skeleton to implement it.

    I do not know of any extended setting that is related to the enable\disable code functionality.


    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: Flow service code coverage

    Posted Thu June 20, 2013 12:38 AM

    Thanks for the response :!:

    The dead code for me is not a disabled step. Its basically a step in the flow which could be a branch/loop which did not get called or executed at all because the test data that i used for my unit testing did not have the required data to go thru those branch or loop steps. This is one of the major challenge we face today in unit testing a big service with lots of logic in it. No matter how hard we try to test all possible scenarios there are always misses. That’s the reason why i wanted to see if there are any ways to get a report every time i test/trace a service that shows the code coverage % based on the test data inputs i used. I was wishing for something like this 4 years back and I still see the value in this especially if SAG themselves provide something out of box. If I am not wrong i believe we have something like this in the Java world.

    One of the short term solution/suggestion that came up internally was to take the screen shots of the trace results with a grey box on every step. But again here there are 2 issues, I will not always be able to have one test data covering all scenarios so i will have to run multiple times and take multiple screen shots. Also the grey boxes are again not that clearly visible.

    Any other ideas on how we can achieve this would be appreciated.


    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: Flow service code coverage

    Posted Thu June 20, 2013 07:28 AM

    Hi Bala,
    I don’t think this might cover all test scenario’s even if you pass through all pieces of code. A branch on a variable would have worked fine with a right value, and the same can lead to an exception with a ‘null’ value and the result of this null might be based on the previous statement. I see the probabilities are more if you want to test each and every scenario.

    Eg., a 3 step service can lead to 9 scenarios. 0-0-0, 0-0-1,… to 1-1-1. Testing just last scenario 1-1-1 cannot give an assurance that all the other 8 scenario’s would work.

    In general, breaking the larger piece of code to smaller units of flow services would help a lot for re-usability, debugging, fixing, testing etc.,

    My 2 cents.

    -Senthil


    #Integration-Server-and-ESB
    #webMethods


  • 8.  RE: Flow service code coverage

    Posted Thu June 20, 2013 08:23 AM

    Hi, I am not saying that I will treat the visual representation of the code coverage % of a flow service as a means for signing off the quality :slight_smile: The quality check via unit testing is a must and every developer should do it with due diligence. There is no second thoughts on this. Breaking the logic in to small services will definitely help in improving the quality by making it easier for the developers to consider all scenarios.

    However a visual representation showing the extent of the code coverage will provide some hint to the developer so that he can work more on getting/preparing the required test data. Also at a high level a team lead or a manager can have a look at this coverage % report.


    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: Flow service code coverage

    Posted Thu June 20, 2013 10:27 AM

    I think i misunderstood the term dead code, i thought dead code is something that is never used or executed during run-time.

    I am not sure there is a way to do it in WM tool set, a basic Google search for what you are asking resulted in this URL, it might help. I never used it but looks like it is the only dedicated WM Service profiler provided by a third party vendor. From the screen shots it looks similar to profiler in J2EE Eclipse.

    I believe there used to be a company called Green hat that provided something similar but i can not find it anymore.


    #webMethods
    #Integration-Server-and-ESB


  • 10.  RE: Flow service code coverage

    Posted Thu June 20, 2013 11:01 AM

    May be there is no ways for visual representation and could be a feature request for SAG? :smiley:

    Well this is a good topic to start with not seen this type of req recently…continue:


    #webMethods
    #Integration-Server-and-ESB


  • 11.  RE: Flow service code coverage

    Posted Thu June 20, 2013 12:06 PM

    I have added this request in Brainstorm and ID is 1057849. Pls vote for this whenever you have time. Lets see :slight_smile:


    #webMethods
    #Integration-Server-and-ESB


  • 12.  RE: Flow service code coverage

    Posted Thu June 20, 2013 02:37 PM


  • 13.  RE: Flow service code coverage

    Posted Wed July 17, 2013 09:13 AM

    You need to build a custom untility… some have it


    #Integration-Server-and-ESB
    #webMethods


  • 14.  RE: Flow service code coverage

    Posted Wed July 17, 2013 11:44 AM


  • 15.  RE: Flow service code coverage

    Posted Wed July 17, 2013 02:22 PM

    I bet, I heard some developed


    #webMethods
    #Integration-Server-and-ESB


  • 16.  RE: Flow service code coverage

    Posted Wed July 17, 2013 03:22 PM


  • 17.  RE: Flow service code coverage

    Posted Fri July 19, 2013 07:27 AM

    Here’s what I’d like, as an offshoot of the same idea: if I have code folders like pub, priv, docs, adapters, etc, I’d love to be able to run a scanner that showed what packages were using services in adapters, priv etc in other packages, ie services they shouldn’t be using.

    Not as good as making Flow better, but it’d be a start!


    #Integration-Server-and-ESB
    #webMethods


  • 18.  RE: Flow service code coverage

    Posted Mon July 22, 2013 12:11 PM

    Yes you are right to start with.


    #Integration-Server-and-ESB
    #webMethods


  • 19.  RE: Flow service code coverage

    Posted Tue November 12, 2013 06:11 AM

    Hi,

    We have created this tool for our service monitoring:
    [url]http://techcommunity.softwareag.com/web/guest/pwiki/-/wiki/Main/RichStatistics+-+how+to+easly+monitor+the+service+activity+on+your+Integration+Server[/url].

    It is not exactly a code coverage took, but you can see the full stack of a service execution.

    br,
    Vlad


    #Integration-Server-and-ESB
    #webMethods


  • 20.  RE: Flow service code coverage

    Posted Tue November 12, 2013 10:36 AM

    Hi Vlad, Eventhough this is not related to code coverage this looks very interesting. Let me check this out :slight_smile:

    I am sure each one of us are implementing lots of functionalities like this which ideally should be offered out of box. SAG should also focus on such items in addition to launching new versions e.g. 9.5 :lol:

    Thanks for sharing :!:


    #Integration-Server-and-ESB
    #webMethods


  • 21.  RE: Flow service code coverage

    Posted Fri September 13, 2019 06:37 AM

    I know it’s too late, but hope it might help someone.

    Check, Code Coverage Analysis section in below document.

    [url]http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite10-2/Cross_Product/10-2_Unit_Test_Framework.pdf[/url]

    Thanks!
    Sathish K


    #webMethods
    #Integration-Server-and-ESB


  • 22.  RE: Flow service code coverage

    Posted Fri September 13, 2019 02:22 PM

    Hi,

    Are you asking about “Code Coverage” feature that came with v10.3 onwards?

    HTH,
    RMG


    #Integration-Server-and-ESB
    #webMethods


  • 23.  RE: Flow service code coverage

    Posted Sun September 15, 2019 10:29 AM

    It’s interesting to know that wM now provides a code coverage tool. We had to build our own one, it produced the data in the cobertura format so that the coverage statistics could be easily displayed in a Jenkins job – along with the results of the unit tests (also produced with our own unit testing framework).


    #webMethods
    #Integration-Server-and-ESB


  • 24.  RE: Flow service code coverage

    Posted Mon September 16, 2019 06:55 PM

    Yup… Now these are all provided OOTB :slight_smile:

    SAG Innovations for dealing future!

    Cheers!
    RMG


    #webMethods
    #Integration-Server-and-ESB


  • 25.  RE: Flow service code coverage

    Posted Tue September 17, 2019 10:14 AM

    Yes, just ten years passed. Now for the next feature! :slight_smile:


    #webMethods
    #Integration-Server-and-ESB