Practice Unit Testing (2)

Source: Internet
Author: User

I know this project is a lot of bugs, can't finish on time, even if the boss fired me should be. Once had a unit test opportunity put in front of me, I did not cherish, wait until later project avalanche to regret. If God can give me another chance, I will say to the boss: I want to do unit test! If you have to add a date to the unit test, I hope it will be.

...

I am not here to say how to do unit testing, since we can not specify how to write the product code to achieve the requirements function, but also can not ask developers how to write test code, or even to write UT.

It is even harder to persuade project managers to implement unit tests in a project, because unit testing often means a longer development cycle, more cost inputs, and, in traditional ways, the ability to complete projects and make money. So in the face of tight deadlines, the decision to implement unit tests in the project does require boldness and trade-offs.

But it is this misunderstanding caused by UT in the domestic difficult to promote, I think for the entire development cycle, Unit testing can shorten the development time, improve product quality, play a role in reducing costs and risk avoidance. Let's take a look at where the time is spent in code writing:

1, Learning and Reading code: for new members of the project team or when using other people's written services, often need to read other people's Code, UT provides the best example, can save study time and cost.

2, the preparation of product code: whether or not the implementation of UT, this is necessary.

3, modify the product code: In the introduction of UT, product code bugs often have to wait until the quality department or this is a customer trial to discover, or even to the system to run after a period of time will appear, of course, UT and can not completely avoid the production of bugs, but can help us find bugs early, early to solve problems, Often can save development time and cost.

4, Refactoring: This small project is not, but for large projects, no UT also dare to say that the reconstruction is indeed a need for superhuman courage! I am more inclined to think that the project without UT is not reconfigurable.

But I also did not participate in the full implementation of unit test projects, the above words are also some empty talk, look forward to your comments.

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.