unit-testing

Using combinations of sets as test data

I'd like to be able to test a function with a tuple from a set of fringe cases and normal values. For example, in testing a function that returns true when given three lengths that form a valid triangle, I'd have specific cases, negative numbers, small numbers, large numbers, values close-to being overflowed, etcetera. Then generating co...

.NET Testing Framework Advice

I'm looking to introduce a unit testing framework into the mix at my job. We're using Visual Studio 2005 (though we may be moving to 2008 within the next 6 months) and work primarily in C#. If the framework has some kind of IDE integration that would be best, but I'm open to frameworks that don't have integration but are still relative...

Best way to implement unit testing in PHP

I'd really like to start implementing Unit Testing in my projects. I don't know how viable this is to do in PHP. If anyone has done this, how was it implemented? Did it increase productivity? ...

What is unit testing?

Saw many questions asking 'how' to unittest in a specific language, but no question asking 'what', 'why', and 'when' What is it? What does it do for me? Why should I use it? When should I use it (also when not)? Common pitfalls/misconceptions ...

Integrating Visual Studio Test Project with Cruise Control

I'm looking into using Visual Studio 2008's built in unit test projects instead of NUnit and I was wondering if anyone has any experience in trying to integrate this type of unit test project with Cruise Control.Net....

.NET Unit Testing packages?

Getting back into a bit more .NET after a few-years of not using it full-time, and wondering what the good unit testing packages are these days. I'm familiar with NUnit (a few years ago), and have played briefly around with IronRuby, with the goal of getting something like rspec going, but don't know much beyond that. I realise I could...

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...

C# Unit Testing Example

I've now found out what Unit Testing is, does anyone have an example of Unit Testing in C#? The example must be simple :)...

How can I unit test Flex applications from within the IDE or a build script?

I'm currently working on an application with a frontend written in Adobe Flex 3. I'm aware of FlexUnit but what I'd really like is a unit test runner for Ant/NAnt and a runner that integrates with the Flex Builder IDE (AKA Eclipse). Does one exist? Also, are there any other resources on how to do Flex development "the right way" beside...

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?...

How to set up unit testing for Visual Studio C++

I'm having trouble figuring out how to get the testing framework set up and usable in Visual Studio 2008 for C++ presumably with the built-in unit testing suite. Any links or tutorials would be appreciated. ...

Unit testing with VSTest basics

Need good tutorial on this topic....

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...

What is the best way to do unit testing for ASP.NET 2.0 web pages?

Any suggestions? Using visual studio in C#. Are there any specific tools to use or methods to approach this? ...

RhinoMocks: How do you properly mock an IEnumerable<T>?

I just keep stumbling through mocking... The latest disaster was not grokking that I need to actually push results inside a mock object of IEnumerable... Here's a sample (demonstration only of IEnumerable, not actually good Interaction-based testing!): using System; using System.Collections.Generic; using Rhino.Mocks; using MbUnit.Fra...

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...

How to make junior programmers write tests?

We have a junior programmer that simply doesn't write enough tests. I have to nag him every two hours, "have you written tests?" We've tried: Showing that the design becomes simpler Showing it prevents defects Making it an ego thing saying only bad programmers don't This weekend 2 team members had to come to work because his code had a...

How do you test/change untested and untestable code?

Lately I had to change some code on older systems where not all of the code has unit tests. Before making the changes I want to write tests, but each class created a lot of dependencies and other anti-patterns which made testing quite hard. Obviously, I wanted to refactor the code to make it easier to test, write the tests and then chang...

What do you use to Unit-Test your Web UI?

The company I'm currently working for is using Selenium for Uniting-Testing our User Interface. What do you use to Unit-Test your Web UI and how effective do you find it? ...