Categories
Programming

Migrating Existing Tests to ApprovalTests

This is a short article to describe how I migrated a bunch of existing verbose tests to ApprovalTests. All of the examples in this article are based on my Shameless Green in C# library, which will be familiar to reader’s of 99 Bottles of OOP. Here are some quick links you might want once you […]

Categories
Programming

Test-Driven Development and Duplication

I have run a good number of test-driven development coding dojos (and behaviour-driven development ones), and participated in plenty of them too. The most common errors I have found can be classified as: Trying to find abstractions too early Drastic code changes under the banner of “refactoring” Both of these problems are solved by practising […]

Categories
Automation Programming Visual Studio

Using an In Memory Database as a Test Double with Entity Framework

If you are using Entity Framework and you want to test your application without the real database, the typical technique employed is to write a repository or query provider that you can substitute with a stub during the test. Sometimes, though, you are better off pushing things a couple of levels deeper. This is where […]

Categories
Programming

My Unit Testing Epiphany Continued

I had some great feedback on my unit testing epiphany. Normally I would append an update, but this was worth a proper follow up article. As a side-note, if you don’t have some friends who will question you, probe you and otherwise engage your mind on a topic – you really need to get some […]

Categories
Programming

Real Life Test Data Builder

So having listened to Ian Cooper talking about Test Mothers and Test Data Builders and carefully considering both options (and trying them out without checking in any code) – I decided to go with the Test Data Builder for the project I am currently working on. The difference between the two is that a Test […]

Categories
Programming

My Unit Testing Epiphany

I promised to write up the details of this after writing the following Tweet while listening to Ian Cooper talk on “TDD: Where did it all go wrong?” at DevSouthCoast in April. “I have had an epiphany at @DevSouthCoast – I’m embarrassed about some TDD techniques I have been using. NO MORE!” So what was […]

Categories
Programming

Slides From Test Driven Development

Here is a brief overview and some of the slides from my Test Driven Development (TDD) talk on Thursday. The theme of the talk was to to discuss TDD in a non-zealous manner. This meant discussing both the costs and the benefits as well as referencing real studies as well as anecdotal evidence. So I […]