locked
code coverage repeated methods b_ and c_ extensions?? RRS feed

  • Question


  • First of all, anyone who answers this correctly, and I have

    some way of understanding that it is correct, I will surely

    mark this as answered, you will get your points! 

    OK, I'm doing unit testing and trying to understand what

    it means when the exact same method, with same parameters and

    return value, shows up more than one time and in one place it is

    covered and in another place it is not.  

    For example, I have a parent in the heirarchy:

    ****XMLUtility.<>c_DisplayClass15

    with the same method showing twice, each as a child:

    <NameOfMethod>b_16(System.XmlLinq.XElement)

    <NameOfMethod>b_17(System.XmlLinq.XElement)

    one shows 100% coverage and the other shows 0% code

    coverage but when I click them they go to the exact same

    method.   I am trying to find information on why it is 100%

    in one case, 0% in the other, but I have no idea even what

    the two cases are, as right clicking only gives me "go to source

    code" which just goes to the exact same code, or it gives

    me the options to Add/Remove columns or copy.

    What does this mean and how do I find out how to get my code

    coverage from 0% in the one case up?

    Monday, March 25, 2013 1:47 PM

All replies

  • Hello,

    Thank you for your post.

    Not sure about your unit test scenario and VS version. Based on your description, I created two simple unit test methods in one unit test in VS2010. Each test method calls the same function.

    After I run the two test methods and check the code coverage result in code coverage result window, I found that two methods has the equal code coverage percentages.

    If you are running unit test in VS2010 IDE and checking code coverage result in code coverage result window, I suggest that you can try the scenario on another machine to check the result if you have other environment.

    Since that one test method has 0% code coverage, you need to make sure that two test methods are executed successfully.

    If you are checking code coverage through customizing code coverage like Customizing Code Coverage Analysis in VS2012, I suggest that you can check the codecoverage.runsettings file configuration to make sure that two test methods must be included. Also you can try to run tests in VS IDE and then check the result in code coverage result window to see if there is anything different.

    If still no help, please attach your scenario and upload it on your sky drive. Then you can post the download link here. We will try to repro your issue with your scenario on our side to check the result.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Amanda Zhu Sunday, March 31, 2013 11:57 PM
    • Marked as answer by Amanda Zhu Sunday, March 31, 2013 11:58 PM
    • Unmarked as answer by jamesiw Monday, April 1, 2013 2:42 PM
    Tuesday, March 26, 2013 2:22 AM
  • Hello,

    Since we haven't heard from you for a long time, I temporarily close this case. I mark useful reply as answer. If you have any concerns, please feel free to reopen it or submit a new question.

    Thanks for your understanding.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, March 31, 2013 11:57 PM
  • I will look into your answer.  I have unmarked it for now, until I can check into

    it and confirm it as a correct answer.  Thanks.

    Monday, April 1, 2013 3:05 PM
  • Hi,
      Thanks for the answer.  Unfortunately I have done what you have done in VS2012,
    but the results are not the same as what I was getting in my other solution.  The other
    solution is what I'm doing at work and there's a lot going on in there, so it's difficult
    to pinpoint what this b_16 b_17 extension means.  But when I create a unit test in
    VS2012, where two different unit test methods call the same method, that called method
    only shows up once, there are not two instances in the code coverage, only two unit test
    methods, not two occurrences of the called method with some kind of b_# extension.  
    Apparently, something else is going on here.  I would like to know what this double occurrence means, and what
    the b_16 and b_17 extensions mean.  That may help me to understand exactly why
    one is showing up as 100% and one as 0%.  Thanks.  If anyone else has ever seen this
    before and knows what this means, please reply.

      

    Monday, April 1, 2013 3:25 PM
  • Hello,

    If possible, please provide a simple example which can be used to repro you issue. Please attach the sample and upload it on your sky drive. Then you can post the download link here. We will try it on our machines.

    when I create a unit test in
    VS2012, where two different unit test methods call the same method, that called method
    only shows up once, there are not two instances in the code coverage, only two unit test
    methods,

    Also please provide us the image which displays the detailed code coverage results on your side so that we can know what you are facing.

    I would like to know what this double occurrence means, and what
    the b_16 and b_17 extensions mean.

    I am not sure about the b_16 and b_17 extensions ‘’. Whether or not you have the two methods in c_DisplayClass15? Are they collected in Code Coverage Result window? In order to further look at them, you can provide us an image which displays them in details.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 2, 2013 1:56 AM