Testing without knowledge of internal code structure, focusing on input-output behavior. The system is a 'black box' - you can't see inside.
Black-box testing simulates how real users interact with software. You don't know or care how the code is written. You only care about what you put in (input) and what comes out (output). This approach tests from a user's perspective, making it highly effective for finding real-world issues.
Like testing a microwave: You don't know the circuit board design. You put in food and time (input), press buttons (user action), and check if food is heated (output). You don't care about the internal circuits.
| Scenario | Steps | Expected Result | Why Black Box |
|---|---|---|---|
| Login Page Testing | Open login page → Enter username 'john@email.com' → Enter password '12345678' → Click Login | Dashboard loads, user is logged in | You don't know how password is validated internally. You only verify the end result. |
| E-commerce Checkout | Add item to cart → Go to checkout → Enter shipping address → Select payment method → Click Pay | Order confirmation page, email sent | You test the workflow from user perspective, not internal database operations. |
| Form Validation | Leave email field empty → Click Submit | Error message 'Email is required' | You verify what the user sees, not how validation code works. |
You're testing a password reset feature. You enter your email and get a 'Password reset link sent' message, but you never receive the email. As a black-box tester, how do you investigate and report this bug?
🔒 Black-box: User perspective, no code access. Test what you see and experience as a user.
Interviewers want to see you understand the user's perspective and think about real-world scenarios.