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
Dry runs and trace tables
- 3 things to know
- AS Unit 1
Overview
Dry run and trace table.
What you need to know
Answer each one before you reveal it.
What is a dry run?
What is a trace table?
Questions from this subtopic
Each one with the model answer underneath.
- 1
What is a dry run?
Model answer
A dry run is working through the statements of a program by hand, keeping track of every variable, to establish what the code actually does rather than what it was meant to do.
- 2
What is a trace table?
Model answer
A trace table is a table with a column for each variable and a row for each step, filled in by hand as the code is followed so the changing values can be read off.
- 3
When is a dry run more useful than running the program?
Model answer
A dry run helps before the code will even compile, and when the fault lies in the logic, because every intermediate value becomes visible instead of only the final output.
- 4
Trace int t = 0; for (int i = 1; i <= 4; i++) { t = t + i; } and state the final value of t.
Model answer
The total rises to 1, then 3, then 6, then 10 as i takes the values 1, 2, 3 and 4, so t finishes holding 10.
- 5
Trace int n = 27; int c = 0; while (n > 1) { n = n / 2; c++; } using integer division, and state the final value of c.
Model answer
The value of n becomes 13, then 6, then 3, then 1, which takes four passes, so c finishes holding 4.
- 6
A loop written for (int i = 0; i <= 3; i++) is meant to process three array elements with indices 0, 1 and 2. What does a trace show?
Model answer
The trace shows i taking the values 0, 1, 2 and then 3, so a fourth pass occurs and uses index 3, which lies one place past the end of the array.
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.