Which unit testing parcels should be installed/loaded?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Which unit testing parcels should be installed/loaded?

Conrad Taylor
Hi, could someone tell me the recommended unit testing parcels that should be loaded/installed?  Also, are there any of documentation for SUnit other than 'SUnit Explained' by Stephane Ducasse's paper?  I'm just looking for something that goes a bit more into detail as to how to properly structure your tests in regards to implementation code when you're TDD.  Last but least,
how does rename the currently selected method name?  When I click, 

'Rename...'

Dialog:  "At least one superclass of OperationTest already defines setUp
Do you want to proceed? Yes"

Dialog:  This will refactor all of the 5 implementors and 8 senders of #setup
Do you want to proceed?  No"

Note:  I answered 'No' because I'm not sure of the end result.

'Remove'

Dialog:  "Some od the methods to be removed are referenced elsewhere in the system:  setup -- 8 references"

Is there any an easier way to rename a method?  BTW, I'm using w7.8nc-nov10.3 and I'm not sure if this is a bug or not.

Thanks in advance,

-Conrad



 

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Which unit testing parcels should be installed/loaded?

Steffen Märcker
Hi Conrad,

I just load SUnitToo(ls) which loads SUnitToo as prerequisite.  
Additionally I use SMock for stubbing/mocking and SUnitToo(verage) for  
code coverage.

Renaming methods: If the system tells you that there are other  
implementors (classes) of that method it would rename those methods and  
all references to the methods selector. If that's not what I want rename  
that method manually (save with other selector, remove) and browse the  
references in order to change them as necessary.

Removing methods: If there are references to the selector, I browse those  
references to see whether removing affects the code sections. If not, I  
remove the method.

Regards, Steffen



Am 04.07.2011, 11:03 Uhr, schrieb Conrad Taylor <[hidden email]>:

> Hi, could someone tell me the recommended unit testing parcels that  
> should
> be loaded/installed?  Also, are there any of documentation for SUnit  
> other
> than 'SUnit Explained' by Stephane Ducasse's paper?  I'm just looking for
> something that goes a bit more into detail as to how to properly  
> structure
> your tests in regards to implementation code when you're TDD.  Last but
> least,
> how does rename the currently selected method name?  When I click,
>
> *'Rename...'*
>
> Dialog:  "At least one superclass of OperationTest already defines setUp
> Do you want to proceed? Yes"
>
> Dialog:  This will refactor all of the 5 implementors and 8 senders of
> #setup
> Do you want to proceed?  No"
>
> Note:  I answered 'No' because I'm not sure of the end result.
>
> *'Remove'*
>
> Dialog:  "Some od the methods to be removed are referenced elsewhere in  
> the
> system:  setup -- 8 references"
>
> Is there any an easier way to rename a method?  BTW, I'm using
> w7.8nc-nov10.3 and I'm not sure if this is a bug or not.
>
> Thanks in advance,
>
> -Conrad
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Which unit testing parcels should be installed/loaded?

Niall Ross
In reply to this post by Conrad Taylor
Dear Conrad,

>Hi, could someone tell me the recommended unit testing parcels that should
>be loaded/installed?  Also, are there any of documentation for SUnit other
>than 'SUnit Explained' by Stephane Ducasse's paper?  I'm just looking for
>something that goes a bit more into detail as to how to properly structure
>your tests in regards to implementation code when you're TDD.
>
Read the chapter Unit Testing in doc/ToolsGuide.pdf. (was updated in
7.7.1, IIRC 7.8 is much the same for that chapter).

(If you have questions after doing so, by all means post them here - we
can use them to improve the documentation further.)

>Last but
>least,
>how does rename the currently selected method name?  When I click,
>
>*'Rename...'*
>  
>
(My discussion shown in logical rather than appearance order of the
warnings.)

>Dialog:  This will refactor all of the 5 implementors and 8 senders of
>#setup
>Do you want to proceed?  No"
>  
>
There are 5 implementors of setUp in your image.  A straight rename will
rename all of them - not necessarily what you intend.  To rename one,
while leaving others, your choices are

 - if all the implementors and senders are in specific packages, you can
rename, then reload/revert the other packages that were changed
(provided they were not dirty or you had saved them)

 - You can load the RBDynamicRenamingUI parcel - read its comment and be
aware of method wrappers, and why you may not want to leave them in your
image.

 - Where you only want to name one method with few callers, and it has
many polymorphs that you do not want to rename, just do it by hand.

>
>
>Dialog:  "At least one superclass of OperationTest already defines setUp
>Do you want to proceed? Yes"
>  
>
This warning is more often useful when you rename _to_ the warned-of selector _from_ another name.

If you were renaming _to_ #setUp, the tool would be warning you that a superclass defines it, so you may want to add a
    super setUp
or else reconsider your chosen new name.

When you rename _from_ the warned-of name, it's having a superclass' implementor is less likely to be a surprise to you - probably you have the existing method selected and can see the icon telling you.  The warning has been there from the beginning, when there were no such icons, and of course may still alert a user to a superclass implementator they had not noticed.  Maybe we could subsume it in the "multiple implementors" warning, e.g.

        - There are N implementors (all in this hierarchy)

        - There are N implementors (not all in this hierarchy)


>*'Remove'*
>
>Dialog:  "Some of the methods to be removed are referenced elsewhere in the
>system:  setup -- 8 references"
>  
>
This is the 'remove' equivalent of the "8 senders" warning above.  You
can look at the senders and satisfy yourself none of them send the
implementor you are about to remove, or just proceed because you are
already sure they do not.

>Is there any an easier way to rename a method?  BTW, I'm using
>w7.8nc-nov10.3 and I'm not sure if this is a bug or not.
>  
>
No bug;  the system warns when what you are doing may have more effects
than you know, with a proceed, cancel and (often) a 3rd option to help
you resolve.
                Yours faithfully
                      Niall Ross

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc