Verify Intent over Implementation

As discussed in Chapter 3, all software has intent, and the first goal of testing is to verify the intent. Black-box testing is popular and effective because it verifies software purely by its intent rather than its implementation. However, most moderately complex algorithms or logic cannot be completely tested purely as a black box. Coverage-guided unit testing requires white-box insight into the implementation.

Notice that this principle says “intent over implementation” rather than “intent instead of implementation” as you find in more prescriptive statements. It is advisable and necessary to guide some level of testing, particularly unit tests, against the implementation, but you should never lose sight of the intent that the code is trying to produce.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.171.51