Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Software Reengineering


Published on

Presentation on Software Reengineering, how to start, what modules to introduce and when, and how to migrate existing code to the new infrastructure.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Software Reengineering

  1. 1. Software Reengineering<br />Don’t rewrite – reengineer!<br />
  2. 2. Why Rework a Functioning System?<br />Make it more maintainable<br />Reorganize and update structure<br />Move to a more modern language or platform<br />Modularization<br />Data reengineering<br />Enable Process Reengineering<br />Add new functionality<br />Improve Performance<br />Improved response to required system changes<br />Introduce quality and other measurable improvements<br />Future labor savings (dev team and business team)<br />System Consolidation<br />You can Rewrite or Reengineer<br />Brad Irby - Alobria Systems<br />
  3. 3. Advantages of Reengineering<br />Reduced Customer Impact<br />No Feature Freeze – Plane Stays in the Air<br />Fits well with Agile Release Schedules<br />Reduced Risk<br />Maintains existing business logic, processes, and side effects<br />Fewer errors interpreting existing system<br />Reduced Cost<br />Can use outside talent <br />Business logic already complete<br />Shorter Timeline (about 6-9 months)<br />Continuous QA<br />25% of the cost of a rewrite (Ulrich, 1990)<br />Brad Irby - Alobria Systems<br />
  4. 4. Before We See Code…<br />Assumptions<br />Winforms - Using Adapted Prism<br />Unit Tests are rarely done now<br />UI Requirements<br />Winforms now<br />ASP MVC near future<br />WPF in the medium future<br />Maybe Silverlight in far future<br />Different UI’s But Single Controller<br />Brad Irby - Alobria Systems<br />
  5. 5. Preliminary Code Review<br />Establish validity of MVC<br />Everybody claims it, few have it<br />Count Number of Static Classes<br />Pure constant or enum classes don’t matter<br />Count Activator Calls<br />Count Average Num References per Project<br />Look at validity of references<br />Where is wizard controller logic?<br />Know What You Are Up Against<br />Brad Irby - Alobria Systems<br />
  6. 6. Lay Groundwork (Basics)<br />Decide Unit Test Framework<br />External GUI runner<br />Integrated into VS2008/2010 (TestDriven)<br />Integrates with Code Coverage<br />Integrates with TFS?<br />Has Command Line<br />Reporting with data export<br />Nunit, MbUnit, MSTest<br />Spend the time to do this right<br />Brad Irby - Alobria Systems<br />
  7. 7. Lay Groundwork (Basics)<br />Divide Tests<br />Integration tests<br />Unit tests<br />Install test runner<br />TestDriven or Resharper are good<br />Train Team<br />TestDriven<br />NUnit<br />Training is an ongoing effort<br />Brad Irby - Alobria Systems<br />
  8. 8. Lay Groundwork (Basics)<br />Setup Build Server<br />Nightly build a must<br />Email build Success/Fail<br />Continuous Integration helps a lot<br />Cruise Control and CCTray<br />Nightly runs of integration tests<br />Unit tests run on each checkin<br />Peer Pressure Not To Break Builds<br />Brad Irby - Alobria Systems<br />
  9. 9. Lay Groundwork (Advanced)<br />Decide on Code Coverage<br />NCover or MS Team Coverage<br />Stats should run nightly to develop trend<br />Over time, decide on max Cyclomatic Complexity<br />Decide on Mocking Framework<br />Moq, Rhino mocks, Typemock Isolator (Big Daddy)<br />Ensure data model is in project by itself<br />Allows use from old and new code<br />Get Team Buy-in on these<br />Brad Irby - Alobria Systems<br />
  10. 10. Let’s See Some Code!<br />Project Structure Strategy<br />Preliminary Code Cleanup<br />Remove unneeded Using clauses and References<br />VS PowerCommands for Usings<br />References – brute force<br />Update project target framework<br />Clean up warnings<br />“Warning as Errors”<br />Careful of too many partial classes<br />Code Changes Good for Junior Dev<br />Brad Irby - Alobria Systems<br />
  11. 11. Start Coding – Add Basics<br />Dependency Injection Container<br />Service Locator<br />Message Aggregator<br />Logger<br />Module Manager<br />Region Manager<br />Toolbar Manager<br />Repository (ORM?)<br />Message Dialog Service<br />Little Effect on Existing Code<br />Brad Irby - Alobria Systems<br />
  12. 12. Migrate Infrastructure<br />Add Bootstrapper<br />Establish first 2 modules<br />Shared<br />Smallest and Easiest Module<br />Move Constants and Enums (Jr. Dev)<br />Make these Static classes<br />Look for Static Services classes<br />Difficult to Mock and test (statics are sealed)<br />Cause problems testing other things<br />Search for “public static class”<br />Change to normal class (singleton via container)<br />Need Interface<br />SearchPageFactory<br />Small Changes Can Have Big Effects<br />Brad Irby - Alobria Systems<br />
  13. 13. Migrate Infrastructure<br />Look for singleton patterns<br />Search for “.Instance”<br />Move to Service Locator<br />BusinessObjectCacheManager<br />Look for services with no Interfaces<br />Can move to “everything” interface easily<br />Put in ServiceLocator<br />Watch your References<br />Old to New = OK<br />New to Old = Bad<br />Slowly Move To New Infrastructure<br />Brad Irby - Alobria Systems<br />
  14. 14. Migrate Views & Controllers<br />Start with Easiest<br />Lots of infrastructure needed for first one<br />Don’t complicate with difficult workflow<br />Use views that don’t need data binding if possible<br />Second – easy workflow with data binding<br />Third – most complicated workflow<br />Last – pass patterns on to team for implementation<br />Build Example Patterns for Others<br />Brad Irby - Alobria Systems<br />
  15. 15. Testing Considerations<br />Bootstrapper<br />Add Extension methods to setup mocks<br />Moq lets you get the Mock via an object<br />Make plenty of Mocking examples for others to learn from<br />Try for 75% or more coverage on new code<br />Don’t overload TestSetup<br />Common beginner mistake<br />Unit Tests Difficult for Some<br />Brad Irby - Alobria Systems<br />
  16. 16. Parting Comments<br />Don’t call old code “Legacy”<br />Work closely with QA<br />You will break things that were solid before<br />Copy code to new projects where you can<br />Unit Tests Difficult for Newbs<br />Brad Irby - Alobria Systems<br />