Seven Realms of unit testing in software testing

Source: Internet
Author: User

For PHP, few people use unit testing, after all, PHP debugging is indeed very convenient.

But in recent years, as PHP has become more and more in-depth in enterprise applications, the requirements for unit testing are increasingly being put to the fore. PHPUnit are 3.0, think about how long the development.

This is an article on the East blog, I do not know if there is any use for you, I was copied down to see.

1. Rejecting unit tests with various pretexts, the more commonly used is "You don't have enough time (to do unit tests)".

2. Try unit test and immediately start to preach the benefits of test driven development with unit tests and testing drivers in your own blog.

3. Unit Test everything. To be able to complete unit tests, modify the private private method and properties to internal internal, and test the Getter () and Setter () properties (method) to achieve unit test coverage 100%.

4. Unable to tolerate the fragile unit test, hastily turned to "integration test" integration test without understanding what it was.

5. A simulation mocking framework was found and was happy to use mandatory semantics (strict semantics).

6. Simulate mock all objects that may simulate mocked.

7. Start real effective unit testing.

Related Article

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.