World map

 

BM: Baca dalam Bahasa Melayu

World C1: Pipeline Thinking

The testing pyramid

You will learn: which tests to write lots of, and which to keep few.

Checked with GitHub Actions 2026-10 on 31 Oct 2026

The problem

Mei’s team has 300 slow browser tests and only 5 small ones. Their pipeline takes an hour. What would you change first?

Pick one answer.

Watch

Tap each point on the timeline.

Tap each layer, from the bottom. Wide at the bottom, thin at the top. That shape is the testing pyramid: Many fast unit tests at the bottom, some integration tests, a few slow end-to-end tests on top..

Try it

Which layer does each test belong to?

Drag a card into a box. Or tap the card, then tap the box.

        Predict

        A bug sneaks into the tax maths.

        Which station will stop the line? Tap it, then press Run.

        What happened on GitHub

        Workflow file .github/workflows/tests.yml

        name: Tests
        on:
        push:
        branches: [main]
        pull_request:
        permissions:
        contents: read
        jobs:
        tests:
        runs-on: ubuntu-latest
        steps:
        - uses: actions/checkout@v7
        - run: npm ci
        - run: npm run test:unit
        - run: npm run test:integration
        - run: npm run test:e2e
        

        The line

        Pull request · feature → main

        Check

        Good test plan, or needs work? Swipe each one.

        Swipe right for good, left for needs work. Or use the buttons.

        1 / 4

        Test every price rule with unit tests

        Test every price rule with unit tests

        You did it!

        You can now plan tests like a pyramid: many fast, few slow.

        Go deeper (optional)

        Some teams draw a different shape, with more integration tests. The big idea stays: many fast tests, few slow ones. Slow end-to-end tests can also run nightly, on a schedule.

        Real rep (optional): count the tests in a project you know. Is it shaped like a pyramid, or upside down?