Test Driven Development In Microsoft.NET

posted on 2004-07-28 at 01:11:27 by Joel Ross

I know. I'm late to the game, but I just finished reading TDD in Microsoft.NET. I figured since we were going to be using NUnit to do tests, what better book to read than one written by one of the creators of the tool we are using?

Anyway, I started reading it last Thursday, and finished up today at work. My laptop had to have it's screen replaced, so I had some downtime to finish it up. Here's the things I found valuable from the book:

1. It's a great primer on how to use NUnit, and tests in general.
2. It isn't a contrived example, as most examples seem to be - the first Stack example is, but the media example can really be applied to real world situations.
3. Fit. I've never used it before. I've heard of it, but didn't understand what it did. I would like to play with that some more.
4. Refactoring. I'd not really thought of refactoring the unit tests. And there are good examples of refactoring in general.
5. Database testing. This was probably the single most valuable thing I got from the book. I have always been unsure of how to test items that rely on database values. The book gives you some good ideas on how to handle this.

The book was thought provoking for me. I'm still not sure I'm going to be going "full fledge" into TDD - i.e., write a test, fix the failure, write another test, fix the failure, refactor, repeat. I can, however, see me writing tests once a structure is in place - the API is laid out for me, but not filled in. Non-compiling code bugs me, and writing a test first that uses non existent objects will cause the build to fail. I guess this is better than nothing.

I've never seen it mentioned, but has anyone used unit tests as a way for a lead developer to spec out code for other developers on the team? For example, let's say I am a lead developer, and I need a developer to create a class that handles a stack. I could write a bunch of tests that demonstrate the functionality, as well as a stub of the stack implementation, and the developer could flush out the stack class, knowing they are done when all tests pass. I know it goes against the "test, fix, test, fix, refactor, repeat" idea, but not too much. It's still TDD.

I'm also interested in UI testing. I've downloaded NUnitASP, and will test that out. I tried it once before, and thought about it for Tourney Logic, but found some shortcomings with testing custom server controls. Now that I'm working on a project with no custom server controls, maybe things will go better this time around.

I'm currently working on some database tests, and will post about my experiences with that. So far, I have one function running against a database, but it's a dev database - now we have to revisit the database build process!

NOTE: This post was written entirely after midnight, so if parts are incoherent, you know why!

Categories: ASP.NET


 

Sam Gentile Was Here

posted on 2004-07-21 at 23:04:32 by Joel Ross

That's right. And I missed it. Yesterday, Sam Gentile gave a presentation in my office.

Somehow, I never heard about it. And I worked from home yesterday, so I never heard the buzz around the office. That's too bad, because I would have loved to see him speak. The talk would have been good too! Oh well, I guess I should pay more attention, huh?

Categories: Consulting


 

Training - What's The Best Way?

posted on 2004-07-20 at 16:48:43 by Joel Ross

My company is looking for feedback of the best way to get us the knowledge we need to do our job. They've asked about a few good methods, but want to know what we want.

To be honest, my best training has been hands-on. Drop me on a project, and let me figure it out. But not everyone learns that way.

Some other options: online CBT, mentoring with subject matter experts, Microsoft events, and offsite training.

Where to start? Let's try online CBT. A good option. I used the Transcender tests to get ready for the SQL Server certification test I took, and it worked great. If we can get the CBTs on CD, so we can use them whenever we want, that would be better than an online source. For me though, I have trouble finding the time to focus on the training. Too many other things to work on.

How about mentoring from an expert. The idea here is one on one training. Great in theory - get an expert, have him tail you (or you tail him) and soak up as much as possible. The problem is that you would get good advice about what to do, but not a lot about why you do it. Of course, one on one seems like it could be very cost prohibitive, especially for a team of 40.

So then you go more along the option of a training course. Personally, these courses are fun, but I don't get much out of them. Why? Well, if it's in the office, I have too much to do. If it's offsite, it's like a vacation. Most training courses are 9-5, and very slowly paced. When I go to these courses, they tend to break into labs for the hands on training. I am always done long before we are ready to regroup, and I end up spending a lot of wasted time doing nothing. Now, with a group of my peers only, that could be reduced, but not completely.

What about the Microsoft events? Most open to the public tend to be more marketing than training. Not to mention, most aren't focused on what we want. It's tough to rely on this type of training to get what we need when we would be relying on Microsoft's schedule. Since they are not a training company, thier events are not as frequent as a training company.

The one option that wasn't listed that I feel should have been is books. There are probably 10 books I could list that I would like to read. Get me some books, and I'd be happy.

So what's the best option? I don't think you can select just one option. It's up to the individual. But first, the company has to make a commitment to the employee to get them training. In the past, I've seen companies pay lip service to training, saying that they want to develop the employees, but when push came to shove, training went out the window. For a company to dedicate itself to training, they need to be willing to dedicate time to it. And I don't mean telling the developer they get two weeks of training a year. I mean working with the developer to say that June 13th (for example) is set aside for you to do a particular online training. At a company I used to work for, we were also an accounting company. Why does that matter? Well, they had to have (documented) proof that each employee recieved three weeks of training over the course of three years. It's only a week a year, but it was guaranteed.

Anyway, what are some other methods to get training? How effective have they been? What has worked for you in the past?

Categories: ASP.NET


 

Jumping On The Unit Testing Bandwagon

posted on 2004-07-20 at 13:42:21 by Joel Ross

Yesterday, I integrated NUnit into our development process. It wasn't too painful, but we only have three unit tests so far. Nothing special, but it's a start.

I also added it to our build process, so the unit tests get run whenever a build occurs (which happens whenever a check-in occurs). Of course, in the process of checking in the unit tests, and configuring the build, I broke it for a few minutes, causing a few emails to go out to the team. But I eventually fixed it.

Anyway, we added unit tests because we had some small, easily testable tasks. Calculations and things like that. We are all new to TDD, so it's a learning experience for us all. I have long been interested in unit testing, but never found an opportunity to use it on a project. At my company, we recently had a project that was very successful that used a lot of the ideas we are using now (NxOpinion info can be found here.). So, as we dug into our project and the requirements, we discovered that we wouldn't be able to capture all of the requirements without an iterative development approach.

As part of that, we weren't sure when the best time to introduce unit testing was. Our team is made up of some fairly green developers. Introducing an object oriented design was a big step, as well as creating a shared component that can be used with both a public website and an internal system.

So throwing unit tests at them right away could have been overload. Of course, introducing it a month later is fine! So that's what we've done. It's a small step, but at least it's in the right direction.

Here's what we'll be testing right now:

1. Simple calculations
2. Anything that can easily be contained into small components, such as creation of objects and setting defaults.
3. Mehtods that use a database in a read-only fashion. On a side note, we are struggling through a good way to do database builds - more on that at a later time.

Here's what I would like to be testing eventually:

1. Methods that rely on writing to the database (being able to test the DAL would be nice!). I'll be watching Roy Osherove's post about Database unit testing and his attempt to build it into NUnit.
2. UI testing. We have some complicated javascript that we use and it would be nice to automate some of those UI tests, as well as being able to test ASP.NET controls.

Some day, we'll get there. Maybe. For now, we're slowly moving in that direction.

Categories: Consulting


 

Home Improvements, Again

posted on 2004-07-16 at 08:35:30 by Joel Ross

It looks like I'll be back on the home improvement front again here real soon. I still have minor tasks to finish on the front porch, but we'll probably be moving on to another project. I still have to side the end (a small section), put down some lattice, paint the inside of the windows, and eventually, put up railing. The first three are more important than the last one. It could wait until next year if we wanted to.

By the way, I'm hoping to get before and after pictures of the house up, but I'm waiting on our family website to get updated to have those. Even though I'm the web developer in the family, my wife maintains the site. It's more of a picture site, and she has the digital camera and the time, so she does it. It makes her happy, and I don't have to worry about it.

Anyway, my wife is looking at what we did to the porch, and now thinking about how we can get more out of the rest of the house. For starters, we'll probably pull up the carpet in the bathroom (yes, you read that right. Carpet in the bathroom), and put down linoleum. It's cheap, and will get us by until we are ready to do it right. The square foot sheets are 27 cents a piece, so we figure this job could cost less than $20, a cheap fix to get us by for a couple of years.

Up after that would be the rest of the carpet on the main floor. Well, not the rest, but the carpet in the dining room and living room. Then, we'd put down wood floors. My wife hates our carpet, and this would be a good way to get rid of it in most of the areas of the house - that would leave it in our den and the bedrooms.

Don't you just love owning a house?

Categories: Personal


 

Offshoring Views Revisited

posted on 2004-07-15 at 10:28:39 by Joel Ross

Over the weekend, I went to my Aunt and Uncle's house to visit with some family in from Texas. I had a pretty good time. But that's not why I'm posting this.

My uncle (Paul), another relative (Bob) (he's my grandma's sister's daughter's husband - how is that related to me?) and I got into a discussion about offshoring. My uncle is deadset against it. When I told him my experiences, I don't think he liked it too much. He didn't seem real thrilled with my views. He did ask a couple of good questions though.

