Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

We want to implement a fairly rough outline of test driven development which involves a developer asking themselves the tests at each stage of the development process. I have read here that its impossible to perform TDD without a tool. Is this true?

share|improve this question

migrated from stackoverflow.com Jun 1 '11 at 15:05

This question came from our site for professional and enthusiast programmers.

1  
What does "the developer asking themselves the tests" mean? –  Rein Henrichs Jun 1 '11 at 23:39
    
And what do you expect to gain by not using existing tools built expressly for this purpose? –  Rein Henrichs Jun 1 '11 at 23:40
add comment

10 Answers 10

up vote 10 down vote accepted

It's possible, it's just more tedious and slow (except for very simple/small tests, where the overhead of setting up and learning and using the tool might be higher than doing it all by hand - this doesn't happen often except for trivial or near-trivial systems). A smart developer will eventually build their own tools, even if it's just a set of shell/batch scripts.

share|improve this answer
add comment

Impossible? No. Probably painful and difficult? Yes.

You can use the tool to run your tests and get instant visual feedback (red/green) on your current progress. If you don't use a test runner you'll probably end up writing rough scripts that execute your tests for you and give you some sort of feedback on your current progress. What's the point? Use a tool (there are great free ones available, and they are easy to learn).

share|improve this answer
add comment

Well, yes and no.

One of the points of the test driven development is that a bunch of test are run constantly during the development of the functionality. Who and how runs the test is of secondary importance.

However, someone having to run the test manually every time he changes something, will soon get tedious, and any programmer worth his salt will automate that task, eventually making a tool of his own (if no more that a set of scripts).

So you do not have to buy or install a tool that facilitates TDD, but that basically means that you'll have to make one yourself.

share|improve this answer
add comment

I'm sure it is possible, but why would you want to? Most testing frameworks are free for you to use and if you have VS2010 you can use MSTest.

share|improve this answer
add comment

absolutely, the "tool" just gives you a nice library to work with and a nice UI to visualize and organize your tests, but a simple small class could do the job or providing the feedback, and you could just write the results to the console

share|improve this answer
add comment

Nothing's impossible I guess but it sure wouldn't be much fun. Our tool of choice is nUnit and the Visual Studio add-on TestDriven.NET. They're both SO easy to get set up.

share|improve this answer
add comment

In TDD you express the requirements as a test and then write code that passes the test. The tools are simply a framework that runs your code and checks the result. The main ones, based on the xUnit family, are free and open-source, and very light-weight.

share|improve this answer
add comment

I would not even go so far as to say that it would be that much more difficult. Just write a simple Console App with your test classes. Your tests should be kept relatively simple anyway. The only thing that could be a bit annoying to implement on your own is the reflection necessary to access private fields and methods. Beyond that, you could easily write your own assert methods in no time at all.

That would cover automated testing, which makes the methodology of TDD much faster. automation is not required for TDD, but it should be noted that TDD is much more than simply having tests. Automated testing, or any other tool will never make it TDD. TDD has more to do with the order in which you do work (Red, Green, Refactor). I would say that regardless of how you are getting anything done, if you are writing tests that start out failing, then do something else that makes them pass (other than changing the tests), then repeat, you are doing TDD

share|improve this answer
add comment

automated tests save time and provide objective evaluation of completeness and correctness (up to a point, obviously)

manual ask-yourself-a-question "Tests" not only would not save time, they would waste time and be nearly pointless

I'm hoping that I misunderstood this question, because it seems incredibly...misguided.

share|improve this answer
add comment
  • You don't need a "test tool" to have automated tests
  • You CAN do TDD without "test tools"

How easy it is to do TDD without a test framework depends on the platform. In most scripting languages it's incredibly easy. In compiled languages it can be harder, but not always. In most cases you will probably end up writing your own "test tool".

To say it can't be done is silly since we can be sure TDD came before TDD tools. Tools facilitate the writing of tests. As such the building of a tool is a process of refinement rather that of original creation.

The automatic running of tests does require some sort of program that at least loops, and execute a command (ie. make build). So in that sense perhaps you do need a "tool". However, this would be using "tool" in such a broad sense as to almost make it meaningless.

You can say that it will be more expensive to develop if you choose not to use a tool since they are created for the express purpose of making the process easier and faster.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.