Unit Test Rept
Unit Test Rept
Unit Test Rept
1. Introduction
In this document, we give the test plan and test results for unit testing of some of the key
modules of the Personal Investment Management System (PIMS).
2.1 Selection of units: We selected only the most important functional and critical classes
for formal unit testing. In the test environment we used, a unit for unit testing is a class.
Here we illustrate the testing methodology by discussing only two classes.
2.2 Test Scripts: As we used Junit for unit testing. The test scripts were java programs
and each test case corresponded to a method in these java programs.
2.3 Fixing of Defects: The programmer fixed the defects found. Unit testing was
successfully complete only if the script executed without any defects.
2.4 Test Script Enhancement: As testing proceeded, some new test cases were added.
This was done by adding new test methods to the testing program.
4. Tests Performed
We unit tested the methods of following two classes: (a) Alerts, and (b) Investment
1
zero
Create a new alert, with a Retrieve the first alert. Its Test passed.
particular date and date and description should
particular description. match with the date and
description with which we
created the alert.
Delete the first alert. Number of alerts should be Test passed.
zero.
Create two new alerts, one Number of alerts should be Test passed.
with a past date and other two.
with a future date.
Retrieve for pending alerts. Number of alerts returned Test passed.
should be one.
Delete alert number 0 Number of alerts should be Test passed.
twice. zero.
(b) Testing the methods of class Investment for correct manipulation of portfolios and
securities
2
Delete PF2 Check that PF2 does not Test Passed
exist.
5. Results:
When the script written (which is in fact a Java file) and compiled and run, it gives us
the number of tests actually executed, and also in how many of them expected results
were obtained, in how many expected results were not obtained, and how many tests
could not go to completion.