GCSE Computing Revision – Types of Testing and Types of Test Data

Testing

  • It is important to test a system in order to check it is robust(unlikely to malfunction)

    The Windows 7 Calculator Accessory displaying a "Cannot Divide by Zero" error message

    Error Messages: You need them to prevent nuclear explosions

  • It is very unlikely that a program will work perfectly the first time it is run
  • Testing tries to ‘break’ the program and reveal the presence of errors
  • If a program isn’t tested errors may be present in the finished product which could:
    A) Ruin the reputation of the company that made it
    B) Kill the customers
    C) Cause some sort of accident
  • There are a few different sorts of testing…

Dry Run Testing

  • This sort of testing is normally done on the algorithm (written as pseudocode or a flowchart) before coding starts
  • The algorithm is stepped through one instruction at a time with example test data
  • A ‘Trace Table’ is used to keep track of the test data
  • This is normally done on a small level as it is hard work and repetitive
  • It is useful because you can spot errors before you even start coding
  • You can look at the trace table and tell exactly what went wrong and where

Black Box Testing

  • Also known as Functional Testing
  • This is carried out from the point-of-view of the user: The tester does not see the code whilst they are doing the testing
  • The test data is carefully chosen to incorporate a wide range of things that may be entered (see the types of test data)
  • A table is usually drawn to compare the expected results for each test to the results that the program actually gave

White Box Testing

  • AKA Structural Testing
  • When the program is tested by trying out every possible path through the code
  • This is much more detailed than Black Box testing as it considers every possible outcome
  • It is normally done by the programmer

Which to Use

  • Black box Testing is the quickest and easiest (in my experience)
  • Dry Run and White Box testing may get you extra marks if you include them in your coursework (the moderator would see you are being thorough)
  • Depending on the type of program, White Box may be more useful than Black Box or vice versa
  • For example, a calculator would be horrible to have to test using White Box but a text-based adventure game would be easier to test with White Box than Black Box
  • I used Black Box for all of my controlled assessments and also Dry Run for one of them but the chances are you’ll have different assignments

Test Data Types

  • There are three types of test data:
  • Normal Data is what the user would normally enter.
    Stuff like 150g of flour for a recipe.
    This should never produce an error. (If it does your program has some serious problems to sort out)
  • Boundary Data is almost wrong data.
    It lies on the edge of what your program is designed to accept.
    If the program asks for a number between 0 and 10 then boundary data would be 0 and 10 (or 1 and 9)
  • Erroneous Data is data that shouldn’t be entered.
    The user may enter it by mistake or a friend may try to break your program for fun
    Any text asking the user for an input should be clear as to what it actually wants
    Ideally you should detect errors when data is entered and ask the user to “Please try again :) “
    If it is not properly dealt with it will probably cause the program to crash

Erroneous Ideas

Here are some ideas to help you think of erroneous data to test your programs:

  • Negative numbers
  • Text instead of numbers
  • Numbers instead of text
  • A mixture of text and numbers
  • Capital letters
  • Lower-case letters
  • Random punctuation or symbols
  • Empty
  • Too long
  • Too short
  • Too high
  • Too low
  • Written in the wrong place
  • Decimals instead of integers
  • Wrong type of data (in general)
  • “Poo” (that’s the word “Poo”, by the way!)
  • Your name
  • Pi to many decimal places
  • Your thoughts on copyright law
About these ads

About Matt

I like writing, filmmaking, programming and gaming, and prefer creating media to consuming it. On the topic of consumption, I'm also a big fan of eating.
This entry was posted in GCSE Computing Revision and tagged , , , , , , , . Bookmark the permalink.

4 Responses to GCSE Computing Revision – Types of Testing and Types of Test Data

  1. Pingback: GCSE Computing Revision – Compression | Matt's blog

  2. Pingback: GCSE Computing Revision – Data Sizes | Matt's blog

  3. Pingback: GCSE Computing Revision – Converting to and from Binary Numbers and Understanding Binary | Matt's blog

  4. Pingback: GCSE Computing Revision – Programming Setup | Matt's blog

Enter comment:

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s