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
Testing inheritance and overridden methods
- 3 things to know
- AS Unit 1
Overview
Confirming an inherited method still behaves in the subclass, that an overridden method is the one that actually runs, and that a call through a base-class reference reaches the right version.
What you need to know
Answer each one before you reveal it.
Why must a subclass be tested even though the base class has already passed its tests?
What is tested about an inherited method the subclass does not change?
Questions from this subtopic
Each one with the model answer underneath.
- 1
Why must a subclass be tested even though the base class has already passed its tests?
Model answer
A subclass adds attributes and may change behaviour, so the inherited methods now run in a different context and may no longer produce the right result.
- 2
What is tested about an inherited method the subclass does not change?
Model answer
The test confirms the method still gives correct results for objects of the subclass, since the subclass's own attributes and constructor may leave the object in a state the base class never encountered.
- 3
What must a test of an overridden method establish?
Model answer
The test must show that the subclass version is the one that runs and that it gives the result the subclass requires, rather than the result the base class would have produced.
- 4
Employee.calculatePay returns hours multiplied by rate, and Manager overrides it to add a bonus of 500. Which two tests are needed?
Model answer
One test creates an Employee and confirms the pay equals the hours multiplied by the rate, and the other creates a Manager with the same hours and rate and confirms the pay is 500 greater.
- 5
How is polymorphic behaviour tested?
Model answer
A test places objects of several subclasses in an array of the base type, calls the same method on each element, and confirms that every object produced the result belonging to its own class.
- 6
Why is a test made through a base-class reference important?
Model answer
The finished application will often hold subclass objects in base-type variables, so testing that way proves the correct version is chosen while the program runs.
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.