Home › Interview Questions › Write a good test case. Also explain the concepts …

Write a good test case. Also explain the concepts of black box testing and white box testing.

🟡 Medium Conceptual Junior level
1Times asked
Oct 2026Last seen
Oct 2026First seen

💡 Model Answer

Test case example – Login functionality: 1. Test case ID: TC‑LOGIN‑001. 2. Pre‑condition: User account exists with username 'user1' and password 'Pass@123'. 3. Steps: a. Open the login page. b. Enter 'user1' in the username field. c. Enter 'Pass@123' in the password field. d. Click the 'Login' button. 4. Expected result: User is redirected to the dashboard and sees a welcome message. 5. Post‑condition: User session is created. 6. Pass/Fail criteria: The dashboard loads within 2 seconds and the welcome message contains the username. 7. Pass/Fail: Pass. 8. Notes: Test should be repeated with invalid credentials to verify error handling. 9. Test data: Valid credentials, invalid credentials, empty fields. 10. Test environment: Staging server. 11. Tested by: QA Engineer. 12. Date: 2024‑10‑25. 13. Status: Completed. 14. Result: Pass. 15. Comments: None. 16. Test case: Black‑box testing treats the software as a black box; testers design tests based on requirements and inputs/outputs without knowledge of internal code. It focuses on functional correctness, usability, and performance. 17. White‑box testing (or clear‑box testing) requires knowledge of the internal structure. Testers write unit tests, path coverage tests, and use code coverage tools to ensure that branches, loops, and error handling are exercised. 18. Key difference: Black‑box tests validate behavior, while white‑box tests validate implementation. 19. Complementary: Both are complementary; black‑box ensures the product meets user needs, and white‑box ensures the code is robust and maintainable.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500