Designing Effective Microtests
Black-Box and White-Box Testing
The kind of testing that verifies behavior from specification, without knowing
or making assumptions about the implementation, is known as black-box testing.When testers and developers talk about black-box testing, they mean
that the entire software is a black box. This approach of testing-by-pretending-to-be-a-user
is very popular and very effective.
The inverse of black-box testing is when you look inside the system or the code, understand its internal structure, processing and flow, and test these internals.This approach is called white-box testing. White-box tests are often too closely coupled to the code and make your tests fragile, since changes to your code often requires changes to your test code.
In microtesting, we treat classes as black boxes, as much as possible.
The inverse of black-box testing is when you look inside the system or the code, understand its internal structure, processing and flow, and test these internals.This approach is called white-box testing. White-box tests are often too closely coupled to the code and make your tests fragile, since changes to your code often requires changes to your test code.
In microtesting, we avoid white-box testing if at all possible.
(Reading...)
Formatting Hints:
To format... | use this markup: |
---|---|
source code | {source:lang=java|lineNumbers=false}...{source} (Supported languages: java, cpp, csharp, c, python.) |
bold text | __some text__ |
italicized text | ~~some text~~ |
underlined text | @@some text@@ |
a method or class name | ``myMethod(...)`` |