1. Why do we write integration tests?
The aim of integration testing is to test the interfaces between the modules and expose any defects that may arise when these components are integrated and need to interact with each other.
2. What problems do integration tests solve?
Verifying if the individual units are communicating with each other properly and working as intended.
Even when each module of the application is unit-tested, some errors may still exist. To identify these errors and ensure that the modules work well together after integration, integration testing is crucial.
Integrating disparate modules testing can help ensure that the integrated units function properly as one unit and align with stated requirements. It can also ensure there are no errors between the different interfaces of different modules.
Ensuring that changing requirements are incorporated into the application : In many real-time application scenarios, requirements can and do change often. These new requirements may not be unit-tested every time, which may lead to missed defects or missing product features. Integration testing can fill in these gaps to ensure that new requirements are incorporated into the final application.
Eliminating common issues missed during unit testing: Some modules that interact with third-party application program interfaces (APIs) need to be tested to ensure they function properly. This may not be done during unit testing, so
Eliminating other common problems: Integration testing also helps eliminate issues, such as inadequate exception handling, API response generation, data formatting, erroneous external hardware interfaces, incorrect third-party service interfaces and error trapping.
3. What are the differences between top-down and bottom-down approaches?
Top-down testing: The top-down approach is an incremental approach that involves testing from the topmost or highest-level module and gradually proceeding to the lower modules. Each module is tested one by one, and then integrated to check the final softwareâs functionality.
Bottom-up testing: Bottom-up (also known as bottom-to-top) integration testing is the opposite of the top-down approach. It involves testing lower-level modules first, and then gradually progressing incrementally to higher-level modules. This approach is suitable when all units are available for testing.