成人快手

Developing test plans and testing a solution - CCEATesting

Once software has been created, it must be tested under different conditions to make sure it works. This can be achieved with white box, black box, unit, integration and system testing, as well as thorough planning and evaluation.

Part of Digital Technology (CCEA)Digital development concepts (programming)

Testing

Black box testing

Black box testing is designed to test the functionality of software. For example:

  • Does the program accept a number and return the square of the number?
  • Does the program accept a Celsius value and return the Fahrenheit equivalent?
Illustration of the differences between black box testing and white box testing

White box testing

White box testing is a method of testing software focusing on the internal structures or workings of an application, as opposed to just its functionality (which testing can achieve).

testing will focus on the structure of the code and will test every possible path through the code.

In the case of the example program converting Celsius to Fahrenheit, would ensure the individual functions (add, sub, mul and div) work as expected.

Unit testing

A unit should be viewed as the smallest testable part of an application. As each new part of the system is completed, it is tested to make sure it works properly 鈥 if not, then other parts of the system that rely on it could fail.

In procedural programming, a unit could be a function 鈥 for example, the addition function in the code above.

In , a unit could be an .

are completed on short 'snippets' of code. Unit tests are typically written and run by programmers to make sure that code meets its design and behaves as planned.

Integration testing

Integration testing takes modules that have been unit tested, groups them in larger sets of code and provides an integrated system (a system with modules working together) ready for .

For example, would be carried out on the code below to determine if the add, mul and div functions can work together:

1	def tempCon(x):
2		return add(mul(x, div(9, 5)), 32)

Line 1 defines the function tempCon. A single value can be passed to this function.

Line 2 calls the divide function, passes the result to the multiply function, which in turn passes the result to the add function to be added to the value 32.

System testing

The purpose of a system test is to ensure that all the individually developed units of software work together as intended.

A benefit of is that it helps you discover problems or inconsistencies between the programmed modules, libraries and functions intended to work together.

For example, once all the functionality of the calculator has been completed, it would be tested as an entire system.

Illustration of the differences between unit testing, integration testing and system testing