Asking newcomers to make SUnit tests

tim Rowledge tim at rowledge.org
Thu Feb 9 00:23:39 UTC 2006


On 8-Feb-06, at 2:02 PM, Peace Jerome wrote:

> [BUG] Complex equality problem
> stéphane ducasse ducasse at iam.unibe.ch
> Wed Feb 8 16:58:32 CET 2006  wrote:
>
>
>> I suggest that you write SUnit tests to document your
> intention and
>> that we can follow what you are doing.
>
> context:
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2006- 
> February/100484.html
>
> Hi stef,
> I want to take issue with this suggestion to a new
> comer.

I guess I'd agree with you statement *partially*. Certainly for a  
complete newcomer it might be very daunting although if someone could  
take a few moments (an hour or so?) to write a swiki page on creating  
a simple SUnit it could be very helpful as an introduction to a very  
good way of helping to explain a problem and the solution and  
providing an ongoing test. It would also be a quite broad learning  
experience since it involves using a browser, editing code,  
iteratively trying things and probably getting to know the debugger a  
little. How much better an introduction could we invent?

In this case I think the questioner has a fair bit of Smalltalk  
experience and an SUnit is a reasonable thing to suggest.

Think of it this way:-
you write a little code to express your starting situation -  
answer := (4 +4i) * (Pi + e i)
you write a comment along the lines of "I think this should result in  
whatever"
you write a line to express your expected answer - self should: 
[ answer = (1.693243300522992 + 23.43949792819535 i)]
If the SUnit fails you have a nice compact way of explaining the  
problem to the rest of us! Good result all round.


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Great leaders inspire by example. When that's not an option, brute  
intimidation works pretty well.





More information about the Squeak-dev mailing list