Brew advanced and proficient-3G mobile value-added business operation, customization and development-94-BREW application unit test method

Source: Internet
Author: User

The main task of unit testing is to verify whether the software unit specified in the detailed specification has been correctly implemented by developers in the form of code. Here, software units refer to a function in process-oriented programming, and to member methods of classes or classes in object-oriented programming. In this test, 100% of each function branch is covered, and 100% of each function is covered.

Unit Tests are generally white-box tests, which are generally divided into manual unit tests and automated unit tests. The basic principle of manual unit testing is to build the pile module and the test Chi module to drive the execution of the tested unit, and then the side testers enter the designed test cases, test whether the Unit to be tested can process the test cases as required. For test cases with exceptions, the tester should record them and report them to the developer. The purpose of Automated unit testing is to make up for the shortcomings of manual unit testing, so that some or all of the unit testing work is automatically completed by the computer, thus comprehensively improving the efficiency of unit testing.

To automate unit testing, Software Reuse Technology of the software framework is generally used. The Framework is an architecture designed to maximize reuse. An important mechanism of the framework is that user-defined methods are generally called by the framework, rather than the user's method call framework, this mechanism is called "reverse control ". When an external event occurs, the Framework scheduler notifies the event processing object, calls the user code, and responds to the event. The essence of Reverse control is to allow the framework, rather than deciding which method is activated by the application to respond to external events. The design pattern is the key to successful development of the framework. Mature frameworks usually use multiple design modes to provide good flexibility and scalability.

Similar to JUnit in Java and cppunit in C ++, developers can construct their own unit test framework based on their own needs.

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.