Build Tools · interview question
How would you explain a key difference between unit tests and integration tests in the context of an e-commerce Java application in an interview?
Multiple choiceHardchapter-10-curatedpremiumbuild-toolsbuild-lifecycle
Answer and explanation
Correct answer
B. Unit tests check individual methods; integration tests check system components work together.
Why
Unit tests focus on individual methods or classes, often using mocks to isolate the unit under test. Integration tests, however, check that multiple system components (like services, databases, and APIs) interact correctly, providing a broader scope of testing.
Test yourself on Build Tools
A free test with instant, explained results. No account needed.
More Build Tools questions
- In a Maven project, where do you declare a dependency for a new library you want to use?
- Which Maven command would you use to ensure that the project is cleaned and rebuilt, including tests?
- When using Maven, which phase is responsible for verifying the quality of the code by running integration tests?
- In a Maven project, how are dependencies typically fetched?
- How does Maven resolve dependencies that are not present in the local repository?
- Which of the following is a primary benefit of using Gradle over Ant for building Java projects?