Problem 6.48
6.48 Mini-case: Progress
Anetha and Bjorn are given a programming challenge. The program must generate 50 random numbers and then find the
median, average, standard deviation, and 90th percentile. Anetha decides to sit and write the entire program quickly and then
debug. Bjorn decides to break the program into 5 parts that he will write and then debug.
Anetha makes fast progress and within an hour has the program written and begins to debug. As expected, there are a few
minor syntax errors when she compiles the program but they are fixed quickly. The first time her program runs completely, the
program output is a mix of numbers and characters. She is not sure if the problem is in the random number generator or the cal-
culations, so she decides to change the random number generator. At 1 hour and 20 minutes her 140-line program was 100%
done but 0% working.
Bjorn took 20 minutes to write the 30-line random number generator. It took him another 15 minutes to debug the program. He
then spent 15 minutes to calculate the average and 10 minutes debugging his 30-line program. In another 20 minutes he had
added and tested 20 lines to calculate the standard deviation. At 1 hour and 20 minutes Bjorn had only written 80 lines of code
that were working.
Anetha continued debugging by changing parts of her program, and saw the numbers begin to look more correct. By 2 hours
her average was near the middle of the range and her standard deviations numbers were around a sixth of the range, both good
signs. However, her median and 90th percentile numbers were clearly wrong.
Bjorn spent 20 minutes writing a number sort routine and 10 minutes debugging the 30 lines of code. In another 10 minutes he
had written and tested the 10 lines of median code. At 2 hours Bjorn had 120 lines of code working. He spent another 10 min-
utes to complete and test the 90th percentile calculation and was complete at 2 hours and 10 minutes.
Anetha continued debugging until 2 hours and 40 minutes, at which point the numbers looked correct, and she declared her
program working.
In total Anetha spent 1 hour and 20 minutes programming, compared to Bjorn who spent 1 hour and 35 minutes. However,
Anetha spent 1 hour and 20 minutes debugging, compared to less than an hour for Bjorn. In simple terms, Bjorn was looking
for 1 problem in a 30-line program while Anetha was looking for 1 line in a 140-line program. Assuming the same number of
errors, the probability of finding the error for Bjorn was roughly 1/30, but for Anetha it was 1/140. Anetha had made more
apparent progress but Bjorn had made more actual progress. Draw timelines for Anetha and Bjorn. How would a WBS differ
between Anetha and Bjorn?
Problem 6.49
Inexperienced designers will often become stuck trying to make the right decision. For example, an engineer
knows that the wrong decision will cost a day of wasted time. The engineer then spends three days looking for the right
solution. Write a simple rule to avoid the trap.
Anetha
BjornProgramming
Debugging