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.
Hint
One piece alone is unit. A few parts is integration. The whole app is end-to-end.Predict
A bug sneaks into the tax maths.
Which station will stop the line? Tap it, then press Run.
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.
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?
Bahasa Melayu
Pasukan Mei ada 300 ujian pelayar yang lambat. Ujian kecil cuma 5. Pipeline mereka ambil masa sejam. Apa anda nak ubah dulu?
Ketik setiap lapisan, dari bawah. Lebar di bawah, nipis di atas. Bentuk itu ialah piramid ujian (testing pyramid).
Setiap ujian ini milik lapisan mana?
Satu pepijat masuk ke kiraan cukai.
Pelan ujian yang baik, atau perlu dibaiki? Leret setiap satu.
Kini anda boleh rancang ujian macam piramid.
You finished this before. Practice is always welcome!
Official docs: Building and testing Node.js · Playwright: running tests in CI
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?