Index of /~billard/se/cs4320/ex1
Name Last modified Size Description
Parent Directory 20-Apr-2008 08:49 -
comp 19-May-2009 09:03 6k
comp.bat 19-May-2009 09:03 1k
comp.c 19-May-2009 09:03 1k
diff 19-May-2009 09:03 23k
diff.c 19-May-2009 09:03 1k
div 19-May-2009 09:03 23k
div.c 19-May-2009 09:03 2k
exp 19-May-2009 09:03 23k
exp.c 19-May-2009 09:03 1k
factorial 19-May-2009 09:03 23k
factorial.c 19-May-2009 09:03 4k
factorial0.html 19-May-2009 09:03 1k
factorial1.html 19-May-2009 09:03 1k
factorial10.html 19-May-2009 09:03 1k
factorial11.html 19-May-2009 09:03 1k
factorial2.html 19-May-2009 09:03 1k
factorial3.html 19-May-2009 09:03 1k
factorial4.html 19-May-2009 09:03 1k
factorial5.html 19-May-2009 09:03 1k
factorial6.html 19-May-2009 09:03 1k
factorial7.html 19-May-2009 09:03 1k
factorial8.html 19-May-2009 09:03 1k
factorial9.html 19-May-2009 09:03 1k
max 19-May-2009 09:03 23k
max.c 19-May-2009 09:03 2k
mult 19-May-2009 09:03 23k
mult.c 19-May-2009 09:03 1k
n_squared 19-May-2009 09:03 6k
n_squared.c 19-May-2009 09:03 12k
negate 19-May-2009 09:03 6k
negate.c 19-May-2009 09:03 1k
print.bat 19-May-2009 09:03 1k
printdoc.bat 19-May-2009 09:03 1k
sum 19-May-2009 09:03 23k
sum.c 19-May-2009 09:03 2k
CS 4320 Software Testing and QA: Ex1 PROOF OF CORRECTNESS
=========================================================
Platform: Paper Exercise (edit in UNIX or PC)
Given: source code
Goal: Since testing cannot prove the absence of bugs,
prove the code is correct mathematically. This is a difficult task,
probably the most difficult in this course. The idea will be
similar to Proof by Induction. The technique is good for short
segments of code, but does not scale very well. But it is
an interesting mathematical concept and, as computer science
students, this will test your logic skills.
a. Take a run through a proof of factorial. Revisit as necessary.
Best to view in IE (see bold characters in pre-formatted text):
factorial0.html
b. Read factorial for all the details.
% factorial
% more factorial.c
c. Now read a very detailed explanation. Spend time of this.
% n_squared
% more n_squared.c
d. % sum
% more sum.c
e. % div
% more div.c
f. % max
% more max.c
g. % mult
% more mult.c
Edit mult.c and prove that it is correct.
Instead of finishing the entire assignment, you should probably give this to the
instructor for verification to make sure you are on the right path.
h. % exp
% more exp.c
Edit exp.c and prove that it is correct.
i. % diff
% more diff.c
Edit diff.c and prove that it is correct.
j. % negate
% more negate.c
Edit negate.c and prove that it is correct.
k. % comp
% more comp.c
Edit comp.c and prove that it is correct.
j. project notebook (see print.bat):
README
max.c
factorial.c
div.c
sum.c
mult.c
exp.c
diff.c
negate.c
comp.c