1. "How long before my job is off shored?"

That's a question I used to worry about, until I started seeing how off shore works. You see, the idea of offshoring is to take the programming tasks and get them completed at a much cheaper rate. But when you work with them, you realize it's not quite that simple. They need much more direction. They need a much better design than the typical developer I deal with. That, right there, is the difference. I am a developer. Offshorers are programmers.

Anyway, Bob brought up a good point. He said that 100 years ago, carriage makers were probably a little worried about the auto industry. At one time, companies were reluctant to put electricity throughout warehouses. Companies were reluctant to embrace the internet and computers. What do all of these have in common? Well, first, the ones who did embrace the changing trends thrived. Those who didn't, whithered. Second, even though some whithered, we're still here and going strong. So yeah, maybe in 10 years my skills will be commoditized. But I have 10 years to figure out what will be valuable. Lesson: Throughout your career, you have to be nimble and accept that things change.

2. "How can the economy continue this trend of services without an industrial base?"

An interesting question, isn't it? Now, what's wrong with it? It assumes we don't have a strong industrial base. I don't think I buy that. But it is a good point. I'm in the service industry, and as I think back on my clients, most of the clients I've worked for provide services for their customers. I have worked for a few industrial clients, but not that many. Paul said he sees a collapse of the US economy in the future if that trend continues. "We can't all provide services for each other. Someone has to create the money." It sounds almost like a call for a global economy, something offshore could help to ignite. Feed money into their economy, and it will eventually come back around to us.

Anyway, that's all I have for now.

Categories: Consulting


 

Going Out On My Own?

posted on 2004-07-15 at 00:15:25 by Joel Ross

That's what I was approached with this week. Not right now, but the possibility of that in the next year or so. Take some time, and work on a plan. Then, when the time is right, make the jump from my current employer to my own partnership with an old buddy of mine.

Scary. That was my first reaction. I have a wife and kid to take care of. I'm the sole provider for my family, so I don't have another income to fall back on. Tourney Logic isn't quite a "quit your job" type of company (yet), so I don't have that either. And, being young (and a little stupid), I haven't built a great amount of savings. But the thought of working for myself is desirable. Right now, if I put in 40 hours or 60 hours, I get the same benefit from the work (other than personal satisfaction).

First, am I considering this? While I wish I could, I can't take the risk right now. I just can't afford to not have income for a month or two. Not to mention health insurance. If it was just me, then this would be a different situation, but it's not. It's my family.

But I at least entertained the thought, and heard out the offer. The idea is to use services as a means to an end. What does that mean? Get clients to service while always keeping an eye open for an opportunity to productize something we do. Once we get to that point, we back off of the servicing a little (just enough to pay the bills), and focus on building the product. That's how Tourney Logic came to be, actually. But we'd need something more marketable than Pool Management software. Once the software side took off, the services side would taper off, and eventually probably go away.

How do you start a consulting practice, big or small? And which is better? I've worked at two companies. The first had a consulting arm of about 400 people throughout 7 offices. The second is at 60 people in 4 offices. And the second is doing much better than the first. Why? Well, I'm not sure. I have some ideas, though. First, the larger company had many more internal issues - each office had a quota, and that created tension between the sales crew. They would angle to put a less talented team (from their office) on a project, rather than throw it over the fence to the more seasoned team at another office. I was there two and a half years, and they restructured the delivery team five times. And as far as the customer was concerned, nothing changed. Out facing, we were exactly the same.

My current company doesn't seem to suffer from those types of issues - yet. I'm already starting to see the conditions for this. Too much management, and not enough delivery. Recipe for disaster.

Anyway, back to the startup. I think the pairing we would have would be ideal. He can sell, and I can deliver. He can get his foot in the door, get me in there, and I can open the door wider. You see, he can talk the talk, and I can walk the walk. Honestly, he can walk the walk too, but he's a great salesman. I can do sales, but in a different capacity. I'm better at letting my actions sell me. So ideally, I would be fully chargeable, while he is part time chargeable (at first) and part time focused on sales. That's why our skill sets are so complimentary. And obviously, we both would eventually focus on whatever application we came up with full time, but that would be a ways off.

The worst part of all this? I know I can't take the risk right now, but he's going to do it anyway. He hasn't said so, but I know him. I had him pegged from day one as someone who would (and could) run his own business someday. And he'd be fun to work with. He and I get along very well. But it's not going to happen. At least not for me. Maybe he'll start it up, get stable, and I can jump in down the line.

Man. Reading this over again, I jumped all over the place. Guess that's what happens when you can't focus. Too much going on, I guess. Oh well, I don't have time to go back and fix it!

