-1

我正在写一篇技术论文,我不确定我是把它们写成错误还是失败。因为据我所知 FAULT 是程序员的错误。此故障/错误可能会或可能不会使程序崩溃。如果故障使程序崩溃,那么它就是故障。问题是如果我得到除零异常,我应该把它写成错误还是失败?谢谢

4

3 回答 3

1

这是一种没有区别的区别,或者是只存在于你心中的区别。唯一相关的考虑是程序没有正确执行。说失败只是由程序员的错误引起的肯定是不正确的。

于 2013-10-06T22:24:46.730 回答
1

我建议您按错误/异常对其进行分类。

异常可以被处理并且有两种类型:

  • 已检查您使用处理方法中的异常try/catch/finally
  • 未选中您通过 usingthrows语句让调用者处理此问题。

您不能隐式处理程序中的错误

于 2013-10-06T22:32:36.183 回答
0

After some research I found that fault is an error made by a programmer and it is not necessary that the system crashes if the fault is executed during run time. While a failure is an error which causes the program to crash or causes run time exception.

So if we are testing a program and we consider a crash of program as error then such error will be called as failure. However if we are looking for other errors which do not cause system crash then such errors are fault.

于 2014-05-21T11:48:41.990 回答