.NET Zone is brought to you in partnership with:

I am a Software Engineer working with the latest in .NET focusing on Web Development. With a burning heart for programming, I blog and author a book about C#. Filip is a DZone MVB and is not an employee of DZone and has posted 54 posts at DZone. You can read more from them at their website. View Full User Profile

How I Join Projects Already in Progress

10.07.2012
| 4927 views |
  • submit to reddit

I want to talk about how I get deep into the new projects that I join, fast. The projects that I’m referring to are those that have been developed on before. The customer never really wants to pay for you to spend too much time learning the code base and the actual project, so you’ll have to use tools that will help you do so fast.

What I do when I first get the project on my table

The first thing that I try to do is get the project running or get all the tests to give me green lights. This assumes, of course, that there are tests written for the system! Just imagine that you need to join a project that has been developed for hundreds or thousands of hours and there’s no tests and no documentation; this is much more common than you might think. That’s why the following quote is what everyone should be feeling when writing code.

Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.


As soon as I’ve gotten the project running, or the tests are all okay, I can move on to understanding the code base. Normally when you get your hands on a project, there’s something specific you need to do to it -- let’s say that you need to implement a feature.

The first thing that I try to do is get an overview of the complexity and what is depending on what. To do this, I’m using NDepend (which I’ve written about in C# Smorgasbord). NDepend will give you great reports and help you find complexity in many forms. Here’s an overview that shows what is connected to what and the size of the boxes indicate the complexity:

When I find something that I think is too complex, I try to identify if there’s a test for that by analyzing the code coverage. If the code coverage is bad, I try to start writing some tests, this will help me get custom to the project. I don’t worry too much if the tests fail; this means that I need to debug the tests which will force me to step into the complex parts of the system and analyze them further.

To get a great overview of my testing, I use the built-in (not in VS2010 Express versions, but in VS2012!) MS Test tooling.

Break & Fix the code

When I’ve come as far as starting to write tests for complex parts that are already in the system; I try to refactor small parts, break stuff to understand the business logic. This all helps me get a great idea of what the particular parts do.

In order to help me get an idea of what is covered by tests and not when browsing around the code, I use NCrunch. NCrunch is great, I configure it to add black dots everywhere to indicate statements that are not covered by tests. Then when they are tested, the dots go green and this is updated in real time!

At this time I can normally start looking at the actual task that I need to perform. Depending on how large the project is and how complex it is, the above process might be short or long. But at least for me, it’s a great way to get my head in a new project.

tl;dr

So you’ve got a new project that you need to implement features in, here’s what I recommend:

  • Analyze the complexity of the code with tools such as NDepend
  • Write tests for un-covered code to understand the flow of the application
  • Use NCrunch to annoy yourself with black dots so that you’ll write more tests and get a better knowledge of the code base
  • Break the code and fix it again — then refactor!

What are you doing to spend less time understanding a system and more time actually fixing the problems?

 

Published at DZone with permission of Filip Ekberg, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Andy Jefferson replied on Mon, 2012/10/08 - 7:54am

So why is this (.Net) appearing on JavaLobby ? (the word Java there is a clue to what language its user should be seeing)

Wojciech Kudla replied on Mon, 2012/10/08 - 8:53am in response to: Andy Jefferson

Yeah, that's irritating, isn't it? It's not the first time this is happening. Wrote to the editors a while ago but never got any response. Going to abandon dzone if this mess continues.

Filip Ekberg replied on Mon, 2012/10/08 - 9:50am in response to: Andy Jefferson

I'm guessing the editor thought that it would be good information to both Java and .NET developers. Even if the tools used to demonstrate are used on .NET code, it doesn't mean that the theory doesn't apply to any programming language.

Mitch Pronschinske replied on Mon, 2012/10/08 - 10:15am in response to: Filip Ekberg

Exactly right, Filip.   Just substitute Infinitest for NCrunch and substitute XDepend for NDepend if you're coding in Java via Eclipse.  The concepts remain the same. (although infinitest doesn't have all the features of NCrunch)

