系统测试桌面应用程序

发布于 2024-08-11 12:02:08 字数 229 浏览 6 评论 0原文

我有一个用 C# 编写的桌面应用程序,使用 VS2008 Pro 创建,并使用 Nunit 框架和 VS2008 的 Testdriven.net 插件进行了单元测试。我需要对应用程序进行系统测试。

我之前曾使用 Firefox 的 Bad Boy 和 Selenium 插件完成过基于 Web 的系统测试,但我对 Visual Studio 和 C# 还很陌生。

如果有人可以分享他们对此的建议,我将不胜感激。

I've got a desktop application written in C# created using VS2008 Pro and unit tested with Nunit framework and Testdriven.net plugin for VS2008. I need to conduct system testing on the application.

I've previously done web based system tests using Bad Boy and Selenium plugin for Firefox, but I'm new to Visual Studio and C#.

I would appreciate if someone could share their advice regarding this.

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

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

发布评论

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

评论(5

不知所踪 2024-08-18 12:02:08

系统测试可能需要通过 UI 完成。这为您提供了两个选项:

1) 您可以通过单击元素来手动执行测试用例。
2) 您可以通过针对 UI 进行编程来自动化测试用例。有很多商业工具可以执行此操作,或者您可以使用编程框架,例如 Microsoft UI 自动化框架。它们往往使用 Windows 内置的辅助功能 API 来访问您的 UI。

您选择手动还是自动路线取决于您将运行测试的次数。如果您只想运行它们一两次,请不要花时间进行自动化。你永远不会赚回来。如果您要经常运行它们,自动化会非常方便。

需要注意的是:自动化 UI 并不难,但它非常脆弱。如果应用程序变化很大,测试将需要大量维护。

System testing will likely need to be done via the UI. This gives you two options:

1) You can manually conduct the test cases by clicking on elements.
2) You can automate the test cases by programming against the UI. There are plenty of commercial tools to do this or you can use a programming framework like the Microsoft UI Automation Framework. These tend to use the accessibility APIs built into Windows to access your UI.

Whether you go the manual or automated route depends on how many times you will be running the tests. If you are just going to run them once or twice, don't spend the time automating. You will never earn it back. If you are going to run them often, automating can be very handy.

A word of caution: Automating the UI isn't hard, but it is very brittle. If the application is changing a lot, the tests will require a lot of maintenance.

别挽留 2024-08-18 12:02:08

正如托马斯·欧文斯(Thomas Owens)对你的问题的评论,首先你必须决定你想要进行什么样的系统测试。但假设您想从功能系统测试开始。准备您想要自动化的用例。那么你必须找到合适的工具。

仅供开始:
AtoIT – 不是测试原子化工具,但它可以自动执行一些任务。这样您就可以记录/编写用例。不太推荐,但可以做到。
HP QuickTestPro – 可以通过录制/脚本轻松使用此工具完成,但价格昂贵,因此对于个人使用来说可能不值得。
IBM 机器人 – 作为 HP QTP。
Powershell – 您可以在 powershell 中编写脚本并执行它们。如果您使用专门的类似 ide 的 powershell 工具,您也可以记录测试。我通过 powershell 做了一些网络自动化,它起作用了。通过一些工作,您可能可以围绕桌面应用程序编写脚本。

最好的方法是尝试不同的工具,并使用最适合您的工具。尝试此链接此链接

As Thomas Owens commented on your question, first you must decide what kind of system testing you want to do. But assuming you want start with Functional System Tests. Prepare use cases you want to automate. Than you must find proper tool.

Just for start:
AtoIT – is not test atomization tool but it lets automate some tasks. So you could record/script use cases. Not really recommended, but can be done.
HP QuickTestPro – easily can be done with this tool via recording/scripting but it is expensive, so maybe not worth it for personal use.
IBM Robot – as HP QTP.
Powershell – you could write scripts in powershell and execute them. If you would use dedicated ide-like tools for powershell you could record test also. I did some web automation via powershell and it worked. With a bit of work probably you could script around your desktop app.

And the best would be to try different tools, and use one that suits you best. Try this link and this link.

明月夜 2024-08-18 12:02:08

系统测试通常有用例、端到端场景以及其他由真人执行的脚本化功能。这些测试不太适合自动化,因为它们要求经过单元测试的齿轮彼此协作。您可能对您的“螺母”和“扳手”进行了很好的单元测试,但只有全面的系统测试才能让您知道您是否有适合手头螺母的扳手尺寸,以及如何从抽屉中选择它/将其返回到抽屉等等。

简而言之——手动测试。

System tests usually have use cases, end to end scenarios and other scripted functions that real people execute. These are the tests that don't lend themselves well to automation as they are asking your unit-tested cogs to work with each other. You might have great unit tests for your "nuts" and your "wrenches" but only a comprehensive system test will let you know if you have the right sized wrench for the nut at hand, how to select/return it from/to the drawer, etc.

In short - manual tests.

黑寡妇 2024-08-18 12:02:08

如果你愿意花钱,你可以看看TestComplete之类的东西。

虽然我还没有真正使用过它(我们公司刚刚购买了它),但它看起来相当不错。您可以记录点击和按键等内容,定义成功标准,稍后它会为您重播测试。它对于 UI 更改似乎非常智能 - 它会记住您单击的按钮,而不仅仅是每次单击的 (x,y)。

它是可编写脚本的,或者是拖放式可编程的。

我不以任何方式参与其中,这也不是一种认可,因为我还没有真正形成自己的看法。

If you're willing to put money down, you could look at something like TestComplete.

Although I haven't really used it yet (our company just bought it), it seems quite nice. You can record clicks and keypresses and stuff, define success criteria, and it will replay the test for you later. It appears to be quite smart about UI changes - it remembers which button you clicked, not just the (x,y) of each click.

It's scriptable, or drag-and-drop programmable.

I'm not affiliated in any way, and this is not an endorsement, because I haven't really formed an opinion of it yet.

絕版丫頭 2024-08-18 12:02:08

也许 NUnitForms 对您有用?

Perhaps NUnitForms could be useful for you?

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