Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# code flow mapping/visualization utility?

I've been asked to re-write (from the ground up) an existing C# winforms application. Unfortunately, this code has been modified by at least a dozen different developers over the past three or four years none of whom seemingly adhered to any kind of coding standard. To say that this code base is a mess would be putting it politely. Given the magnitude of the code (~24k lines) and the fact that the code is completely new to me, I'd like to find some kind of utility that will help me to more quickly understand how this application works at a high level. Bear in mind that there don't seem to be an abundance of good OOP practices in this code so I need something a little more detailed than class diagrams. I've seen references to generating sequence diagrams which might be more like what I'm looking for but I only have VS2010 Premium and I'm under the impression that this functionality is only provided with the VS Ultimate SKU. I have access to the current version of .NET Reflector and I've seen a couple of people mention that there are plug-ins for that which might be useful but I don't have any specific names.

like image 986
bmt22033 Avatar asked Apr 13 '11 13:04

bmt22033


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is the full name of C?

In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.

What is C in C language?

What is C? C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.

Is C language easy?

C is a general-purpose language that most programmers learn before moving on to more complex languages. From Unix and Windows to Tic Tac Toe and Photoshop, several of the most commonly used applications today have been built on C. It is easy to learn because: A simple syntax with only 32 keywords.


1 Answers

Rewriting the code from scratch can be a disaster: See this: http://www.joelonsoftware.com/articles/fog0000000069.html

This is not an easy task as you mentioned there were a dozen developers before you. Behind each developer is his own methodology and his own logic of the system. Everyone does it their own way.

Here are some of the problems you could encounter

  • Following another developers logic
  • Whether or not the developer is still around or has changed positions or worse changed jobs
  • Finding the or even if a technical specification exists (this is the most important)
  • Legacy code that was originally written, then patched, then patched again and again...
  • Custom code that might have been integrated or written within the application
  • Security if there is any

Besides having a bunch of flowcharts / diagrams of the application the best thing to ask for or obtain is the technical spec. What is the purpose of the program and given that 12 other people worked on it is it something you can take on yourself?

You mentioned OOP, do you plan to take spaghetti code and do an entire rewrite to fit the object oriented model? If so that is a lot of work...and with 12 prior brains working on it someone's logic is bound to trip you up.

Sorry I don't have the best advice, but this could be a daunting task...especially if those developers before you are no longer there.

See these SO threads for more info:

  • When to rewrite a code base from scratch

  • Is this the "one in ten" time to rewrite?

  • Rewrite of legacy code

like image 76
JonH Avatar answered Nov 11 '22 16:11

JonH