Focusing on discipline -- Reading on the concept of design

Source: Internet
Author: User

Question: I am reading the book "design: The Evolution nature of Professional Software Development" (won the 19th jolt Productivity Award). I wrote my thoughts and comments, just as I thought.

 

The topic of this chapter is unit testing, which brings me a lot of thinking.

The first is to test economics. The author has brought us an interesting dialectical logic:

  • Most software development professionals praise the benefits of testing, and most modern software development processes also include testing as one of the essential elements of the project.
  • Many software developers do not perform any tests except to ensure that their code can be compiled successfully (let's see if it can run) and perform manual functional tests.

These two phenomena are obvious to me. On the one hand, I also pay attention to testing during the project process and suggest introducing single-test. On the other hand, I am also like many software developers, the cost of a single test is too high. "I am too busy to write a test.", "if I write a single test, I don't have time to write the code." "All my code has implemented the function, why do we need to write a single test to repeat this meaningless and not rigorous proof?"

In fact, when I mentioned that testability is a basic quality criterion, I began to reflect on my understanding of the single test and test. In my many code practices, I ignored the testability indicator. In addition, I only saw the cost of a single test, but did not see the benefits of a single test. I did not even find a reason for myself to try a single test. Although I have learned a lot about software engineering theory, I have simply taken testing as a stage of engineering and not integrated with development. Even with the agile development method, the coding and testing changes in the agile mode are not re-examined.

As far as I know, unit testing has been or is playing an increasingly important role in many types of development fields, and has achieved good benefits and improved code quality, for example, server development. However, in the field of mobile clients that need to quickly respond to changes, there are few cases of good single-test implementation. On the one hand, the single-test framework and technology in this area have not yet accumulated so much, on the other hand, it may be limited by development methods, devices, and rapidly changing needs. However, in this chapter, the author has demonstrated the benefits of testing. I think this is what I want to make up.

End this chapter with the author's original article.

  • Writing and testing is a process of studying the expected behaviors of classes. Understanding what you want to do before you start, which gives you a clearer understanding of the entire workflow.
  • Testing provides a security net for refactoring. An emerging design is a gradual process, that is, there will be many changes (even more than we are used ). To actively make changes, we need to perform tests to confirm that we have not damaged anything and thus increase our confidence in making changes.
  • Testing is a document that records not how classes run, But what classes should do from an external perspective.

-- Welcome to reprint, please indicate the source of http://blog.csdn.net/caowenbin --


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.