SerTi

Susanna Blomqvist
Antti Korhonen
Heikki Mylläri
Pekka Pakari

Testing Plan 0.2
							15.05.2003

University of Jyväskylä
Department of Mathematical Information Technology

Authors:	Susanna Blomqvist (SBl), Antti Korhonen (AKo), Heikki Mylläri (HMy), Pekka Pakari (PPa)
Title:	Testing plan for the SerTi Project
Abstract:	The SerTi project designs and develops the SerialTester software for Stresstech Ltd. This testing plan describes the testing cases for the software.
Version history:

Table of Contents

1.	Introduction
2.	Terms, Acronyms and Abbreviations
3.	Testing Environment
4.	Notation of a Test Case
5.	Test Cases
5.1.	The Most Common Use Cases
5.2.	Log and Commands
5.3.	Parameter Dialog
5.4.	Communication Port
5.5.	Motor Controls
5.6.	Polling
6.	Reporting
7.	Conclusion

 
1.	Introduction

SerTi is a student software project that will be carried out in the University of Jyväskylä during spring 2003, under the supervision of the Department of Mathematical Information Technology. The project will design and develop to Stresstech Ltd. a software called SerialTester. It is a Windows-based application suitable for testing and monitoring equipment controlled via RS-232 bus.

The document describes the testing cases for the SerialTester software. In chapter 2 are explained some terms, acronyms and abbreviations that are used in this document. Chapter 3 describes the testing environment and chapter 4 the notation used in the test cases. Chapter 5 contains the test cases and chapter 6 tells how the tests should be reported.

The document’s test cases are based on the requirements and use cases of the software which are presented in the Requirement Spesification document. After the test cases have been performed, project group writes a Testing Report document that contains information about the test cases.
2.	
Terms, Acronyms and Abbreviations

The following terms are used in the document:

SL	(StressLogic) is a motor driver and an I/O board manufactured by StressTech Oy.	
ST	(SerialTester) is the testing/monitoring software for StressLogic that will be developed by the SerTi project.	
RS-232	is a PC serial communication standard.	
I/O	is the abbreviation for Input/Output.	
Spy cable	is a special 3 headed cable used to monitor RS232 communication between two systems. Third end is connected to the PC that logs the traffic between the monitored systems.	
GUI	is the abbreviation for graphical user interface.	
View/Model	is a design paradigm where model (the core of the software) is separated from view (GUI). In other words, no part of the actual software functionality resides within the GUI classes.	
STL	(Standard Template Library) is a C++ library that provides a set of easily composable C++ container classes and generic algorithms (template functions).	
MFC	(Microsoft Foundation Class) is Microsoft’s class library for Windows based software.	
3.	
Testing Environment

All tests described in the document will be carried out with the computers in the project group’s room. The operating system is Windows 2000, processors varies from Celeron 700MHz to AMD Athlon XP 1600+ with 256 MB RAM memory. Hard drives and graphic adapters have sufficiently memory.

The other equpments that project group has are XY-table, remote controller and StressLogic, which is connected with serial cable to the computer. In addition to SerialTester.exe, files that are needed are commands.ini, mfc42.dll, msvcp60d.dll and msvcrt.dll.

4.	Notation of a Test Case

The next table describes the notation of a test case:

CASE 1.1.1 The name of the case.	
Precondition:	The status of the program before performing the test case and all the things that must be done before starting to perform the test case are described in this cell.	
Description:	The list of the steps that the tester has to perform is described here.	
Post condition:	The presumed status of the program after the test case is carried out.	
Remarks:	These things the tester should notice while performing the test case.	

5.	
Test Cases

The chapter describes the test cases. First there are tests for the most common use cases, next subchapter contains tests for Log view and Commands ‘terminal’. There are also test cases for changing and saving motor parameters and communication settings, motor contrlos and for reading status’ automatically (polling).

5.1.	The Most Common Use Cases

CASE 1.1 Initialization	
Precondition:	Target system is powered and operational. SerialTester is running.	
Description:	1.	Select Connect from the Connection menu.
2.	Select Initialize SL from the Connection menu or send command IN from the Commands view.	
Post condition:	Target system is initialized. Initialization command response are shown in the Log view.	
Remarks:		

