CAD CAD Continuous Integration and Testing 2 — Questions and Answers
Question 1: What is the primary purpose of a CI build pipeline in an Agile development environment?
- To automatically compile, test, and validate every code change merged into the shared repository (Correct answer)
- To replace manual code reviews entirely
- To deploy code directly to production without any checks
- To generate documentation for each sprint
Correct answer: To automatically compile, test, and validate every code change merged into the shared repository
A CI pipeline automatically builds and tests each integration to catch defects early and maintain a releasable codebase.
Question 2: Which testing strategy is most aligned with the Agile testing pyramid?
- A large number of unit tests, fewer integration tests, and minimal end-to-end tests (Correct answer)
- Equal numbers of unit, integration, and end-to-end tests
- Mostly end-to-end tests with very few unit tests
- Only manual exploratory testing after each sprint
Correct answer: A large number of unit tests, fewer integration tests, and minimal end-to-end tests
The testing pyramid recommends many fast unit tests at the base, fewer integration tests in the middle, and a small number of slow end-to-end tests at the top.
Question 3: In a CI workflow, what does 'breaking the build' typically indicate?
- A committed change caused compilation errors or test failures in the shared branch (Correct answer)
- The CI server hardware has malfunctioned
- A developer deleted the repository by accident
- The project manager rejected a user story
Correct answer: A committed change caused compilation errors or test failures in the shared branch
Breaking the build means a recent commit introduced code that fails to compile or passes existing tests, blocking the team.
Question 4: What is the recommended response time for fixing a broken CI build in Agile practice?
- It should be the team's top priority and fixed immediately (Correct answer)
- It can wait until the next sprint planning session
- It should be assigned to the QA team only
- It should be deferred until a hardening sprint
Correct answer: It should be the team's top priority and fixed immediately
Agile teams treat a broken build as the highest priority because it blocks the entire team from integrating and validating further changes.
Question 5: Which practice helps ensure that automated tests in a CI pipeline remain trustworthy?
- Eliminating flaky tests and ensuring each test produces deterministic results (Correct answer)
- Running tests only on weekends to reduce server load
- Allowing tests to pass intermittently without investigation
- Writing tests only for new features, not bug fixes
Correct answer: Eliminating flaky tests and ensuring each test produces deterministic results
Flaky tests erode confidence in the CI pipeline, so teams must fix or remove non-deterministic tests to keep the suite reliable.
Question 6: What is the main benefit of running static code analysis as part of a CI pipeline?
- It detects code quality issues, security vulnerabilities, and style violations automatically before code review (Correct answer)
- It replaces the need for any form of testing
- It speeds up the application at runtime
- It eliminates the need for version control
Correct answer: It detects code quality issues, security vulnerabilities, and style violations automatically before code review
Static analysis catches potential bugs, security flaws, and coding standard violations early without executing the code.
What is the primary purpose of a CI build pipeline in an Agile development environment?