Ask HN: Can a software ever be 100% bug free? If we have so many great devs, and people constantly working on a piece of software. Why can't they produce 100% bug free software/app? |
Ask HN: Can a software ever be 100% bug free? If we have so many great devs, and people constantly working on a piece of software. Why can't they produce 100% bug free software/app? |
Probably the closest the world has ever come to bug-free code of substance is that produced by NASA for their space shuttles, and it cost ~$1,000 per line. (http://history.nasa.gov/sts1/pages/computer.html) This would make the typical YC app cost tens or hundreds of millions just to launch, and would put something like e.g. the operating system for your cell phone outside of the budget of most nations.
There are a host of other engineering tradeoffs that have to be made, too. In addition to prioritizing cost over bugs, shipping speed over bugs, feature set over bugs, being able to actually hire programmers over bugs [+], etc, are all important.
[+] Many programmers would consider the type of work environment you need to get bugs down to zero to be an oppressive place to work in. Among other things, it will quite literally try to crush any creativity out of you, turning you into an automaton which exactly implements the specs given to you. Those specs were dictated by Really Important People. You're not one. Write your function. Your last function was non-compliant with rule 436 2a subsection b. Improve your performance or we'll find someone who is not a threat to our software quality.
There is research being done on programs that can be proven to be correct and some progress has been made on practical languages. See Idris and Coq.
Moreover, it's very common to use many LaTeX packages that are slightly incompatible, or have to be loaded in a fixed order, or don't handle accented letters, or ...
We have so many layers that software has to run on-top of: You have raw hardware, but a layer above that is the BIOS, and a layer above that is the OS, and a layer above that are the SDKs like .NET/GTK/Ncurses/Shell, and above that you have the layers that are built into software itself as abstractions, and on top of that ...
If anything on any one of those layers changes, you have the potential of introducing bugs. Not all interface contracts are honored by all developers/engineers. There have absolutely been cases where changes are made at one level and that has an effect on everything that runs on top of it.
So even if you can reliably say that your program is 100% bug free for a specific OS running on a specific set of hardware at Time T, that has the potential to break during the next release of any of those products.
The software the Patio11 mentions (NASA systems) is running in a very specific context. It's running on hardware that has a high level of formal verification, and it's running on a RTOS or running directly on hardware, such that there isn't anything that can interfere with the software, because otherwise even the CPU scheduler could introduce bugs into your system.
Anyway, that's my view of things, I'd love for someone to tell me if I'm wrong, since that's all based on observations I've made during my industry experience.
There are provers that help as well, such as Alloy.
For the typically/average project put there, the mayor problem I see is that people still rely on code coverage as the one and only metric for quality of their tests (if they even implement tests at all). Code coverage is a lazy, flimsy and unreliable metric that has been subsumed by the more powerful metric called mutation score.
If devs utilized mutation analysis more, they would provably have much better quality software.
See this video: http://confreaks.tv/videos/mwrc2014-re-thinking-regression-t...
However, these techniques are often too computationally expensive in many practical cases. Moreover, formal verification requires one to very precisely specify how a piece of code should behave, as well as how the environment in which it operates may behave. (Think of OS, network I/O, user interaction, etc.) This is another source of often prohibitive complexity.
I don't think that you can consider CPUs to be bug-free. Just to pick one, Intel got SYSRET wrong: https://blog.xenproject.org/2012/06/13/the-intel-sysret-priv...
It doesn't have anything to do with users or weird scenarios.
https://bugs.freebsd.org/bugzilla/buglist.cgi?quicksearch=bs...: "15 bugs found."
Not all of these are bugs, but there definitely are bugs in populair implementations of grep.
print "Hello World!"
And who knows what happens or what bugs are fixed when intel/amd push new firmware to the chip.