Blackbox vs Glassbox
No, they're not window managers
Blackbox tests use only the public, documented API
- 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
- My 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
Prev | toc | Next