unit-testing

Starting UnitTesting on a LARGE project

Can anyone recommend some best-practices on how to tackle the problem of starting to UnitTest a large existing CodeBase? The problems that I'm currently facing include: HUGE code base ZERO existing UnitTests High coupling between classes Complex OM (not much I can do here - it's a complex business domain) Lack of experience in writing ...

Continuous Integration for Common Lisp?

Are there any continuous integration frameworks for CL? Specifically, I'm looking for: Automated "build", i.e. ASDF system load from base state Automated tests Status push - email notification and the like, especially for broken builds and failed tests Status pull - website, logs, anything the dev team can pull to read Status history - ...

unit testing for an application server

Hi, I wrote an application server (using python & twisted) and I want to start writing some tests. But I do not want to use Twisted's Trial due to time constraints and not having time to play with it now. So here is what I have in mind: write a small test client that connects to the app server and makes the necessary requests (the commun...

Writing unit tests in Django / Python

I've not used Unit Tests before other than a quick introduction in a Uni course. I'm currently writing an application though and would like to teach myself TDD in the process. The problem is, I've no idea what to test or really how. I'm writing a Django application, and so far have only created the models (and customised the admin appli...

Is there any C# Dynamic Mock framework available for Silverlight?

I want to use dynamic mocks when testing a Silverlight application. I have tried Moq and Rhino but these frameworks assemblies cannot be added to a silverlight project as they are incompatible with the silverlight runtime. Is there an existing silverlight mock framework (or patch for moq) that will allow me to use mock objects in a sil...

Does redirecting assembly binding work for unit testing with a test runner?

Ok, so here's the full description of the problem I'm having: I am trying to use NUnit ExtensionMethods but whenever I run a test containing one of the extension methods using TestDriven.Net or if I just flat out try to load the assembly using a test-runner GUI (Icarus or NUnit) I get a FileNotFoundException. Pounding head against a wa...

ASP.NET Web Application Testing Experiences

Hi Everyone, In our project, we have 20 simple web controls, 8 composite web controls including Ajaxable Custom Grid. And all modules are developed dependent to these controls. And now I afraid to change a control, because it effects modules more then I think. It's too late I know but I need to write some test cases for my controls. ...

What is Rhino Mocks Repeat ?

What is Rhino Mocks Repeat ? Repeat.Any(); Repeat.Once(); What does it mean and how it works ? ...

How to test a named_scope that references a class attribute with Shoulda?

I have the following ActiveRecord classes: class User < ActiveRecord::Base cattr_accessor :current_user has_many :batch_records end class BatchRecord < ActiveRecord::Base belongs_to :user named_scope :current_user, lambda { { :conditions => { :user_id => User.current_user && User.current_user.id } } } end and I'm tryin...

Are there any good TDD tools or resources for VB6?

Hi Guys, Yea i know i'm way behind times but what i've got here is a antique VB6 editor app which i believe that no one will be upgrading to .NET soon. It uses a couple of third party DLLs tools and as it's still using the good old RichEdit control i basically can raise my own Bug farm with just this tool alone. So enough is enough and...

How can I test a standalone Perl script?

Hello! I have written a small Perl script and now I would like to create a test suite for it. I thought it would be nice to be able to use the script as a module, import the subs defined in the script and test these. Is there a way to have the script both standalone Perl script and Perl module? (I do not want to split the script into a ...

Replace function units

I am writing a unit test infrastructure for a large Delphi code base. I would like to link calls to pure functions in SysUtils.FileExists for example to a "MockSysUtils.FileExists" instead. Creating a SysUtils unit with the same interface is not appreciated by the compiler. What I am thinking of is to hook in my mock function at runtim...

How do I do Perl machine or platform dependent TDD?

How do I go about testing a function or module that is machine or platform dependent? For example, something that looks at/depends on $^O or a module like Net::Ifconfig::Wrapper? I don't need to test that Net::Ifconfig::Wrapper is returning the correct values, but I do need to test whether or not I'm doing the right thing with those va...

Testing for a deadlock with nUnit

Hello - I'm new to unit testing and nUnit (2.48). I'd like to write a test method where the failure case is that it deadlocks. Is this possible? Obviously nUnit doesn't know by default how long the method should take to execute, so would I have to write code to do the work on a separate thread and then abort it and throw and exception if...

How to unit test library that relies on Session object

I have several asp.net mvc websites consuming the same controller and model. This common logic is put in seperate libraries. These libraries use the HttpContext.Current.Session. How can I make these unit testable? I read about the StateValue but can't completely grasp it. Where should I get this StateValue thing? Is it a lib I reference?...

Unit-testing Delphi data modules

If all the business logic is present in a datamodule (TSQLDataSets and TDataSetProviders) how would you refactor the code to make the application more appropiate for unit testing? ...

Get name of currently executing test in JUnit 4

In JUnit 3, I could get the name of the currently running test like this: public class MyTest extends TestCase { public void testSomething() { System.out.println("Current test is " + getName()); ... } } which would print "Current test is testSomething". Is there any out-of-the-box or simple way to do this...

Unit Testing: Beginner Questions

I'm finally starting out with unit testing, having known that I should be doing it for a while, but I have a few questions: Should or shouldn't I retest parent classes when testing the children if no methods have been overwritten? Conceptually, how do you test the submitted part of a form? I'm using PHP. (Edit: The reason I ask this is...

TDD: Help with writing Testable Class

Hello, I have a quick little application and wanted to give a try to develop using TDD. I've never used TDD and actually didn't even know what it was until I found ASP.NET-MVC. (My first MVC app had unit tests, but they were brittle, way coupled, took too much up keep, and were abandoned -- I've come to learn unit tests != TDD). Back...

Unit testing scala actors

Anyone know of a good way to unit test Scala actors? In the general sense I have an actor that receives a message and will send out other messages in response. This is done on multiple threads, and an actor that is not correct may either send the wrong messages or no message at all. I need a simple way of creating a mockup actor that sen...