What is the core difference between a unit test and an integration test?
- A.Developers write unit tests while QA writes integration tests
- B.Scope: a unit test covers one unit while an integration test covers several parts
- C.Unit tests check logic while integration tests only check the UI
- D.Unit tests run automatically while integration tests are run by hand
Answer: B
Scope. A unit test checks one isolated unit of logic and runs very fast. An integration test checks multiple parts wired together (service + real DB, API + handler); it is slower but catches errors where the parts connect.
References