test-driven

How to write a test method in NUnit for testing a savefile method?

I wrote a savefile method to save an object to xml. But I am not sure how to test the method in NUnit. Do I need create a sample file manually and compare the string between the files? Are there any better ways to test the method? Thanks for your answer. ...

Dynamic Testing Tools

I am looking for some sort of dynamic testing tool. Let me explain what I mean. I have a modular application and part of my business strategy is to license each module independently. I would like to test things such as the fact that one module's tests all still pass even when the other module is not present on the file system. Another t...

Dead-simple introduction to TDD (Test driven development)

Hello. Even though there are plenty introductions to TDD (even in PHP, my primary programming language now), I'm feeling a bit stuck about it. My friend introduced me TDD a while ago, but I wasn't actually able to understand it - what's the point in writing tests to everything first - even the simplest tasks - when in the end, it looks...

How do you figure out what test will best represent the feature you want to create?

Test driven development on wikipedia says first develop a test that will fail because the feature does not exist. Then build the code to pass the test. What does this test look like? How do you figure out what test will best represent the feature you want to create? Can someone give an example? Like if I make a logout button feature t...

In TDD, should tests be written by the person who implemented the feature under test?

We run a project in which we want to solve with test driven development. I thought about some questions that came up when initiating the project. One question was: Who should write the unit-test for a feature? Should the unit-test be written by the feature-implementing programmer? Or should the unit test be written by another programmer,...

How can you implement test driven development with legacy code?

The situation: millions of lines of code, more than one hundred developers and frequent defects. We want to avoid repeating defects and we want to improve code design (who doesn't?). Test Driven Development (first unit test, then code) sounds ideal: write a test case for each function. But, with so much code written, how can TDD be imp...

Integration vs Unit Testing

Im developing with Grails. Since the framework will bootstrap data and a fully flushed out spring context, I find that I write a lot of integration tests for services. Let me rephrase that: I find I write no unit tests for services, only integration tests. Is this a bad idea? The only downside I see to it is that my tests take a bit...

Test driven development: Void methods

I have been learning about TDD (using JUnit) and I have a doubt about how to go about testing void methods, in which case I can't directly use something like an assertTrue() on the return value of a method.. For example, say I have a simple console based application, and a part of it prints a menu on screen, say using this method: publi...

What is a good way to do a light unit-testing in an Rails web application?

I am on a tight timeline with minimum resources for a project. I would like to practice test driven development for this project, but realistically, i would not have time to learn any of the more sophisticated frameworks like Cucumber, Rspec, etc. And it would probably be counter-productive at this point anyway What do you recommend i...

What are some good examples of open source projects developed in a test-driven fashion?

I found http://stackoverflow.com/questions/2893841/open-source-projects-with-good-quality-tests but I wanted to ask something a bit different. I'm having a hard time visualizing how to build production code using TDD practices, particularly for networked database-driven applications where big chunks of functionality are dependent on one...

How do you tailor your dev process around adding unit tests to the build?

Hi folks, I have ran into a situation at work where it has been proposed to add our units tests to the Cruise Control continuous build process. The units test would be added as another project in CC, so that we would have a "Normal Build" project and a "Build and Test" project. We currently use the "Normal Build" process to a) make sure...