Free Essay

Se433Hw5

In:

Submitted By lovedolcelee
Words 1085
Pages 5
SE433-­‐HW5 Mengwei Li Program1. Shipping Cost 1. Input variables: shippingType purchaseCost destination

2. shippingType:

vEC11: {standardShipping, nextDayShipping} – Allowed shipping types. iEC11: {other Strings} – Shipping types that not exist.

destination:

vEC21: {IL, CA, NY} – States that need tax added. vEC22: {other states in US} – Tax-­‐free states. iEC21: {other Strings} – Other counties.

purchaseCost:

vEC31: (0, 50) – If standard shipping, shipping cost cannot be waived. vEC32[50, POSITIVE_INFINITY] – If standard shipping, shipping cost waived. iEC31: [NAGATIVE_INFINITY, 0] – Negative cost. iEC32: NaN – Not a number.

3. WNT001: A $36 order using standard shipping to IL (Tax added, shipping cost not waived.) Input: shippingType: standardShipping, purchaseCost: 36, destination: IL ExpectedOutput: 10 + 36 * 106% = 48.16

WNT002: A $60 order using next-­‐day shipping to MI (Tax-­‐free, shipping cost not waived.) Input: shippingType: nextDayShipping, purchaseCost: 60, destination: MI ExpectedOutput: 25 + 60 = 85

4. WRT001: Negative purchase cost input for standard shipping to IL. Input: shippingType: standardShipping, purchaseCost: -­‐20, destination: IL ExpectedOutput: exception in purchaseCost

WRT002: NaN purchase cost input for next-­‐day shipping to IN. Input: shippingType: nextDayShipping, purchaseCost: a, destination: IN

ExpectedOutput: exception in purchaseCost

WRT003: A $25 order for standard shipping to UK. Input: shippingType: standardShipping, purchaseCost: 25, destination: UK ExpectedOutput: exception in destination

WRT004: A $25 order for unkown shipping to IL. Input: shippingType: unkownShipping, purchaseCost: 25, destination: IL ExpectedOutput: exception in shippingType

5. SNT001: A $25 order using standard shipping to IL. (Tax added, SC not waived) Input: shippingType: standardShipping, purchaseCost: 25, destination: IL ExpectedOutput: 10 + 25 * 106% = 36.5

SNT002: A $25 order using next-­‐day shipping to IL. (Tax added, SC not waived) Input: shippingType: nextDayShipping, purchaseCost: 25, destination: IL ExpectedOutput: 25 + 25 * 106% = 51.5

SNT003: A $25 order using standard shipping to IN. (Tax-­‐free, SC not waived) Input: shippingType: standardShipping, purchaseCost: 25, destination: IN ExpectedOutput: 10 + 25 = 35

SNT004: A $25 order using next-­‐day shipping to IN. (Tax-­‐free, SC not waived) Input: shippingType: nextDayShipping, purchaseCost: 25, destination: IN ExpectedOutput: 25 + 25 = 50

SNT005: A $75 order using standard shipping to IL. (Tax added, SC waived) Input: shippingType: standardShipping, purchaseCost: 75, destination: IL ExpectedOutput: 75 * 106% = 79.5

SNT006: A $75 order using next-­‐day shipping to IL. (Tax added, SC not waived) Input: shippingType: nextDayShipping, purchaseCost: 75, destination: IL

ExpectedOutput: 25 + 75 * 106% = 104.5

SNT007: A $75 order using standard shipping to IN. (Tax-­‐free, SC waived) Input: shippingType: standardShipping, purchaseCost: 75, destination: IN ExpectedOutput: 75

SNT008: A $75 order using next-­‐day shipping to IN. (Tax-­‐free, SC not waived) Input: shippingType: nextDayShipping, purchaseCost: 75, destination: IN ExpectedOutput: 75 + 25 = 100

6. SRT001: Negative purchase cost $-­‐25 input using standard shipping to IL. Input: shippingType: standardShipping, purchaseCost: -­‐25, destination: IL ExpectedOutput: exception in purchaseCost.

SRT002: Negative purchase cost $-­‐25 input using next-­‐day shipping to IL. Input: shippingType: nextDayShipping, purchaseCost: -­‐25, destination: IL ExpectedOutput: exception in purchaseCost.

SRT003: Negative purchase cost $-­‐25 input using standard shipping to IN. Input: shippingType: standardShipping, purchaseCost: -­‐25, destination: IN ExpectedOutput: exception in purchaseCost.

