Index of /~billard/se/cs4320/ex9
Name Last modified Size Description
Parent Directory 20-Apr-2008 08:49 -
btree 19-May-2009 09:03 26k
btree.c 19-May-2009 09:03 13k
btree.dat 19-May-2009 09:03 1k
print.bat 19-May-2009 09:03 1k
CS 4320 Software Testing and QA: Ex9 COVERAGE ANALYZER
======================================================
Platform: UNIX
Given: source code
Goal: Write an automated test script to improve code coverage.
In Ex4, you used White Box Test to achieve Path Coverage.
Given the source code, you designed specific Test Cases.
In this exercise, you will not use a formal method for
testing, you will just exercise the software with various
inputs until a tool tells you that you've touched 90%
of the lines of code.
a. Introduction
Examine the sources to a B-Tree program:
% more btree.c
Compile the program to include coverage metrics:
% gcc -fprofile-arcs -ftest-coverage -o btree btree.c
Examine an automated test input:
% more btree.dat
Run the program using the automated test input:
% btree btree.dat
Check the code coverage of the individual functions and the source overall
the gcov tool:
% gcov -f btree.c
b. Exercise
Expand btree.dat to use more i(nsert x; d(elete x; p(rint;
to increase the code coverage to over 90%
Make one final run to capture printouts:
% btree btree.dat >btree.out
% gcov -f btree.c >gcov.out
c. project notebook (see print.bat):
README
btree.dat
btree.out
gcov.out