1

I'm looking for the solution (asp.net C#) to rewrite the core of the project that was created about 10 years ago without any global changes through all of these years. The component that i want to rewrite contains the base system logic, is used in multithreaded environment and contains thousands lines of code. Unit tests covers only 30% of the code. But (of course) I have no chance to break something after refactoring.

The question is: what is the best approach to do this? Are there any helped libraries?

EDIT 1: the source code is not weird, there is a little of spaghetti code, database design is good, there is no repetitive code, but the structure of the project needs to be fully re-factored: changes in oop patterns, disconnecting the implementation, replacing template method pattern with strategy or publisher/subscriber, etc..

Ivan Yuriev
  • 488
  • 8
  • 14
  • The similar question http://stackoverflow.com/questions/3618357/code-refactoring-on-bad-system-design . It's about Java but I think the approach is the same. – chameleon Apr 20 '16 at 10:53
  • The code had been around for 10 years without needing major work, isn't in a particularly bad shape, has a good db, works safely in a multi threaded environment, why does it *need* refactoring? What's the driving force, what are you hoping you achieve? Is its current structure causing too much friction? If there isn't a compelling reason for it, then don't... – forsvarir Apr 20 '16 at 18:35
  • the reason is to add new functionality more quickly and easily. Current project structure is NOT loosely coupled and every change in (super) base class forces to change all the its descendants. there are 3-4 superbase classes and the other 100+ classes are the descendants of them. I want to create more flexible structure where I can extend classes instead of changing 'em according to Open\Close principle – Ivan Yuriev Apr 21 '16 at 08:52

0 Answers0