CASE 1.2 Set and send configuration	
Precondition:	Target system is powered, operational and initialized. SerialTester is running.	
Description:	1.	Select the Param button for desired motor or from Setup menu Parameters/Motor…
2.	Give new values or edit existing values on each field and select Send.	
Post condition:	New parameters are sent to the target system.	
Remarks:	Sent parameters and the response should also appear in the Log view.	

CASE 1.3 Retrieving status	
Precondition:	The target system is powered, operational and initialized. SerialTester is running.	
Description:	1.	Press the Read button for the desired motor.
2.	Press the Read button for the I/Os.	
Post condition:	The program has read the status of the motor and the system’s I/Os.	
Remarks:		

CASE 1.4 Running motors	
Precondition:	The target system is powered, operational and initialized. SerialTester is running. The motor parameters are set and sent.	
Description:	1.	Set the Target value for a motor.
2.	Press button Cal or Start for the motor.	
Post condition:	The motor has been run toward the given target position and stopped when the position or a limit reached.	
Remarks:		

5.2.	Log and Commands

CASE 2.1 Saving Log	
Precondition:	Target system is powered, operational and initialized. SerialTester is running.	
Description:	1.	Press the Save button below Log.
2.	Choose the file in Save File dialog. 
3.	Press the Save button in Save File dialog.	
Post condition:	The file is created and there is all information from the Log. 	
Remarks:	Perform the test with different amounts of text in Log (including when it’s empty).	

CASE 2.2 Saving command file.	
Precondition:	Target system is powered, operational and initialized. SerialTester is running.	
Description:	1.	Press Save button below Commands.
2.	Choose file name in which to save the information.	
Post condition:	Commands are saved in file and there is all information from the Commands field.	
Remarks:	Perform the test with different amounts of text in Commands (including when it’s empty).	

CASE 2.3 Running command file. 	
Precondition:	Target system is powered, operational and initialized. Serial tester is running and communication port is opened. Command file exists.	
Description:	1.	Press Load button below Commands.
2.	Choose the file name to be opened. 
3.	Manually send commands by pressing Enter with the cursor pointing the command you want to send. 
4.	Press Run all button to run all commands in Commands. 	
Post condition:	Commands are sent to the system and are written to the Log. 	
Remarks:		

CASE 2.4 Sending commands consecutively.	
Precondition:	Target system is powered, operational and initialized. The program has been started and communication port is open.	
Description:	1.	Write a command to Commands.
2.	Press enter in Commands cursor pointing the command you wrote so that commands are sent consecutively.	
Post condition:	The commands are sent consecutively and the system has answered all of them. 	
Remarks:		

CASE 2.5 Copying/Pasting from/to Commands field	
Precondition:	The program has been started.	
Description:	1.	Copy some text.
2.	Paste to command field.
3.	Select some text from the Commands field.
4.	Copy it to the clipboard.
5.	Paste the clipboard contents to somewhere else.	
Post condition:	Text is pasted to Commands. Text copied from the Commands field is copied and pasted.	
Remarks:		

CASE 2.6 Copy from Log screen	
Precondition:	Target system is powered, operational and initialized. The program has been started and communication port is open.	
Description:	1.	Highlight text from Log screen. 
2.	Press Ctrl + c or click the right button of the mouses and choose copy.	
Post condition:	Text is copied to the clipboard.	
Remarks:		

CASE 2.7 Setting mark	
Precondition:	The program has been started and communication port is open. Some text is already in Log. 	
Description:	1.	Push Mark button below Log view.	
Post condition:	Last line of Log says -------- MARK n -------- where n is running number of marks. 	
Remarks:		

CASE 2.8 All messages sent and received are going to Log when the port is open.	
Precondition:	The program has been started.	
Description:	1.	Open communication port by choosing Connect from the Connection menu.
2.	Use SerialTester normally, send text from Commands and use also some buttons.	
Post condition:	All messages sent and received can be seen in the Log view. 	
Remarks:	All commands and buttons must be tested and used also ‘illeagal’ values.	

