Chapter 03 · Software Testing with AI Automation
Black Box vs White Box (Simple)
Black box = you cannot see the code. White box = you can. Most UI testing starts black box.
Why this matters
Job posts and interviews still ask this. Knowing the idea helps you choose techniques (boundary values vs unit tests) without memorising long definitions.
What you will learn
You will compare both styles, map them to LearnKart examples, and try one boundary-value idea (password length).
How to do it
We stay practical. Formal ISTQB wording can wait until you need a certificate.
Steps (do these in order)
- Step 1 — Black box picture. You only see inputs and outputs — like a customer using the website. Design cases from requirements.
- Step 2 — White box picture. You see code branches — like a developer writing unit tests for if/else. Coverage of lines/branches matters.
- Step 3 — Boundary example. If password must be 8–16 chars, test 7, 8, 16, 17. Boundaries catch off-by-one bugs.
- Step 4 — Grey box note. Sometimes you know the API contract but not all code — that middle ground is common in API testing.
- Step 5 — Pick for Volume 1. Playwright UI tests in the next chapters are mostly black box. Unit tests (white box) can join later.
Practice
- Label five checks as black or white box.
- Write boundary cases for “quantity 1–99” on a cart page.