tdd

What are good online introductions to testing and Test Driven Development?

I'm looking for an online introduction to unit testing and TDD. I have virtually no experience with TDD, unit testing, or any other agile methodology. My development environment is C++ on Linux. If there's a quality introduction to unit testing and TDD that uses C++ as the example language, that'd be great. If not then a general intr...

What is Test Driven Development? Does it require to have initial designs?

Hello Everybody, I am very new to TDD, not yet started using it. But i know that we have to write test first and then actual code to pass the test and refactor it till good design. My concern over TDD is that where does it fit in our SDLC. Suppose i get a requirement of making order processing system. Now, without having any model & de...

BDD And Unit Testing

I have been doing TDD and was using it more as unit testing than to drive my design. Recently I have read a lot about BDD; now that I have a better idea about them both, I was trying to figure out how to use BDD and unit testing concurrently. For example I would drive my design using BDD Dan North style ,and lets say am working on app...

Resources for TDD on Android

Anyone know of any good resources to get me started with test driven development on the Android platform? ...

Using rspec to test code prone to external infuence

Hi guys, I'm using rspec to test a code that may fail depending on the change of a site structure (the external influence I mentioned). I would like to write an example that involves "should raise an error" but I'm not sure if rspec is the right tool to test code in such situations. Could someone point me in some direction? Thanks in a...

How to adopt TDD and ensure adherence?

I'm a senior engineer working in a team of four others on a home-grown content management application that drives a large US pro sports web site. We have embarked upon this project some two years ago and chose Java as our platform, though my question is not Java-specific. Since we started, there has been some churn in our ranks. Each one...

TDD'ing MVC Controllers to drive design

Hi, I am starting out on a new project (well, restarting an existing one), and trying to adopt TDD (for the nth time) for all the benefits that it should bring. I believe that TDD will result in my tests driving me to write only the code that I need to write, but it will drive me to write the code that I NEED and not leave some out. T...

While doing TDD and adding features incrementally, do I design database ahead or add tables and columns while coding?

One of the most important opportunity TDD gives us, from my point of view, is to develop projects incrementally, adding features one by one, which means ideally we have working system at every point in time. What I am asking is, when the project involves working with a database, can we use this incremental approach for creating database ...

Unit testing Domain model objects

In our Core domain model design, we have got a class called "Category" whose constructor is internal by design. Since the constructor is internal, when writing unit test cases I won't be able to create the object of "Category". So my question, is it a best practice to make the constructor public just for making the "Category" class tes...

Is Scrum possible without test driven development?

I have now witnessed two companies move to agile development with scrum. In both cases the standard of coding was good enough when each part of the application was only being work on by one or two developers with the developers spending a reasonable amount of time working on one part of the application before moving to the next task. ...

How do I test Prism event aggregator subscriptions, on the UIThread?

I have a class, that subscribes to an event via PRISMs event aggregator. As it is somewhat hard to mock the event aggregator as noted here, I just instantiate a real one and pass it to the system under test. In my test I then publish the event via that aggregator and then check how my system under test reacts to it. Since the event wil...

Any teams out there using TypeMock? Is it worth the hefty price tag?

Hi, I hope this question is not 'controversial' - I'm just basically asking - has anyone here purchased TypeMock and been happy (or unhappy) with the results? We are a small dev shop of only 12 developers including the 2 dev managers. We've been using NMock so far but there are limitations. I have done research and started playing with...

What is the easiest set of tools to get started with Source Control, TDD, and CI for Microsoft.Net 2008/2010

I work on a team with three other developers and one business analyst writing internal business applications. We're primarily building apps in ASP.Net, and do so in a very 2003-ish way. It's like going back in a time machine. Although two of the other developers are amenable to learning new things, one of the developers is not. He's ...

Any sensible way of executing an ASP.NET MVC view from NUnit?

I'm aware of things like Selenium and WatiR, but what I'd like to be able to do is to test that the view renders the HTML I expect when it's presented with given inputs. No javascript debugging, just checking the HTML. However, to do that, I need to be able to execute the view programmatically. Is there any reasonable way of doing thi...

how to test or describe endless possibilities?

Example class in pseudocode: class SumCalculator method calculate(int1, int2) returns int What is a good way to test this? In other words how should I describe the behavior I need? test1: canDetermineSumOfTwoIntegers or test2: returnsSumOfTwoIntegers or test3: knowsFivePlusThreeIsEight Test1 and Test2 seem vague and it woul...

TDD test data loading methods

I am a TDD newb and I would like to figure out how to test the following code. I am trying to write my tests first, but I am having trouble for creating a test that touches my DataAccessor. I can't figure out how to fake it. I've done the extend the shipment class and override the Load() method; to continue testing the object. I feel...

Where to put my xUnit tests for an F# assembly?

I'm working on my first 'real' F# assembly, and trying to do things right. I've managed to get xUnit working too, but currently my test module is inside the same assembly. This bothers me a bit, because it means I'll be shipping an assembly where nearly half the code (and 80% of the API) is test methods. What is the 'right' way to do t...

How to run only the latest/a given test using Rspec?

Let's say I have a big spec file with 20 tests because I'm testing a large model and I had no other way of doing it : describe Blah it "should do X" do ... end it "should do Y" do ... end ... it "should do Z" do ... end end Running a single file is faster than running the whole test suite, but it's still pretty long. Is there ...

Test Driven Development with C++: How to test a class which depends on other classes?

Suppose I have a class A which depends on 3 other classes X, Y and Z, either A uses these through a reference or a pointer or say A is templated to be instantiated with X, Y and Z doesn't matter, the key is that in order to test A, I need to have X, Y and Z. So I need to have fakes for A, B and C. Suppose I write them. Now, how do I sw...

RSpec: Stubbing out calls for certain parameters

I want to stub out a method only for a certain parameter. Say I have a class class Foo def bar(i) i*2 end end Now I want to stub out the method bar only for calls with a value of say 3 and return the method return value in all other cases: >> foo = Foo.new >> foo.bar(2) => 4 >> foo.stub!(:bar).with(3).and_return(:borked) >> f...