SQ-I (INFO2180) Fall 2012
Development and Unit Testing
In this assignment, you and your partner (maximum 2 people) take the sample Assignment-3
code and complete the implementation and more importantly unit test the library of functions.
Besides handing in the modified / completed code as part of this assignment, you will also be
producing (and handing in) a Test Plan document and Test Report document.
Sample Assignment-3 Code Background
This project is made up of 3 C# classes.
Two of the classes are part of a namespace called Functions.
The classes in this namespace have been setup to compile into a supporting library
These classes (called StringBreakout and Factorial) are only made of class methods
o The StringBreakout class contains a number of methods to count the number of
digit characters, alphabetic characters and non-digit/non-alphabetic characters
found within a string
o You will also need to develop another method for the StringBreakout class
o The Factorial class contains a single recursive class method to determine the
factorial of a value
Keep in mind that the code developed in these classes is a starting point and you’ll need
to look at the code to read the “QUESTIONS” and “TASKS TO DO” comments that are
left there for you and your partner
The other class (called FunctionTest) only contains a main() function
This serves as a classic standalone test harness (as described in class)
Again, you will have to read the comments in this source to determine what else / other
tasks need to be completed.
Due Date : November 20, 2012 (by 11:59pm) Page 1
SQ-I (INFO2180) Fall 2012
What You’ll Need to Do
It may not be apparent to you at the outset, while you are using the classic standalone test-
harness to do your unit testing (Note: that this is one of the issues / problems with unit testing
using such a test-harness), but there is a logic flaw in the StringBreakout class.
You will need to better design / modify the StringBreakout methods to perform the
You will need to develop the FindAndExtractDigits() method as part of the
Use what you learned in the Unit Testing Lesson to implement such a test suite for the
methods in the Functions namespace. Use Visual Studio to setup, configure and
execute this test suite
o I expect that there will be on 5 unit test cases per method in the Functions
namespace. Your unit tests
Can test the normal functionality of the method
e.g. factorial(5) = 120
Can test boundary conditions of the method (if applicable)
Can test exception conditions of the method (if possible)
It is up to you to determine if a method can and does have a boundary
test that could be executed – if so I expect to see one (in your 5 unit test
It is up to you to determine if a method can and does have an exception
test that could be executed – if so, I expect to see one (in your 5 unit
o I expect that your Unit test case methods will have header comments containing
Unit Test Description (as defined in the Lesson). As well, please place these unit
test descriptions in Word document format and submit with your completed code
I’d like you to name your unit tests (as setup with Visual Studio) according to the Test
Identifier used in the Unit Test Description
Use Visual Studio to set up and automatically run through all Unit Tests and generate a
What to Submit
Your submission for this assignment should contain
Modified Assignment-3 source code
Word (or DOxygen) document containing your Unit Test Descriptions – note in real
projects, this document would form the foundation of your Test Specification and your
Also include a Test Report from Visual Studio showing the results of all of your tests.
Place all of this information in one ZIP file (please make sure that both team member’s
names are in the ZIP filename)
Please submit your ZIP file to the appropriate Angel Dropbox by the due date – remember to
also include the names of the 2 team members in your source comments.
Due Date : November 20, 2012 (by 11:59pm) Page 2