Blackbox vs Glassbox
Blackbox vs Glassbox
●
No, they're not window managers.
●
Blackbox tests use only the public, documented API.
▶
No cheating
▶
You have to forget how the code is implemented
▶
More closely approximates real world usage
▶
Immune from internal changes
▶
Often forces you to make the public API more flexible
●
Glassbox tests can use whatever you want.
▶
Cheat, steal, lie, violate encapsulation
▶
Often necessary to test certain 'untestable' parts
▶
May be broken by internal changes, undermines the test suite.
●
Blackbox is preferred where possible, glassbox is sometimes
necessary.
▶
Sometimes you can just peek inside the box.