Question: Package MyUnitTests; import org.junit.Test; import static org.junit.Assert.*; public class Scrabble ScoreTest {public ScrabblescoreTest() {}@Test public void templateTest() {//setup test values//set expected result//get actual result//compare expected


Package MyUnitTests; import org.junit.Test; import static org.junit.Assert.*; public class Scrabble ScoreTest {public ScrabblescoreTest() {}@Test public void templateTest() {//setup test values//set expected result//get actual result//compare expected and actual results}} ScrabblescoreTest For this portion of the assignment you will need to create a suite of unit tests in the provided ScrabblescoreTest class which can be found in the MyUnitTests package. You should use a white box testing approach to ensure that you achieve branch and statement level coverage for the calculateScore test. To achieve statement level coverage means that you have unit tests such that every statement block (each node in a control flow graph) is executed at least once. Essentially that after running your unit tests, every line of code in your calculateScore method has been executed at least once by some unit test. To achieve branch (decision) level coverage means that you have unit tests such that every selection statement (nodes in a control flow graph which lead to multiple other nodes) have each possible branch evaluated. So in the case of loops you ensure that you test when the loop iterates as well as when it makes no iterations, and for selection statements all true and false blocks are visited at least once. You should view the WReSTT learning object for White Box testing to learn how to construct a control flow graph and ensure that you have proper statement and branch testing. Note that by achieving branch coverage, you will guarantee that you have achieved statement coverage. Depending on how you implement your calculateScore method, you may not require too many unit tests to achieve branch coverage. You may want to write additional unit tests to ensure that your method works approximately. Package MyUnitTests; import org.junit.Test; import static org.junit.Assert.*; public class Scrabble ScoreTest {public ScrabblescoreTest() {}@Test public void templateTest() {//setup test values//set expected result//get actual result//compare expected and actual results}} ScrabblescoreTest For this portion of the assignment you will need to create a suite of unit tests in the provided ScrabblescoreTest class which can be found in the MyUnitTests package. You should use a white box testing approach to ensure that you achieve branch and statement level coverage for the calculateScore test. To achieve statement level coverage means that you have unit tests such that every statement block (each node in a control flow graph) is executed at least once. Essentially that after running your unit tests, every line of code in your calculateScore method has been executed at least once by some unit test. To achieve branch (decision) level coverage means that you have unit tests such that every selection statement (nodes in a control flow graph which lead to multiple other nodes) have each possible branch evaluated. So in the case of loops you ensure that you test when the loop iterates as well as when it makes no iterations, and for selection statements all true and false blocks are visited at least once. You should view the WReSTT learning object for White Box testing to learn how to construct a control flow graph and ensure that you have proper statement and branch testing. Note that by achieving branch coverage, you will guarantee that you have achieved statement coverage. Depending on how you implement your calculateScore method, you may not require too many unit tests to achieve branch coverage. You may want to write additional unit tests to ensure that your method works approximately
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
