Tax Calculation Program

User Generated



Houston Baptist University


Unformatted Attachment Preview

Page 1 of 3 Homework Assignment 2 (100 Points) CSE 464, Fall 2022 SCAI, Arizona State University Due: By Saturday Oct 1st 11:59 pm Please see the submission instructions given in the first page Note: This is an individual homework, DO NOT collaborate -----------------------------------------------------------------------------------------------------------1.[ 25 Points ] Tax Calculation Program: Consider a software system that computes income tax based on adjusted gross income (AGI) and number of dependents according to the following rules. This software doesn’t calculate tax for people over 1 million or negative income. Also, the tax will not be deducted for families with AGI less than 25000. Finally, max number of dependents one can claim is 10. If AGI is between 25000 and 100000 and number of dependents less than 5 the tax due is 22% of AGI, otherwise, the tax rate is 20% If AGI is between 100001 and 1million and number of dependents less than 5, the tax due is 27% of AGI, otherwise, the tax rate is 25% Suppose you need to test this application using boundary value analysis (assume that you will be using robustness testing). a) Identify boundary values for AGI and dependents for robustness testing b) Draw the 2-D graph where X axis is AGI and Y axis is dependents that shows robustness testing data points for the tax calculation program. c) How many test cases you will have for robustness testing? d) Develop Only 10 test cases to test this application using robustness testing. Represent your test cases using a table Page 2 of 3 2.[50 Pts] Equivalent Partitions: Social Security Number Verification Consider the following program that checks if a social security number (ssn) is a correct number. Following is the criteria that determines if a social security muber is a correct ssn (Please DO NOT use this algorihm for any program that you write, acutaul algorithm may be different. This is only for CSE 464 class software testing practice only) The valid SSN (Social Security Number) must satisfy the following conditions: • • • It should have 9 digits. It should be divided into 3 parts by hyphen (-). The first part should have 3 digits and should not be 000, 666, or between 900 and 999. • The second part should have 2 digits and it should be from 01 to 99. • The third part should have 4 digits and it should be from 0001 to 9999. a) [20 Pts] How do you test this application using EP technique? Identify your EPs Write test cases based on your EPs (use strong robust classification). b) [30 Pts] Develop Junit test cases based on your test cased listed above and test the java program given. This java program has two defects. Identify defects in this program (If your test cases can catch them, you have developed good set of test cases!). You can assume that the user consists of numbers and “-“ only. No need to consider other types of inputs such as strings, characters …etc. c) [10 Pts] How do you fix the defects in the program? Submit the corrected program. Page 3 of 3 3.[25 Points] Decision Table: Shipping Charges Program Description: The Fast Freight Shipping Company charges following rates Weight of Packages (in Kilograms) 0 < weight
Purchase answer to see full attachment
Explanation & Answer:
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

View attached explanation and answer. Let me know if you have any questions.

-------------------------------------------------------------------SOURCE CODE:
void main()
long AGI;
int dependents;
float temp;
printf("Enter AGI value:");
if(AGI=25000 && AGI= 0; i -= 2) {
int number = getDigitAtIndex(securityNumber, i);
sum += getSumOfANumber(number * 2);
return sum;

public int sumOfTwoPrecedingSteps(int sumOfEveryOtherDigit, int
sumAfterDoublingDigits) {
return sumOfEveryOtherDigit + sumAfterDoublingDigits;

private static int numberOfDigits(long securityNumber) {
return (securityNumber +"").length();

private static int getDigitAtIndex(long securityNumber, int location) {
String cNumber = securityNumber + "";
return Integer.parseInt(cNumber.charAt(location) + "");

private static int getSumOfANumber(int number) {
return number == 0 ? 0 : number % 10 + getSumOfANumber(number /
10) ;
Testcase for the Main class
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class socialsecurityValidatorTest {
private static long VALID_security_NUMBER = 5196081888500645L;
private static long INVALID_security_NUMBER = ...

I was stuck on this subject and a friend recommended Studypool. I'm so glad I checked it out!


Related Tags