We will talk about:
Testing concepts
Building test cases and Makefile
What test cases should there be for Bigint
's addition function?
Refresher from lecture (lecture slides for reference)
There are three steps in a test:
Set up the "fixture", the system to be tested
Perform the test
Verify the resultes, make sure there are no unwanted side effects
{
// Setup fixture
Bigint left(9);
Bigint right(5);
Bigint result;
// Test
result = left + right;
// Verify
assert(left == 9);
assert(right == 5);
assert(result == 14);
}
Update your shared/ folder in svn.
It is assumed that your provided material working copy is named shared and that it is in your home directory. If not, adjust accordingly.
cd # Go to your home directory
cd shared # Go into your shared working copy
svn update
You will get messages about files being added and updated.
As a part of your lab assignment, you must complete a quiz in Canvas. This quiz will cover what you learned in the previous lab about Subversion.
You have the entire lab to complete the quiz. You may not complete this quiz outside of your lab.
Create tests for the following operators in Bigint. Remember we build tests cases first, then implement the code.
+
- addition
*
- multiplication
Tests need to use assert
and the ==
operator
Tests must cover all situations for add and multiply.
Take advantage of techniques discussed in lecture and lab to construct the test cases.
What are the inputs? What are the outputs? What are the equivalence classes? What are the boundary values?
Remember that the best test case has a high potential for uncovering a failure.
The following must be true when you are done, NAMES MUST MATCH EXACTLY:
In your cs23001 directory you have created a directory named bigint.
In the directory bigint you have the following files:
test_add.cpp
test_multiply.cpp
The test files do NOT need to run or compile at this time as you do not have the add or multiple implemented. They should have a good comprehensive set of tests, this should help you implement the methods.
There are NO executables in the repository.
Your programs compile, run, and perform as specified using the Makefile.
Your programs follow the General Program Requirements.
Use the browser one more time to verify that your work has been committed.
http://svn.cs.kent.edu/courses/cs23001/svn/USERNAME
You can click on the above link then replace "USERNAME" in the browser's location box with your information.
Upon completion of this assignment it will be assumed you are comfortable with the skills used in this assignment.
Do not hesitate to ask your instructor if you have questions or problems.