Browse DevX
Sign up for e-mail newsletters from DevX


eXtreme.NET Iteration One: Refactoring with Resharper

This article follows a team of developers learning to use XP (eXtreme Programming) techniques to improve the way they deliver software. Follow this team as they learn about Resharper, a tool that may help them refactor their code.

he eXtreme .NET Team

  • eXreme Eddie—Eddie has been programming for more than 20 years. He has done everything from mainframe work through embedded systems. Eddie was an early adopter of XP techniques and has been using XP in Java projects for the past couple of years. Eddie embodies the XP spirit.
  • .NET Deepak—Deepak is a young, smart coder. He graduated last year but has been using the .NET Framework since it first went into beta. Deepak knows and loves .NET. Deepak represents all there is to love about .NET.
  • Skeptic Sue—Sue has been in software development for 10 years. She has been mainly developing Windows software in C and C++. Sue was promoted in her previous job to project manager, which she hated. She left and joined this team so that she could get back into developing software. Sue carries the scars from many failed projects and doesn't trust new ideas.
  • Panic Pete—Pete is very bright and comes up with amazing solutions for problems. He is the clown of the team. Pete has been writing code for five years but has never finished a single project he started. Pete panics when the going gets tough and verbalizes this panic. When this happened at a previous job he quit.
  • Customer Chris—Chris is the internal customer for the team. He works with marketing and the customer support team. Chris once tried to write some code in a training course. He didn't enjoy it. Chris is a people person: He loves engaging in conversation.
Morning Meeting
Let's join the team now as they hold a morning meeting to discuss their project.

Eddie: Good morning, everyone!

Team: Morning!

Eddie: I am really pleased with how things are going. How do you feel Chris?

Chris: Yes, it looks like you have gotten off to a good start.

Deepak: I am concerned about using the CourseCosts library; the code in there is pretty messy.

Pete: Panic!

Sue: Why? Did you write that library Pete?

Pete: (looking somewhat sheepish) Yes, kind of. I was involved in that project but I left the team before they shipped.

Chris: How does this impact me? The SportSpeak project allows them to start selling courses online and we were banking on reusing that library. Wasn't that the plan?

Eddie: Sure that is the plan. What do you think Deepak?

Deepak: I think we should be fine, but if we are going to touch the code in there we will probably want to do some refactoring.

Chris: What's that? Is it expensive? I thought we just needed to add the ability to cope with event sponsors injecting money into the event.

Eddie: Refactoring is changing the structure of the code without changing the behavior of the code.

Chris: OK, so you want to do what exactly?

Sue: I think it is a bit like doing spring cleaning on the code. Something Pete could do on his desk.

Pete: (Smiling) If you stopped leaving all your junk on my desk it would only be half as messy!

Everyone except Sue laughs for a moment before realizing that Sue has not taken this well and is glaring at Pete.

Chris: OK, well we have job to do here guys. Is there something that will make this code cleaning exercise any easier for you?

Eddie: In the last tool I used for a Java project we had refactoring tools in the IDE. I haven't seen anything like that in Visual Studio .NET.

Deepak: I have heard Microsoft will put some in the next version.

Pete: Yeah I read that too. VS2005 will have refactoring tools. That looks cool!

Sue: Great, but until you smart alecs invent a time machine we are stuck with Visual Studio 2003.

Deepak: There are a couple of tools I've seen that plug-in to Visual Studio for doing refactoring.

Eddie: Oh, that's interesting! Have you used them?

Deepak: I downloaded the trial of Resharper and I could show you some of what it does.

Pete: Cool!

Eddie: Well, since you worked on that project Pete, and Deepak has played with this Resharper tool, why don't the two of you pair up this morning and see if it will help us move forward with working on the library?

Deepak and Pete look at each other and grin.

Sue: And no monkey business guys!

Pete: Would we?

Eddie: Um… yes most likely!

Chris: OK, so we'll know this afternoon if this tool is worth buying?

Deepak: Yeah I reckon we should.

Eddie: Great! Let's get to it then.

Thanks for your registration, follow us on our social networks to keep up-to-date