tdd

How to test a COM dependent object in C#

Hi, I´m trying to do TDD with an object that has a dependency on a COM Interface. I though about mocking the COM interface, while doing development testing, and do it real on the integration tests. However, I cannot mock the COM interface, I tried with Moq, and it throws an exception: System.TypeLoadException was unhandled by us...

TDD - What tests should I write for this function?

I've read that I should be writing the simple, basic tests first and gradually moving up to the harder ones. What tests (in order) should I be writing for the following function? function List.syncWithList(lst) should add any items to the list that are not in the list but are in lst should delete any items in the list that are not in ...

Developing XSLT with TDD/BDD

I've been assigned the task of creating an XSLT transform on an XML dump from a database. Being a believer of Test/Behavior Driven Development I was wondering if anyone has attempted it before or has advice about how to go about it. My gut reaction is to test this 'black box' with rspec. Is there a unit testing framework out there f...

What to do with non-regressive tests?

Not really a Ruby on Rails question, but that is the framework which we are working in. We are migrating data from a legacy system into our own system, and have been testing the code that will do the data migrations. These tests live alongside the rest of the applications tests, and so ran against our build server on commits, etc. Onc...

"Test Driven Development" Refactoring Design Complexity

Hi all, I am currently studying test driven development. I am inquiring about an improvement in design if we refactor after the development of every couple of units as opposed to dedicated refactoring sessions that are more spaced apart in time. I am aware that the technical debt will be larger. But I am wondering what other impacts. ...

Explain TDD in simple terms

I was browsing StackOverflow when I encountered this question. Here the author mentions his/her style of debugging: I am wondering how to do debugging. At present the steps I follow is, I complete a large script, Comment everything but the portion I want to check Execute the script and in one of the answers another u...

First Moles test - redirection not happening.

Here's the code. GetParentPath is called as per normal! [TestMethod] [HostType("Moles")] public void GetParentPath_slashOnEnd_returns() { var sapi = new MPhotobucketApi(); sapi.GetParentPathString = s => s; var api = new PhotobucketApi(); var parentPath = api.GetParentPath("hello/world/")...

Test Driven Design - where did I go wrong?

I am playing with a toy project at home to better understand Test Driven Design. At first things seemed to be going well and I got into the swing of failing tests, code, passing test. I then came to add a test and realised it would be difficult with my current structure and that furthermore I should split a particular class which had t...

How to approach implementing an interface in a TDD way

So I'm trying to convert myself to a more test- and behaviour- driven approach to my development. It's good for me, and I've seen good results in the few projects I've used it for so far. My current project is a FUSE-based filesystem - I want to add some functionality over basic filesystem access so FUSE seemed like a good fit. All I ...

Trying to gain confidence in the benefits of TDD

I just bought The Art of Unit Testing from Amazon. I'm pretty serious about understanding TDD, so rest assured that this is a genuine question. But I feel like I'm constantly on the verge of finding justification to give up on it. I'm going to play devil's advocate here and try to shoot down the purported benefits of TDD in hopes that ...

Unit test behaviour after exception is thrown?

Hi all, I am just starting out with unit testing and have a scenario I'm not sure how to appraoch and my solution doesn't feel right. I have a bit of code that does something, if it fails i.e. throws an exception the exception is caught and logged as below. public T CreateTypedObjectInstance<T>() { T o = default(T); try ...

TDD for an OSX app

Are there any good solutions out there for TDD of a MacOSX Objective-c app? EDIT: more info I would really like something similar to rSpec from the Ruby world. Is the XCode built in stuff sufficient? I have heard that it is not. I would like something that supports Mocks, Stubs, and most/all of the test conditions supplied by rSpec (or...

.NET... How to TDD with flat files

I have a project where most of the challenges are to ensure software works correctly with flat text files outputted by several external systems. Mangement made decision to introduce Agile and TDD as a particular implementation. I found that mocking input from the flat files makes no sense because the main issue to resolve is exactly co...

Is there any advantages in using VS2010 for TDD vs VS2008?

I want to push our management to migrate to VS2010 sooner. The new feature in our project is to migrate to TDD. I want to convince that there are endless benefits of migrating to TDD and VS2010 simultaneously. Is there really? VS2008 Pro vs VS2010 Pro - whats good can be used in terms of unit-testing? (sorry for the dumb question bu...

It is possible/productive enough to TDD in C++ projects?

Hello guys, I want to know if anyone of you guys use TDD in your c++ projects and how it performs compared to managed languages like C# and Java. And what frameworks you guys are using to automate tests on c++ projects? ...

XCode and SenTestingKit not outputting to the editor window

I am new to testing in Xcode. I am following the developer documentation "iOS Developement Guide" Unit Testing Applications. I have successfully added unit test bundles to my application with one failing test. When I build the test target the output shows 1 error as expected but the editor does not show the expected error message unde...

Unit testing and SAP

I am looking for some tutorials and guides for unit testing on SAP platform. So far, I have found some mention of ABAP Unit and of Ruby programming language being implemented on SAP platform, making it much more interesting option for unit testing SAP. However, the information is quite scarce and I would appreciate some help on the subj...

Can I create a Stub of an Activity in Testing Project?

I want to create a stub of one of my Activities, but I want to keep it in the test project so not to have it in the actual apk. I don't seem to be able to find a way to do it though. I get this: java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.example.test.StubA...

Philosophy behind Test Driven Development

I'm currently working my way through http://www.railstutorial.org/ It uses Rspec along with a TDD approach. I understand that writing lots of tests can help you ward off bugs as your app gets more complex, but I don't understand why you would write tests for simple things like the existence of a page title. It seems that you end up writ...

How should I implement this specflow step?

Okay, I've decided to try and get to grips with the whole TDD process from start to finish. I'm writing a simple blog in ASP.NET MVC 2 Application and have started with doing acceptance tests to test my fetaures as I implement them. I'm using SpecFlow as my BDD/ATDD framework. I've been reading "Growing Object Orientated Systems Guid...