Talking About Tests With XP

If you've looked at my blog, you've probably seen a lot of testing done; in fact, I've been torn with deciding what to include, and what not to.  At times, it seems like it might be important, but then later I think about it, and say "maybe it wasn't."  I ended up skipping an iteration cycle because I was able to complete the features quicker than I could post about them, so I apologize for that.

But I wanted to talk about why I do post about testing.  The reason you see testing up front is because with XP, there are a lot of things we assume that will work.  As developers, we do make a lot of assumptions; we assume the code we right is bug-free (at least some times), we think that we know about one area of the framework when it turns out we were wrong.  I have a lot of problems with interactions in my app, that I wonder if testing first would have fixed it.

At any rate, testing first with what you don't know, or are unsure of, or even if you think you know, is a good approach, because we often aren't completely sure, and are operating off of our assumptions, knowledge passed on in books, blogs, and articles, or some other source.  That's why I show the importance of testing, and even improving my tests.  Sometimes they blow up, sometimes they don't.  Seeing the progression can be good, or it can be overbearing in a blog, and I just pray that this is in the former.

At any rate, testing first before implementing is a good approach, because it really does improve the quality of your code.  I'm seeing great progress in my own code.  I'm implementing working features better than I did before.  It has change the way that I view approaching developing applications.  Unfortunately, in my career, I didn't have a ton of success with applications, mostly because I was knew, and mostly because I was forced onto a methodology that didn't work in the past for other developers and that didn't also work for me.

I see how iterative development can work, with testing as the key.  It may seem like a lot; there are plenty of times when I'm dreading creating another test, and that may be a time to walk away for a little bit.  But that's the typical life of a developer. At any rate, I wanted to discuss the balance between testing and implementing, and why testing was important, and why I had a lot there.  I hope you found that beneficial.

Comments

No Comments