unit-testing

How do I test that a Rails Helper defines a method?

I am creating a Rails plugin and it is dynamically adding a method to a Helper. I just want to ensure that the method is added. How can I see if the Helper responds to the method name? ...

Unit-testing COM written in .NET

Is there a way to unit-test COM-visible .NET assemblies from .NET (not via direct .NET assembly reference)? When i add reference in my test project to the COM component whitten in .NET it complains. ...

Why should I use RSpec or shoulda with Rails?

I am setting up a rails app and I just finished making some unit tests and my friend said that apparently fixtures are no longer cool and people are now using RSpec or shoulda. I was wondering what the actual benefits are to use these other toolkits. Any information at all is appreciated. -fREW ...

how do you organize unit tests?

Do you write one case per function/method, with multiple checks in the test case, or a test case for each check? ...

In need for a site that explains how to use PHPUnit

I am searching for a tutorial (optimally with Zend Framework) on how to use PHPUnit. I have found a couple on google but have not quiet understood it yet. ...

How do you integrate a TDD approach with VisualStudio?

I am interested in hearing about experiences using TDD and unit testing for C++ in general with Visual Studio 2005 (Professional) First some background. We have a fairly large project and much of it has been developed on Linux using CppUnit for the unit tests. The project is divided into several libraries, each with their own set of tes...

Should domain objects and simple JavaBeans be unit tested?

Should simple JavaBeans that have only simple getters and setters be unit tested?? What about Beans with some logic in getters and setters? ...

Unit testing a multithreaded application?

Does anyone have any advice for a consistent way to unit test a multithreaded application? I have done one application where our mock "worker threads" had a thread.sleep with a time that was specified by a public member variable. We would use this so we could set how long a particular thread would take to complete its work, then we cou...

Can people recommend some good books and resources on unit testing?

Can people recommend books and other resources on unit testing? All levels from beginning to advanced techniques. ...

How do I remove duplication in shoulda tests?

Here is what I have: context "Create ingredient from string" do context "1 cups butter" do setup do @ingredient = Ingredient.create(:ingredient_string => "1 cups butter") end should "return unit" do assert_equal @ingredient.unit, 'cups' end should "return a...

How can I test for an expected exception with a specific exception message from a resource file in Visual Studio Test?

Visual Studio Test can check for expected exceptions using the ExpectedException attribute. You can pass in an exception like this: [TestMethod] [ExpectedException(typeof(CriticalException))] public void GetOrganisation_MultipleOrganisations_ThrowsException() You can also check for the message contained within the ExpectedException li...

What unit-test frameworks would you recommend for J2ME?

Hi, I'm relatively new to J2ME and about to begin my first serious project. My experience in testing isn't too deep either. I'm looking for a unit test framework for J2ME. So far I've seen J2MEUnit, but I don't now how well supported it is. I've seen JavaTest Harness but I don't know if it's not an overkill. Please tell me what frame...

How do you create a custom attribute for MS Test?

If you want to create a custom attribute for MS test (say [Repeat(3)] how would you do that? ...

Test Automation with Embedded Hardware

Has anyone had success automating testing directly on embedded hardware? Specifically, I am thinking of automating a battery of unit tests for hardware layer modules. We need to have greater confidence in our hardware layer code. A lot of our projects use interrupt driven timers, ADCs, serial io, serial SPI devices (flash memory) etc.. ...

Should unit test classes be kept under version control with the rest of the code?

If I create a test suite for a development project, should those classes be kept under version control with the rest of the project code? ...

How best to test the validity of XML from a method?

I have some WCF methods that are used to transmit information from a server application to a website frontend for use in binding. I'm sending the result as an XElement that is a root of an XML tree containing the data I want to bind against. I'd like to create some tests that examine the data and ensure it comes across as expected. ...

What is the best way to unit test webforms apps ( ASP.NET )

What is the best way to Unit test my webforms applications? Looks like people are loving Watin, and selenium. ...

How would you unittest a memory allocator?

There's a lot of people today who sell unittesting as bread-and-butter of development. That might even work for strongly algorithmically-oriented routines. However, how would you unit-test, for example, a memory allocator (think malloc()/realloc()/free()). It's not hard to produce a working (but absolutely useless) memory allocator tha...

When to use test scripts over unit testing?

I am currently working on a project that has been in production for over two years. The project makes extensive use of unit testing and scripted UI tests. Initialy unit tests covered the system framework, business rules and state transitions (or workflow). Test scripts are used for black box testing. However, over time the cost of mainta...

What is the most convincing way to require formalized unit testing?

This certainly presupposes that unit testing is a good thing. Our projects have some level of unit testing, but it's inconsistent at best. What are the most convincing ways that you have used or have had used with you to convince everyone that formalized unit testing is a good thing and that making it required is really in the best inte...