



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Professor: Anderson; Class: Software Engineering Methods and Tools; Subject: Computer Science; University: University of Colorado - Boulder; Term: Fall 2004;
Typology: Assignments
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Software Testing Notebook Worksheet # Automating Testing & Fixing Bugs Due: November 12, 2004
Name:
Lab Time:
Grade: /
On my honor, as a University of Colorado at Boulder student, I
have neither given nor received unauthorized assistance on this work.
Signature:
Automating Testing
This week you will be writing three tcsh-based shell scripts to automate testing. You will then use these scripts to help debug the ezpay program until you get it to pass all of its test cases. Place your shell scripts in your architecture- independent bin directory, and make sure that this directory is in your path.
Setting Up
This week’s focus is not on structural testing, so we will not use a jcoverage- instrumented version of ezpay. To switch back to a version of ezpay that has not been modified by jcoverage, perform the following steps.
Now we need to modify the ezpay shell script that currently sits in your src/ezpay directory so that it can be moved to your architecture-independent bin directory.
set ezpayJars = (ezpay-jcov.jar ezpay.jar)
to look like this:
set ezpayJars = (ezpay.jar)
set ezJars = ($ezJars dist/lib/$jar)
to look like this:
set ezJars = ($ezJars $HOME/csci3308/src/ezpay/dist/lib/$jar)
$HOME/csci3308/bin/ezpay
.
A Script to Run One Test Case
Create a shell script in $HOME/csci3308/bin called run-test that takes as arguments a test set and a test case, and an optional verbose flag, -v. This script might be invoked like this:
run-test ts1 tc run-test -v ts2 tc
If a test case passes, the run-test script should exit with a status code of 0, otherwise it should exit with a status code of 1. In verbose mode, the script should print the test set and test case number, and either test passed, or test failed, like this:
ts1 tc05: test failed ts2 tc13: test passed
integer arguments. It will take those arguments and divide the first by the second, multiply the result by 100, and produce a formatted percentage string. Thus, the invocation
percentage 4 23
produces the string “17.39%”. The behavior of percentage is undefined if anything but integers are passed as its arguments. This script should allow you to produce the summary line for the run-set script with ease.
A Script to Run All Test Sets
Create a shell script called run-all in $HOME/csci3308/bin that calls run-set on all of the test sets for the program (just ts01 and ts02 in our case.) This script can take an optional verbose flag, -v, which it passes to run-set, if present. Be sure to comment your script.
Script Design
You will have to make some choices about how each script works. If you need to change directories, should you do it in run-test, or in run-set before calling run-test? What error checking should you do? Document your design decisions in a README file. Additionally, be sure to document how to use each script. IMPORTANT: These scripts should assume that they are being invoked in the architecture-independent build directory that we used in worksheet 1. You should create a ts02 directory in $HOME/csci3308/build/ezpay/test so that you can run test cases from both test sets in the $HOME/csci3308/build/ezpay directory. Your test sets still live in your ezpay src directory, but they are “executed” in the builddirectory (again, just like we did in worksheet 1). FURTHERMORE: The -v flag for the run-test, run-set, and run-all scripts has nothing to do with ezpay’s -v flag. Your functional and structural test plans determine when ezpay is invoked with its -v flag.
Debugging
Now, you need to debug the ezpay program. Execute run-all -v on the ezpay program; save the results of this test run to a file called pre-debug.txt. Now, modify the ezpay source code to fix bugs. Note: the source code is contained in $HOME/csci3308/src/ezpay/src/ezpay. After each bug fix, recompile the ezpay program (by invoking “ant” in the ezpay src directory) and then run the run-all -v script in the ezpay build directory to see if more test cases pass. You do not need to save the output of these incremental test runs. Keep debugging the program until all of your test cases pass for both test sets. If you can’t get 100% of your test cases from ts and ts02 to pass, then get as close as you can, and explain why it is impossible to achieve 100%. When you have finished debugging, execute run-all -v one last time and save the results to a file called post-debug.txt.
What to Hand In
This worksheet is worth 75 points. You should hand in the following items: