| Rod Waldhoff's Weblog |
|
|
Rod Waldhoff's Weblog Monday, 5 May 2003
The Pleasures of Profiling #
Prompted by Nick's post about Axion's insert performance and some internal product delivery schedules, I've been doing some profiling and tuning of Axion's performance (with some good results). I'm reminded of how much I truly enjoy this activity. I can tell you don't believe me, so I took some notes and wrote up a brief account. Friday, 2 May 2003
Unit tests with log statements are a code smell #
While this is not an earth shattering realization, I've come hold the opinion that log statements (log4j, logkit, java.util.logging, commons-logging, what have you) within unit tests are a code smell, perhaps universally. While I'll sometimes add a few System.out.println calls to a unit test while I'm trying to diagnose a particular failure, configuring a full-blown logging setup within a unit test always seemed like more time and trouble than it was worth. From time to time I'll encounter a heavily logged TestCase in some code base I'm working with. The more I work with such TestCases, the more I find this to be an indication that something is not right. Here's why:
* If you find yourself wanting programmatic inspection of log messages, I'll suggest you're looking for messaging, not logging. |
recent posts
Currently Reading
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
© Copyright 2003 Rodney Waldhoff.
Last updated: 12/8/2003; 10:40:52 AM. |