CASE 2.9 All messages sent and received shouldn’t go to the Log when the port is closed.	
Precondition:	The program has been started. The communication port is closed.	
Description:	1.	Use SerialTester normally, send text from Commands and use also some buttons. 	
Post condition:	No text should be written to Log. Communication port is closed.	
Remarks:	See case 2.8.	

CASE 2.10 Rotating Log buffer.	
Precondition:	Target system is powered, operational and initialized. The program has been started and the communication port is open.	
Description:	1.	Select Preferences…from the Setup menu.
2.	Choose a small Log buffer size and select OK.
3.	Send to the Log more text than the chosen buffer size.	
Post condition:	All text is sent to the Log, but after the limit is reached the old lines will disappear.	
Remarks:		

CASE 2.11 Choosing earlier sent commands.	
Precondition:	Target system is powered, operational and initialized. The program has been started and communication port is open.	
Description:	1.	Send several commands to the SL.
2.	Select an earlier sent command from the Commands and push Enter or Send button.	
Post condition:	All commands can be seen in the Log.	
Remarks:	Earlier sent command won’t appear again to the Commands.	

5.3.	Parameter Dialog

CASE 3.1 Changing and sending the parameter values.	
Precondition:	The program has been started, communication port is open and StressLogic has been initialized.	
Description:	1.	Select the Param button for the desired motor or from Setup menu Parameters/Motor…
2.	Give new values to each field and select Send.	
Post condition:	SerialTester sends parameters and does not check the validity of the values.	
Remarks:	Perform test with irrational parameters. Parameters are written to the Log.	

CASE 3.2 Saving parameters.	
Precondition:	The program has been started.	
Description:	1.	Select the Param button for desired motor or from Setup menu Parameters/Motor…
2.	Select Save button which will open the saving dialog. Give a name for the file and select Save.	
Post condition:	All parameters are written in the file.	
Remarks:	This command saves parameters for all motors.	

CASE 3.3 Loading parameters.	
Precondition:	The program has been started.	
Description:	1.	Select the Param button for desired motor or from Setup menu Parameters/Motor…
2.	Select Load. Choose the desired file and select Open.	
Post condition:	The parameters in the chosen file are in the fields of the dialog.	
Remarks:		

CASE 3.4 Running motors if motor parameters have not been sent.	
Precondition:	Target system is powered, operational and initialized. The program has been started and communication port is open.	
Description:	1.	Press any motor control button.	
Post condition:	Motor parameter dialog will appear.	
Remarks:		

5.4.	Communication Port

CASE 4.1 Changing the port settings when the port is closed.	
Precondition:	The program has been started and communication port is close.	
Description:	1.	Select Connection Settings… from the Connection menu.
2.	Change port settings in the dialog.
3.	Press the OK button.	
Post condition:	Port settings are changed without restarting.	
Remarks:		

CASE 4.2 Changing the port settings when the port is open.	
Precondition:	The program has been started and the communication port is open.	
Description:	1.	Select Disconnect from the Connection menu.
2.	Select Connection Settings… from the Connection menu.
3.	Change port settings in the dialog.
4.	Press OK button. 	
Post condition:	Port settings are changed without restarting.	
Remarks:	Port settings can’t be changed when the connection is open.	

CASE 4.3 Storing port settings for the next use.	
Precondition:	The program has been started and the communication port is open.	
Description:	1.	Change the port settings like described in the case 4.2.
2.	Select Disconnect from the Connection menu.
3.	Close the program.	
Post condition:	When you next time start the program, the last given settings are shown in the Port Settings.	
Remarks:	You should also check the file comm.cfg where the settings are saved.	

CASE 4.4 Opening the communication port when port is already open.	
Precondition:	The program has been started and the communication port is open.	
Description:	1.	Select Connect from the Connection menu.	
Post condition:	The port is still open.	
Remarks:	The status bar tells that the port is already open.	

5.5.	Motor Controls

