Testing and evaluationFinding errors

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

Finding errors

In the example on the previous page, the predicted result and actual result do not match.

When this happens, it is necessary to go back to the design and implementation phases to try to identify the error.

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

The design for the query is fine.

Implementation

A mistake has been made during implementation.

N5 Computing Science implementation lines

The query will return the pupils who do not receive tuition. The database developer has accidentally entered ‘No’ instead of ‘Yes’. The SQL code should have read:

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

This would return:

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

Now that the actual result matches the predicted result, testing is complete for this query.