Help evaluate technique (newby)

Help evaluate technique (newby)

Post by Steve Jorgense » Fri, 18 Jul 2003 07:10:47



I just finished Part 1 working through the challenge tests at
http://xp123.com/xplor/xp0201/, and I saw myself doing something that I don't
know if is considered good or bad form.  I'm posting here hoping for feedback,
postive or negative.

At one point, I had just finished making a test pass, and I didn't see any
refactoring that seemed to be needed.  Then I added the next test to my test
class, and saw that it in light of -that- test, there was some refactoring
required before it would be simple to implement.

My decision, at that point was to comment out the new test, so all tests pass
again, then refactor.  I refactored in the smallest chunks I could manage, and
ran tests after each change (including sometimes when I expected failures, but
wanted to see if the failures were precisely the ones I expected).

After the refactoring was complete and tests passed, I proceeded to uncomment
the new test again and implement the code to make the test pass.  After some
final refactoring, the tests still passed, and I was done with Part 1.

I guess the question would be, at the point where a new test makes some
refactoring seem to be in order, was I right to hold off on the new test, and do
the refactoring first?  Or should I have tried to figure out a simple way to get
the next test to pass (though none was coming to mind), then refactor afterward?

Thanks for any feedback,

- Steve Jorgensen

 
 
 

Help evaluate technique (newby)

Post by Phli » Fri, 18 Jul 2003 15:19:55



> I just finished Part 1 working through the challenge tests at
> http://xp123.com/xplor/xp0201/, and I saw myself doing something that I
don't
> know if is considered good or bad form.  I'm posting here hoping for
feedback,
> postive or negative.

> At one point, I had just finished making a test pass, and I didn't see any
> refactoring that seemed to be needed.  Then I added the next test to my
test
> class, and saw that it in light of -that- test, there was some refactoring
> required before it would be simple to implement.

> My decision, at that point was to comment out the new test, so all tests
pass
> again, then refactor.  I refactored in the smallest chunks I could manage,
and
> ran tests after each change (including sometimes when I expected failures,
but
> wanted to see if the failures were precisely the ones I expected).

> After the refactoring was complete and tests passed, I proceeded to
uncomment
> the new test again and implement the code to make the test pass.  After
some
> final refactoring, the tests still passed, and I was done with Part 1.

> I guess the question would be, at the point where a new test makes some
> refactoring seem to be in order, was I right to hold off on the new test,
and do
> the refactoring first?  Or should I have tried to figure out a simple way
to get
> the next test to pass (though none was coming to mind), then refactor

afterward?

You have correctly picked up the meme that all tests are sacred, and none of
them should ever regress.

That meme applies, for Programmer Tests, from the time you commit onwards.

The "suspend a test" pattern applies, quite legitimately, to situations
where growing function X gets easier if function Y would have already
existed first. You comment out test_X and use test_Y to grow Y. Then you go
back and restore test_X and use it to finish X.

There are those who claim to obey the rule "only one interruption level"
here. They won't interrupt test_Y to start test_Z.

And, of course, during a big rework session you'l temporarily disable tests
that "get in the way".

However, if your friendly neighborhood coach catches you...

--
  Phlip
    http://www.c2.com/cgi/wiki?TestFirstUserInterfaces

 
 
 

Help evaluate technique (newby)

Post by John Rot » Fri, 18 Jul 2003 17:21:13



Quote:> I just finished Part 1 working through the challenge tests at
> http://xp123.com/xplor/xp0201/, and I saw myself doing something that I
don't
> know if is considered good or bad form.  I'm posting here hoping for
feedback,
> postive or negative.

> At one point, I had just finished making a test pass, and I didn't see any
> refactoring that seemed to be needed.  Then I added the next test to my
test
> class, and saw that it in light of -that- test, there was some refactoring
> required before it would be simple to implement.

> My decision, at that point was to comment out the new test, so all tests
pass
> again, then refactor.  I refactored in the smallest chunks I could manage,
and
> ran tests after each change (including sometimes when I expected failures,
but
> wanted to see if the failures were precisely the ones I expected).

> After the refactoring was complete and tests passed, I proceeded to
uncomment
> the new test again and implement the code to make the test pass.  After
some
> final refactoring, the tests still passed, and I was done with Part 1.

> I guess the question would be, at the point where a new test makes some
> refactoring seem to be in order, was I right to hold off on the new test,
and do
> the refactoring first?  Or should I have tried to figure out a simple way
to get
> the next test to pass (though none was coming to mind), then refactor
afterward?

> Thanks for any feedback,

I don't know that there's a single "right" answer. It depends on a
lot of factors, and some of them are personal work habits.

John Roth

- Show quoted text -

Quote:

> - Steve Jorgensen

 
 
 

Help evaluate technique (newby)

Post by Robert C. Mart » Sat, 19 Jul 2003 04:31:38



written this on (or about)  Wed, 16 Jul 2003 22:10:47 GMT, :

Quote:>I just finished Part 1 working through the challenge tests at
>http://xp123.com/xplor/xp0201/, and I saw myself doing something that I don't
>know if is considered good or bad form.  I'm posting here hoping for feedback,
>postive or negative.

>At one point, I had just finished making a test pass, and I didn't see any
>refactoring that seemed to be needed.  Then I added the next test to my test
>class, and saw that it in light of -that- test, there was some refactoring
>required before it would be simple to implement.

>My decision, at that point was to comment out the new test, so all tests pass
>again, then refactor.  I refactored in the smallest chunks I could manage, and
>ran tests after each change (including sometimes when I expected failures, but
>wanted to see if the failures were precisely the ones I expected).

>After the refactoring was complete and tests passed, I proceeded to uncomment
>the new test again and implement the code to make the test pass.  After some
>final refactoring, the tests still passed, and I was done with Part 1.

>I guess the question would be, at the point where a new test makes some
>refactoring seem to be in order, was I right to hold off on the new test, and do
>the refactoring first?  Or should I have tried to figure out a simple way to get
>the next test to pass (though none was coming to mind), then refactor afterward?

I've seen it done both ways, and can't say that either was incorrect.
It's pretty much a judgement call.  Most of the time I prefer to
comment out the test and refactor first; but there are times when it's
better to make the second test pass by hook or crook, and then
refactor.

Robert C. Martin  | "Uncle Bob"                  

PO Box 5757       | Tel: (800) 338-6716        
565 Lakeview Pkwy | Fax: (847) 573-1658           | www.objectmentor.com
Suite 135         |                               | www.XProgramming.com
Vernon Hills, IL, | Training and Mentoring        | www.junit.org
60061             | OO, XP, Java, C++, Python     |

 
 
 

1. Newby needs help to create a transparent window

I am attempting to write a Win32 program which has a transparent main
window but can't figure out how to do this.  The
wndclass.hbrBackground gives me the color but it is always opaque.  

I need this in order to create a full-screen window where the area I
draw is on the right-hand third and the bottom third.  For the left
and top 2/3's I want whatever is displayed by other windows to show
through.  Any suggestions/guidance would be greatly appreciated.

Thanks in advance,
Greg
Greg

2. Line 1111/1010 emulator error

3. newby needs help with input

4. Major vendors quit bundling NT

5. Newby needs help!

6. Extracting contents of library.

7. Help a newby please

8. 16-Bit-functin WInNoShutdown

9. Evaluating Object Databases- help!

10. Need help in evaluating FUSION OO development methodology

11. Help on evaluating software development products

12. Help with Windows printing techniques

13. HELP: how to create TWO VIEWS with MFC & DRAG/DROP techniques