[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

official poll - unit testing

John Maclean

4/2/2009 1:41:00 AM

Hello,
My name is Mr Official and I am hereby asking you to participating in
my poll. "Do you really do unit testing?"

Acceptable answers;

* Janet Jackme does my dishes cos I unit test all of the time
* I only unit test when < insert reason for testing>


--
John Maclean
07739 171 531
MSc (DIC)

Timezone: GMT

7 Answers

Phlip

4/2/2009 1:56:00 AM

0

> * I only unit test when

the wind blows...

David Masover

4/2/2009 3:41:00 AM

0

On Wednesday 01 April 2009 20:40:37 john maclean wrote:
> Hello,
> My name is Mr Official and I am hereby asking you to participating in
> my poll. "Do you really do unit testing?"
[...]
> * I only unit test when

I only unit test when I have enough of a concept of what I'm trying to build
that a test makes sense.

Places where I don't test:

- Vague prototypes. Tests are a way to describe how something should behave.
If I don't yet know how it's supposed to behave, I can't really write a test.
Sometimes, you just have to experiment.

- Tiny one-off scripts. Often, writing a test for these would require
duplicating most of what the script already does, and it's not likely to
contain any subtle bugs that you wouldn't find by just running it.

- UIs. Mostly because I haven't gotten around to learning Selenium or
anything similar. Also because this is the hardest place to automate testing,
and the easiest place to manually test.

Michael Malone

4/2/2009 4:10:00 AM

0

john maclean wrote:
> Hello,
> My name is Mr Official and I am hereby asking you to participating in
> my poll. "Do you really do unit testing?"
>
> Acceptable answers;
>
> * Janet Jackme does my dishes cos I unit test all of the time
> * I only unit test when < insert reason for testing>
>
>
>
In truth, I only unit test after something breaks. I guess I start
doing things thinking "this will only be a one or two line change" and
before I know it, I've added an extra module of code that is largely
based on old code, but just different enough to break it. I also find
that working in Ruby is counter-productive to working up the mental
drive to unit test. This is not me getting all fanatic about ruby (ok,
much) but it's true of other dynamic languages. I grew up on Java and C
and with that, one tends to get bogged down in so much detail trying to
translate behaviour into code, that testing is a nice, high-level view
of your program that validates your design to some degree. In dynamic
languages, things are already pretty high-level and the tendency here is
to believe that writing code correctly every time is about as difficult
as writing english sentences with correct grammar each time. A quick
run through the spell checker (ruby -wc) and everything's done, right?

So yes, it's probably the confidence I get from a dynamic language
_after_ C and the like that lets me believe that I've become a brilliant
coder overnight because I can suddenly parse strings quickly without
worrying about memory leaks, pointers and NUL chars (when I was at
university we had a 10% test dedicated to doing just that!). In short,
the bug minefields I trained to be extra-worried about no longer exist,
so setting up a Unit Test for the 'easy bits' mentally seems like more
effort than it's worth. Until it breaks. Part of solving the problem
is obviously defining the solution, to me, which is exactly where the
test comes!

It might be a slightly contradictory way of looking at things, but it's
certainly honest!

Michael

=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================


Tom Cloyd

4/2/2009 4:43:00 AM

0

john maclean wrote:
> Hello,
> My name is Mr Official and I am hereby asking you to participating in
> my poll. "Do you really do unit testing?"
>
> Acceptable answers;
>
> * Janet Jackme does my dishes cos I unit test all of the time
> * I only unit test when < insert reason for testing>
>
>
>
And from whatever data you get what do you expect to infer?

This is waste of time. At most, you'll get a frequency distribution of
those who responds.

Meaning...what?

You cannot know.

t.

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website)
<< sleightmind.wordpress.com >> (mental health weblog)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Julian Leviston

4/2/2009 8:00:00 AM

0

Personally, bdd rocks.

Blog: http://random8.ze...
Learn rails: http://sensei.ze...

On 02/04/2009, at 2:41 PM, David Masover <ninja@slaphack.com> wrote:

> On Wednesday 01 April 2009 20:40:37 john maclean wrote:
>> Hello,
>> My name is Mr Official and I am hereby asking you to participating in
>> my poll. "Do you really do unit testing?"
> [...]
>> * I only unit test when
>
> I only unit test when I have enough of a concept of what I'm trying
> to build
> that a test makes sense.
>
> Places where I don't test:
>
> - Vague prototypes. Tests are a way to describe how something should
> behave.
> If I don't yet know how it's supposed to behave, I can't really
> write a test.
> Sometimes, you just have to experiment.
>
> - Tiny one-off scripts. Often, writing a test for these would require
> duplicating most of what the script already does, and it's not
> likely to
> contain any subtle bugs that you wouldn't find by just running it.
>
> - UIs. Mostly because I haven't gotten around to learning Selenium or
> anything similar. Also because this is the hardest place to automate
> testing,
> and the easiest place to manually test.
>

Eleanor McHugh

4/2/2009 8:05:00 AM

0

On 2 Apr 2009, at 02:40, john maclean wrote:
> Hello,
> My name is Mr Official and I am hereby asking you to participating in
> my poll. "Do you really do unit testing?"
>
> Acceptable answers;
>
> * Janet Jackme does my dishes cos I unit test all of the time
> * I only unit test when < insert reason for testing>

I only unit test for satirical effect.


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-...
----
raise ArgumentError unless @reality.responds_to? :reason



John Maclean

4/2/2009 10:02:00 AM

0

2009/4/2 Julian Leviston <julian@coretech.net.au>:
> Personally, bdd rocks.
>
> Blog: http://random8.ze...
> Learn rails: http://sensei.ze...
>
> On 02/04/2009, at 2:41 PM, David Masover <ninja@slaphack.com> wrote:
>
>> On Wednesday 01 April 2009 20:40:37 john maclean wrote:
>>>
>>> Hello,
>>> My name is Mr Official and I am hereby asking you to participating in
>>> my poll. "Do you really do unit testing?"
>>
>> [...]
>>>
>>> * I only unit test when
>>
>> I only unit test when I have enough of a concept of what I'm trying to
>> build
>> that a test makes sense.
>>
>> Places where I don't test:
>>
>> - Vague prototypes. Tests are a way to describe how something should
>> behave.
>> If I don't yet know how it's supposed to behave, I can't really write a
>> test.
>> Sometimes, you just have to experiment.
>>
>> - Tiny one-off scripts. Often, writing a test for these would require
>> duplicating most of what the script already does, and it's not likely to
>> contain any subtle bugs that you wouldn't find by just running it.
>>
>> - UIs. Mostly because I haven't gotten around to learning Selenium or
>> anything similar. Also because this is the hardest place to automate
>> testing,
>> and the easiest place to manually test.
>>
>
>

Julian,

Looks like you've just started your blog but when I search for bdd I
get a "undefined local variable or method `on_empty' for #". That
supposed to happen?


--
John Maclean
07739 171 531
MSc (DIC)

Timezone: GMT