tdd

How do I unit test persistence?

As a novice in practicing test-driven development, I often end up on a quandary as to how to unit test persistence to a database. I know that technically this would technically be an integration test (not a unit test), but I want to find out the best strategies for the ff: Testing queries. Testing inserts. How do I know that it is th...

What's the best way to implement BDD/TDD in .NET 2.0?

I'm looking to add a testing suite to my application, however I can't move to the newer testing frameworks for .NET 3.5. Does anyone have a suggestion about good testing frameworks to use?...

What is Test Driven Development (TDD)?

What is TDD (Test Driven Development) Please include both benefits and drawbacks, as well as tools for your taste....

What is Your Experience with Unit Testing in Practice?

//Yes, Virginia, there is a wikipedia. What I'm asking here is what you've found unit testing to be in your own practice. It would be helpful to know the pros, cons, obstacles to introducing unit testing, flaws in the unit testing process, value gained by unit testing, and so on that the developers here have observed in their day to day...

What are the primary differences between TDD and BDD?

Test Driven Development has been the rage in the .NET community for the last few years. Recently, I have heard grumblings in the ALT.NET community about BDD. What is it? What makes it different from TDD?...

TestDriven.NET is not running my SetUp methods for MbUnit

I've created some MbUnit Test Fixtures that have SetUp methods marked with the SetUp attribute. These methods run before the tests just fine using the MbUnit GUI, the console runner, and the ReSharper MbUnit plugin. However, when I run the tests with TestDriven.NET it does not run the SetUp methods at all. Does anyone know if this i...

Why should I practice Test Driven Development and how should I start?

Lots of people talk about writing tests for their code before they start writing their code. This practice is generally known as Test Driven Development or TDD for short. What benefits do I gain from writing software this way? How do I get started with this practice?...

TDD and Mocking Frameworks

For the past five years I've been using TDD where possible and I feel fairly comfortable and confident with the methodology. I already know what mocking frameworks are used for but I'd like to learn more about how to use them. Does anyone have a list of links to good examples of using mocking frameworks (including best practices, anti-p...

How do you mock a Sealed class?

Mocking sealed classes can be quite a pain. I currently favor an Adapter pattern to handle this, but something about just keeps feels weird. So, What is the best way you mock sealed classes? Java answers are more than welcome. In fact, I would anticipate that the Java community has been dealing with this longer and has a great deal...

Getting started with Agile and TDD..

How do I get started in Agile and TDD. I have learnt a bit about Agile, but finding it difficult to get started. How do I get started. ...

Test Cases VS ASSERTION statement

In my most C++ project I heavily used ASSERTION statement as following: int doWonderfulThings(const int* fantasticData) { ASSERT(fantasticData); if(!fantasticData) return -1; // ,,, return WOW_VALUE; } But TDD community seems like to enjoy doing something like this: int doMoreWonderfulThings(const int* fantast...

Best practice for integrating TDD with web application development?

Hi all, Unit testing and ASP.NET web applications are an ambiguous point in my group. More often than not, good testing practices fall through the cracks and web applications end up going live for several years with no tests. The cause of this pain point generally revolves around the hassle of writing UI automation mid-development. ...

How do you unit test web apps hosted remotely?

I'm familiar with TDD and use it in both my workplace and my home-brewed web applications. However, every time I have used TDD in a web application, I have had the luxury of having full access to the web server. That means that I can update the server then run my unit tests directly from the server. My question is, if you are using a ...

What is a quality real world example of TDD in action?

What is a quality real world example of TDD in action? What small-to-medium open source projects in .net are out there that show off best practice in TDD and might work as a reference for doing TDD right? ...

Beginning TDD - Challenges? Solutions? Recommendations?

OK, I know there have already been questions about getting started with TDD.. However, I guess I kind of know the general concensus is to just do it , However, I seem to have the following problems getting my head into the game: When working with collections, do will still test for obvious add/remove/inserts successful, even when based...

How to Ease TDD with MSTest / VS2008

I've read time and time again that TDD/test first is more difficult with MSTest than it is with other testing frameworks such as nUnit, MBUnit, etc... What are some suggested manual workarounds and/or 3rd party bits that you suggest when MSTest is the only option due to infrastructure policy? I'm mainly wondering about VS 2008 Team Suite...

How should I test a method that populates a list from a DataReader?

So I'm working on some legacy code that's heavy on the manual database operations. I'm trying to maintain some semblance of quality here, so I'm going TDD as much as possible. The code I'm working on needs to populate, let's say a List<Foo> from a DataReader that returns all the fields required for a functioning Foo. However, if I want ...

Best books about TDD

I'd like to enhance my TDD knowledge and practice. What would you recommend to read? ...

Random data in Unit Tests?

I have a coworker who writes unit tests for objects which fill their fields with random data. His reason is that it gives a wider range of testing, since it will test a lot of different values, whereas a normal test only uses a single static value. I've given him a number of different reasons against this, the main ones being: random ...

What's the best way of unit testing private methods?

How do I use jUnit to test a class that has internal private methods? It seems bad to change the access modifier for a method just to be able to run a test. Thanks. ...