Skip to main content
Dat 3rd Sem Fall 2025
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Test Types

Test types

🔲   Black-box Testing

Definition:
Black-box testing is a method of software testing that focuses on what the software does, without any knowledge of the internal code or logic.

Key points:

  • The tester only knows the inputs and expected outputs.
  • Tests are based on requirements and functionality.
  • Common techniques: boundary value analysis, equivalence partitioning, state transition testing.
  • Used for system testing, acceptance testing, and often integration testing.

Example:
Testing a login form by entering valid and invalid usernames/passwords to see if the system behaves correctly, without knowing how the authentication is implemented internally.


⚪   White-box Testing

Definition:
White-box testing (also called clear-box or glass-box testing) is a method where the tester has access to the internal code, and tests are based on the internal logic and structure of the code.

Key points:

  • The tester uses knowledge of the source code to design test cases.
  • Focuses on code paths, conditions, loops, and branches.
  • Common techniques: statement coverage, branch coverage, path testing.
  • Often used for unit testing and security testing.

Example:
Testing each possible branch of an if statement in a function to make sure every line of code is executed at least once.

Comparison Black vs White testing

FeatureBlack-box TestingWhite-box Testing
FocusFunctionality / behaviorInternal logic / code structure
Tester knows code?❌ No knowledge of internal code✅ Full knowledge of internal code
Test basisRequirements and specificationsSource code, control flow, and logic
Typical useSystem, integration, and acceptance testingUnit testing, sometimes integration
Test techniques- Equivalence partitioning
- Boundary value analysis
- State transition
- Statement coverage
- Branch coverage
- Path testing
ToolsUI test frameworks, API testing toolsUnit test frameworks, static code analyzers
ExamplesTesting a form submission, login page, or API responseTesting all code paths in a sorting function
Best for detectingMissing or incorrect functionalityLogic errors, unreachable code, security issues