您如何对自己的软件进行压力测试?

发布于 2024-08-08 14:18:24 字数 296 浏览 4 评论 0原文

我一直在独自开发一个应用程序,而且我正处于一个一切都很顺利的阶段——只要用户做了他或她应该做的一切。 :-) 该软件需要更多的测试来看看它有多强大,当人们重复单击同一个按钮、尝试打开错误类型的文件、将数据放在错误的位置等操作时它的工作效果如何。

我'我在这方面遇到了一些麻烦,因为我很难思考如何正确使用该应用程序。这些对我来说都是边缘情况。不过,在开始将应用程序提供给 Beta 测试人员之前,我希望该应用程序尽可能稳定并经过充分测试。假设我现在不是在谈论雇用专业测试人员,我很好奇你们是否有任何提示或系统的方法来思考这项任务。

谢谢,一如既往。

I've been working on an app, by myself, and I am at a stage where everything works great--as long as the user does everything he or she is supposed to do. :-) The software needs more testing to see how robust it is, how well it works when people do things like click the same button repeatedly, try to open the wrong kind of files, put data in the wrong places, etc.

I'm having a little trouble with this because it's a bit difficult for me to think in terms of using the application incorrectly. These are all edge cases to me. Still, I'd like to have the application as stable and well tested as possible before I start giving it to beta testers. Assuming that I am not talking about hiring professional testers at this point, I'm curious whether y'all have any tips or systematic ways of thinking about this task.

Thanks, as always.

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

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

发布评论

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

评论(3

千里故人稀 2024-08-15 14:18:24

嗯,听起来你在谈论两件不同的事情
“测试你的应用程序的功能”和“压力测试”(这是你的问题的标题)

压力测试是指你有一个网站,并且想要检查它是否可以同时为 100,000 人提供服务。查看您的应用程序在压力下的表现。您可以通过多种方式执行此操作,例如记录一些操作,然后让多个代理计算机同时访问您的应用程序。

这个问题听起来更像是质量保证问题。这就是测试员/Beta 测试员的职责。但是您可以自己做一些事情来验证您的应用程序是否能发挥最佳性能。

对代码进行单元测试将是一个好的开始,它可以帮助您尝试找到那些边缘情况。如果您的方法接受诸如整数之类的东西,请尝试传入 int.max、int.min,然后看看会发生什么。将空值传递给所有内容。如果您使用 .Net,您可能需要查看 PEX,它将遍历您的应用程序拥有的所有分支/代码路径。这可能会帮助您进一步完善单元测试,以尽可能地测试您的应用程序。

集成测试,看看你平常做的一些事情到底会发生什么。这将帮助您在以后的开发中“发现错误”。

这些是一些关于您可以自己尝试找到可能错过的边缘情况的快速提示。但是,是的,最终您需要将您的应用程序交给其他人进行测试。只要确保在它袭击他们之前你已经尽可能多地掩盖了:-)

Well it sounds like you are talking about 2 different things
"Testing your application's functionality" and "Stress testing"(which is the title of your question)

Stress testing is when you have a website, and want to check that it can server 100,000 people at the same time. Seeing how your application performs under stress. You can do this a number of ways, e.g by recording some actions and then getting a number of agent machines to hit your application concurrently.

This questions sounds more like a Quality Assurance question. That is what testers / beta testers are for. But there are things that you can do yourself to validate your application works the best it can.

Unit testing your code would be a good start, it helps you to try and find those edge cases. If your method takes in things like ints, try passing in int.max, int.min, and seeing what blows up. Pass nulls into everything. If you are using .Net you might want to look at PEX, it will go through all the branches/codepaths that your application has. That might help you to further refine your unit tests to test your application the best you can.

Integration tests, see what happens end to end for some of your usual things. This will help you 'find bugs' as you are developing later.

Those are some quick tips on things you can do yourself to try and find edge cases that you may have missed. But yes, eventually you will need to pass your app off to someone else to test. Just make sure that you have covered off as much as you can before it hits them :-)

浮华 2024-08-15 14:18:24

确保单元测试和集成测试中有足够的代码覆盖率。

使用适当的 UI 验证,并测试可能会破坏它的组合。

我发现一个架构良好的应用程序可以减少 UI 中可能的排列数量(用户可以破坏它的方式),这会很有帮助。 MVC 等设计模式在这方面特别有用,因为它们使您的 UI 饰面尽可能薄。

Make sure you have adequate code coverage in your unit tests and integration tests.

Use appropriate UI validation, and test combinations that can break it.

I have found that a well-architected application that reduces the number of possible permutations in the UI (ways the user can break it) helps a lot. Design patterns like MVC can be especially useful in this regard, since they make your UI veneer as thin as possible.

堇色安年 2024-08-15 14:18:24

自动化。

(重新)分解您的代码,以便另一个程序可以向它抛出用户事件。创建简单的用户事件脚本并将其回放到您的程序中。捕获来自 beta 用户的事件并将其保存为测试脚本(对于重现问题和检查回归很有用)。编写一个模糊测试器,对脚本应用小的随机更改,并在您的程序中尝试它们。

通过这种自动化,您可以压力和应用程序并发现明显的问题,例如缓存和内存泄漏。它不会测试实际功能。对于功能来说,单元测试可能会有所帮助。有大量的单元测试框架可供尝试。选择一些有用的东西,学习编写好的测试,并将它们集成到您的构建过程中。

Automation.

(Re)Factor your code so that another program can throw user-events at it. Create simple scripts of user events and play them back to your program. Capture events from beta users and save those as test scripts (useful for reproducing problems and checking for regressions). Write a fuzz-tester that applies small random changes to the scripts and try them against your program as well.

With this kind of automation you can stress and application and find glaring problems like caches and memory leaks. It won't test the actual functionality. For functionality, unit tests can be helpful. There are a ton of unit testing frameworks out there to try. Pick something useful, learn to write good tests, and integrate them into your build process.

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