在 MATLAB 中使用遗传算法自动生成测试数据

发布于 2024-08-26 01:25:17 字数 78 浏览 2 评论 0原文

我正在做我的软件测试项目。遗传算法是我想用来在 MATLAB 中生成自动测试数据\测试用例的技术。

请帮助我成功完成我的项目。

I am doing my project in software testing. Genetic algorithm is the technique I want to use to generate automatic test data\test cases in MATLAB.

Please help me in doing my project successfully.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

待天淡蓝洁白时 2024-09-02 01:25:17

首先,我建议您了解自己真正想做的事情。我知道遗传算法和遗传编程有一种异国情调的感觉,听起来它们可以做很多事情,但在现实世界中存在局限性。

如果您想使用 GA 为程序生成测试用例,那么您必须能够定量确定何时成功生成了以下测试用例:

A. 代表唯一的测试用例。

B. 正确测试代码。

C. 产生预期结果。

D. 产生现实的用例。

First I would recommend that you understand what you REALLY want to do. I know Genetic Algorithms and Genetic Programming have an exotic feel to them and they sound like they can do a lot, but there are real-world limitations.

If you want to use GA's to generate test cases for a program, then you must be able to quantitatively determine when you've successfully produced a test case that:

A. Represents a unique test case.

B. Correctly tests code.

C. Produces the expected results.

D. Results in a realistic use case.

风启觞 2024-09-02 01:25:17

如果(且仅当)您可以实现一个能够评估“测试用例”有多好的适应度函数,那么 GA 就是解决您的问题的良好候选者。

另外,如果在您的特定场景中,“好”和“坏”测试用例之间没有区别,而只有“测试用例”和“非测试用例”之间没有区别,那么您可能最好使用其他一些生成策略!

GAs are a good candidate for your problem if (and only if) you can implement a fitness function capable of evaluating how good a "test case" is.

Also, if in your particular scenario there is no difference between "good" and "bad" test cases but only between "test cases" and "non test cases" then you're probably better off with some other generation strategy!

早茶月光 2024-09-02 01:25:17

首先制定评估测试数据的适合度标准。在我看来,适应性可能是程序控制流图中的分支谓词。本期参考korel(90)。尝试提出一些初始测试用例并应用遗传算法来生成比现有更好的其他测试用例。

Firstly make a fitness criteria that evaluates the test data . IN my opinion fitness could be the branch predicates in the control flow graph of a program. take a reference of korel(90) in this issue. try to come out with some initial test case and apply GA to generate other test case which is better than the existing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文