![Page 1: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/1.jpg)
Testing Strategies
COMP1 – Section 4.2. Testing
![Page 2: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/2.jpg)
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
![Page 3: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/3.jpg)
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
![Page 4: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/4.jpg)
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
![Page 5: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/5.jpg)
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.
![Page 6: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/6.jpg)
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.
![Page 7: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/7.jpg)
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
![Page 8: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/8.jpg)
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.
![Page 9: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/9.jpg)
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
![Page 10: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/10.jpg)
Testing strategies
Black box testing White box testing
Alpha testing Beta testing
![Page 11: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/11.jpg)
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?
![Page 12: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/12.jpg)
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?
![Page 13: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/13.jpg)
Alpha Testing
Carried out by the software developer’s in-house testing team.
Reveals errors and omissions is systems requirements definition.
![Page 14: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/14.jpg)
Beta Testing
Software is tested by a number of potential users who agree to use the system and report any problems.
![Page 15: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/15.jpg)
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
![Page 16: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/16.jpg)
Checking your newly gained knowledge:
testing strategies – examples? Test plan and recording tests –What
needs testing? validation of input data – Why
important?
![Page 17: 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](https://reader036.vdocuments.us/reader036/viewer/2022082817/56649e0f5503460f94af9987/html5/thumbnails/17.jpg)
Homework
COMP1-4.1.A. Validation. Question 1 in validation and error handling section from the Book on page 225.
By Tuesday