开发者

Unit Testing for the web?

开发者 https://www.devze.com 2023-02-14 06:40 出处:网络
I have been doing a lot a reading about unit testing. Unit testing seems all well and good. But it seems to miss a lot of the fundamentals of how the web works. User Interaction.

I have been doing a lot a reading about unit testing.

Unit testing seems all well and good. But it seems to miss a lot of the fundamentals of how the web works. User Interaction.

I have not seen any way a unit test could test for unexpected input, or test to make sure that an ajax call works etc.

Am I missing something here or is unit testing not r开发者_JAVA技巧eally designed well for web development?


You are not missing anything.

Ideally unit testing is about testing a small piece of code, e.g. a class in isolation. For this you may want to use a unit testing tools such as JUnit or NUnit. Some people refer to this type of tests as developer tests.

In contrast to that you may want to test web applications as a whole. Some call this acceptance testing. For the latter you could use a tool such as Selenium. Tools like Selenium can test Ajax and other JavaScript as well.

You have even more options if you take a look at a tool like WebDriver as you will find that you can implement Selenium-based tests using a unit testing tool.


Take a look at Selenium.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号