


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 2003;
Typology: Assignments
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Software Testing Notebook Worksheet # Structural Testing Due: Friday, November 7, 2003
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:
jcoverage
This week you will be using a tool called jcoverage to create a structural test set. A structural test set is complete when it achieves complete coverage of the program’s control flow graph. jcoverage records coverage information for test cases executed by your program under test. To get started using jcoverage, we need to configure your environment. First, you need to add the following directory to your command path:
~csci3308/ant/bin
. Second, you need to add the following lines to your .cshrc file:
setenv JAVA HOME /tools/cs/j2sdk
setenv ANT HOME ~csci3308/ant
Third, you need to add the j2sdk package to the list of packages in your .cshrc file. Fourth, logout and login and verify that your new environment reflects these changes. You should see the two new environment variables and the new direc- tory in your PATH environment variable. The output of the command which javac should be /tools/cs/j2sdk/bin/javac and the output of the command which java should be /tools/cs/j2sdk/bin/java.
ezpay source code
Copy ~csci3308/src/ezpay2.tar to your src directory. This tar file is designed to be unpacked into your existing ezpay directory:
tar xvf ezpay2.tar
Your ezpay directory now contains the following new items:
Take a look at the src directory and examine the source code for ezpay. You can also take a look at the run-tests script. This script can serve as a basis for writing a script to automate your test cases for this week. It is slightly different from the script shown in worksheet 1, due to a requirement imposed by the jcoverage tool (explained in more detail below). Feel free to change the run-tests script as much as you like. IMPORTANT: You can look at the build.xml file and the ezpay script if you want, but please do not change them.
Building the ezpay program
The build.xml script is designed to make it easy to build the ezpay program and to make it easy to generate jcoverage reports. To build ezpay, type the following:
ant
...and that’s it! (If you are curious, ant is a build management system similar to make. The build.xml file contains all of the instructions needed to build ezpay and integrate it with the jcoverage tool.) Note that the build process created a file called jcoverage.ser that keeps track of the lines of code that have been executed by your test cases. You are now ready to generate your first jcoverage report. (Hint: since we haven’t run any test cases yet, our report is not going to have much to show!) Type the following:
ant report
This command has created a report directory. You can view the report by loading report/index.html into a Web browser.
What to Turn in
This worksheet is worth 50 points. You must turn in the following:
tar cvf lastname-ts2.tar report test/ts
Remember to use your own last name in the command above. (10 points).