0% found this document useful (0 votes)
10 views3 pages

SWT301

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

SWT301

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Question 1:

Defect ID: DF001

Defect Name: Can not find symbol

Line number: 2

Defect Description: Missing to import library BufferedReader

Fixing Solution: import java.io.BufferedReader;

Defect ID: DF002

Defect Name: Can not find symbol

Line number: 10

Defect Description: Missing to import library IOException

Fixing Solution: import java.io.IOException;

Defect ID: DF003

Defect Name: Can not find symbol

Line number: 6

Defect Description: Missing to import library FileReader

Fixing Solution: import java.io.FileReader;

Defect ID: DF004

Defect Name: unreported exception IOException

Line number: 23

Defect Description: Missing try- catch

Fixing Solution: Adding try-catch for reader.close();

Question 2:
@Test

public void testException1() {

OrderCalculator o = new OrderCalculator();

assertThrows(IllegalArgumentException.class, () -> {

o.calculatorTotalPrice(new double[]{}, "VIP", false, null);

});

}Question 3:

Test Case 1: Normal Flow – Successful Add items to cart.

ID: TC001

Description: Test add cart success.

Preconditions:

- The customer is logged in

Test Steps:

- Customer log into the website


- Customer choose the items
- Customer click the Add button

Expected Result: Customer add items to cart successfully.

Note: Normal flow (NF)

Test Case 2: Normal Flow – Successful apply a discount code.

ID: TC002

Description: Test apply discount code success.

Preconditions:

- The customer is logged in.


- The shopping cart must have at least one item.

Test Steps:

- Customer log into the website


- Customer choose the items.
- Customer click the Add button to add items to cart.
- Customer choose a discount code.
- Customer apply that discount code to their product.

Expected Result: Customer apply discount code successfully.

Note: Normal flow (NF)

You might also like