Skip to content
Sharp

Project Structure · interview question

In the context of continuous integration for a Java e-commerce project, how can you ensure that only production-ready code is merged into the main branch?

Multiple choiceMediumchapter-10-curatedpremiumproject-structurecontinuous-integration
Choose one answer
Answer and explanation

Correct answer

D. Use a CI pipeline that runs automated tests and requires all tests to pass before merging.

Why

Using a CI pipeline that runs automated tests ensures that code changes do not break existing functionality. Requiring all tests to pass before merging acts as a safeguard against integrating untested or broken code into the main branch. Manual code reviews, while helpful, are not as reliable as automated tests in catching all potential issues.

Test yourself on Project Structure

A free test with instant, explained results. No account needed.

Start free test
All Project Structure questions →