{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

w10-tutorial 9

# w10-tutorial 9 - principal interest rate and year deposited...

This preview shows pages 1–2. Sign up to view the full content.

Software Development Practices S2 2009 HIT2308 Tutorial 9 in Week 10 1. Describe, relate and contrast the following terms, giving examples where possible from your experience: Error The process of making mistake in the code Defect The error that appears on the screen . Fault Same as defect 2. What is the difference between debugging and testing? Testing = finding a bug Debugging = fixing the bugs. 3. What is a test case? A set of inputs and corresponding expected output, environment (i.e . user-defined types, sample database etc.) Boundary input, representative inputs, 4. Complete the following template for a test case for this brief description. You may need to describe the set up as well so that the test can be executed. The set up is sometimes called the environment . A method is required in a Bank class that will calculate compound interest, returning the calculated total amount. The method will accept as a parameter, the year when the calculation should stop. The method will use the instance variables

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: principal , interest rate and year deposited . Test No. 1 Type of testing Testing objective Test input Expected output (or one metamorphic relation) Software Development Practices S2 2009 HIT2308 5. Describe another test case based on this code fragment which was written to solve 4 above. Again you may need to describe the set up or environment. Use the alternative template below. public class Bank { public double principal; public int interest; public int yearDeposited; . . . public double calculateInterest ( int yearToEnd ) { double prin; prin = principal; for (int y = yearDeposited; y < yearToEnd; y++); { prin = prin * ( 1 + interest/100); } return prin; } } An alternative template for a test case is Purpose Input(s) Environment (if needed) Expected output(s) 6. How many of the errors in the code would your test case have found? How many errors did you find?...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

w10-tutorial 9 - principal interest rate and year deposited...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online