tdd

Test Driven Development and Pair Programming

I am on a team where i am trying to convince my teammates to adopt TDD (as i have seen it work in my previous team and the setup is similar). Also, my personal belief is that, at least in the beginning, it really helps if both TDD and Pair Programming are done in conjunction. That way, two inexperienced (in TDD) developers can help each ...

TDD - When introducing a class when refactoring - should that class be unit tested?

Presume you have a class which passes all its current unit tests. If you were to add or pull out some methods/introduce a new class and then use composition to incorporate the same functionality would the new class require testing? I'm torn between whether or not you should so any advice would be great. Edit: Suppose I should have ad...

How to Integrate LinqToSql with Metadata Annotations

I'm just getting started on a new MVC project, and like a good boy I am trying to defer going to the DB for as long as possible. Here's the scoop: I'm planning on using the ComponentModel.DataAnnotations decorations. I'm also planning on using LinqToSql Is is possible to write a unit test against the DataAnnotations metadata classes?...

Is too much focus on testing benefits a bad thing overall?

What I mean by this, is that sometimes architects look to simplify and improve testability, at the expense of other important forces. For example, I'm reviewing a very complicated application, made so by extensive use of design patterns that overly favor testing, e.g. IoC, DI, AOP, etc... Now, typically I like these things, but this ...

How to test-drive software that uses external command-line tools

I'm trying to figure out how to test-drive software that launches external processes that take file paths as an input and write output after lengthy processing to stdout or some file? Is there some common patterns on writing tests in this kind of situations? It is hard to create fast executing tests that could verify correct usage of ext...

Multiple or Single Repositories with LINQ

I've been reading Chapter 11 (Testable Design Patterns) in the Professional ASP.NET MVC 1.0 book. In the examples in this chapter, data access is split into a number of repositories: IOrderRepository, IProductRepository, etc. That all makes sense: a single repository for a single class of data. However, this breaks down somewhat for me...

What's the best argument to convince developers to learn TDD?

Let me first come out of closet. I'm a TDD believer. I'm trying to practice Test Driven Development as much as I can. Some developers at my work refuse to even try it. I myself started TDD by trying to prove to one of my peers that Test Driven Development is a bad idea. The arguments are: Why? I was pretty successful developer so ...

Unit testing in C++

I've been reading a lot about Unit tests and Test Driven developemnt. Recently, I also read java unit test code. I however, prefer to develop in Qt. So I googled up "unit testing in c++" and found a host of information about various unit testing frameworks available for C++. However, I could not find a reliable comparison of the the v...

Should I Use TDD?

I'm the only developer in my (very small) company and I'm about to start on a medium sized ASP.NET web application for said company. I'm trying to figure out if I should learn Test Driven Development (TDD) and implement it in this application. I need to start developing our new application shortly and I'm worried about testing. I've ...

Unit Testing Private Setter Question (C#)

I'm trying to test an Order entity method called AddItem and I'm trying to make sure that duplicate items cannot be added. Here is some example code: [Test] public void ItemCannotBeAddedTwiceToOrder() { Order o = new Order(); Item i = new Item("Bike"); o.AddItem(i); o.AddItem(i); Assert.AreEqual(o.ItemCount, 1, "A...

How do you make methods relying on extension methods testable?

I have an extension method with the following signature (in BuildServerExtensions class):: public static IEnumerable<BuildAgent> GetEnabledBuildAgents(this IBuildServer buildServer, string teamProjectName) { // Omitted agrument validation and irrelevant code var buildAgentSpec = buildServer.CreateBuildAgentSpec(teamProjectName);...

How could I convince my boss to follow TDD?

Possible Duplicate: How to encourage implementation of TDD? My boss knows about TDD but won’t allow us to use it because he thinks that it is just a passing hype that everyone talks about but no serious. How could I convince him to follow TDD? ...

TDD Unit testing (VS 2008) WCF services - Symbols not loaded for debuging test

Hi there, Can anyone help, i have been succesfully testing with the built in tdd that ships with vs 2008. But now i wish to test my wcf... I added a default.aspx in the wcf service (you need to do this according the ms) ... now when i put a break point in my test.. and click the icon debug test in current context, all goes well ..,the t...

Unit Testing the Web GUI

Recently i heard a dicussion in which TDD was the hot buzz word. Now acc to one speaker that to test your behaviors you need to use MVC but on the other side its been said that TDD is an approach which can be adopted in any environment (as the discussion sorround between ASP.NET MVC or Webforms). The other guy claimed if you put your beh...

What would be a good task for a test-driven development presentation?

Possible Duplicate: What would you like to see in a TDD demo? What is a good sample class to demonstrate TDD? I'd like to prepare a one-hour talk on test-driven development, using Python. But rather than describing what TDD is (and giving little examples), I'd like to choose some user stories that could be implemented usin...

How to reduce the time spent on testing?

I just looked back through the project that nearly finished recently and found a very serious problem. I spent most of bank time on testing the code, reproducing the different situations "may" cause code errors. Do you have any idea or experience to share on how to reduce the time spent on testing, so that makes the development much mor...

Testing the clearing of cookie values in Rails?

How do I send a cookie in a functional test? How do I test to be sure that the cookie is cleared? I've had great success using TDD to build the models for a Rails application, but have hit a snag with regard to controller testing: I can set cookie values once in a test and read them, but I can't clear them. That is: test "clears cookie...

Lazy Loading, TDD, Data-First Approach: Are those killer bullets in the heart of Entity Framework?

EDIT: Guys, sure I meant Entity Framework not ASP.NET MVC, it was a typo most probably! Yesterday I came a cross this article that lists some of the bad stuff with Entity Framework. And after doing some google stuff I found this one which basically is the defender here. These two posts discussed some major issues of entity framework suc...

TDD: Where to start the first test

Hello, So I've done unit testing some, and have experience writing tests, but I have not fully embraced TDD as a design tool. My current project is to re-work an existing system that generates serial numbers as part of the companies assembly process. I have an understanding of the current process and workflow due to looking at the exi...

How do I unit test code that creates a new Process?

How can I test the following method? It is a method on a concrete class implementation of an interface. I have wrapped the Process class with an interface that only exposes the methods and properties I need. The ProcessWrapper class is the concrete implementation of this interface. public void Initiate(IEnumerable<Cow> cows) {...