Unittesting aspect-oriented features.
Posted
by Tomas Brambora
on Stack Overflow
See other posts from Stack Overflow
or by Tomas Brambora
Published on 2010-03-08T14:03:58Z
Indexed on
2010/03/08
14:06 UTC
Read the original article
Hit count: 373
Hi,
I'd like to know what would you propose as the best way to unit test aspect-oriented application features (well, perhaps that's not the best name, but it's the best I was able to come up with :-) ) such as logging or security?
These things are sort of omni-present in the application, so how to test them properly?
E.g. say that I'm writing a Cherrypy web server in Python. I can use a decorator to check whether the logged-in user has the permission to access a given page. But then I'd need to write a test for every page to see whether it works oK (or more like to see that I had not forgotten to check security perms for that page).
This could maybe (emphasis on maybe) be bearable if logging and/or security were implemented during the web server "normal business implementation". However, security and logging usually tend to be added to the app as an afterthough (or maybe that's just my experience, I'm usually given a server and then asked to implement security model :-) ).
Any thoughts on this are very welcome. I have currently 'solved' this issue by, well - not testing this at all. Thanks.
© Stack Overflow or respective owner