Testing From Multiple Angles
I just read Doug Alcorn’s post on Dynamic Constants and Their Pitfalls. Maybe constructing an automated unit test isn’t possible, but this could be caught with static analysis tools if a policy is written that doesn’t allow dynamically constructing constant strings. If automated, then a developer doesn’t need to think about it – until the policy is violated. And in that case the scanner flags the code and loads it up in the IDE for review. It’s fixed.
Developers can run static analysis tools at any time, even against code that doesn’t compile or is not complete. Do you use static analysis tools? I don’t want to single out Doug, but rather ask the general question would static analysis have saved any time in this case? Would automated static analysis create enough value to complement unit testing? How does this work for you?
- Andy

Leave a Reply