[SOLVED] Branch Coverage, Statement Coverage and Path Coverage | Java Unit Testing
Create a directory called “TestClassValue” Hereafter, we call this directory <dir>. Create a Java class com.work.sample.FlawedClass in directory <dir>/src. (The actual path will obviously reflect the package structure.) 100% Branch Coverage & 100% Statement Coverage Add to the class a method called flawedMethodl that contains a division by zero fault such that it is possible to create a test suite that achieves 100% branch coverage and does not reveal the fault every test suite that achieves 100% statement coverage reveals the fault. Conversely, if you were able to create the method, then create two JUnit test classes com.work.sample.FlawedClassTestBCl and com.work.sample.FlawedClassTestSCl for class FlawedClass as follows: FlawedClassTestBCl should achieve 100% branch coverage of flawedMethodl and not reveal the fault therein. FlawedClassTestSCl should achieve 100% statement coverage of flawedMethodl and reveal the fault therein. Both classes should be...
Comments
Post a Comment