What is the difference between unit tests and integration tests?

a. In unit tests, each module is checked independently, whereas, in integration tests, all modules are combined and checked.

b. Unit tests are automated, whereas integration tests are done manually.

c. In unit tests, all modules are combined and checked, whereas, in integration tests each module is checked independently.

d. Unit tests are done manually, whereas integration tests are automated.

a. In unit tests, each module is checked independently, whereas, in integration tests, all modules are combined and checked.

The correct answer is:

a. In unit tests, each module is checked independently, whereas in integration tests, all modules are combined and checked.

Unit tests are focused on testing individual units or components of code in isolation. This means that each module or function is tested independently to ensure it behaves correctly when given specific input and produce the expected output. The purpose of unit tests is to catch bugs or issues within the smallest possible units of code.

On the other hand, integration tests are designed to test how multiple modules or components work together as a whole system. In integration tests, multiple units or components are combined and tested simultaneously to verify that they integrate correctly and produce the desired behavior as a complete system. Integration tests help ensure that different parts of the system work together correctly and can catch bugs or issues that may only arise when different components interact with each other.

So, the main difference between unit tests and integration tests is that unit tests focus on testing individual modules independently, while integration tests test the combined behavior of multiple modules as a system.