Unit Testing and integration testing

Source: Internet
Author: User

Unit Test

Unit testing refers to the smallest unit of code to test, for different languages, the unit has a different definition, according to the actual situation to determine:

cell in C: a function or sub-procedure

elements in the Java language: a class

Graphical Software Unit: A window or a menu

object-oriented languages such as C + +: basically a class

Ada Language Unit: Independent process or function

Unit testing refers to the inspection and validation of the smallest testable unit in the software. is the lowest level of test activity.

Developers will write a small piece of test code to check the functionality of a particular function, to see if the code will do as expected, to form a habit, to write high-quality code, and to improve the coding level.

Integration Testing

Integration testing is a logical extension of unit testing, and unit testing covers all the smallest units, but integration testing is still essential, there is no problem within the unit, but when many units are assembled into components, problems that cannot be reflected locally are likely to be exposed globally, so integration testing is also called assembly or joint testing.

The integration test unit must be a unit that has already been tested, otherwise the effectiveness of the integration test will be greatly affected. Error correction also has a greater cost, the method of integration testing is to test whether the combination of software units work properly, testing the interface between them and so on.

comparison of unit tests and integration tests:

The same starting point, are to ensure the robustness of the project, reliability, correctness.

Different points: (1) Check time: Unit test is in the early stage of software coding

The integration test is tested as soon as the system is ready to be developed

(2) test purpose: Unit test is the programmer's own detection, is to test the function of the class

Integration testing focuses only on input and output, providing quality assurance to customers

(3) test tools: Unit tests can use the automated test framework to write test code.

Integration testing requires more coordination, and testing focuses on business processes and performance

(4) test granularity: Unit test is on a single program

Integration testing is on the entire system

Integration testing is larger than unit testing, consumes more resources and consumes a long time.

The following is a brief introduction to system testing and acceptance testing:

System testing: The final software system is thoroughly tested, and the subsystems already tested are assembled into a complete system to verify that the function is consistent with the specification.

Acceptance testing: To show future users that the system can work as expected, the last action before the software is deployed.

Unit Testing and integration testing

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.