About unit tests?
How many of the Web developers used unit tests?
What do you think?
Khan seems they're going to do this thing in the company
What would you do if PHP was using unit tests? With what tools?
Actually, I don't quite understand what a unit test is.
------Solution--------------------
PhpUnit
SimpleTest
I've seen some, I've done a few examples, but I haven't used them in the project.
Write a bunch of test cases, and you can only run test cases to test them later.
------Solution--------------------
Do not know what is called unit testing, so do development
------Solution--------------------
How Rd leverages PHPUnit
1. Use PHPUnit to debug, complete unit self-test;
2. Submit the test case code to the SCM and keep it in sync;
3. Get code coverage for the test case and set a threshold value (75%?). ), test cases below the threshold value cannot be passed through unit tests;
4. Improve rd Test Cases through QA feedback;
5. Combine phing to use PHPUnit to verify the correctness of the code in the new environment when deploying the new environment;
6. Combined with selenium to do large-scale automated integration testing, improve the quality of code testing;
In addition, according to the test case design experience defined by software engineering, the test code should be 1.2-1.5 times times the amount of program code. Although the initial writing has a certain price, but the effect is not comparable.
How QA uses PHPUnit
1. Learn more about project design and functionality by Reading Rd's test case design;
2. Feedback the defects in the test case design to RD through the QA perspective;
3. Write test cases for testing;
Method one uses Pear
Run Pear channel-discover pear.phpunit.de;
Pear Install Phpunit/phpunit
Method two manual Installation
1. Download the package from http://pear.phpunit.de/get/and unzip it;
2. Add the extracted directory to the include_path in php.ini;
3. Rename the script pear-phpunit to PHPUnit;
4. [email protected][email protected];
5. Add executable permissions for PHPUnit scripts and add $path;
6. [Email Protected][email protected]
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