Categories: Consulting


 

Tourney Bracket Control 2.0 Development Is Underway

posted on 2004-07-13 at 10:12:43 by Joel Ross

Well, it's been underway for a little while, really. But last night, I had the motivation to put quite a bit of time into it. I've rearchitected quite a bit of the way it renders (which is the most complicated part of the control).

For anyone not in the know about Tourney Logic, here's a brief description of what we are about. We started out to build the best ASP.NET pool management software available, and eventually to evolve into the best pool management software available, regardless of technology. As we thought about how the best way to do this was, we came up with the idea of having a bracket control that would handle the rendering and logic associated with brackets. And since we were building it anyway, we might as well make it available to anyone else who might want to use it in their applications. But our eventual goal was to build a Pool Manager, which we did.

Right now, we have two products available: the bracket control and the pool manager. Right now, the pool manager only supports the NCAA tournament, but plans are to make it configurable for multiple tournaments. I'm not sure when that will happen, but that's the goal.

But first, the Tourney Bracket Control. It is undergoing a pretty big rearchitecture. Why? Well, first, some of the rendering logic was not as tight as it could have been. It was good enough for what we needed (a 64 team tournament configured exactly as the NCAA tourney was), and worked for other simple, single elimination tournaments that don't reseed (bye, bye NHL). So we published it. And it did OK. It worked fine for the pool manager. But we wanted more out of it. We have other ideas, and the first step is to get the bracket control "up to snuff."

So what does that mean? First, and most important, is to support double elimination. We have a plan in place to make that happen, but it's not a small task. Next, we will be adding a much better management experience. Teams will be editable right in the bracket. More information can be added to matchups, including locations, times, etc. Each matchup could be linkable to view that information. The designer experience will be much better. Right now, it is very rough, and we know it has issues. We'll have more samples. We know we need more of those. Anyway, we're still in the planning stages, but moving forward on what we know we need to do.

Later this year, we'll begin the process of working on the Pool Manager again. We had a good year with it for a first year, and landed a couple of (unexpected) big fish. Hopefully that trend will continue. More on the Pool Manager as that gets closer. For now, it's all bracket control development.

Categories: Develomatic


 

Scoble Wants To Link To My Blog!

posted on 2004-07-13 at 09:39:10 by Joel Ross

Yup, that's right. He said so right here. Apparently a lot of other people think he was talking to them, but when I read it, it was obviously to me!

I'm not sure what he'll find interesting about my blog, but hey, I've been reading his for a while now.

Categories: Blogging


 

Tom Clancy On XBox

posted on 2004-07-08 at 16:17:45 by Joel Ross

Over the weekend, I rented Rainbow Six 3, and yesterday I bought Ghost Recon: Island Thunder. Both are good games.

First, I'm a huge Tom Clancy fan. I've read almost all of his fiction books that have a relation to Jack Ryan (not the one running for Senator!). That includes Rainbow Six (even though Ryan wasn't in that one). I loved the book, and I loved the game on PC. On XBox, the game looked great. There was one thing that bothered me about it though. I don't have XBox live, and there's no multi-player option unless you either have a system link, or you use XBox live. That was disappointing. The box says 1-16 players, and obviously you can only get 16 if you are on Live or have more than a few XBoxes around. But I hoped that I could at least play with 4 players on one console. Nope. Not happening. It would have been awesome to be able to go through some of those levels with three of my buddies. And that's one of the reasons I rented it. I guess I should have done my homework a little better, huh?

Because of the above issue, I opted to buy Ghost Recon. It's only a two player game, but at least the two of us can sit at the same console and play. I played it briefly last night, and it was great. I like the more realistic shooters, where one good shot can kill not just your enemy, but you too. I was just testing out a level, and I wasn't moving around for more than 2 minutes when BANG, I was shot in the head, and the mission was over. I also like the way you control your team. It's much easier than in Confict: Desert Storm II. You don't have as much control, but you can switch to them and play as them if need be.

Both of the games are challenging. While I had RS3, it took me three days to finally beat the first level. I could get to the second hostage, but the terrorists always killed her before I could get a round off in his direction. Last night, I beat the first level of GR on the second try (my first try was a complete disaster, and I decided to do the training first), but lost two guys in the process.

All in all, I think I'll be happy with Ghost Recon. It's older (only cost me $15), but like I've said before, it's new to me! But if I ever get around to getting XBox live, I'll definitely be getting Rainbow Six 3 (or what ever the latest one is at the time)!

Categories: XBox


 

<< 1 ... 114 115 116 117 118 119 120 121 122 123 124 >>