views:

188

answers:

3

I've found that test first development can be painful if the workflow is slow. It can take a long time to write a test, compile, run the tests, write code, compile, then run the tests again. Part of the problem is that the delays to compile and run tests to some extent interrupts my flow. When my brain has an idea, I want to be able to get it out and test it quickly.

I'm looking for an editor or IDE that does TDD well. By well, I mean:

  • TDD workflow can be done entirely using keyboard shortcuts
  • Tests are launched quickly
  • Easy to view test results
  • Fast compilation (I know this depends on language/code size)
  • Overall speed

The 2 languages I care about are C# and Python.

What editor/IDE do you use? What does your workflow look like (i.e. the things you need to click on, the keyboard shortcuts you use, etc.) to complete one new method using TDD? any recommendations?

+1  A: 

I've always found Visual Studio + Test Driven.NET to be the best. The test runner built into VS2008 is, I agree, fairly slow.

Netbeans is pretty fast too, but that's not for C#...

Rob Stevenson-Leggett
+2  A: 

vim/bash/screen

The workflow is this: (starting from command mode in a vim session editing the source files)

to compile and run the test suite: <right-arrow><up-arrow><enter> (left and right arrow keys are bound to prev and next in screen, the next window is a bash terminal and the up-arrow selects the previous command which is 'make check', but can be modified to work with any language: the previous command should simply be the command to run your test suite)

If the unit test of function "foo" fails: <left-arrow>:ta foo<edit>

I still do not understand why IDE's are so praised. Modularity is good. Integration is bad.

William Pursell
Yah honestly, you can save a lot of time editing text using vim, ++
meder
+2  A: 

I use Eclipse & JUnit. Run Last Launched is Ctrl-F11, and I've configured it so that running my tests automatically saves my changes (Preferences --> Run/Debug --> Launching --> Save Required Dirty Editors Before Launching). Last week a friend gave me a small test; we found that in 12 minutes of coding at top speed, I had run my tests 36 times. Every 20 seconds my tests run, including save, compile, run, and watch the red/green. This wasn't a test to see how fast I could run my tests; it was an incidental and, at least to us, interesting data point. When I'm at my best, I'm running my tests three times a minute; Eclipse and JUnit make that possible.

I've used Visual Studio with its native test system (nunit? I've forgotten); switching between the "I"DE and the test runner is infuriating. I know there are plugins available that eliminate that pain, and I'd recommend finding them.

Carl Manaster