CCEA A-Level Software Systems Development CL4
Software and the Development Environment
Defining Data: Types, Variables and Classes
Program Control Structures
Objects, Classes and Data Structures
Exception Handling and Managing Input and Output
Testing an Object Oriented Application
Graphical User Interface Objects and Events
Multiple Forms and Linking to Files
Designing, Testing and Evaluating an Event Driven Application
Reasons for Systems Development and Systems Methodologies
Managing Projects
Testing Strategies
Database Concepts and Entity Relationship Modelling
Normalisation and Structured Query Language
Project Management and the Systems Approach in Practice
Defining Requirements and Documenting the Design
Building a Desktop Solution with a Database
Testing and Evaluating the Solution
Testing an Object Oriented Application
Test harnesses, drivers and stubs
- 3 things to know
- AS Unit 1
Overview
Test harness, test driver and assertion in a test.
What you need to know
Answer each one before you reveal it.
Why is a class tested with a harness rather than inside the finished application?
What is a stub?
Questions from this subtopic
Each one with the model answer underneath.
- 1
What is a test harness?
Model answer
A test harness is code written purely to exercise the software under test, supplying the inputs, making the calls and reporting whether each result matched what was expected.
- 2
Why is a class tested with a harness rather than inside the finished application?
Model answer
A harness lets the class be tested as soon as it is written, with none of the rest of the program present, so any fault found belongs to that class alone.
- 3
What is a test driver?
Model answer
A test driver is a small program that creates objects of the class under test and calls its methods with prepared values, standing in for the application code that will eventually call it.
- 4
What is a stub?
Model answer
A stub is a simple stand-in for a class or method that has not been written yet, returning a fixed value so the code depending on it can be tested now.
- 5
When is a stub needed?
Model answer
A stub is needed when the class under test calls something not yet available, such as a database class or a payment service, so testing does not have to wait for that part to be finished.
- 6
A class needs today's date from a clock class. Why is a stub used when testing it?
Model answer
A stub returns the same fixed date every time, so a test of behaviour that depends on the date produces the same result whenever the test is run.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Testing an Object Oriented Application, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.