Hello,
I need someone that can finish these two exercises.
Assignment #2
Turn in your work as a single Word or PDF file.
Problem 1 |
Problem 2 |
Total |
||||||
1.1 |
1.2 |
1.3 |
2.1 |
2.2 |
2.3 |
2.4 |
2.5 |
|
10 pts |
10 pts |
10 pts |
20 pts |
10 pts |
10 pts |
15 pts |
15 pts |
100 pts |
status == SINGLE |
income <= SINGLE_CUTOFF1 |
income<= SINGLE_CUTOFF2 |
income <= MARRIED_CUTOFF1 |
income<= MARRIED_CUTOFF2 |
Table 1.1 Test cases (test inputs)
Test case no |
Test input |
|
status |
income |
|
Table 1.2 Decision coverage
Decision |
Test Case ID (s) |
|
True |
False |
|
status == SINGLE |
||
income <= SINGLE_CUTOFF1 |
||
income<= SINGLE_CUTOFF2 |
||
income <= MARRIED_CUTOFF1 |
||
income<= MARRIED_CUTOFF2 |
@Test
public void test () {
TaxReturn aTaxReturn = new TaxReturn(10000, 2);
System.out.println(“Your tax is ” + aTaxReturn.getTax());
}
Run your Junit tests with a code coverage analysis tool. If you use EclEmma in Eclipse, right click on TexReturnTest.java, select “Coverage As†from the menu, and then select “Junit Testâ€.
If your test cases in Table 1.1 have achieved the decision coverage, then every line of the code in the getTax method should be covered, as shown in the following screenshot.
Provide in this document the source code of your TaxReturnTest.java, a screenshot of the test execution, and a screenshot of the coverage information.
Node no |
Code |
start 1 2 3 4 5 6 7 8 9 end |
public static void isPrimeNumber(int number) { if (number > 1) { boolean isPrimeNumber = true; int i = 2; while (isPrimeNumber && i < number) { if (number % i == 0) isPrimeNumber = false; else i++; } if (isPrimeNumber) System.out.println(number + ” is a prime number.”); else System.out.println(number + ” is not a prime number.”); } else { System.out.println(“Please input a number greater than 1.”); } } |
@Test
public void test3() {
PrimeNumber.isPrimeNumber(13);
}
Provide in this document the source code of PrimeNumberTest.java, a screenshot of the test execution results in the console window, and a screenshot of the code coverage for isPrimeNumber.
2.4 Complete the following Definition/Use table for isPrimeNumber.
Node number |
Variables |
||
Definition |
C-Use |
P-Use |
|
start |
|||
1 |
|||
2 |
|||
3 |
|||
4 |
|||
5 |
|||
6 |
|||
7 |
|||
8 |
|||
9 |
2.5 Complete the following Definition/Use Associations table for isPrimeNumber. Add rows as needed.
Variable |
Def node |
Def-C-Uses |
Def-P-Uses |
NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.
The post software architecture test maint appeared first on The Nursing Hub.