Thursday, December 27, 2007

Test Driven Development and GUI Testing: Temperature Converter details

We will be introducing Test Driven Development concepts applied to GUI testing in this series. Obviously, to do it we need a GUI.
In this case we are using a very simple GUI application which is a variation of the Temperature Converter used in the Java Tutorials: Lesson: Learning Swing with the NetBeans IDE.


The original GUI looks like this. However we are introducing some modifications to the design.
One of the problems is that errors are not reported to the user, and the other, which is perhaps a matter of taste is the use of a label to show the result and no button to close forcing the user to use windows manager's close button.

Use Case: Convert Temperature
Although this example is extremely simple, it doesn't hurt if we apply the same set of techniques we would be applying in a more complex problem.















Actor Action System Response
1. The user enters a temperature in Celsius, and then press Convert
2. The system converts the temperature to Fahrenheit and the result is presented to the user
3. The user wants to enter another temperature and continues from 1 or presses Close to exit.
4. The process finishes.
Alternative Courses
Temperature is below absolute zero
Indicate error
Invalid input characters entered
Indicate error


Next article, shows how to start developing this simple use case using Netbeans IDE 6.0, UML, and Test Driven Development.

No comments: