But even when I try and test I don't hit 1 bug per 2000 lines of code. For example, I wrote a collapsing futures library for obj-c [1]. It only has about 1000 lines of non-test non-header code. The code is tested, I've used it in projects, and I re-read it now and then trying to come up with ways to break it. Is it reasonable for me to lay 50:50 odds on a bug being present? I don't think so.
(Are you the owner of the github repo statsd.net [2]? `someGraphiteLine.Equals(null)` returns false but `someGraphiteLine.Equals((GraphiteLine)null)` throws an exception.)
1: https://github.com/Strilanc/ObjC-CollapsingFutures 2: https://github.com/lukevenediger/statsd.net
These numbers compare unfavorably with the cost of software contracts, the typical pay of software developers, and the amount of time that a line of code gets to spend with its developer[2].
[1] Amy Bach, _Ordinary Injustice: How America Holds Court_ [2] Steve McConnell, _Software Estimation_
Errors certainly happen, but they're almost certain not to be dominated by errors of simple oversight, which explain the vast majority of bugs.