Conversation
|
What's what for? |
|
Branch coverage tests whether both code paths of a branch have been https://en.wikipedia.org/wiki/Code_coverage#Basic_coverage_criteria On Sun, Aug 24, 2014 at 8:54 PM, Peter Bengtsson notifications@github.com
|
|
Ah. it's not for git branches. Me==silly. But I still don't understand how this is different? If you have: if condition:
then_this()
else:
then_that()If both the if and the else statement is covered, it'll give you 4 out of 4 lines of test coverage. What would branch coverage add? |
|
Statement coverage works the same as branch coverage so long as you always have an else clause. Imagine this code: If condition is always true in all of your tests, statement coverage will tell you your coverage is complete. Branch coverage will inform you that you don't have a test for when condition is false. |
|
But in the case of if you have 3 lines test coverage you don't need branch coverage, right? |
|
Also, in python might have this: Suppose that your tests call |
Saw your article. Thought you might be interested in seeing if you have complete branch coverage as well.