为什么我应该使用 PHP 测试框架?

发布于 2024-09-01 08:57:59 字数 181 浏览 3 评论 0原文

最近,我听到很多人争论如何将 PHPunit 和 SimpleTest 等 PHP 测试功能与他们选择的 IDE(对我来说是 Eclipse)一起使用。在谷歌搜索该主题后,我仍然很难理解使用这些测试框架来加速开发的利弊。

如果有人可以从更基本的层面为我解释这一点,我将非常感激。我使用 PHP5 来发送通知。

多谢!

I have recently heard a lot of people argue about using PHP testing features like PHPunit and SimpleTest together with their IDE of choice (Eclipse for me). After googling the subject, I have still a hard time understanding the pros and cons of using these testing frameworks to speed up development.

If anyone could explain this for me in a more basic level, I would really appreciate it. I am using PHP5 for the notice.

Thanks a lot!

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

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

发布评论

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

评论(1

时光清浅 2024-09-08 08:57:59

我不是单元测试的忠实粉丝:我并不是说它们没有用,它们在某些情况下可能非常有用。

问题是有些人倾向于高估他们可以通过单元测试做什么。

只需记住两件事:
1) 单元测试不能替代 beta 测试。即使其背后的代码有效,坏接口仍然是坏接口。 (例如:如果一个按钮不可点击,那么它所附加的功能是否有效并不重要)
2)单元测试需要时间来编写。如果您单独或在一个小团队中开发一个小项目,也许您可​​以利用这段时间来改进您的代码。

看看这个(请持保留态度地阅读,很明显作者的写作方式是具有挑衅性的):
http://www.wilshipley。 com/blog/2005/09/unit-testing-is-teh-suck-urr.html

I'm not a big fan of unit testing: I'm not saying they're useless, they can be very useful - in certain situations.

The thing is that some people tend to overestimate what they can do with unit test.

Just remember two things:
1) Unit test CANNOT substitute beta testing. A bad interface remains a bad interface even if the code behind it works. (e.g.: if a button is unclickable it doesn't really matter whether the function to which it is attached works or not)
2) Unit test require time to be written. If you're developing a small project alone or in a small team maybe you can use that time to improve your code.

And have a look at this (please read it with a pinch of salt, it is obvious that the author is being provocative in the way he writes things):
http://www.wilshipley.com/blog/2005/09/unit-testing-is-teh-suck-urr.html

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