levo

Testing Strategies

Program and unit testing

  • 3 things to know
  • A2 Unit 1

Overview

Program testing, one weakness of the developer testing their own module and driver in unit testing.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What is a unit test suite, and what is the benefit of automating it?

Key term

What is program testing?

Key term

Who normally carries out unit testing, and when?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is program testing?

    Model answer

    Program testing checks a single program or module on its own, feeding it chosen inputs and confirming that the outputs and the changes it makes to data are exactly those specified for it.

  2. 2

    Who normally carries out unit testing, and when?

    Model answer

    Unit testing is normally carried out by the developer who wrote the module, as soon as it compiles and before the module is released to be combined with anyone else's work.

  3. 3

    State one weakness of the developer testing their own module.

    Model answer

    A developer tests against their own understanding of the requirement, so a module built on a misunderstanding is tested with data that fits the same misunderstanding and passes.

  4. 4

    Why should a unit test check one behaviour at a time rather than several at once?

    Model answer

    A test checking one behaviour names the fault the moment it fails, whereas a test exercising six rules together reports only that something in the module is wrong and leaves the developer to work out which rule broke.

  5. 5

    What is a stub, and why is one needed?

    Model answer

    A stub is a dummy version of a module that has not been written yet, returning a fixed value so that the module being tested can call it and run to completion.

  6. 6

    What is a driver in unit testing?

    Model answer

    A driver is a small program written to call a finished module with test values, standing in for the higher-level code that will eventually invoke the module.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Software and the Development Environment
Defining Data: Types, Variables and Classes
Program Control Structures
Objects, Classes and Data Structures

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A null is the of one.
absencepresencetype

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AA null means no value has been recorded.
BZero and an empty string are values.
CA null is the absence of a value.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

An error is the mistake a person made.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Testing Strategies, 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.