Tag | TDD Posts

I came across and found very useful, bare in mind I am relatively new to the EF and TDD so any suggestions would be welcomed. I have been very busy recently with a new project, as I am in control of this project I have wanted to do things correctly from the start, I also am using it as an opportunity to get familiar with all the newest and shiniest of Microsoft's technologies. The platform is using a combination of ASP.Net MVC 2.0 and the Entity Framework 3.0. Because I know this codebase is going ...
Note to the one reader I have (Hi mom!): I accidently deleted this post, so this is a repost. I’ve just started a new initiative in our company: a coding dojo. I first saw this last week at the XP days, and I loved every minute of it. Emmanuel Gaillot introduced us to this idea with a simple challenge: compare poker hands. The implementation was written in Haskell from scratch, using TDD and Baby Steps. As Bob Martin mentioned: the beauty of this was that most of the attendees did not know Haskell, ...
I consider myself extremely fortunate. I go to work everyday and do something I LOVE to do and I get paid quite well for it. Everyone should be that lucky. But about once a year I go through what I call, "Code Burn Out". I still enjoy what I do, I just don't come home and work on my own stuff. I don't spend all my time reading about software development and practicing to make myself better. I spend very little time on Twitter, and I don't even get on my computer very much after normal working hours. ...
I applaud efforts to encourage test driven development, however I find myself cringing at the examples being produced by the framework designers we are supposed to look up to. I've noticed this with the buzz around TDD and ASP.Net MVC and now that buzz is transferring to the Entity Framework. I think it is wonderful that these frameworks are designed with testability in mind. However, it is up to the developer to actually employ TDD when composing their applications. There are other ways to test, ...
I talk to Hadi Hariri about the differences between Behavior Driven Development (BDD) and Test Driven Development - and why Hadi chooses BDD every time. Hadi wrote an article on BDD for the December 2nd 2009 UK MSDN Flash newsletter: “Test Driven Development (TDD) is about design, not about testing first. We use unit tests and testing frameworks to drive out the design of our API and validate its usage. Think of TDD as an approach to defining the specification of our application. However the true ...
So you're familiar with TDD (test-driven development)... Failing your tests first, then building up your classes to satisfy your tests so they're all "Green"... This is a typical scenario and is pretty straightfoward with .NET. Well now you have to create a WCF service and implement unit testing to ensure you don't break your service when you build out a new version. This is a bit more challenging but you do have some different options: Separate out your service code into a library and run your tests ...
Here's a quick notes from the TDD session which I conducted some time back. Introduction Writing test before writing production code. Design as you go along. Follow Red-Green-Refactor paradigm Benefits Spot design flow early. Test before the production code is built. Identify poort requirements or requirement gaps. Reduced testing time. The test forms the functional document for your code. Quickly identify bugs. Reduces the cost of bugs in the long run. Low level regression test suite. Road blocks ...
Career/Skill Path Each individual is playing different roles. Some are software engineer, some are programmer, tech lead, architect, project manager and so on… How would your skill to develop over a period of time so that you can take the next step and will prove to be true to your designation. Here are some of the check list… Check what skills you have and develop the one which you don’t currently possess. It’s not just about superficial skill, but true skill I am talking about. Don’t go over the ...
From time to time (and when there's room for it, of course), I'm doing a so-called Code Kata, a small to mid-size programming exercise that usually originates from some seminar or meeting. (Kata collections can be found here or here, for example.) What I especially like about them is the level of professional self-knowledge that they provide: When working on a Kata, you can experience how you deal with things without the usual business pressure. Lately, I did the KataPotter (you can download my solution ...
Every now and then, I end up writing and re-writing the same code (or very, very similar) to achieve a functionality that I’ve had before. Sometimes I can remember where I wrote it, so I can just copy and paste. At other times, I have to redo it again since I forgot where it was. So I’d like to put it up on my blog so I have access to it. If anyone else gets to see it and can use it, so much the better for everyone. Of course, I’d also accept criticism to the code too . So, this is my first one; ...
I am practicing Test Driven Development (TDD) now for some two years or so, and soon this technique of writing software felt so natural, that I hardly could imagine doing it another way or even imagine a reason why I should do so. But on the other hand, I know that not questioning something anymore and not being self-critical from time to time is a certain recipe for running into a disaster sooner or later. So I asked myself: What makes TDD such a natural way of writing software? and What are your ...
Recently, I read some posts about Duct Tape programming from Joel Spolsky, Michael C. Neel, Jak Charlton, “Uncle” Bob Martin and Jeffrey Palermo. I have followed these posts closely. While the intent is good, I think the delivery suffers. The whole thing started with Spolsky (as it often does) creating a post that (I think) was meant to say, “Hey stop pontificating on sweet new techniques and start shipping software!” Excellent point. Do that. Don’t worry anymore what other developers might think ...
Okay, so recently I was working on a new suggestion for my client. It was a fairly simple request; create a snapshot of data to be used in monthly calculations, with the option to regenerate the snapshot at a later time. The snapshot was easy. I thought regenerating the snapshot would be easy too, but somehow I found a way to make it hard. The first mistake I made was not writing a test first. Really this had a lot to do with laziness. The data that I am capturing is only available via a view into ...
Well, here we are again. Last time, we talked about project structure and came up with the one we’ll use for this series. Next we’ll talk tools. We’ll talk tools like Tim Taylor talks tools: with lots of grunts for my favorites and only a little explanation about what the tools do.) This is mostly because there is LOTS of material on the interwebs about all of these tools. I tend to favor the tools that are the most widely used for two main reasons: they have been battle tested by the largest crowd ...
In an effort to continually improve as a developer, one of the things I do is read lots of books. Recently I read Rails for .NET Developers by Jeff Cohen and Brian Eng. Overall, I would definitely recommend this book to any ASP.NET developer that wants to learn more about Rails or wants to better understand the concepts behind MVC. Given that ASP.NET MVC was heavily influenced by Ruby on Rails, I wanted to learn more about Rails so that I could have a better understanding of how MVC evolved the way ...
It's been years now that unit testing frameworks and tools have grabbed our attention, made their way into our favorite IDE and sparked yet another wave of seemingly endless "my framework is better than yours" wars. And then there are the principal wars of whether TDD is better than Test After Development. And most excitingly the automated testing tools etc. Oh, and let's not forget mocks! So we have all the tools we need – right? Well, kind of, no. I recently attended a talk by Llewellyn Falco and ...
In this Issue: Rui Marinho, Danijel Stulic, Jesse Liberty, Bill Reiss, Evgeny, Chris Klug, Brad Abrams, and Page Brooks. Shoutout: Mike Harsh reports Slidentity Updated for Silverlight 3 RTW ... if you haven't seen this, now is a good time... very cool! Terence Tsang is getting overrun with XAML snippets [no wonder :) ] and is working on an idea for an app to help him organize his resources: Silverlight Resources Directory. He's also looking for input for you! From SilverlightCream.com: Data Visualization ...
At least not by the FIRST definition in Merriam-Webster online. “a body of methods, rules, and postulates employed by a discipline : a particular procedure or set of procedures” To me, this refers to my development practices (Test-Driven Development, Domain-Driven Design, Pair Programming, SOLID principles, SOA, SOC, etc.). How I do software development. Kanban and Scrum do, however, meet the second definition: “the analysis of the principles or procedures of inquiry in a particular field” It’s a ...
The Way I've Come To See BDD Over the last year and a half, I have been moving from TDD to BDD. For those who don't know, this is not a tool or technology switch so much as it is a mental paradigm shift. Luckily, I didn't work in a lot of shops that ever did a lot of unit testing (testing units of code after you write them). Most often, we'd be under time crunches that forced PMs to make the decision to forego unit testing in order to meet a hard deadline that they got from some estimation crystal ...
I just completed my first iteration on a project I was injected into at work. What makes this project interesting is the approach to software development as well as the technology makeup. Many developers wonder what its like to switch from traditional methods and adopt something like TDD or OSS tools like nHibernate, Rhino Mocks, Castle Project, etc. I wanted to share some thoughts and what my experiences have been after completing my first iteration in exactly that type of environment. TDD – Different, ...
Dylan Smith from Anvil Digital will be presenting Tuesday night (June 23rd) on VS.NET 2010! Do you ever deal with bugs that you can’t reproduce? Do you use a lot of manual testing? You won’t want to miss this chance to see how the new features in Visual Studio Team System 2010 Tester Edition can help your team. VSTS Architecture edition has also been undergoing a drastic change, replacing what was a mostly lackluster feature set with some phenomenally useful tools. See how the new Architecture Explorer ...
For most developers going to the DBA for any sort of request was usually a mixture of concern, apprehension, strife, and anger…because while you just wanted to cold-cock the snarky bugger, you knew that you’d have to play nice if you had any chance of seeing your stored proc change getting put in place before the next release. Now it appears that developers need to look both ways before crossing the street, and the threat comes from the one group you’d think would be shy and timid: the designers! ...
Check the add-ins you installed before Visual Studio 2010 if you enabled VS 2010 integration in them. Particularly TestDriven.NET is the problem. Go to “Add Remove Programs” / “Programs and Features”, find Test Driven.NET, click “Change”, and then modify it to remove VS2010 integration from it. Also, if you are using AnkhSVN, make sure to download a new latest daily update build and use that, otherwise, you’ll get an exception when starting VS 2010. I’ll be writing more about VSTS 2010 and .NET 4.0 ...
Typemock guys, the guys behind the only mocking framework that can apply mocking in complex environments like Microsoft SharePoint, are releasing a new Product,, ASP.NET Bundle. Here is what they’re saying about it: Typemock is launching a new product for ASP.NET developers – the ASP.NET Bundle - and for the launch will be giving out FREE licenses to bloggers and their readers. The ASP.NET Bundle is the ultimate ASP.NET unit testing solution, and offers both Typemock Isolator, a unit test tool and ...
Good attendees learn from the speaker; this week I was reminded that good speakers learn from their audience. The NJDOTNet (http://www.njdotnet.net/) group was fun (My thanks to Jess Chadwick for the invite!), a lot of sharp, involved people (and one wise-aleck to keep things interesting). NJDOTNet’s feedback shows I need to clarify a number of points. They are the relationship between the iterative development process and test case selection, the recommended number of asserts per test, and the relationship ...
Central Ohio Day of .NET was awesome. As promised, here are my code and slides from my talk, Test Driven Development with Inversion of Control. However, ignore them. I have my preferred TDD stack available at http://github.com/ignu/spec... complete with a sample test project ...
First of all, thanks to all those brilliant people who made the long arduous journey to the UK (and to all those who just happened to be near by). I know it must have killed you to be so far away for so long. I can only imagine how hard it was for you. All of us that couldn’t go really feel for you and feel your pain. Okay! So, for those of us that couldn’t go, some of these guys really did a tremendous job of twittering what was going on during the conference. They absolutely did not have to do ...
I’ve known Jim Duffy for almost 6 years now, and I can honestly say he thinks he’s one of the funniest people I’ve ever met. When I first asked Jim to do a NINE Questions interview, back in September, he was delighted to have an opportunity to talk about his favorite subject. Fast-forward 7 months and welcome to the longest NINE Questions interview ever. Ladies and Gentleman, I give you Jim Duffy. 1. Where are you from? A long time ago in a galaxy far away... oh wait, that one's already been used. ...
We’ve all heard the mantra – Unit Testing is good for the soul. We hear about the goodness of things like JUnit, NUnit, and TDD from other people. But you’re not convinced. After all, it takes more time to write unit test code – and you’d rather get on with the next feature. Besides, whether it’s true or not, you certainly feel like your progress is measured by how many features you crank out. In my own journey, I found I went through three distinct stages to testing heaven. Look at my “diary” for ...
I wanted to thank the many speakers that came out to the Winnipeg Code Camp this past Saturday. Everyone did a great job, and the investment to the community was greatly appreciated. I was able to record a few videos of some of the speakers, and wanted to highlight the others who I didn’t get a chance to interview. Aaron Erickson – Magenic Al Williams – Sunset Hill Solutions Al has been a great supporter of the Winnipeg developer community, presenting at the .NET User Group and at our recent code ...
Those of you that do Game Development, how many of you are also doing TDD (Test Driven Development) as part of the process? I've recently made a promise to myself that I would start doing more TDD in my projects (ok ok, doing "any" would qualify as more, technically...) and I find myself at a loss for what to actually test. It seems easier in traditional projects, but in game development where you rely on random things and generated things and player input things, I'm curious what you (those of you ...
Here's what's happening: Attendees: 428 Sessions: 73 Speakers: 49 Tracks: 15 Sessions: ASP.NET Make your Data Dance with ASP.NET Dynamic Databy Shawn Weisfeld + Show Description ASP.NET Dynamic Data is a framework that lets you create data-driven ASP.NET Web applications easily. It does this by automatically discovering data-model metadata at run time and deriving UI behavior from it. A scaffolding framework provides a functional Web site for viewing and editing data. You can easily customize the ...
My work environment is usually an anything goes, wild west of development sort of place. There are no rules imposed, just a “get things done” attitude. Because of auditing, source control was a necessity that got added to the mix. We use SVN through VisualSVN Server and TortoiseSVN as a client. Well, as a part of self improvement and to produce better more reliable code, I’ve taken up learning TDD for myself. Our current methodology of testing here is based mostly on WTFs per minute and copious prayer. ...
I have been developing web sites for a little over a decade now, and I have to tell you, I missed the boat. A lot of that time was wasted. I spent most of my career developing crappy code that was doomed to cause some poor sap some real heartache. To those who have had to support my crappy legacy code, I profusely apologize. You know who you are, and you undoubtedly know who I am. You've probably spent many hours rewriting my leftovers and trying to spin gold out of code-dung. Again, I apologize. ...
With my new job, I’ve not been able to take advantage of a lot of Agile/XP practices. In a company of four, where each is effectively working on a different project, collaboration is minimal. Also, for the projects that I am working on, the customer is very adamant about getting a detailed proposal up front, including a list of all of the screens and how they will operate. I’ve managed to get by without too much detail, but it is still more than I am generally comfortable with. TDD and Continuous ...
My trial ran out a few days ago. And I haven't posted about R# for almost a month. I have to a few more things to share, and perhaps I can save everyone some time. The R# team has done quite a few small things to raise the tool a step above my expectations. There are a lot of things that may seem small, but really turn out to be significant improvements to the way I manage my code. Simple things, like, locating new code (via refactoring) with similar declarations (fields with fields, properties with ...
I really like TDD (Test Driven Design) and like to push messages through the system as soon as possible. I have really enjoyed using Powershell to drive the input of XML files into file receive locations. Here are two of the simplest recipes. Repeatedly dropping the same file This will copy a single file one hundred times, each with a different numeric filename (i.e. 1.xml, 2.xml, etc...) for($i = 0; $i -le 100; $ += 1) { Copy-Item .\SampleMsg.xml C:\FileDrop\IN\msg_$i.xml if($i % 10 -eq 0) { $i ...
So as I mentioned in my last post I have this large-ish .Net application which has a pretty low quality level. The first task was to convince the powers that be that there is sufficient benefit to be had to justify the cost of dedicating 1-2 developers to focusing on quality improvements. Now we need a plan for how to approach making quality improvements. Ultimately I think we are going to need to do some major work refactoring large parts of the application (hopefully we can break these down to ...
I've been using ReSharper now for about one and a half weeks. Now that I am writing some new code, I have more to share. The most helpful and time saving feature that I have encountered so far is code generation. In one case, I had added a couple of new properties to one of my entity objects. In actuality, I add the code in my test first. R# quickly recognized that the property didn't exist and gave me the option to create a field or property. I chose the property option and presto, R# found my class ...
While doing a bit of reading on TDD I stumbled across these two fantastic links from Steven Harman. Two quick and straight to the point reference guides to outline when and how often to write tests in your solution. Nice work. http://whenshoulditest.com http://howoftenshoulditest.com Then he follows it up with this gem "Saving the world via TDD", possibly the best example of TDD code ever. It attempts to prove that if skynet had of followed correct TDD principals arnie and his terminator pals would ...
Just came back from another great SoCal Code Camp. I had some valuable insights and discussions about TDD and the use of Pex. Thank you attendees! While developing the presentation for Pex, I ran into a situation where the Pex.Assume() did not seem to work at all: Consider the function public List<short> MakeList(short baseNum, short count) { List<short> result = new List<short>(count); for (short i = 1; i <= count; i++) { result.Add((short)(baseNum * i)); } return result; } ...
This question is for all of the TDD and unit test folks, so I’m hoping someone comes up with an answer. I’ve been writing unit tests and analyzing code coverage for one of my libraries for about a week now and I’m starting to see the end, at least for this particular library. However, I’ve run in to a problem trying to ensure as close to 100% code coverage as possible. This exists in several methods in a few different classes, but I’ll take the simplest one for illustration purposes. I have cod that ...
To ease the transition from TDD to BDD, I have built my own little base class and stolen Scott Bellware’s extensions from SpecUnit.net to make my own BDD style specification framework. It keeps things simple and means very little transition pain from the NUnit testing we were doing. The base class is called SpecificationBase. It simply ties into the NUnit test methods. 1: using NUnit.Framework; 2: 3: namespace Application.Specifications.... 4: { 5: [TestFixture] 6: public abstract class SpecificationBase ...
Normal 0 false false false MicrosoftInternetExplorer4 /* 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-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.000... mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} I just got back from my first ...
I've been looking around for sometime, but never found some good information about it. Well, today, I've found some interesting articles (It's not really that new, the article is dated September 15 2008). It seems that there's a possibility for Unit Testing with SharePoint, you can do it with TypeMock. The article is found here. Here are some other referenced articles that might be interesting. Unit Testing SharePoint Beginners guide to TDD Webpart development Sharepoint typemock wrapper (on codeplex) ...
Event Date: Saturday, January 19, 2009 Event Time: 08:30 (registration), 09:00 – 17:00 Event Location: Microsoft Tampa Office If you want to learn what TDD is all about, this is the event to attend. It’s a day-long event where you will go from start to finish with a sample domain problem and learn how to write tests to drive functionality of the system. This promises to be an excellent event and will be good for both beginners and those experienced with TDD. There will be two tracks running simultaneously, ...
For some reason, I've been obsessed with Behavio(u)r Driven Development for the last few months. I've only been doing TDD for a little over a year, and I am totally loving what it's done for my design, so why would I look for something else? It's NOT something else. Dave Astels says, "Behavior Driven Development is what you are doing already if you are doing Test Driven Development very well." BDD is how we're supposed to be doing Test Driven Development. The problems that people end up having with ...
QUICK THOUGHT: The engineering practices in Extreme Programming (Like TDD, Pair Programming, etc) can lead you to improving your code. But it won't do it for you. TDD will point out design flaws, but it won't GIVE you good design skills. If you write lousy code, you'll find it very hard to maintain practicing XP, but XP won't MAKE your code better. You still have to do it. You STILL have to read books, write code and share with other developers.

KAIZEN!

~Lee
The Chippewa Valley .NET Users Group is holding their first Code Camp on Nov. 8th, 2008 in Eau Claire, WI. I’m one of the presenters, and I'll be talking about XNA. I think it's pretty neat how Doug Rhoten and Dan Krueger (the CVCC planning committee) are providing a Microsoft Technologies track and an Agnostic/Cross-over track. With that, there will be sessions covering topics such as Cloud Computing, Rails, XNA, AJAX-enabled Websites with Java and NetBeans, C++, Real World practices with WPF & ...
As I try and learn about all the available productivity features of R#, I will post what I learn here... for posterity and for anyone who might find it useful. Alt+Insert is used to generate code in the text editor window. If you are in the text editor, it will bring up a context menu to allow you to generate ctors, members and properties. If you highlight a place in the Solution Explorer and hit Alt+Insert, it will bring up a context menu for generating a class, interface or struct in that folder ...