From: SourceForge.net <no...@so...> - 2013-01-07 13:03:54
|
Bugs item #2957940, was opened at 2010-02-24 04:31 Message generated for change (Comment added) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720015&aid=2957940&group_id=130558 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Closed Resolution: Rejected Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: John Lewis (lewijw) Summary: The bug of the percentage branches covered for each class? Initial Comment: Example Pattern 1 if (a || b) → OK ============================= A. branch covered (2/2) 1. a = true b= true 2. a = false b = false ============================= Pattern 2 if (a && b) → NG? The expected pattern is ============================= A. branch covered (2/2) 1. a = true b= true 2. a = false b = false ============================= But ============================= A. branch covered (2/4) 1. a = true b= true 2. a = false b = false 3. a = true b= false 4. a = false b = true ============================= Isn't the pattern of 3 and 4 covering of the condition? ---------------------------------------------------------------------- Comment By: https://www.google.com/accounts () Date: 2013-01-07 05:03 Message: No, in fact there are 3 branches to cover a && b condition a = true b = false a = true b = true a = false Typicall usage is for example String s = ... if ( b != null && new Boolean(d) ) { ... } It's not possible to cover all 4 branches. It's similar to || condition. ---------------------------------------------------------------------- Comment By: John Lewis (lewijw) Date: 2010-02-24 13:45 Message: There are two conditions in the if statement: is "a" true and is "b" true? To cover the first one, tests have to set "a" to true and "a" to false. To cover the second condition, tests have to set "b" to true and "b" to false (of course "a" will need to be true in both cases). So, there are 4 permutations that have to be covered. Please clarify if I have not understood your question. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720015&aid=2957940&group_id=130558 |