Please enable JavaScript to use CodeHS

Agentic Engineering & AI Software Topics

Continuous integration and testing

Continuous integration means merging small changes often and running an automated test suite every time. If the tests fail, the change is blocked until it is fixed. This is how modern teams, including teams of agents, keep software from quietly breaking.

CI / QA ~10 min High School / College Prep
The Big Idea

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.


CS Minute

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.


Agentic Engineering

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:

  1. Agent writes code on a branch.
  2. Agent writes or updates tests for that code.
  3. CI runs the tests.
  4. A human reviews the result and merges if it passes.

This loop keeps agents from breaking production while still letting them move quickly.


Code

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


Interactive

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.

// CI output will appear here

Your Turn

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.


Check Yourself

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.