Rick Ross replied on Mon, 2012/10/08 - 10:32am in response to: Andy Jefferson

This is simple, and I feel the DZone team made a very reasonable call in this case. It is often difficult to pinpoint exactly where a particular story fits into our many zones, since it may have elements that are also applicable to other zones.

If you expect to come to Javalobby and find ONLY Java and absolutely nothing else, then you may expect something more narrow-minded than we actually are. DZone is not, and will not become, the FOX News of the Java space, where broader perspectives are never considered and where everything we publish comes from a single, narrowly defined viewpoint.

I started Javalobby, and I feel that DZone's editorial team was right to cross-pollenate this story into the Javalobby article stream. We wouldn't like to lose your support, but please understand that we are serving a broader mission that includes more than just Java. 

Wojciech Kudla replied on Mon, 2012/10/08 - 11:55am in response to: Filip Ekberg

This is more general problem. Do you think this article belongs to Javalobby as well?

Thomas Wheeler replied on Mon, 2012/10/08 - 12:28pm

I don't want DZone to be the FOX News / MSNBC of the Java world. Back in the day, Javalobby was pretty much 100% about Java, but this is 2012 and DZone is a lot more than just Java. Rick, you're doing it right.

Andy Tripp replied on Mon, 2012/10/08 - 1:49pm in response to: Thomas Wheeler

...and the people who perferred "just Java" are obviously long gone. I wonder how the current dzone traffic compares to the "Javalobby back in the day" traffic.

Mitch Pronschinske replied on Mon, 2012/10/08 - 2:44pm in response to: Wojciech Kudla

@ Wojciech
You're right about that one.  It must've been mistakenly added to the Javalobby feed and it's out now.

Andy Jefferson replied on Mon, 2012/10/08 - 11:46pm in response to: Rick Ross

Rick,

good that you have a wider mission, but not all of us share your mission, and I simply asked a question as to why this is appearing (not wanting some controversy to be blown up out of it, since that detracts from Filips article and didnt want to do that). I later on found the "Feedback" link and contacted your people directly (there didnt seem to be a simple "Contact Us" in the footer, why?).

While this article (and others too maybe) could be useful if written in a general way (or by including key info of what the equivalent tool is in Java, or whatever other language ... who knows, maybe the reader hasn't got a crystal ball and doesn't know what the equivalent is?) but sadly it isn't written general. You think it's useful, so fine. Obviously you could just let a user select the "zones" they are interested in (you went to the trouble of separating them in the top menu) and then just show what they want. Everyone's happy then, rather than just the people who want to see everything. Your call, its your site.

The end result of posting a comment against it is that I get spammed with endless "someone has replied" emails, which provide an unsubscribe link that doesn't work (it comes back with "Access Denied"). So seemingly you give people with a login for JavaLobby permission to view articles from other spaces, and comment on them, but not unsubscribe. Seems like something isn't connected there, and I reported that but no reply. Just have to mark DZone emails as spam til its fixed.

Lund Wolfe replied on Sat, 2012/10/13 - 8:15pm

Like many others, if there was an alternative to JavaLobby I would have taken it long ago.  The site does have many issues.  I don't know whether it's due to trying to be genericly compatible with other systems, using all frameworks and tools to make it just a Content Management System, or they just can't afford to hire a programmer.

They claimed to have an editable profile at one time that would allow the user to opt-in/opt-out of non-Java related zones.  It would be better to empower the users than to play the Large And In Charge game.

Jaffa Wify replied on Mon, 2012/11/12 - 11:24pm in response to: Andy Jefferson

Come up with substitute versions of everyday words. People do this all the time and it is called slang. When you do it intentionally and only let a few people in on it, it can be a good way to keep your communication secret. Thanks a lot.

Regards,

translate english to russian


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.