Testing and evaluationExample

A database is fit for purpose if it meets the end use and functional requirements. Testing queries and examining actual output against expected output helps to determine fitness for purpose.

Part ofComputing ScienceDatabase design and development

Example

A list of all pupils who are members of the orchestra should be returned, provided that the pupil receives tuition. The list should be sorted in descending order of surname.

Design

Query Design: Return a list of all pupils who are members of the Orchestra and receive tuition

Field(s)First Name, Surname, Tuition
Table(s)Pupil, Orchestra
CriteriaTuition = True
Sort OrderSurname DESC
Field(s)
First Name, Surname, Tuition
Table(s)
Pupil, Orchestra
Criteria
Tuition = True
Sort Order
Surname DESC

Implementation

SELECT Pupil.First Name, Pupil.Surname, Orchestra.Tuition
FROM Orchestra
INNER JOIN Pupil ON Orchestra.PupilID = Pupil.PupilID
WHERE Orchestra.Tuition = ‘No’
ORDER BY Pupil.Surname DESC;

Testing

Predicted result

The predicted result shows what the developer expects the query to return.

First NameSurnameTuition
JamesMcNameeYes
TabisoMatazinadzeYes
First NameJames
SurnameMcNamee
TuitionYes
First NameTabiso
SurnameMatazinadze
TuitionYes

Actual result

The actual result of the query is then recorded. It can be compared to the expected result to make sure that the query has executed as expected.

First NameSurnameTuition
BeatricePannerNo
AmyMcNameeNo
AmyJonesNo
First NameBeatrice
SurnamePanner
TuitionNo
First NameAmy
SurnameMcNamee
TuitionNo
First NameAmy
SurnameJones
TuitionNo