Replying to the entire list this time:

>From McConnell's summary in Code Complete 2nd Edition, p. 521

> Industry average experience is about 1-25 errors per 1000 lines of code
for delivered software. (cites 6 surveys in the literature from 1981 to
2003)

Of course, that's production code that has presumably been through far more
testing and other forms of quality assurance than scientific code.  The 95%
number is just an assumption for an example, not a precise citation.  Greg
may know of a better number for scientific code, but I don't think that's
really the point of the exercise.

On Mon, Nov 24, 2014 at 12:44 PM, Shoaib Sufi <[email protected]>
wrote:

> Hi Aron,
>
> What I mean is where does the assumption of a line of code being 95%
> correct come from.
>
> Thank you for helping me think more clearly about the question I wanted to
> ask.
>
> Best
> Shoaib
>
>
>
> On Mon, Nov 24, 2014 at 5:38 PM, Aron Ahmadia <[email protected]> wrote:
> > It's a function of statistics, assuming each of the lines of code is an
> > independent distribution that is either correct or wrong.
> >
> > Given the input assumption (95% of all source code lines are correct as
> > written the first time), then the code is correct if the individual lines
> > are all correct, which has probability P = 0.95^17.  This is more
> correctly
> > rounded to 42%, but it's in the right ballpark :)
> >
> > On Mon, Nov 24, 2014 at 12:34 PM, Shoaib Sufi <
> [email protected]>
> > wrote:
> >>
> >> Hi,
> >>
> >> At the bottom of:
> >>
> >>
> https://github.com/swcarpentry/bc/blob/gh-pages/novice/r/04-cond-colors-R.Rmd
> >>
> >> It states:
> >>
> >> 'Our final heatmap function is 17 lines long, which means that if
> >> there's a 95% chance of each line being correct, the odds of the whole
> >> function being right are only 41%. Before we go any further, we need
> >> to learn how to test whether our code is doing what we want it to do,
> >> and that will be the subject of the next lesson.'
> >>
> >> Where is the reference for making a statement like that - i.e. %
> >> chance of errors based on function length.
> >>
> >> Thanks
> >> Shoaib Sufi
> >>
> >> _______________________________________________
> >> Discuss mailing list
> >> [email protected]
> >>
> >>
> http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org
> >
> >
>
_______________________________________________
Discuss mailing list
[email protected]
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org

Reply via email to