Your Code Base Sucks!    and how to fix it   By Llewellyn Falco & Woody Zuill
Goal:Share Techniquesfrom the field
ToolsTechniquesTests
Tools:Subversion (svn)            Visual Svn Host,not file system                              TortoiseSvn    Do not check...
Tools:Resharper                                            Keyboard Shortcuts                                             ...
Tools:dotCover
Tools:Vs2010 ProductivityPower Tools              Show Full Map                    Alt + ↑↓
Tools Websites:The Simple-Talk CodePrettifier
Tools Websites:VB.net to C#
Tools:FxCop /Code Analysis         Step 1: Turn off EVERYTHING
Tools:SqlServer                Profiler             Read Only            Checkpoints
Tools:Source Monitor         File>Options>Allow Parsing of UTF8
Techniques
Techniques:Delete Clutter //stringFormat.Alignment = StringAlignment.Center; //stringFormat.LineAlignment = StringAlignmen...
Techniques:Delete Dead Code
Techniques:Delete Dead Resources
Techniques:Delete Dead ResourcesFunding.csFundingReport.2011.rdlcFundingReport.rdlcHelpingReport.2011.rdlc       Funding.c...
Tests
Functional is Easypublic string EncodeForSt3Standard(int a, char c)
Functional is Easypublic string EncodeForSt3Standard(int a, char c)           A                 C             Output      ...
Functional is Easypublic string EncodeForSt3Standard(int a, char c)           A                 C             Output      ...
Functional is EasyAll Parameters In       EncodeForSt3Standard     (int a, char c)                        Deterministic   ...
Reduce To Functional public void CreateDailyTasks()                          CreateDailyTasks                       // Que...
Reduce To Functional public Sql[] CreateDailyTasks(     )                           CreateDailyTasks                      ...
Functional is Easy    public Sql[] CreateDailyTasks(      )All Parameters In                     CreateDailyTasks     Know...
www.ApprovalTests.com     check here for more information   about how we actually tested the code
Contact           Woody Zuill          wzuill@yahoo.com  Llewellyn Falco   info@spunlabs.com
Your codebase sucks! and how to fix it
Your codebase sucks! and how to fix it
Upcoming SlideShare
Loading in …5
×

Your codebase sucks! and how to fix it

962 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Your codebase sucks! and how to fix it

  1. 1. Your Code Base Sucks! and how to fix it By Llewellyn Falco & Woody Zuill
  2. 2. Goal:Share Techniquesfrom the field
  3. 3. ToolsTechniquesTests
  4. 4. Tools:Subversion (svn) Visual Svn Host,not file system TortoiseSvn Do not check in generated or local files
  5. 5. Tools:Resharper Keyboard Shortcuts Refactorings http://www.jetbrains.com/resharper/docs/ReSharper40DefaultKeymap.pdf
  6. 6. Tools:dotCover
  7. 7. Tools:Vs2010 ProductivityPower Tools Show Full Map Alt + ↑↓
  8. 8. Tools Websites:The Simple-Talk CodePrettifier
  9. 9. Tools Websites:VB.net to C#
  10. 10. Tools:FxCop /Code Analysis Step 1: Turn off EVERYTHING
  11. 11. Tools:SqlServer Profiler Read Only Checkpoints
  12. 12. Tools:Source Monitor File>Options>Allow Parsing of UTF8
  13. 13. Techniques
  14. 14. Techniques:Delete Clutter //stringFormat.Alignment = StringAlignment.Center; //stringFormat.LineAlignment = StringAlignment.Center; //if (otherData != "") VS// This is a part of the code with does some string alignment// It was put here in response to a problem with Rp Donations// If the Center isn’t of height 60
  15. 15. Techniques:Delete Dead Code
  16. 16. Techniques:Delete Dead Resources
  17. 17. Techniques:Delete Dead ResourcesFunding.csFundingReport.2011.rdlcFundingReport.rdlcHelpingReport.2011.rdlc Funding.csHelpingReport.rdlc HelpingReport.2011.rdlcHotelReport.2011.rdlcHotelReport.rdlc ➪ HotelReport.2011.rdlc JeersReport.2011.rdlcJeersReport.2011.rdlc MailingReport.2011.rdlcJeersReport.rdlcMailingReport.2011.rdlcMailingReport.rdlc
  18. 18. Tests
  19. 19. Functional is Easypublic string EncodeForSt3Standard(int a, char c)
  20. 20. Functional is Easypublic string EncodeForSt3Standard(int a, char c) A C Output 45 ‘a’ **** -1 ‘z’ ** 7 ‘f’ ******
  21. 21. Functional is Easypublic string EncodeForSt3Standard(int a, char c) A C Output 45 ‘a’ **** -1 ‘z’ ** 7 ‘f’ ******
  22. 22. Functional is EasyAll Parameters In EncodeForSt3Standard (int a, char c) Deterministic All Effects Out string
  23. 23. Reduce To Functional public void CreateDailyTasks() CreateDailyTasks // Queries Database // create task Items
  24. 24. Reduce To Functional public Sql[] CreateDailyTasks( ) CreateDailyTasks // Queries Database // create task Items
  25. 25. Functional is Easy public Sql[] CreateDailyTasks( )All Parameters In CreateDailyTasks Known Database Deterministic All Effects Out Sql Log
  26. 26. www.ApprovalTests.com check here for more information about how we actually tested the code
  27. 27. Contact Woody Zuill wzuill@yahoo.com Llewellyn Falco info@spunlabs.com

×