CASE 5.1 Running motors with Start button. 	
Precondition:	The program has been started and communication port is open. StressLogic is initialized and the motor power is on. User has sent the motor parameters.	
Description:	1.	Set Target.
2.	Press Start button.	
Post condition:	Motor will be run to the target position. Then it stops automatically.	
Remarks:	If the motor reaches the negative or the positive limit it will stop there.	

CASE 5.2 Stopping the motors with Stop button.	
Precondition:	The program has been started and the communication port is open. StressLogic is initialized and the motor power is on. User has sent the motor parameters. The motor is running.	
Description:	1. Press Stop button.	
Post condition:	The motor is stopped.	
Remarks:	Test all motors.	

CASE 5.3 Running the motors with the control buttons.	
Precondition:	The program has been started and the communication port is open. StressLogic is initialized and the motor power is on. User has sent the motor parameters.	
Description:	1.	Press down the button ‘<’ or ‘>’ for the desired motor.
2.	Release the button.	
Post condition:	The motor was run to the selected direction as long as the button was pushed down or the limit was reached.	
Remarks:	Test all motors. See also case 1.4.	

CASE 5.4 Running the motors with the shortcut keys.	
Precondition:	The program has been started and the communication port is open. StressLogic is initialized and the motor power is on. User has sent motor parameters.	
Description:	1.	Push down the shortcut key for the desired motor.
2.	Release the key.	
Post condition:	The motor was run to the selected direction as long as the key was pushed down or the limit was reached.	
Remarks:	Test all motors and other motor driving buttons. See cases 5.3 and 1.4.	

CASE 5.5 Calibrating.	
Precondition:	The program has been started and the communication port is open. StressLogic is initialized and the motor power is on. User has sent the motor parameters.	
Description:	1.	Give a non-zero Target value for the desired motor.
2.	Select the Cal button for the motor.
3.	Press the Zero button for the motor.
4.	Press the Read button for the motor.	
Post condition:	The motor is run toward the target position and will stop when the limit or the target is reached. Position is set as zero.	
Remarks:		

5.6.	Polling

CASE 6.1 Retrieving the motor status.	
Precondition:	The program has been started and communication port is open. StressLogic is on and initialized.	
Description:	1.	Press the Read button for the desired motor.	
Post condition:	The program has read the status of the motor.	
Remarks:		

CASE 6.2 Retrieving the I/O status of the StressLogic.	
Precondition:	The program has been started and communication port is open. StressLogic is on and initialized.	
Description:	1.	Press the Read button for the inputs and the outputs.	
Post condition:	The program has read the status of the inputs and outputs.	
Remarks:		

CASE 6.3 Autopolling	
Precondition:	The program has been started and communication port is open. StressLogic is on and initialized.	
Description:	1.	Select the AutoStatus from the Setup menu.	
Post condition:	The program will automatically read the status of the motors and the inputs and outputs. All information is written to the Log.	
Remarks:		

CASE 6.4 Setting the autopolling interval.	
Precondition:	The program has been started and communication port is open. StressLogic is on and initialized.	
Description:	1.	Select Preferences… from the Setup menu.
2.	Set the value of Autostatus interval.
3.	Select the OK.	
Post condition:	When Autostatus is on the program will read the status’ with the given interval.	
Remarks:	The interval value must be between 100 and 60 000.	

6.	Reporting

About all tests will be written a Testing Report when they are carried out.The following example describes how the tests are reported. Test cases names may be abbreviated.

Date:	15.5.2003-16.5.2003	
Tester:	Susanna Blomqvist	
	
Test cases:	DATE:	PASS/FAIL:	Remarks:	
	
1. Log and Terminal	
1.1 Saving Log	15.5.2003	PASS		
1.2 Command files	16.5.2003	FAIL	Some notifications.	
				
Remarks:	

7.	Conclusion

SerialTester is a software that is used to test and monitor devices through RS232 line. The software is developed for Stresstech Ltd. This document describes the test cases that project group will  carry out for the software. The testing environment that is used in the test cases is also described.

When implementing test cases and some will be failed, the fault will be fixed and all the test cases will be carried out again. After carrying out tests, project group will write a Testing Report where is listed implemented tests and remarks, see chapter 6.