0% found this document useful (0 votes)
39 views13 pages

Y10 - 16-01-2024-Test Data

Uploaded by

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

Y10 - 16-01-2024-Test Data

Uploaded by

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

Computer

Science
With: Mr Mike
7.6 Test data
Date: 16 January 2024

LO: How to use and apply suitable test data.

Success criteria: Students understand what test data is and


know how to use it to check the program is working.

Instructions: In this session I will discuss test data and how it is


used, please update your notebooks for reference.
How to suggest and apply suitable test data

In order to determine whether a solution is working as it should,


it needs to
be tested.

Usually before a whole system is tested each sub-system is


tested separately.

Algorithms written in pseudocode or as flowcharts can be tested


by a person
working through them using any data that is required and seeing
what the result
is.
How to suggest and apply suitable test data

Computer programs can be tested by running them on a


computer using any
data that is required and seeing what result is output.

However, in order to test a solution thoroughly it may need to be


worked through several times with different sets of test data.

A set of test data is all the items of data required to work


through a solution.
For instance, the set of test data used for Activity 7.6 was 7 and
18.
How to suggest and apply
suitable test data
Normal data
Normal data should be used to work through the solution to find
the actual result(s) and see if they are the same as the expected
result(s).

For example, consider an algorithm that records the percentage


marks, entered
in whole numbers, from ten end-of-term examinations for a pupil,
and then finds
the average mark.

A set of normal test data for this purpose could be:


Normal test data: 50, 50, 50, 50, 50, 50 50, 50, 50, 50
Expected result: 50
Abnormal data
Solutions also need to be tested to prove that they do not do
what they are
supposed not to do.

In order to do this, test data should be chosen that would be


rejected by the solution as not suitable, if the solution is working
properly.

This type of test data is called abnormal test data. (It is also
sometimes called
erroneous test data.)
Abnormal data
For example, erroneous/abnormal data for our algorithm to find
the average
percentage marks from ten end of term examinations could be:

Erroneous/abnormal data: -12, eleven


Expected results: both of these values should be rejected
Extreme data
When testing algorithms with numerical values, sometimes only
a given range
of values should be allowed.

For example, percentage marks should only be in the range 0 to


100. Our algorithm above should be tested with extreme data.

Extreme data are the largest and smallest values that normal
data can take.
In this case:
Extreme data: 0, 100
Expected results: these values should be accepted
Boundary data
There is another type of test data called boundary data.

This is used to establish where the largest and smallest values


occur.

At each boundary two values are required: one value is accepted


and the other value is rejected.

For example, for percentage marks in the range 0 to 100, the


algorithm should be tested with the following boundary data:
Boundary data for 0 is: -1, 0
Expected results: -1 is rejected, 0 is accepted
Activity 7.11
Google classroom - todays lesson - Activity 7.11

Turn the activity in when you finish.


Pop Quiz
1. What is test data used for?
» It’s used to determine if a solution is
working or not
2. Name types of test data?

» Normal, Abnormal and extreame (live, boundary).

3. What is boundary data?


» Used to establish the largest
and smallest values
4. What is abnormal data?
» Data that is outside the range
Thank you.
In our next session we will discuss: Trace
tables

Have fun!

You might also like