What is continuous integration?
Continuous integration, or CI, is a practice: every time someone pushes code, an automated system builds the project and runs tests. The goal is to catch problems immediately, while the change is still small.
CI makes it safer to move fast. It also makes it safer to let AI agents propose changes, because the tests act as a safety net.
Key idea: the earlier you catch a bug, the cheaper it is to fix. CI catches bugs minutes after they are introduced.
Types of tests
Different tests catch different problems:
- Unit tests: check a single function or small module.
- Integration tests: check that modules work together.
- End-to-end tests: simulate a real user using the whole application.
- Regression tests: make sure a bug, once fixed, stays fixed.
A good test suite gives you confidence. A bad test suite is slow and full of false alarms. Writing tests is a skill that improves with practice.
Why CI matters for agents
AI agents can generate a lot of code quickly, but speed is not the same as correctness. A CI pipeline forces the agent's changes to pass the same tests a human would run.
Agents can also write tests themselves. In fact, a common workflow is:
- Agent writes code on a branch.
- Agent writes or updates tests for that code.
- CI runs the tests.
- A human reviews the result and merges if it passes.
This loop keeps agents from breaking production while still letting them move quickly.
A test and a CI workflow
Here is a tiny Python function with two tests, plus the GitHub Actions workflow file that would run those tests every time someone pushes code or opens a pull request.
test_calculator.py
.github/workflows/tests.yml
Run a CI pipeline
Pick a branch, then run the CI pipeline. Some branches are healthy; one contains a bug. See how the tests respond.
Check yourself
Why is a fast CI pipeline especially useful when an AI agent is making many small changes?
Your answer:
Sample answer: A fast CI pipeline gives the agent quick feedback. If a change breaks something, the agent can fix it immediately instead of piling more changes on top of the bug.
Quick quiz
1. What does continuous integration do?
2. Which kind of test checks that a fixed bug does not come back?
3. Why do agents need CI?
Keep learning
CI is the safety net. Next, learn how code review and quality checks add a human and automated layer of judgment on top of the tests.
Part of the “Agentic Engineering & AI Software Topics” series.