SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


RE:


Author
Message
avi_a
avi_a
SSC-Enthusiastic
SSC-Enthusiastic (141 reputation)SSC-Enthusiastic (141 reputation)SSC-Enthusiastic (141 reputation)SSC-Enthusiastic (141 reputation)SSC-Enthusiastic (141 reputation)SSC-Enthusiastic (141 reputation)SSC-Enthusiastic (141 reputation)SSC-Enthusiastic (141 reputation)

Group: General Forum Members
Points: 141 Visits: 36

Hi.

There is a cardinal mistake in the artcle about the TDD flow.

You wrote:

In TDD, we follow the steps below.

  • Create the test case for testing each tiny bit of functionality.
  • Run this test ( it will fail the first time as there is no code for this functionality.)
  • Write only the code to pass the test cases.
  • Run the test case again
  • If the test case fails refractor the code to pass the test case

However, in TDD you *never* refactor to make a test pass! You should get the test to pass in the simplest way (sometimes even by "cheating" with a hardcoded result), and then refactor only while all test are passing. This makes sure you'r refactorings are always just "refactoring" (i.e. just changing the structure of the code without changing behaviour), while assuring that you *always* have code that works (even if it's still being refactored).

Nevertheless I was happy to see this article on SQLServerCentral, and especially glad to hear about the TSQL perspective. (I've been doing TSQL TDD manually for several months now, without any framework.. it's definitely hard but worthwhile. )

- Avi





Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search