For more discussion on this issue, see my article "The Null Flag Bug Pattern".
关于这个问题的更多讨论,请参阅我的文章《空标志错误模式》。
Here's the breakdown of this week's bug pattern.
下面是本周的错误模式的小结。
For more discussion on this issue, see my article The Null Flag bug pattern.
关于这个问题的更多讨论,请参阅我的文章空标志错误模式。
Programmers can identify the problem by learning about the Double Descent bug pattern.
程序员可通过学习DoubleDescent 错误模式来识别这种问题。
He mentions AspectJ specifically in "The Null Flag bug pattern" in connection with exceptions.
他在与异常有关的“The NullFlagbug pattern”中特别提到了AspectJ。
Returning a flag value would have many of the same problems as the Null Flag bug pattern we discussed last time.
返回一个标志值将引起许多与我们上次讨论的空标志错误模式一样的错误。
So for a bug pattern detector to be effective, it must minimize false alarms, preferably no more than 50 percent.
所以对于一个有效的bug模式检测器,它必须最小化假警报数量,最好使假情报不超过 50%。
As you learned last month, the first step in writing a bug pattern detector is clearly identifying the bug pattern.
正如您在 上一期 中所学的,编写bug模式的第一个步骤是清楚地标识 bug 模式。
But FindBugs is different — it USES bytecode analysis and a host of plug-in bug pattern detectors to find common bugs in code.
但是FindBugs不同,它利用字节码分析和很多内置的bug模式检测器来查找代码中的常见bug。
It also gives the algorithm of how to use this bug pattern to find new bug. The corresponding tool SBF is developed as well.
本文首次提出了使用程序依赖图表示漏洞模式以及相应的漏洞模式生成算法,并实现成对应的工具sbf。
The first bug pattern relating to null-pointer exceptions that we'll explore is one that I call the Dangling Composite pattern.
我们将探讨的第一个关于空指针异常的错误类型,是一个我称之为悬挂复合类型的错误类型。
Part 1 of this brief series on effective testing built a FindBugs plugin to find a trivial bug pattern, that of calling System.gc .
这一简短系列的第1部分介绍了如何进行有效测试,它构建了FindBugs插件来查找一个简单的bug模式(只需调用System . gc即可)。
These contain information about all the try-catch blocks in the method, so you'll have to correlate the throw and catch information to identify the bug pattern.
它们包含关于方法中所有try - catch块的信息,所以您必须将抛出信息和捕获信息关联,以标识bug模式。
To detect this bug pattern, you'll need to know where the try-catch blocks are, what might be thrown out of the try block, and what is caught in the catch blocks.
要检测此bug模式,则需要知道try -catch块的位置、try块可能抛出的内容以及在catch块中将捕获的内容。
All that is needed for a bug pattern detector to be effective is that it turn up a high enough percentage of questionable code to make it worth the effort of using it.
一个有效bug模式检测器的主要功能是发现更高百分比的可疑代码,使该模式具有更大的使用价值。
The process of tuning a detector involves looking at the false alarms and refining the bug pattern so as to eliminate some false alarms without excluding too many actual bugs.
优化检测器的过程包括查找假警报和细化bug模式,以消除某些假警报,同时不要将太多的真实bug排除在外。
So if FindBugs is a bug pattern detector, it stands to reason that it can also serve as an auditing tool to measure the degree of compliance with a set of design principles.
因此如果FindBugs是bug模式检测器,那么它理所当然可以用作审核工具,衡量代码与一组设计原理的符合程度。
In this installment, you'll develop a detector for a less trivial bug pattern, called RuntimeException capture. (this bug detector is now included in the FindBugs distribution.)
在这一期的文章中,您将开发一个称为RuntimeExceptioncapture的更小bug模式的检测器(目前,FindBugs发行版中已包含此bug检测器。)
In the next installment, we'll take a look at yet another very common bug pattern that manifests itself as a null-pointer exception, how to recognize it, and how to avoid it.
在下一个部分,我们将还要注视另外一个非常普遍的,也被证明是一个空指针异常的错误类型,以及怎样识别它和避免它。
Bug patterns often stem from confusing features of the language or the class library; this bug pattern stems from the somewhat counterintuitive fact that RuntimeException extends Exception.
bug模式通常源自语言的模糊功能或类库;出现此bug模式是因为RuntimeException扩展了Exception,这稍微有点违反常理。
Creating bug pattern detectors can have very high leverage; once you've created a detector, you can run it on any code you want, now or in the future, and you might be surprised what turns up.
创建bug模式检测器可以提高使用价值;创建检测器之后,无论是现在还是将来,您都可以在您需要的任何代码上运行它,并且您可能对发现的问题感到惊讶。
You find a bug, establish a pattern, fix the bug, and fix the process.
您找到错误,然后建立模式、修正错误,最后修正过程。
Just to show how insidious bugs of this pattern can be, I've already introduced a bug in the following code.
为了显示这种类型的错误是多么隐蔽,我已经在下面代码中引入一个错误。
Once a bug is fixed developers can use the "find matching clones" to see other code that follows the same pattern.
某个bug修复后,开发人员就可使用“查找匹配克隆”功能来看看其他遵循同样模式的代码。
Pattern direction bug removed when using multiple Current sources.
模式方向错误时,将删除使用多个电流源。
Pattern direction bug removed when using multiple Current sources.
模式方向错误时,将删除使用多个电流源。
应用推荐