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
