| Author |
linking seams/aspects
|
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 23645
|
|
One of the techniques is to create a seam to alter behavior without changing code. In the book, link seams (changing the files the linker uses) are an example. It seems like aspects would be the equivalent in Java. Is it a problem effectively changing the compilation for testing? If you aren't testing what gets deployed, can't bugs still get through? (I'm not that comfortable with Aspect Oriented Programming and its effects on testing yet.) Or is this more similar to mocks? [edited to fix typo] [ November 16, 2004: Message edited by: Jeanne Boyarsky ]
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta
|
 |
Michael Feathers
author
Greenhorn
Joined: Aug 24, 2004
Posts: 24
|
|
Originally posted by Jeanne Boyarsky: One of the techniques is to create a seam to alter behavior without changing code. In the book, link seams (changing the files the linker uses) are an example. It seems like aspects would be the equivalent in Java. Is it a problem effectively changing the compilation for testing? If you aren't testing what gets deployed, can't bugs still get through? (I'm not that comfortable with Aspect Oriented Programming and its effects on testing yet.) Or is this more similar to mocks? [edited to fix typo] [ November 16, 2004: Message edited by: Jeanne Boyarsky ]
Great question. It is important to have higher level tests of the full application, but the kind of testing that I'm concentrating on is really unit testing, testing pieces in isolation. And, if you have to introduce seams to do that you do get a very tangible benefit. You are able to examine a class or a function by itself and feel confident that you've changed it the way you expected. Re: Aspects, yes, that is one approach, but OO itself gives us seams to exploit. The discussion on 'object seams' gets into that a bit.
|
Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0131177052/ref=jranch-20" target="_blank" rel="nofollow">Working Effectively with Legacy Code</a>
|
 |
Alexandru Popescu
Ranch Hand
Joined: Jul 12, 2004
Posts: 995
|
|
It seems that lexic stuff here just lost me on the way :-(.
Is it a problem effectively changing the compilation for testing?
What do you mean by this?
If you aren't testing what gets deployed, can't bugs still get through?
Please help me out .
(I'm not that comfortable with Aspect Oriented Programming and its effects on testing yet.) Or is this more similar to mocks?
Completely lost, as these techniques are going completely 2 different ways. ./pope ps: don't get angry on a non-native english guy (that's me - not even the dictionary could help me :-) )
|
blog - InfoQ.com
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11945
|
|
Originally posted by Ali Pope: Is it a problem effectively changing the compilation for testing? What do you mean by this?
I believe he's talking about a situation where you replace some of the linked ("linked" as in C/C++) resources with just-for-testing replacements to help testing the component under test. The doubt Jeanne has would then be along the lines of whether it's safe to "mock" things that affect the compilation process of your C/C++ application. Did I get it even remotely correct?
|
Author of Test Driven (Manning Publications, 2007) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
Alexandru Popescu
Ranch Hand
Joined: Jul 12, 2004
Posts: 995
|
|
Thanks Lasse. I guess we both under the some doubt umbrella :-). However your explanation seems to me pretty interesting and I would translate it into Java world as mocking functionality (and not using AOP ). I will wait for more explanations on this. ./pope
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 23645
|
|
Lasse, That is exactly what I was trying to say! Michael, You're right. Seams are more like mocks than aspects. Mocks are interfaces to the program from other classes. I feel comfortable with those as the interface is just a contract. So it follows that a linking seam would be the same. Thanks!
|
 |
 |
|
|
subject: linking seams/aspects
|
|
|