This excerp was taken from the book "Code Complete" by Steve McConnel, which was quoted as well in this blogs. Quoted:
(a) Industry Average: "about 15 - 50 errors per 1000 lines of delivered
code." He further says this is usually representative of code that has some
level of structured programming behind it, but probably includes a mix of coding
techniques.
(b) Microsoft Applications: "about 10 - 20 defects per 1000 lines of code
during in-house testing, and 0.5 defect per KLOC (KLOC IS CALLED AS 1000 lines
of code) in released product (Moore 1992)." He attributes this to a combination
of code-reading techniques and independent testing (discussed further in another
chapter of his book).
(c) "Harlan Mills pioneered 'cleanroom development', a technique that has
been able to achieve rates as low as 3 defects per 1000 lines of code during
in-house testing and 0.1 defect per 1000 lines of code in released product (Cobb
and Mills 1990). A few projects - for example, the space-shuttle software - have
achieved a level of 0 defects in 500,000 lines of code using a system of format
development methods, peer reviews, and statistical testing."