Stage 3b: Testing a system
How a system is tested: unit testing with normal, extreme and abnormal data, then integration testing.
Key words (15)
systems testing, unit testing, integration testing, module, test plan, test number, normal data, extreme data, abnormal data, live data, expected outcome, actual outcome, remedial action, test strategy, function testing
Lesson Objectives
Why is testing needed?
The system must be tested before it is implemented (installed and used). Testing:
- Finds errors before real data is put at risk.
- Makes sure that the system does what the requirements say it should do.
- Is much cheaper and quicker than correcting faults after the system is in use.
Test strategies
A test strategy is the overall plan for what will be tested and in what order. The system is tested at three levels:
- Each module - each part of the system is tested on its own (unit testing).
- Each function - each task that the system carries out, for example a calculation, a search or a sort, is tested to make sure that it gives the correct result.
- The whole system - all the parts are tested working together (integration testing).
Testing individual modules of the system

- Testing individual parts (modules) of the system is also known as unit testing.
- Any errors found will be corrected by the person who created the module (a programmer for example).
- The module that failed the first test will then be re-tested to make sure that the error has been fixed.

- When each module (part) of the system has been created, it must be tested to make sure that it works correctly.
Examples of modules that should be tested:
- Data / File structures - do tables hold data correctly?
- Validation rules - does the system reject unreasonable / incorrect data?
- Input screens - do form controls allow users to enter data correctly? Is input data in the correct format (correct currency or date formats for example)?
- Output screens - are output results correct, clear and complete?


1. Testing the data/file structure

- Data or file structures are the database tables that are needed to store system data.
- Tables are made up of field names, data types and properties (length, format etc.).
- Test data must be entered into each field to make sure that the data can be stored.

2. Testing system validation rules
- Validation rules coded into the system need to be tested to make sure that data entered is reasonable or acceptable.
- Each rule must be tested to make sure that it works and blocks data entry errors.
3. Testing system inputs

- Data can be entered into the system in a variety of different ways - text box, drop-down list, option button, check box etc.
- Each one must be tested to make sure that the data is captured correctly.
- If data requires special formatting, this must also be tested. For example - is a date being captured as dd/mm/yyyy? Are currency values correct?

4. Testing system output formats

- Outputs could be in the form of a variety of reports that show specific system data.
Reports must be tested to check the following:
- Does the report display the correct information?
- Is the information complete?
- Do outputs include company data like name, logo, contact details etc.?

Testing individual modules of the system (images)


Using a test plan

- Testing a system involves creating and using a test plan. A test plan will test that every system module works.
A good test plan will include:
- The test number
- The test data to be used in the test
- The type of test - normal / extreme / abnormal
- The expected outcome of the test
- The actual outcome of the test should be logged (data accepted / rejected).
- Remedial action - what needs to be done to rectify the problem (if there is one)

Testing with normal, extreme and abnormal data
A test plan should always use four types of testing data:
- Normal data
- Extreme data
- Abnormal data
- Live data
Scenario:
Imagine we were testing a system module (text box) to make sure that it will only accept entries of numbers between 1 and 5.
The test data would look similar to the example in the table below.
Test data to accept numbers between 1 and 5
| Type of test data | Description | Example |
|---|---|---|
| Normal data | Data which should be accepted and pass the test without any problems. (In our example, this was any number between 1 and 5). | The numbers 1, 2, 3, 4 or 5 should be accepted. |
| Extreme data | Data which is on the border of what the system will accept. | Using the same scenario as above, the numbers 1 and 5 would be used to test the borderline data. |
| Abnormal data | Data that should not be accepted by the system. (In our example, this is any data other than 1, 2, 3, 4 or 5). | Examples of data that should be rejected by the system could be 0, 6, Two, Hello, etc. |
An example test plan

- The table below demonstrates an example test plan that could be used to test a system module that will be used to accept the age of a driving test candidate.
- The module should accept ages within the range of 17 - 70. Any other data should be rejected.
- If testing identifies errors with the module, it would be corrected and re-tested.

Testing a module to accept numbers between 17 and 70
| Test number | Data entered | Type of test data | Expected outcome | Actual outcome | Remedial action |
|---|---|---|---|---|---|
| 1 | 20 | Normal | Accept | This section would be filled in by the tester and will log what actually happened as a result of each test. If any of the actual outcomes were different to the expected outcome, the module would have to be corrected and then re-tested. | This section is filled in for any tests that failed. Remedial action describes what needs to be done to fix the error. |
| 2 | 45 | Normal | Accept | ||
| 3 | 59 | Normal | Accept | ||
| 4 | 17 | Extreme | Accept | ||
| 5 | 70 | Extreme | Accept | ||
| 6 | Thirty | Abnormal | Reject (error message) | ||
| 7 | 16 | Abnormal | Reject (error message) | ||
| 8 | 71 | Abnormal | Reject (error message) | ||
| 9 | -10 | Abnormal | Reject (error message) |
Testing the system as a whole (integration testing)

- Once individual parts of the system have been tested and any problems solved, the system will be tested as a whole:
- Testing the system as a whole is known as integration testing.
- Any problems found during whole system testing will be corrected and then re-tested.
- Integration testing uses live data (that the company actually uses) to make sure the system can accept and use it.
- Live data has already been used in the current system, so the correct results are known and can be compared with the results from the new system.

Why test the system as a whole?

- Testing the system as a whole makes sure that all of the individual modules work with each other correctly:
- For example - a data entry form might allow a user to enter their date of birth correctly, but when submitted, this data might not be clearly visible on the report.
- Whole system testing identifies this issue, and the developer will reformat the report so that fonts are clearer.

End of the topic
You've completed the topic: lesson 5 of 8 published in this unit, and already 60% of the way through. Keep it up!
When you are ready, click the Next button below to move on to Stage 4: Implementation.