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...
Want to share photos of your group with the world? Add a group photo to Flickr.

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 #17520 of 18129 |
Re: [agile-testing] Automated testing of logging feature

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 sends it to a listener in your tests. It's open source, so you could modify the code if needed (it's also incredibly configurable, so you might be actually be able to configure it to write to a port). Alternatively, just do something which should be logged, then scan the destination file to see if it would be logged. But that's not actually answering the question--just a fun thing to think through.

Basically the acceptance test should be that, for every action which should be logged, is it actually appearing in the log? You have a user story ("Log stuff") which needs to be broken into individual user stories ("Log this activity," "Log that activity."), and each child story needs a test.

On Thu, Jul 9, 2009 at 10:03 AM, Tomas Pollak <tomas_pollak@...> wrote:


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 developers have been using it at their own will. But recently some problem that wasn't logged correctly has raised our customer's awareness on this, and he included a story for the next sprint saying that we should define some logging criteria to prevent these problems in the future, and apply it uniformly throughout the code.

My question is: how do you write acceptance tests for such a requirement? Our goal is that whatever tests we write on this sprint will also be useful as the code continues to evolve and more features (and their logging) are added.
Do you have some experience where you tested that the logging was correct that you can share? Any useful links?

Thanks,
Tomás




--
John Overbaugh
blog: http://thoughtsonqa.blogspot.com


Fri Jul 10, 2009 3:45 pm

john.overbaugh@...
Send Email Send Email

Forward
Message #17520 of 18129 |
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