Search the web
Sign In
New User? Sign Up
agile-testing · Agile Software Testing
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Automated testing of logging feature   Message List  
Reply | Forward Message #17523 of 18124 |
Re: [agile-testing] Automated testing of logging feature

Daniel Wellman wrote:
> The short answer is that most logging tends to be an afterthought rather
> than treated with the same care as the other business-requested
> features. This typically means a proliferation of log statements
> scattered throughout the code. If the logs we're talking about are used
> by the operations group for critical support, then it's important that
> those messages get unit tested. The most common use of Log4j sprinkles
> static method calls to Logger.getLogger() throughout several classes and
> is hard to test. Instead, Freeman and Pryce recommend treating logging
> as a service which gets injected into classes that need it, and unit
> tested that way.

I whole-heartedly agree that logging should be a first-class user story.
Too many apps fill up the log with trivia, yet don't contain the
information needed for in-production fault isolation.

If you've already got code that fetches a logger rather than having one
injected, it's quite easy under Log4J to programmatically insert your
own appender. The static getLogger() calls are just easy entry points
into a very configurable system.

- George

--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------




Sat Jul 11, 2009 3:23 pm

gdinwiddie
Offline Offline
Send Email Send Email

Forward
Message #17523 of 18124 |
Expand Messages Author Sort by Date

Hello all, I'm working on an agile project and we have been writing acceptance tests for every story so far. We are using Log4J for logging, and so far the...
Tomas Pollak
tomas_pollak
Offline Send Email
Jul 10, 2009
2:17 pm

... Let me see if I understand correctly. Latent problems may exist in your software that are yet undetected and the customer wants these, as they happen, to...
Kaleb Pederson
kaleb_pederson
Offline Send Email
Jul 10, 2009
3:45 pm

Hmmm.... One option would be to assume Log4J handles the actually file writes, and then override it to redirect what it would write to a file, so it actually...
John Overbaugh
john.overbaugh@...
Send Email
Jul 10, 2009
3:45 pm

My favorite writeup on logging is from the soon-to-be-released book "Growing Object-Oriented Software, Guided by Tests" by Steve Freeman and Nat Pryce, the...
Daniel Wellman
etl_dan
Offline Send Email
Jul 11, 2009
1:29 am

... I whole-heartedly agree that logging should be a first-class user story. Too many apps fill up the log with trivia, yet don't contain the information...
George Dinwiddie
gdinwiddie
Offline Send Email
Jul 11, 2009
3:24 pm

... Agreed.  What I like most about Freeman & Pryce's approach is that they essentially make the logging service an interface, so instead of doing something...
Daniel Wellman
etl_dan
Offline Send Email
Jul 11, 2009
4:17 pm

Log4j already has lots of capabilities to write to a port (SocketAppender and SocketHubAppender). We've used this to write a general purpose functional test...
Bradley, Todd
todd404
Online Now Send Email
Jul 13, 2009
1:39 pm

see texttest (www.texttest.org, described in chapter 10 of my book), which is a full acceptance testing framework designed around analysing log entries. -- ...
Gojko Adzic
gojko_lastname
Offline Send Email
Jul 11, 2009
1:22 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help