TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Can a software ever be 100% bug free?

8 点作者 BlackLamb超过 9 年前
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?

9 条评论

patio11超过 9 年前
Bug free isn&#x27;t a requirement for the vast majority of applications. Attaining it is <i>very</i> expensive, and most people&#x2F;companies are not willing to pay the price.<p>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 <i>per line</i>. (<a href="http:&#x2F;&#x2F;history.nasa.gov&#x2F;sts1&#x2F;pages&#x2F;computer.html" rel="nofollow">http:&#x2F;&#x2F;history.nasa.gov&#x2F;sts1&#x2F;pages&#x2F;computer.html</a>) 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 <i>most nations</i>.<p>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.<p>[+] 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 <i>exactly</i> implements the specs given to you. Those specs were dictated by Really Important People. You&#x27;re not one. Write your function. Your last function was non-compliant with rule 436 2a subsection b. Improve your performance or we&#x27;ll find someone who is not a threat to our software quality.
loumf超过 9 年前
Programs that produce an output from an input and exit can get very close. See TeX as an example.<p>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.
评论 #10211773 未加载
rnovak超过 9 年前
I think it can be formally proved that software that is non-trivial cannot be written to be 100% bug free in all cases, in all contexts, and I think that&#x27;s a by-product of how software runs.<p>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&#x2F;GTK&#x2F;Ncurses&#x2F;Shell, and above that you have the layers that are built into software itself as abstractions, and on top of that ...<p>If <i>anything</i> on <i>any</i> one of those layers changes, you have the potential of introducing bugs. Not all interface contracts are honored by all developers&#x2F;engineers. There have absolutely been cases where changes are made at one level and that has an effect on <i>everything</i> that runs on top of it.<p>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.<p>The software the Patio11 mentions (NASA systems) is running in a very specific context. It&#x27;s running on hardware that has a high level of formal verification, and it&#x27;s running on a RTOS or running directly on hardware, such that there isn&#x27;t anything that can interfere with the software, because otherwise even the CPU scheduler could <i>introduce</i> bugs into your system.<p>Anyway, that&#x27;s my view of things, I&#x27;d love for someone to tell me if I&#x27;m wrong, since that&#x27;s all based on observations I&#x27;ve made during my industry experience.
maramono超过 9 年前
There are methods that can be applied to software that formally prove properties of software so that those pieces are free of bugs. These are called formal methods and require heavy use of math. Some of them are ASM and Z.<p>There are provers that help as well, such as Alloy.<p>For the typically&#x2F;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.<p>If devs utilized mutation analysis more, they would provably have much better quality software.<p>See this video: <a href="http:&#x2F;&#x2F;confreaks.tv&#x2F;videos&#x2F;mwrc2014-re-thinking-regression-testing" rel="nofollow">http:&#x2F;&#x2F;confreaks.tv&#x2F;videos&#x2F;mwrc2014-re-thinking-regression-t...</a><p>And here: <a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Mutation_testing" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Mutation_testing</a>
tr352超过 9 年前
You can mathematically prove whether a piece of code is 100% bug-free using formal verification techniques (<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Formal_verification" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Formal_verification</a>).<p>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&#x2F;O, user interaction, etc.) This is another source of often prohibitive complexity.
评论 #10215849 未加载
insoluble超过 9 年前
If we can agree that low-level hardware such as CPUs are essentially physical software, then it would seem that there are many bug-free software pieces out there. Many operating systems these days seem to have perfect or near perfect memory and thread management. Kernel mode drivers in general require a high level of quality since bugs usually mean death. User mode is where things get sloppy, and front-end Web Development is where things often get extra sloppy.
评论 #10212472 未加载
SQL2219超过 9 年前
It probably has a lot to do with how many users you have. 10 users, then bug-free is possible. 10,000+ well that is a different story. The more users you have, the more weird scenarios they come up with on how to break stuff.
评论 #10211650 未加载
S4M超过 9 年前
It depends of the complexity of the software. The small Unix utilities like grep or ls are, AFAIK, bug free, because what they do is very simple, but something more complicated is more likely to have small bugs somewhere.
评论 #10215815 未加载
评论 #10217681 未加载
as1ndu超过 9 年前
absolutely!!! look at the python code below :D<p>print &quot;Hello World!&quot;