Learning Outcomes
Students should be able to:
• Explain the following iterative approaches to testing:
– White Box;
– Black box;
– System;
– Unit; and
– Integration testing.
• Create and use a test plan that identifies test procedures for use during and after development to check a system against success criteria
• Devise and use the following types of test data:
– Valid;
– Invalid;
and – Extreme.
Is a technique used to study the structure or logic of a program. White box testing tests beyond the user interface and into the code of the program. The tester chooses inputs to exercise paths through the code and decides on appropriate outputs. This involves going through the code on a line by line basis and checking it performs as it should.
Advantages
√ Can be started at an earlier stage.
√ No need to wait for the GUI to be created.
√ More thorough – covering most paths.
Disadvantages
x Testing can be complex, highly skilled resources are required.
x Thorough knowledge of programming and implementation is required.
x Test script maintenance can be a problem if implementation changes too frequently.
x Tools for every kind of implementation/platform may not be readily available.
Black box testing tests the software without the user knowing the internal structure of the code or program. Suitable inputs are selected based upon the interfaces of the system. For example testing the navigation structure of a website that each link selected will take the user to the expected page. This involves getting a user to use the software and checking the overall functionality of the system.
Advantages
√ Tests are completed from an end user's point of view and will expose any discrepancies from the actual specification.
√ The tester does not need to know any programming languages or how the software has been created.
√ Tests are completed by independent companies separate from the developers, this allows for an objective perspective.
√ Tests can be completed as soon as specifications are completed.
Disadvantages
x Only a small number of possible input tests can actually be completed leaving many paths untested.
x Tests are difficult to design if there are not clear specifications.
x If the designer/developer has already run a case independent tests can be redundant.
x Can only be performed after the system has been developed.
System testing makes sure the system works as described in the specification, the solution is tested against each of the requirements to ensure it performs the necessary tasks. This is done by using a test plan to test each individual system function, to test with extreme or invalid data and to test that the whole system produces the correct results for the input data.
Advantages
√ It simulates actual system usage.
√ It does not make any system structure assumptions.
Disadvantages
x It can miss logical errors.
x There is a high possibility of redundant testing.
Unit testing is basically testing each part/unit/ component of the software. A unit is the smallest testable part of any software. It will usually have a single input and a single output. Unit testing is normally performed by the software developers and is the first level of testing.
Advantages:
√ Unit testing increases confidence when needing to change pieces of code.
√ Development is faster as errors can be detected more easily.
√ Debugging is easier – when a test fails the only part that needs debugged are the latest changes.
Disadvantages:
x Very time consuming.
x Does not show absence of errors.
x Hard to create realistic, useful tests.
This is where individual components are combined and tested as a group. Its purpose is to find faults with how the components interact with each other. It is used to find defects in the interface and different parts of the system such as the operating system, file system and hardware.
A test plan is the basis for formally testing any software; it is a document stating the scope of the testing, the approach being used, the resources needed to complete the testing and a list/schedule of the tests to be completed.
Testing is used to ensure that the system works as it is supposed to. Before a system can be tested it is important to decide what tests need to be completed. It is not always possible to test every single component, so developers will choose from different ranges of data.
Valid
This is the most obvious data that should work – valid data confirms that the software works as expected. Invalid This is data that you know should not work.
Extreme
This data can be either valid or invalid; it tests the limits of the software.
Valid extreme data tests the highest and lowest data that should be allowed. Invalid extreme data tests that is at the edge of failure or nearly acceptable. For example, if you were developing a numberguessing game, you might have a unit of code that asks the user to choose a number in a specific range, e.g. “Choose a number between 1 and 10”. To test this unit, you could try a whole range of inputs to see what happens: 0, 1, 3, 4.5, 10, 11,, –99, 10.00001
Keywords
Possible Exam Questions
1. Describe the difference between Black Box and White Box testing explaining when each would be used. (3)
2. Why is it important to test a system against the user requirements? (2)
3. Describe integration testing. (3)
4. Give an advantage and disadvantage of unit testing. (2)
5. A variable called age has been validated using a range check to make sure the system only accepts people between the ages of 21 and 60. Explain the testing data you would need to ensure this range check is working accurately.(6)
Valid
Invalid
Extreme