I realize only 3 testcases are needed. I also understand the difficulty of implementing the change. I work in hardware simulation and we have similar coverage analysis issues.
Rick "The Rhino" N6RNO @Tehama October 4-5, 2014 Where will you be? http://www.cqp.org On Sun, Jan 19, 2014 at 9:56 AM, Marc R. Hoffmann < hoffm...@mountainminds.com> wrote: > Hi, > > code coverage tools work on the actual implementation, not on the intenden > symantics. For your example data flow analysis would be necessary to > collapse such descissions. If the boolean expression is a method (e.g. > Date.before()) you would even need to understand the semantics of these > methods. > > Speaking for JaCoCo there are no plans to implement such a semantical > analysis. > > BTW, for your particular example 3 test cases are enough to cover all > branches. > > Cheers, > -marc > > On 19.01.14 09:03, Richard Eversole wrote: > >> For code like: >> >> if (i<0 || i>255) { >> } else { >> } >> >> the condition is reported as having 4 branches. Technically, this is >> correct but two branches collapse as the condition has only 3 ranges of >> possible values: >> i<0 T >> i>255 T >> 0<=i<=255 T .. ie. i<0 F and i>255 F >> Could someone enhance the tool to only report the 3 branches when numeric >> ranges exist ? >> not critical just a thought..... of course then this expands as you write >> even more complex range checks on numbers.... >> -- >> You received this message because you are subscribed to the Google Groups >> "JaCoCo and EclEmma Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to jacoco+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > -- > You received this message because you are subscribed to a topic in the > Google Groups "JaCoCo and EclEmma Users" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/jacoco/-yW-upncnwk/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > jacoco+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.