How unit and functional testing can help with Web application development

Source: Internet
Author: User
I got a preliminary look. PHPUnitFeel
单元测试is to use a test class, simulate the browser to fill out the form, submit the form, test whether the normal operation can be successful.
功能测试I don't know yet.

I think, PHPUnit is not for a small website, the role is not very good?
What is the right size to use PHPUnit?

I don't think PHPUnit can test out some potential pitfalls and bugs (submitting unexpected form data, etc.). Writing a test class is not as good as opening a browser test yourself, is it?

In addition, it can be said that the use of phpunit experience and feelings.

Reply content:

Preliminary understanding of the PHPUnit feeling
单元测试is to use a test class, simulate the browser to fill out the form, submit the form, test whether the normal operation can be successful.
功能测试I don't know yet.

I think, PHPUnit is not for a small website, the role is not very good?
What is the right size to use PHPUnit?

I don't think PHPUnit can test out some potential pitfalls and bugs (submitting unexpected form data, etc.). Writing a test class is not as good as opening a browser test yourself, is it?

In addition, it can be said that the use of phpunit experience and feelings.

First answer you 1th, unit test you said with the browser form simulation under the submission, this is not wrong, but with the form of the simulation submission, may not be able to cover all of your code logic, unit testing coverage, general formal enterprise, the requirement coverage of more than 80%;

2nd, if each run unit test need manual intervention, then this unit test meaning is not very much; usually you finish your module, then write the test code separately, then you will hand over the tool "continuous integration" to complete, only you submit an SVN version number, then go back to work, the next day, After continuous integration, you will be given a list of the results of the unit tests, as well as some other problems with the code, such as Cyclomatic complexity, number of lines of code, etc...

Third, the general small site does not need to waste time to write unit testing, because unit testing is time-consuming, generally with the write business time is 1:1, so like a large web site, security requirements are relatively high, or those large to need to split the application layer of the level of each module, will write unit test script, Otherwise, small companies can not spend this time to do this, after all, the time cost equivalent to the programmer's wages.

Do not know whether this answer to solve your doubts?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.