Why should I be using testing frameworks in PHP?

百般思念 提交于 2019-12-21 22:08:40

问题


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!


回答1:


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



来源:https://stackoverflow.com/questions/2843394/why-should-i-be-using-testing-frameworks-in-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!