问题标签 [parasoft]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2020 浏览

c++ - parasoft C++ 单元测试题

我在一个项目上工作,该项目刚刚被告知我们必须将 Parasoft C++ 单元测试工具整合到未来的任何代码更改中。我面临的问题是我们的方法更改非常小,现在看来我们被迫对整个方法进行单元测试。许多这些方法是成百上千行代码。我可以肯定地知道,如果我必须完全测试这些方法,那么我们将遇到修复空指针检查等老问题,而我们的预算和人力无法处理这些修复。

有谁知道 parasoft 是否允许您测试方法的一小部分?或者如果另一个单元测试框架会更好。

0 投票
2 回答
292 浏览

c# - Generating tests from run-time analysis

We have a large body of legacy code, several portions of which are scheduled for refactoring or replacement. We wish to optimise parts that currently impact on the user-experience, facilitate reuse in a new product being planned, and hopefully improve maintainability too.

We have quite good/comprehensive functional tests for an existing product. These are a mixture of automated and manually-driven GUI tests, but they can take a developer more than half a day to run fully. The "low-level domain logic" has a good suite of unit tests (NUnit) with good coverage. Unfortunately, the remainder of the code has no unit tests (or, at least, no worthy unit tests).

What I'd like to find is a tool that automatically generates unit tests for specific methods/classes and maybe specific interfaces based on their use and behaviour in the functional tests. These unit tests would be invaluable for refactoring, and would also be run as part of our C.I. system to detect regressions much earlier than is currently happening (and to localise regressions much better than "button X doesn't work.").

Do any such tools exist? Do you have any recommendations for me?

I've come across Parasoft .TEST, which looks like it might do want I want. Do you have any comments on that, with respect to my situation?

I don't think something that just generates test code from a static analysis, ala NStub, is useful here. I suppose it is actually the generation of representative test data that is really important.

Please ignore the merits, or lack of, of automated test generation - it is not something I'd usually advocate. (Not least because you get tests that pass for broken code!)

0 投票
4 回答
4698 浏览

parasoft - 有人有 parasoft .test 或 jtest 经验吗

首先,我没有 parasoft .test 或 jtest 经验。我已经阅读了产品可以自动生成单元测试的数据表。

但我很想知道自动生成的单元测试有多么有用。它真的不需要开发人员的任何其他努力吗?

欢迎任何经验分享。

多谢!

0 投票
3 回答
750 浏览

c++ - 如何在 Parasoft C++test 中将函数标记为不返回?

我们有一个die输出错误信息并退出的函数,例如:

我们使用Parasoft C++test来静态分析我们的代码,但它没有意识到这die是一个非返回函数。所以当它看到如下代码时:

它警告*bar可能会取消引用空指针,即使bar为 NULL 会阻止该行执行。有没有办法以dieParasoft 识别的方式标记为不返回?


编辑:我需要在 GCC 和 VS 2003 中都可以使用的东西,但是#ifdef如果有人有一个只能在 VS 中使用的解决方案,我不会放弃解决问题的方法

0 投票
3 回答
1018 浏览

c++ - 来自 Parasoft C++test 的令人困惑的控制流分析

我们使用Parasoft C++test来静态分析我们的代码。它在使用如下代码时遇到问题:

它在线警告*x;说:

在任何情况下都不应随后访问已释放的内存

不知何故,可以得出结论,控制流可以传递到catch(...)块中,删除x,越过throw;,然后到达*x;. 我尝试throw std::exception("");了其他几个,得到了同样的结果。Parasoft 当然知道异常并将它们合并到其控制流中,因为还有许多其他测试涉及异常检查。在这种情况下只是混淆了,还是实际上有某种方法可以让这个程序的执行同时击中delete x;and *x;

0 投票
1 回答
367 浏览

static-analysis - Parasoft 规则向导

我正在尝试创建一个静态规则来检查令牌传递以在 SIL4 应用程序中进行防御性编程。

规则如下:“每个函数都应有一个 const uint_32 作为最后一个参数”

IE:

有人可以帮助我吗?我在黑暗中摸索

0 投票
2 回答
116 浏览

c++ - 传递 sizeof 强制返回的质量错误

我正在使用一个名为 Parasoft C++ Test 的代码质量工具。它抱怨以下内容:

它指出:

在“setsockopt”函数调用中,不要将 long 转换为 int 表达式作为“5”函数参数传递

我尝试了几种不同的铸造选项来解决这个问题,但它们似乎都没有任何效果。我可以执行以下操作并使其消失:

有没有办法在 setsockopt 调用中内联调用 sizeof(int) 而不会产生此质量错误?

0 投票
1 回答
1731 浏览

c++ - Parasoft c++测试链接单元测试错误

我的项目可以成功构建和链接,并且没有关于单元测试的编译错误。

错误信息只有“测试执行:为选定源的测试单元链接测试可执行文件时出错。”

那么,任何人都可以提供一些建议吗?谢谢。

我使用 VS2005 和 VS 9.1 的 parasoft c++ 测试。

0 投票
2 回答
345 浏览

c++ - c++ parasoft错误

我有 parasoft 我的解决方案,我得到 3 个相同的错误,“应该使用管理资源的对象”这些错误来自我创建的结构。如何在不更改结构的情况下删除它?“指针名称”指针

0 投票
1 回答
134 浏览

c++ - Parasoft 错误:应使用管理资源的对象而不是“x”指针

我创建了一个二叉搜索树,我的二叉树的每个节点都设置在一个包含键的结构中,以及一个指向左右节点的指针。

在我的这个二叉搜索树的复制构造函数中,我调用了一个辅助方法来递归遍历看起来像这样的树:

我在标题中提到的错误是在上面最后一个 if 语句中的左右指针上。

如果有人能告诉我如何删除它,那将不胜感激。