Questions tagged [test-first]

32 questions
89
votes
17 answers

How do you unit test a unit test?

I was watching Rob Connerys webcasts on the MVCStoreFront App, and I noticed he was unit testing even the most mundane things, things like: public Decimal DiscountPrice { get { return this.Price - this.Discount; } } Would have a…
FlySwat
  • 172,459
  • 74
  • 246
  • 311
56
votes
8 answers

Is there a difference between TDD and Test First Development (or Test First Programming)?

Both ideas sound very similar to me, but there might be subtle differences or the exact same thing, explained in different ways. What is the relationship between TDD and Test First Development/Programming?
Thomas Owens
  • 114,398
  • 98
  • 311
  • 431
6
votes
4 answers

Understanding the difference between "test-first" and "test-driven"

I've had conversations about this topic in the past, and I think I might know the answer, but I've not been able to articulate it properly. Here's what I think I know: I suspect you are test-first rather than test-driven if you already have the…
Neil Barnwell
  • 41,080
  • 29
  • 148
  • 220
6
votes
4 answers

Test-First development tool for SQL Server 2005?

For several years I have been using a testing tool called qmTest that allows me to do test-driven database development for some Firebird databases. I write a test for a new feature (table, trigger, stored procedure, etc.) until it fails, then…
Jeff Jones
  • 361
  • 1
  • 9
5
votes
3 answers

Unit tests for Stored Procedures in SQL Server

I want to implement Test First Development in a project that will be implemented only using stored procedures and function in SQL Server. There is a way to simplify the implementation of unit tests for the stored procedures and functions? If not,…
miguelbgouveia
  • 2,963
  • 6
  • 29
  • 48
4
votes
5 answers

Test writing strategy advice

So, I'm getting more and more engulfed with test driven development these days and the more code I write while thinking tdd, the more decisions it's seems as though I have to make about the extent of testing that I should write. I would like to set…
matt_dev
  • 5,176
  • 5
  • 33
  • 44
4
votes
3 answers

TDD: How would you work on this class, test-first style?

I am writing a small app to teach myself ASP.NET MVC, and one of its features is the ability to search for books at Amazon (or other sites) and add them to a "bookshelf". So I created an interface called IBookSearch (with a method DoSearch), and an…
rodbv
  • 5,214
  • 4
  • 31
  • 31
3
votes
3 answers

In TDD, how do you write tests first when the functions to test are undefined?

If you have nothing, you cannot write a test because there is nothing to test. This seems pretty obvious to me but never seems to be addressed by proponents of TDD. In order to write a test, you have to first decide what the method or function looks…
Gungwald
  • 109
  • 1
  • 6
3
votes
3 answers

How to conciliate TDD with SUT interface's contracts?

Assuming we are implementing using TDD a Stack class, we would need, for each bit of functionality of our Stack class, to add a new test that exercises it: [TestMethod] public void Should_Be_Empty_After_Instantiation() [TestMethod] public void…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
3
votes
1 answer

Tips and tricks for test-first development

Just read this blog post - Help! I’m Terrible At Migrating/Restructuring Code In A Test-First Manner. I've had similar experiences, and thought I'd try an open it up to the wider community ...
Bermo
  • 4,921
  • 1
  • 28
  • 31
3
votes
4 answers

Starting a new project - where do I start?

I am going to start a project of my own, which will be ASP.NET MVC + Fluent NHibernate. I want to use test-first approach as much as I can. So, where exactly do I start from? Database schema? Domain model? Mapping domain model classes to the…
chester89
  • 8,328
  • 17
  • 68
  • 113
2
votes
2 answers

Rake Aborted! Gem::LoadError: Could not find rspec 'x' but did find 'y'

I'm working my way through the test first ruby tutorials (https://github.com/alexch/learn_ruby/blob/master/index.html) and I'm having a problem running my rake tests. This is the error message I have: "rake aborted! Gem::LoadError: Could not find…
D_S_B
  • 208
  • 3
  • 9
2
votes
1 answer

Test First's Temperature Object project - It passes all the tests, but is this what I was supposed to be learning?

I'm going through Test First's Ruby projects and I've done most of them but 08_temperature_object has me pretty confused, not least because even though I have gotten it to work passing the tests I'm not sure if I did it how they wanted. Here's what…
MCB
  • 2,021
  • 1
  • 18
  • 32
1
vote
1 answer

What is the flow of using BDD as test-first development approach for front-end and back-end as one project?

Currently I am working on a project using BDD with Cucumber as a test-first development methodology. I am struggling to understand the integration of UI with my back-end code. As per my understanding BDD->Write failing Scenario (Feature…
1
vote
4 answers

Couple of questions about unit-testing

Let's assume we are designing a Stack class test-first (TDD): public class Stack { private T[] elements = new T[16]; private int size = 0; ... } This Stack makes use of a size 16 internal array to store its elements. It will work…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
1
2 3