unit-testing

Measuring code coverage in Delphi

Is there any way to measure code coverage with DUnit? Or are there any free tools accomplishing that? What do you use for that? What code coverage do you usually go for? Jim McKeeth: Thanks for the detailed answer. I am talking about unit testing in the sense of a TDD approach, not only about unit tests after a failure occured. I'm inte...

iPhone Unit Tests Hang; Fail to Call -applicationDidFinishLaunching:

I have unit tests set up for my iPhone project built using the Google Toolkit for Mac framework on top of OCUnit. I have a dependent project called "Unit Tests" that builds and runs the tests as needed. But then it all stopped working, for no reason that I can fathom. Suddenly, my "Unit Tests" executable launches and just sits there, wa...

How to setup Google C++ Testing Framework (gtest) on Visual Studio 2005

It is not documented on the web site and people seems having problem setting up the framework. Can someone please show step by step introduction to a sample project setup. ...

Is it possible to Unit Test SQL (MS SQL Server 2005)?

We are having a lot of tables, views and stuff. There are a few people working on different stuff on the same database and sometimes, we change things that screws up others work (like change the columns in the view, or changing the parameters to the stored procedure). Is there any way, to automate these checks? I don't even know if unit...

UI Testing Framework + Continuous Integration ??

So I have an application that I inherited and I want to build up an automated test suite around it. The application wasn't designed with testability in mind, and the code is a "big ball of mud". My plan was to use a UI Automation testing framework and create a suite of tests at the UI level until I had enough coverage to allow me to st...

What are good practices for unit testing J2EE/Web applications

What are the best ways to test servlet oriented web applications. With possibly jdbc backed backends. Front-end = Struts2 and some servlets Back-end = hibernate, some basic jdbc ...

Perl build, unit testing, code coverage: A complete working example

Most Stackoverflow answers that I have found in regards to the Perl build process and unit testing and code coverage simply point me to CPAN for the documentation there. There's absolutely nothing wrong with pointing to CPAN modules because that's where the full documentation is supposed to reside. I've had trouble finding complete wor...

How to unit test my application manually on multiple browsers?

My project requires support on multiple browsers, like Firefox 2.0, firefox 3.0, IE 6, IE 7, etc. My problem is I cannot test the application on lower versions of the browsers. I have to move to other system or other machines for the testing. Is there any way to solve this? I cannot even use Virtual Box, since my company won't encourage...

Is it possible to measure function coverage with gcov?

Currently we use gcov with our testing suite for Linux C++ application and it does a good job at measuring line coverage. Can gcov produce function/method coverage report in addition to line coverage? Looking at the parameters gcov accepts I do not think it is possible, but I may be missing something. Or, probably, is there any other ...

Run a single unit test from a fixture of many in MbUnit

Is there anyway to add an attribute to a [Test] method in a [TestFixture] so that only that method runs? This would be similar to the way the [CurrentFixture] attribute can be used to only run a single fixture. I ask as sometimes when I test the model I want to profile the sql being executed and I only want to focus on a single test. Cur...

C : POSIX threads library test-suite

I'm working on a thread library which implement user level threads (i have something like pthread_setscope which works) and I'm looking for some set of tests to avoid writing one for every function I implement (mutexes, conditions, etc ...) Does anyone know something like that? ...

Best practices with Unit testing on Third Party software API's (AutoCAD)

Hi, We are developing applications for use within AutoCAD. Basically we create a Class Library Project, and load the .dll in autoCAD with a command (NETLOAD). As so, we can use commands, "palettes", user controls, forms etc... AutoDesk provides an API through some dll's, running in their program directory. When referencing these dll'...

Unit Testing Third Party ORM

Hi, I've read a few threads on SO about usefulness of unit-testing various applications. The opinions can range from "test everything all the time" to "unit tests are useless", and everything in between ("test where it makes sense"). I tend to lean towards the middle one. That leads me to my question. I am trying to decide if it would...

Should non-public functions be unit tested and how?

I am writing unit tests for some of my code and have run into a case where I have an object with a small exposed interface but complex internal structures as each exposed method runs through a large number of internal functions including dependancies on the object's state. This makes the methods on the external interface quite difficult...

Returning empty lists as default with Rhino Mocks

I think it's a good practise to always return empty lists or arrays instead of null when a method comes up with no results to avoid null checks in the code. Because Rhino Mocks returns the default value for an object, which is null for lists and arrays, a lot of times I have to either add the null checks back in or setup the mocks with...

Is it necessary to unit test ActiveRecord validations?

Is it necessary to unit test ActiveRecord validations or they are well-tested already and hence reliable enough? ...

Unit testing inheritance

I have a question concerning unit testing. Let's say that I have several classes that inherit behaviour from a parent class. I don't want to test all the child classes for this behaviour. Instead I would test the parent class. However, I should also provide a test proving that the behaviour is available in the child classes. Do you think...

unit testing jsp 2.0 .tag files

How do people test jsp 2.0 tags? The ones that have .tag extensions and are basically jsp files with some extra support for passing parameters. ...

Incremental .NET code coverage tool?

I'm looking for a tool (preferably free) that analyzes incremental code coverage of our C# solution. What I mean by this is that I don't want to know what the total code coverage is for all code or even for a namespace, but only new lines of code or perhaps lines of code that changed since the last checkin. (We use subversion for source...

What's the difference between Assert.AreNotEqual and Assert.AreNotSame?

In C#, what's the difference between Assert.AreNotEqual and Assert.AreNotSame ...