Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Instrumentation Strategies


#1

Most of my clients only require exception reporting so I find SmartInspect richly invaluable as a logging tool. However since my clients are not willing to speed time and effort instrumenting code I have no practical experience in this area.

Is there any recommended book or source that provides insight into the pros and cons of instrumenting code along with concrete strategies for achieving this goal?

Any guidance would be greatly appreciated.


#2

Hello Kevin,

Sorry for the late response. It’s difficult to give a recommendation about a book as there are no general books about logging as far as I know. There are some books about specific logging frameworks such as log4j (Java logging framework) but they are more like manuals on how to use the specific framework rather than a general strategy guide. Also, while logging and error handling are also regularly covered in general (programming or programming language) books, these topics usually don’t go very deep and also just explain the technical basics.

One reason there are so few books about logging is that logging and instrumenting strategies often depend on the actual application that is instrumented. There are some approaches that are commonly used for certain types of applications (network servers, multi-tier architectures, desktop applications) but in the end, instrumenting an application is usually a very customized process.

A simple instrumenting strategy that works well is to instrument the most important parts of your application first and then add more coverage later. Personally, I’m no big fan of cluttering the source code with too many logging statements and tend to keep the coverage consistent across the entire application with instrumenting just the important events. Tools like PostSharp can help to achieve a great coverage with minimal effort and source code changes.

Hope that helps. You can also write us an email (contact@gurock.com) or use our support form in case you want to discuss this in more depth or have any specific questions.

http://www.gurock.com/customers/support/

Regards,
Tobias