Answered step by step
Verified Expert Solution
Question
1 Approved Answer
progamming language is java you can ignore the branches just indicate what file the code goes in . only code is code you write to
progamming language is java you can ignore the branches just indicate what file the code goes in only code is code you write to complete task. no preexisting code Task : Add to the class a method called buggyMethodl that contains a division by zero fault such that it is possible to create a test suite that achieves statement coverage and does not reveal the fault, and it is possible to create a test suite that achieves less than statement coverage and reveals the fault. o The method can have any signature. If you think it is not possible to create such a method, then create an empty method; add a comment in the empty body of the method that concisely but convincingly explains why creating such method is not possible. o Conversely, if you were able to create the method, create two JUnit test classes edu.qcseclassBuggyClass Testscla and edu.qcseclassBuggyClass TestsClb for class BuggyClass as follows: BuggyClass Testscla should achieve statement coverage of buggyMethodl and not reveal the fault therein. o BuggyClass Test sclb should achieve less than statement coverage of buggyMethods and reveal the fault therein. o Both classes should be saved in directory testAlso in this case, the actual path will obviously reflect the package structure, and the same holds for the test classes in the subsequent tasks.Task : Add to the class a method called buggyMethod that contains a division by zero fault such that it is possible to create a test suite that achieves statement coverage and does not reveal the fault, and every test suite that achieves more than branch coverage reveals the fault. The method can have any signature. o If you think it is not possible to create such a method, then create an empty method; add a comment in the empty body of the method that concisely but convincingly explains why creating such method is not possible. o Conversely, if you were able to create the method, create two JUnit test classes edu.qcseclassBuggyClass Test SC and edu.qcseclassBuggyClass TestBC for class BuggyClass as follows: o BuggyClass TestSC should achieve statement coverage of buggyMethod and not reveal the fault therein. o Buggyclass TestBC should achieve more than branch coverage of buggyMethod and reveal the fault therein. o Both classes should be saved in directory testTask : Add to the class a method called buggyMethod that contains a division by zero fault such that it is possible to create a test suite that achieves branch coverage and does not reveal the fault, and it is possible to create a test suite that achieves statement coverage, does not achieve branch coverage, and reveals the fault. o The method can have any signature. If you think it is not possible to create such a method, then create an empty method; add a comment in the empty body of the method that concisely but convincingly explains why creating such method is not possible. o Conversely, if you were able to create the method, create two JUnit test classes edu.qcseclassBuggyClassTestBC and edu.qcseclassBuggyClass Test SC for class BuggyClass as follows: o BuggyClassTestBC should achieve branch coverage of buggyMethod and not reveal the fault therein. BuggyClassTest SC should achieve statement coverage of buggyMethod less than branch coverage of buggyMethod and reveal the fault therein. Both classes should be saved in directory testTask : Add to the class a method called buggyMethod that contains a division by zero fault such that every test suite that achieves statement coverage reveals the fault, and it is possible to create a test suite that achieves branch coverage and does not reveal the fault. o The method can have any signature. o If you think it is not possible to create such a method, then I create an empty method; add a comment in the empty body of the method that concisely but convincingly explains why creating such method is not possible. o Conversely, if you were able to create the method, create two JUnit test classes edu.qcseclassBuggyClass Test SC and edu.qcseclassBuggyClassTestBC for class BuggyClass as follows: BuggyClass Test SC should achieve statement coverage of buggyMethod and reveal the fault therein. o BuggyClassTest BC should achieve branch coverage of buggyMethod and not reveal the fault therein. o Both classes should be saved in directory test Task : Add to class BuggyClass a method buggyMethods by completing the code skeleton provided below so that it is possible to create a test suite that achieves statement coverage, and the division by zero fault at line cannot be revealed by any test suite. public void buggyMethodint i int x; point where you can add code x i; point where you can add code o In completing the method: you cannot add any extra parameter to the method; you cannot use any exception handling mechanism; you cannot use reflection. you cannot use any code rewriting technique. basically, you can only add zero or more lines of code to replace the placeholders point where you can add code If you think it is not possible to create such a method, then I create an empty method; add a comment in the empty body of the method that concisely but convincingly explains why creating such method is not possible. o Conversely, if you were able to create the method, create a JUnit test class edu.qcseclassBuggyClass TestsC for class Buggyclass as follows: o BuggyClassTest sc should achieve statement coverage of buggyMethods and not reveal the fault therein. The class should be saved in directory test Create a directory called "Assignment in the root directory of the personal repo we assigned to you. Hereafter, we will call this directory Create a Java class edu.qcseclassBuggyClass in directory srcThe actual path will obviously reflect the complete package structure.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started