Tag | TDD Posts

I was recently given an opportunity to review the TypeMock Isolator v7 framework. This is a very feature rich add-in for Visual Studio which simplifies unit testing by putting all the features you need right at your finger tips. Below is an abbreviated list of features found in the product. Components AutoRunner Failed Test Analyzer Coverage Test Auto-Complete The biggest productivity feature is the unit testing dashboard which drops down from the top of your Visual Studio code window. It provides ...
Myth 3: The source of all bad code is inept developers and stupid people When you review code is this what you assume? Shame on you. You are probably making assumptions in your code if you are assuming so much already. Bad code can be the result of any number of causes including but not limited to: using dated techniques (like boxing when generics are available) not following standards (“look how he does the spacing between arguments!” or “did he really just name that variable ‘bln_Hello_Cats’?”) ...
I’m using xUnit and the Resharper test runner. Today, I ran into a situation where I couldn’t run tests. The runner icons weren’t showing in the gutter. Then I pressed Ctrl+U+R and received the following message: Well, there were several tests in the file, decorated with FactAttribute. Considering that I the code was written via TDD and the test were definitely working, I was curious why I suddenly couldn’t run them. It turns out that I removed the public modifier from the class in the not-so-distant ...
Jason Gorman blogged about TDD and binary search. He also followed up with a 2nd take. The question Jason raised was, will you end up with binary search using TDD. Jason also mentions Uncle Bob's transformation priority premise which is an interesting idea. Looking at Jason's attempts I thought that maybe you could take even smaller steps, I couldn’t resist to try so here’s how I did it. My first test is the same as Jason's: [Test] public void When_key_is_not_found_index... { ...
Agility needs to get onto the next level – that´s what I tried to explain in my previous articles. After a reality check – what´s missing from Agile practice? –, and some general musings about how a next level of Agility could look like, here now some very tangible suggestions. Crank up the frequency Current Agile practice is suffering from too little attention to Acceptance. To change this, very, very clear Acceptance dates need to be set. Acceptance can only get into a real pulling mode, if dates ...
In my previous article I came to a couple of conclusions based on the reality of software development, or should I say “the nature of software development”? Here are the – to me - undeniable facts of what our industry is all about: Customers hardly know, what they want. Any specification is inherently fuzzy and incomplete. What fits the customer´s needs can only be determined by actually trying it out. The customer can only recognize a running piece of software as acceptable. Because customers hardly ...
In this Issue: Michael Collier, Samidip Basu, Jesse Liberty, Dhananjay Kumar, and Michael Crump. Above the Fold: WP7: "31 Days of Mango | Day #16: Isolated Storage Explorer" Samidip Basu Metro/WinRT/W8: "1360x768x32 Resolution in Windows 8 in VirtualBox" Michael Crump Shoutouts: Michael Palermo's latest Desert Mountain Developers is up Michael Washington's latest Visual Studio #LightSwitch Daily is up Alex Golesh releases a Silverlight 5-friendly version of his external map manifest file tool: Utility: ...
For several years, I use TDD (Test-Driven Development) to produce code. I no longer plans to work without using TDD. The use of TDD significantly increases code quality, but does not guarantee that the code is the code that corresponds to the requirements specifications (write the "right code" with BDD as opposed to the write "code right" with BDD). Dan North has described in an article in published in 2006 the foundations of the BDD (Behavior-Driven Development). In this article, he introduces the ...
I've been back working with BizTalk 2006 R2 for a customer recently and I've become such a fan of the BDD style acceptance tests I've done in the past with BizTalk 2010 that its quite frustrating working back in Visual Studio 2005 and not being able to use Specflow alongside BizUnit 4 like I described in the recent videos on these subjects BizTalk & BDD Part 1 BizTalk & BDD Part 2 In BizTalk 2006 development your back to the older style xml bizunit tests and we were looking at some old tests ...
So I am new to TDD and have been enjoying the ride of learning a new approach – today I came across an interesting situation that I thought I would blog about. I was writing a class that had all sorts of string manipulation in it. I needed some helper methods that would extend my string manipulation abilities. I had read somewhere that I should avoid static methods when doing TDD so I wrote the initial helper class to look something like this… public class StringHelper { public string ReverseStringEx1(string ...
I have recently being trying to implement TDD as a practice in writing code. Up to now I buy into many of the benefits of TDD but it is one thing agreeing that a practice is good and a totally different thing implementing the practice. The approach I have taken was relatively simple, Write a test to exercise the functionality you want in a method Run test – it will fail Implement method Run test – it should pass Repeat first step Seems simple enough… when it came to implementing the process a concern ...
During the last months, I was (for some reasons that are not related to programming) working for a dev shop where software development was done the 'traditional' way: You just write your application's production code, do it as good as you can, and hopefully it will be good enough and no problems will occur in production (this is HDD: Hope-driven development). Anyway, after I had finished this contract, I felt the need to review some core aspects of what I think is Test-driven development. And while ...
Download binaries and application – 32K Source code – 99K Background Recently I was looking for a .NET implementation of QR code generator. Most of components either use online services to generate and/or recognize QR code or the implementation was not “good enough” for my purposes. The most popular and very powerful Java implementation comes from google’s open source project code.google.com/p/zxing called ZXing (Zebra Crossing => Z=Zebra + X=Cross + ing). There I found a one-to-one c# port of ...
Recently I stumbled across a question on stackowerflow.com about Edulinq. Its a series of blog posts turned at the end into a free eBook. Downloaded to my eBook reader and had a lot of fun in subway. There where not to much to discover inside of LINQ for me, but it could help a novice to understand the LINQ “magic” and use it efficiently. Another very important point for me was the test driven approach. You could take this book as a guide for test driven design and development. Reading this book ...
After a few months of work, I am very happy to announce that the Dallas TechFest Speaker line up and schedule is full and finalized. You can find it on the Dallas TechFest website or on Michael Perry’s Windows Phone 7 app in the marketplace. I am very excited to see some of the more popular speakers such as Denny Cherry, Miguel Castro, Matt Hienze, Chris Koenig, and Caleb Jenkins to name a few. I am also jazzed about some of the new faces like Calvin Carter and Kumar Unnikrishnan and their enthusiasm ...
Ron Jeffries challenged me to show how Flow-Design and Event-Based Components can help software development. This is the problem he posed in the Software Craftsmanship discussion group: Solve bowling scoring. Here is the specification. Note that this is a simpler version than the one Bob Martin often uses. I'll take questions if you have any. Given a list of the rolls of a legal game of ten pin bowling, which you may assume are provided without error or omission, produce the total, final, score of ...
Doing CodeKatas is all the rage lately. That´s great since widely accepted exercises are important to further the art. They provide a means of communication across platforms and allow to compare results which is part of any deliberate practice. But CodeKatas suffer from their size. They are intentionally small, so they can be done again and again. Repetition helps to build habit and to dig deeper. Over time ever new nuances of the problem or one´s approach become visible. On the other hand, though, ...
In the month of May we met again for the .NET Usergroup, and I presented some introductory material into software design and architecture. The talk was aimed at looking into new ways of software design and managing of complex software components by using domain driven approach. I talked about best practices, coding patterns and DDD, TDD and DataObjects.NET (http://dataobjects.net). I advocated for best practices presented by the best practices team http://msdn.microsoft.com/e... ...
I’m crazy excited about the technology industry right now. We’re seeing evolution happen in real time, and at all levels. From the major platforms, we’re seeing Google’s overall story taking shape, Microsoft playing catch-up but showing with WP7 and Windows 7 that they are very much still a competitor, and Apple continuing to bolster their empire beyond fanboys with their quality technology and innovations. Then there’s the software platforms like Facebook, Twitter, Linked In, and others that are ...
The second programming book I read on holiday was Growing Object Oriented Software Guided By Tests by Steve Freeman and Nat Pryce. To sum up early: its a very, very good book on TDD. When I first came across TDD, I immediately saw it as a good idea. Don't write any code without first having a test to cover it and you get automated tests to run any time which prove your system works and document how. Awesome! Getting stuck in with TDD threw up a few questions I couldn't find easy answers to, though: ...
Last saturday I participated the Code Retreat organised by Agileminds.be There were 6 code retreats at the same moment arround the world. In Belgium, UK, Spain, USA and 2 in Romania. We all had the same challenge, to implement the Conway's Game of Life. By writing beautiful code, using TDD . For me, TDD is a new thing. I allready read about it, but thinking in a TDD way is really different and difficult. I met interesting people, and it was great to skype with the other Code Retreat around the world. ...
In this Issue: Ollie Riches, Damon Payne(-2-), Jesse Liberty(-2-), Shawn Wildermuth, John Papa, Beth Massi, Michael Crump, Mike Taulty(-2-), Jorge Peraza, and Peter Kuhn(-2-). Above the Fold: Silverlight: "Delay Binding Updates within a certain Context" Damon Payne Blend: "Phone Tools reaches Beta!" Shawn Wildermuth Blend: "Blend Bits 26–Use Libraries for Assemblies" Mike Taulty Shoutouts: If you're in the UK, Mike Ormond announced a new set of WP7 Workshops: New Windows Phone 7 Workshops I met Gregor ...
In my previous post I summarized the notation for Flow-Design (FD) diagrams. Now is the time to show you how to translate those diagrams into code. Hopefully you feel how different this is from UML. UML leaves you alone with your sequence diagram or component diagram or activity diagram. They leave it to you how to translate your elaborate design into code. Or maybe UML thinks it´s so easy no further explanations are needed? I don´t know. I just know that, as soon as people stop designing with UML ...
It's been 3 years since I did any coding and am starting back up with Java using netBeans and glassfish. Right off the bat I noticed two things about Java's ease of use. The java ide (netBeans) has finally caught up with visual studio, and jUnit, has finally caught up with nUnit. netBeans intellisense exists and I don't have to subclass everything in jUnit. Now on to the point of this very short post ( request) I'm trying to figure out how to do test driven development with vxml and have not found ...
Yes, coding in its general sense is extremely easy, and it is getting easier by the day. So easy that a small child can rattle off some code and end up with something that works. In fact, for many years there I was in my little bubble with the IDE as my own personal universe where I could define my own rules on how things worked with little regard to anything anyone else said or did. If I wanted on Monday to declare all variables in small case, then that was fine. If on Tuesday I decided that it ...
I’m trying to find time to update the Prairie Developer Conference 2011 website, and the sessions and speaker information will be up by this weekend including the registration page. For those that are wondering what the session and speaker list looks like, I wanted to give a sneak peak. We have a fantastic set of sessions by world class technologists! We’re covering .NET, Java, Ruby, SQL Server, Agile, User Experience, Mobile, Security, Azure, Office, SharePoint, and others. In fact, this year I’ve ...
Microsoft have now released Web Matrix (and ASP.NET MVC3 if you so inclined!) One signifcant utility is IIS Express which will replace Cassini It is worth noting that SP1 for VS2010 should be out in Q1. Links: http://www.hanselman.com/bl... http://www.hanselman.com/bl... http://arstechnica.com/micr... ...
“Write great code and everything else becomes easier” is what Paul Pagel believes in. That´s his version of an adage by Brian Marick he cites: “treat code as an end, not just a means.” And he concludes: “My post-Agile world is software craftsmanship.” I wonder, if that´s really the way to go. Will “simply” writing great code lead the software industry into the light? He´s alluding to the philosopher Kant who proposed, a human beings should never be treated as a means, but always as an end. But should ...
Today, I'm going to talk about a touchy subject: the notion of working in a company that doesn't use the prescribed "best practices" in its software development endeavours. Over the years I have, using a variety of pseudonyms, asked this question on popular programming forums. Although I always add in some minor variation of the story to avoid suspicion that it's the same person posting, the crux of the tale remains the same: A Programmer’s Tale A junior software developer has just started a new ...
Normal 0 false false false EN-GB X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans... mso-ascii-font-family:Calibri; ...
Day three of The Art of Agile Training (taught by James Shore and Diana Larsen) has been put to rest. Today we moved into the delivery phase of the training. In other words, less planning, more doing. I didn't think we could "do" much more interaction than the first two days, but James and Diana proved me wrong. My key learning today was the absolutely central role of Test-Driven Development (TDD) in Agile delivery. To explain how TDD makes me feel requires a story. About a year ago, while mired ...
I received (by chance, mostly) a Netduino last tuesday. Netduino is an open-source hardware project based on Arduino and the .Net Micro Framework. And it’s extremely cool. I’m a C# developer and I was always interested in electronics. This is an excellent tool to start to understand that incredible world. I was about to buy an Arduino when the Netduino fell on my lap, so I was really happy about it. Netduino has various disadvantages over Arduino (for starters, it’s more expensive, not all the shields ...
TOPIC: BDD and SpecFlow This is a presentation on how to use BDD and SpecFlow to build software driven by specifications. It will include a brief overview of how SpecFlow works and how to define specifications, followed by a compare and contrast with standard TDD. It will finish with real-world SpecFlow examples of successes and failures. PRESENTER: Darren Cauthon Darren Cauthon is a developer with over eight years of experience, half of which have been on the .Net platform. He currently works for ...
In this Issue: Michael Washington, Michael Crump, Don Burnett, John Papa, Jeremy Alles, Rob Miles(-2-), and David Gadd. From SilverlightCream.com: Silverlight Open File Dialog Behavior (MVVM) Michael Washington has a cool post up on building a Behavior in Blend to produce an Open File Dialog. “Fade in” Screen in Silverlight 4 Michael Crump responds to some questions about a 'fade-in' screen effect built with Expression Blend, and has a tutorial up on that and a demo page. Windows Phone Design Days ...
These days, JetBrains (the manufacturer of ReSharper (R#)) released the beta version of a new code coverage tool – dotCover. Because I’m a big fan of the R# add-in, I was particularly curious about having a first look at the newest JetBrains child. Notably, I wanted to see how it would take advantage of its deep R#/VS integration to make code coverage an integral part of a developer’s working experience. Here are my first impressions about it… Note: Because I’m using NCover for Code coverage analysis ...
Last year my employer, Protegra, put on the first ever Software Development and Evolution Conference (SDEC) in Winnipeg. The event was such a huge success and the feedback we got was so positive that we’re doing it again this Fall and we’re making it bigger and better than last year! SDEC10 will occur October 13th and 14th 2010 at the Winnipeg Convention Centre! We’ve expanded the event to two days from the one day we did last year, and that means more sessions and more speakers! We’re still feeding ...
Today I released an open source project for doing xUnit style unit testing. Recently I got roped into doing some embedded C code for a project and I wanted to TDD it. On investigating my unit testing framework options I ended up rolling my own as many frameworks were either too simple or trying to be too smart. While I’m generally happy with the general style of how to write tests with it, there’s a number of things to cleanup and it probably needs a bit more rounding out for other peoples needs. ...
It was a pleasure seeing old friends and meeting new ones at the LI .Net User Group Meeting on Thursday June 3rd 2010. I was very impressed as more than 35 developers were present which highlights the buzz MVC is creating with its latest release. We covered an introduction to MVC then went on to discuss new features in MVC2. I enjoyed the good dialogue among the group as we discussed how MVC can fit side-by-side with an existing WebForms paradigm and how MVC Support for TDD can dramatically shift ...
I have been working on little tool to simplify my life and perhaps yours as developer as well. It is basically a command line tool that allows you to execute queries on your compiled .NET code base. The main purpose is to find out how big the impact of an api change would be if you changed this or that. Now you can do high level operations like Diff public types for breaking changes. Who uses a method? Who uses a type? Who uses implements an interface? Who references me? What format has the binary ...

I usually love doing TDD and am moving towards understanding BDD (Behaviour Driven Development).  My learnings are documented in the form of an article at CodeProject.

The URL is http://www.codeproject.com/KB/architecture/BddWithSpecFlow.aspx

I will keep this updated as and when I learn a couple of more things.

Hope you like it.

Cheers !!!

 

I recently realized the many parallels you can draw between the theory of evolution and evolving software. Evolution is not the proverbial million monkeys typing on a million typewriters, where one of them comes up with the complete works of Shakespeare. We would have noticed by now, since the proverbial monkeys are now blogging on the Internet ;-) One of the main ideas of the theory of evolution is the balance between random mutations and natural selection. Random mutations happen all the time: ...
Update 29/04/10: In contrary to what I initially stated in this post, Moles is not only available as part of the Pex framework, but also stand-alone on Visual Studio Gallery, and this is completely free (no MSDN subscription required). - Thanks to Peli for the correction... Usual opensource mocking frameworks (like e.g. Moq or Rhino.Mocks) can mock only interfaces and virtual methods. In contrary to that, Microsoft’s Moles framework can ‘mock’ virtually anything, in that it uses runtime instrumentation ...
Lately, I exchanged some arguments with Derick Bailey about some details of the red-green-refactor cycle of the Test-driven development process. In short, the issue revolved around the fact that it’s not enough to have a test red or green, but it’s also important to have it red or green for the right reasons. While for me, it’s sufficient to initially have a NotImplementedException in place, Derick argues that this is not totally correct (see these two posts: Red/Green/Refactor, For The Right Reasons ...
In this Issue: Rénald Nollet, Roboblob, Laurent Bugnion, Timmy Kokke, Michael Sync(-2-), Victor Gaudioso, and Bill Reiss. Brought to you from a tiny table in my no-tell-motelTM in 'Vegas AKA "cheaper than anywhere else" and the WiFi is free and smokin'... From SilverlightCream.com: Sync your Silverlight out-of-browser application data without service but with Dropbox Rénald Nollet is in good company (Walt Ritscher) because he's demo'ing synching OOB apps with dropbox. Unit Testable WCF Web Services ...
One of this morning’s sessions at Alt.NET 2010 discussed BDD. Charlie Pool expressed the opinion, which I have heard many times, that BDD is just a description of TDD done properly. For me, the core principles of BDD are: expressing behaviour in terms that show the value to the system actors Expressing behaviours / scenarios in a format that clearly separates the context, the action and the observations. If we go back to Kent Beck’s TDD book neither of these elements are mentioned as being core to ...
Unit Testing with VS2008 Team System and Moq In order to loop around the software development life cycle, you do really have to do the unit testing. Once you get in this stage, you will realise that you need to get your hand dirty with heaps of isolation and refactoring and you wish the whole team had been practicing the Test Driven Programming. It is vital that you test your application and the more dependencies you have in classes, the deeper nightmare for isolation. Possibly in some cases, bad ...
Topic: nServiceBus is mature and powerful open source framework that enables to design robust, scalable, message-based, service-oriented architectures. Latest improvements in the configuration API enables developers to quickly get started and build a working simple system that uses messaging infrastructure. The goal of this session is to give a jump start with the framework, introduce basic concepts such as message handlers, Sagas, Pub/Sub, Generic Host and also create a working demo application ...
Since the dawn of the computer age, various methodologies have been introduced to improve quality and reduce cost. In this posting, I will by sharing my experiences with Test Driven Development; both its benefits and limitations. To start this topic, we need to agree on what TDD is. The first is to define each of the three words as used in this context. Test - An item or action which measures something in some quantifiable form. Driven - The primary motivation or focus of a series of activities (process) ...
I was presenting at the excellent .NET Developer Network in Bristol last night run by the awesome Guy Smith-Ferrier. Guy reminded me of this awesome news which needs broadcasting widely – Jesse Liberty is in town in April. Sweet. Stolen directly from Guys post: “Jesse Liberty, Silverlight Geek (Microsoft US Developer Evangelist for Silverlight), is doing a tour of the UK and Ireland in April to coincide with Microsoft UK's week of TechDays (#techdays) events. Jesse is speaking at Bristol, London, ...
I have previously posted on the area of Test Doubles and Mocking under the guise of Project NEric. I also have blogged on specific tools such as Pex and TypeMock – but I wouldn’t claim to be an expert on the area. Far from it. Luckily I know a man who is. Meet Gil Zilberfeld who works at TypeMock and kindly agreed to do a couple of guest posts on Mocking. This is the first of those two. I should get the second online next week when I return from holiday. Thanks again Gill. Introduction to Mocking ...