testing strategies comp1 – section 4.2. testing. aims at the end of this lesson you will be able...
TRANSCRIPT
Testing Strategies
COMP1 – Section 4.2. Testing
Aims
At the end of this lesson you will be able to:
Explain different testing strategies Design and carry out basic testing Demonstrate the importance of
validation of input data
What can you test?
If you planned to build a car you could plan the tests to perform BEFORE you even put a nut and bolt together I want the car to stop from 60mph to 0 in
3 seconds I want the car to accelerate from 0 – 60 in
10 seconds You could create hundreds of tests Only AFTER you had built the car could
you implement the tests
Your program
The same is true of your program or project (A2)
Create a test PLAN during the design stage
Then: Create the projectThen: Test the program/project using your
test plan
Testing is a big area(as is Texas)
You can not hope to test all the possible combinations in your program
For example for one input variable you could enter ever possible combination of keyboard characters, clearly infeasible (and a bit silly)
We can split up the problem. This makes it simpler to manage.
Test Plan
Think about the things your program will be doing:
Reacting to user input Choose from menus Producing outputs like invoices
Processing calculations Are the monetary values calculated correctly Does the graph show the correct figures
Validating input See 4.1. validation and error handling Give some examples.
Format of the USER test plan
User testing
Test no
Test data Reason for choice of test data
Expected Outcome
Actual Outcome
Comment
1 Choose menu option ‘A’ for flights only’
To see if use can make choice
Go to correct holiday calculator
2
CALCULATION test planTest no
Test data Reason for choice of test data
Expected Outcome
Actual Outcome
7 (HolPrices added) and divided by noOfHols:1+2+3/3
To see if the average price of holidays is calculated correctly
23 – need to divide by No of items added to get correct result. See screen prints 5 and 6.
8 People * HolPrice 3 * 30
Cost of holidays calculated correctly
90 Holiday cost calculated correctlySee screen print 1
Note the test numbers follow on from the user tests
Note, your program does not have to work correctly in every way. SOME errors are
permitted. It is actually good to show that some areas do not work but explain how you go about solving these problems.
VALIDATION test planTest no
Test data Expected outcome
Reason for choice of test data
Actual Outcome
Comment
17 Age:-1 rejected Below acceptable value - boundary
18 Age:10000 rejected Above acceptable value - invalid
19 Age: Blank no-input
Rejected Cell contains no data - erroneous
20 Age:110 Accepted Upper bound of acceptable data
21 Age:1 Accepted Lower bound of acceptable data
22 Age:25 Accepted Normal data - valid
23 Age: A Rejected Erroneous data - invalid
Note the test numbers follow on from the calculation tests
Testing strategies
Black box testing White box testing
Alpha testing Beta testing
Black box testing
Referred to as ‘functional testing’ Carried out independently of the
code used in the program. Create test data that covers all the
inputs and outputs and program functions by looking at the specification
Examples?
White box testing
Referred to as ‘structural testing’ Program code is studied and tests
are devised which test each possible path at least once.
Weakness: you cannot test what is not there!!!
Examples?
Alpha Testing
Carried out by the software developer’s in-house testing team.
Reveals errors and omissions is systems requirements definition.
Beta Testing
Software is tested by a number of potential users who agree to use the system and report any problems.
Activity in pairs:
Download testing template.doc from Moodle->COMP1->4.2. Testing
Decide on test data Carry out testing with neighbour –
SWAP seats! Record outcomes! If you have extra time!: Download zip file from Moodle in 4.2. Use 4.2. Testing of Insurance calculator
program.doc to test program
Checking your newly gained knowledge:
testing strategies – examples? Test plan and recording tests –What
needs testing? validation of input data – Why
important?
Homework
COMP1-4.1.A. Validation. Question 1 in validation and error handling section from the Book on page 225.
By Tuesday