SRT004: Negative purchase cost $-­‐25 input using next-­‐day shipping to IN. Input: shippingType: nextDayShipping, purchaseCost: -­‐25, destination: IN ExpectedOutput: exception in purchaseCost.

SRT005: A $25 order using standard shipping to UK. Input: shippingType: standardShipping, purchaseCost: 25, destination: UK ExpectedOutput: exception in destination.

SRT006: A $25 order using next-­‐day shipping to UK. Input: shippingType: nextDayShipping, purchaseCost: 25, destination: UK ExpectedOutput: exception in destination.

SRT007: A $75 order using standard shipping to UK. Input: shippingType: standardShipping, purchaseCost: 75, destination: UK ExpectedOutput: exception in destination.

SRT008: A $75 order using next-­‐day shipping to UK. Input: shippingType: nextDayShipping, purchaseCost: 75, destination: UK ExpectedOutput: exception in destination.

SRT009: A $25 order using unkown shipping to IL. Input: shippingType: unkownShipping, purchaseCost: 25, destination: IL ExpectedOutput: exception in shippingType.

SRT010: A $25 order using unkown shipping to IN. Input: shippingType: unkownShipping, purchaseCost: 25, destination: IN ExpectedOutput: exception in shippingType.

SRT011: A $75 order using unkown shipping to IL. Input: shippingType: unkownShipping, purchaseCost: 75, destination: IL ExpectedOutput: exception in shippingType.

SRT012: A $75 order using unkown shipping to IN. Input: shippingType: unkownShipping, purchaseCost: 75, destination: IN ExpectedOutput: exception in shippingType.

7. shippingType:

purchaseCost: 0: when customer want to checkout without anything in the shopping cast. 50: maximum number for not waiving standard shipping cost. 50.01: minimum number for waiving standard shipping cost.

destination: California: test abbr. and full write.

8. BT001: A $0 order using stardard shipping to IN. Input: shippingType: standardShipping, purchaseCost: 0, destination: IN ExpectedOutput: exception in purchaseCost.

BT002: A $50 order using stardard shipping to IN. Input: shippingType: standardShipping, purchaseCost: 50, destination: IN ExpectedOutput: 10 + 50 = 60

BT003: A $50.01 order using stardard shipping to IN. Input: shippingType: standardShipping, purchaseCost: 50.01, destination: IN ExpectedOutput: 50.01 = 50.01

BT004: A $25 order using stardard shipping to CA. Input: shippingType: standardShipping, purchaseCost: 25, destination: California ExpectedOutput: 10 + 25 = 35

Program 2. Pluralization 1. Equivalence classes {not noun} {not singular noun} {singular noun ends in “s”} {singular noun ends in “f” or “fe”} {singular noun ends in “y”} {singular noun ends in “o”} {singular noun ends in “us”} {singular noun ends in “is”} {singular noun ends in “on”} {regular singular noun} {singular noun that don’t change at all when they’re pluralized} {special singular noun that don’t follow any rules}

2. Cover all EC Test001: Test not-­‐noun words. Input: smart Expected output: smart

Test002: Test not singular noun words. Input: apples Expected output: apples

Test003: Test singular noun ends in “s”. Input: truss Expected output: trusses

Test004: Test singular noun ends in “f” or “fe”. Input: wife Expected output: wives

Test005: Test singular noun ends in “f” or “fe”. Input: wolf Expected output: wolves

Test006: Test singular noun ends in “y”. Input: city Expected output: cities

Test007: Test singular noun ends in “o”. Input: potato Expected output: potatoes

Test008: Test singular noun ends in “us”. Input: octopus Expected output: octopi

Test009: Test singular noun ends in “is”. Input: analysis Expected output: analyses

Test010: Test singular noun ends in “on”. Input: phenomenon Expected output: phenomena

Test011: Test regular singular noun. Input: apple Expected output: apples

Test012: Test singular noun that don’t change at all when they’re pluralized. Input: sheep Expected output: sheep

Test013: Test special singular noun that don’t follow any rules Input: man Expected output: men

3. Boundary value and special value

{child, woman, man, person, goose, mouse, etc.} special noun that don’t have rules. {barracks, deer, etc.} nouns don’t change.

4. Additional test cases ADT001: Test special singular nouns. Input: child Expected output: children

etc….

Similar Documents