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 constructors and object state
- 3 things to know
- AS Unit 1
Overview
Object's state and tested about an attribute the constructor never assigns.
What you need to know
Answer each one before you reveal it.
Why should a test check that two objects of the same class do not share data?
Why is a constructor tested separately from the other methods?
Questions from this subtopic
Each one with the model answer underneath.
- 1
Why is a constructor tested separately from the other methods?
Model answer
A constructor settles the state every object begins in, so a fault there makes every later test unreliable and leaves every object wrong from the moment it exists.
- 2
How is a constructor tested?
Model answer
An object is created with known arguments and every attribute is read back through the class's accessors to confirm that each was stored correctly.
- 3
How is a constructor that rejects invalid arguments tested?
Model answer
The test supplies an unacceptable value and confirms that either no object is created or the fault is reported, so no object can exist holding that value.
- 4
How are overloaded constructors tested?
Model answer
Each version is tested in its own right, because each takes a different set of arguments and each contains its own code for filling in the attributes it was not given.
- 5
A one-argument Rectangle constructor is meant to build a square from a single side. What does the test check?
Model answer
The test creates the object with one value and confirms that reading the width and reading the height both give that same value.
- 6
What is meant by an object's state?
Model answer
An object's state is the set of values its attributes hold at a given moment, and the state is what distinguishes one object of a class from another.
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.