About unit testing? Solution

Source: Internet
Author: User
About unit testing? Which of the following unit tests are used for web development? What do you think? Khan seems they are going to do this at the company. how would you use it if php is tested in unit? What tools are used? In fact, I still don't quite understand what unit test is called ------ solution ------------------ phpUnitSimpleTest. I have read some examples, but I have never used them in projects. Write a bunch of test cases. in the future, only test cases will be executed?
Which of the following unit tests are used for web development?


What do you think?


Khan seems they are going to do this at the company.

How do you use php Unit testing? What tools are used?



Actually, I don't quite understand what unit testing is.

------ Solution --------------------
PhpUnit
SimpleTest
I have read a few examples, but I have never used them in projects.
Write a bunch of test cases. in the future, you only need to execute the test cases for testing.
------ Solution --------------------
Do not know what unit testing is, so do development
------ Solution --------------------
How does RD use PHPUnit
1. Debug with PHPUnit to complete unit self-test;
2. submit the test case code to scm and keep them synchronized;
3. obtain the code coverage of the test case and specify a threshold (75% ?), Test cases lower than the threshold cannot pass unit tests;
4. improve RD test cases through QA feedback;
5. use PHPUnit to verify the code correctness in the new environment when deploying the new environment with Phing;
6. use Selenium for large-scale automated integration testing to improve the code quality;
In addition, according to the test case design experience defined by software engineering, the test code should be 1.2-1.5 times the amount of program code. Although there is a certain cost for the initial compilation, it is not comparable with the resulting utility.
How QA uses PHPUnit
1. read the RD test case design to learn more about the project design and functions;
2. report defects in test case design to RD from the QA perspective;
3. write test cases for testing;
Method 1 Pear
Run pear channel-discover pear.phpunit.de;
Pear install phpunit/PHPUnit
Method 2 Manual installation
1. download and decompress the software package from http://pear.phpunit.de/get;
2. add the decompressed directory to include_path in php. ini;
3. change the script pear-phpunit to phpunit;
4. [email protected] [email protected];
5. add executable permissions for the phpunit script and add $ PATH;
6. [email protected] [email protected]

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.