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.
An Overview of
.NET Best Practices
Stephen D. Ritchie
Rappahannock Area Developers .NET Users Group
17 Mar 2015
Excella Consulting
Overall – Challenges
Continuous Integration
No CI Server
No Code Analysis
Not Triggered by SCM
- 2 -
Excella Consulting
Overall – Challenges
Code Reviews
Not Conducted
Issues Not Tracked
Issues Dropped
- 3 -
Excella Consulting
Current – Challenges
Automated Builds and
Deployments
Manual Deployment
No Automated Testing
No Code An...
Excella Consulting
Current – Challenges
Automated Unit Testing
Low Code Coverage
No Mocking Framework
Failing or Ignored T...
Excella Consulting
Opportunities
- 6 -
Best Practices Matrix
Complexity
Risk
Cost
Value
Excella Consulting
Minimal, Essential
Source Control
- 7 -
Excella Consulting
TFS
- 8 -
Excella Consulting
SVN
- 9 -
Excella Consulting
Mercurial
- 10 -
Excella Consulting
Git
- 11 -
Excella Consulting
Level Metaphor
- 12 -
Excella Consulting
32
4 5 6
7 8 9
1
Go to Green
- 13 -
Excella Consulting
Level 1 – Goals
Build Script
- 14 -
Excella Consulting
Level 1 – Starting Point
Manual Builds
- 15 -
Excella Consulting
MSBuild
- 16 -
Excella Consulting
NAnt
- 17 -
Excella Consulting
PowerShell
- 18 -
Excella Consulting
Extensions
- 19 -
Excella Consulting
Level 1 – Example
- 20 -
Example Build
Script
Excella Consulting
Level 1 – Result
One Script,
Builds Everything
- 21 -
“Run the Runner”
Build Script
Excella Consulting
32
4 5 6
7 8 9
1
Go to Green
- 22 -
Excella Consulting
Level 2 – Goals
Continuous
Integration
- 23 -
Excella Consulting
Level 2 – Starting Point
No CI Server
- 24 -
Excella Consulting
Level 2 – To Do
Install CI Server
Triggered by Code Push
“Run the Runner”
- 25 -
Excella Consulting
TFS
- 26 -
Excella Consulting
CC.NET
- 27 -
Excella Consulting
Jenkins
- 28 -
Excella Consulting
TeamCity
- 29 -
Excella Consulting
Level 2 – Example
- 30 -
CI Server
Example
Excella Consulting
Level 2 – Result
Observe & Report
- 31 -
Excella Consulting
3
4 5 6
7 8 9
1 2
Go to Green
- 32 -
Excella Consulting
Level 3 – Goals
Code Analysis
- 33 -
Excella Consulting
Level 3 – Starting Point
No Code Analysis
- 34 -
Excella Consulting
Level 3 – To Do
Analysis Tool
Static Code Analysis
Run with CI Server
- 35 -
Excella Consulting
FxCop
- 36 -
Excella Consulting
Gendarme
- 37 -
Excella Consulting
StyleCop
- 38 -
Excella Consulting
NDepend
- 39 -
Excella Consulting
Simian
- 40 -
Excella Consulting
Sonar
- 41 -
Excella Consulting
Level 3 – Example
FxCop 10
- 42 -
Analysis Tool
Example
Excella Consulting
Level 3 – Result
Analyze,
Improve,
Monitor
- 43 -
Excella Consulting
4 5 6
7 8 9
1 2 3
Go to Green
- 44 -
Excella Consulting
Level 4 – Goals
Automate Testing
- 45 -
Excella Consulting
Level 4 – Starting Point
No Tests
- 46 -
Excella Consulting
Level 4 – To Do
Testing Framework
Run with Runner
Run with CI Server
- 47 -
Excella Consulting
MSTest
- 48 -
Excella Consulting
MBUnit
- 49 -
Excella Consulting
xUnit.net
- 50 -
Excella Consulting
NUnit
- 51 -
Excella Consulting
Level 4 – To Do
Mocking Framework
Isolation
Interaction Testing
- 52 -
Excella Consulting
Rhino Mocks
- 53 -
Excella Consulting
Moq
- 54 -
Excella Consulting
Level 4 – Example
- 55 -
Automate Testing
Example
Excella Consulting
Level 4 – Results
Passing
Tests
- 56 -
Excella Consulting
5 6
7 8 9
1 2 3
4
Go to Green
- 57 -
Excella Consulting
Level 5 – Goals
Code Coverage
+ More Tests
+ More Code Analysis
- 58 -
Excella Consulting
Level 5 – To Do
Coverage Tool
Run in Visual Studio
Run with CI Server
- 59 -
Excella Consulting
NCover
- 60 -
Excella Consulting
OpenCover
- 61 -
Excella Consulting
dotCover
- 62 -
Excella Consulting
Level 5 – Example
- 63 -
Code Coverage
Example
Excella Consulting
Level 5 – Results
100% Class Coverage
+ More Code Analysis
- 64 -
Excella Consulting
6
7 8 9
1 2 3
4 5
Go to Green
- 65 -
Excella Consulting
Level 6 – Goals
Code Review
+ More Tests
+ More Code Analysis
- 66 -
Excella Consulting
Level 6 – To Do
Pick Approach
Share Opinions
Track Issues
- 67 -
Excella Consulting
Pairing
- 68 -
Excella Consulting
Group
- 69 -
Excella Consulting
Peer
- 70 -
Excella Consulting
Level 6 – Example
Peer
- 71 -
Code Review
Example
Excella Consulting
Level 6 – Results
Reviewed Code
100% Method Coverage
+ More Code Analysis
- 72 -
Excella Consulting
7 8 9
1 2 3
4 5 6
Go to Green
- 73 -
Excella Consulting
Level 7 – Goals
Packaging
+ More Coverage
+ More Code Analysis
+ More Tests
- 74 -
Excella Consulting
MSI
- 75 -
Excella Consulting
Web Deploy
- 76 -
Excella Consulting
Octopus
- 77 -
Excella Consulting
Zip Archive
- 78 -
Excella Consulting
Level 7 – Example
Zip
- 79 -
Packaging Example
Excella Consulting
Level 7 – Results
Packaged Deliverable
Code Reviews
40% Line Coverage
+ More Code Analysis
- 80 -
Excella Consulting
8 9
1 2 3
4 5 6
7
Go to Green
- 81 -
Excella Consulting
Level 8 – Goals
Automated
Deployments
+ More Tests
+ More Line Coverage
+ More Code Analysis
- 82 -
Excella Consulting
Script
- 83 -
Excella Consulting
Level 8 – Example
MSBuild
- 84 -
Automated
Deployment Example
Excella Consulting
Level 8 – Results
Automated
Deployments
+ Code Reviews
+ 60% Line Coverage
+ More Code Analysis
- 85 -
Excella Consulting
9
1 2 3
4 5 6
7 8
Go to Green
- 86 -
Excella Consulting
Level 9 – Goals
Full Code Coverage
+ More Tests
+ More Coverage
+ More Code Analysis
- 87 -
Excella Consulting
Testing
- 88 -
Excella Consulting
Level 9 – Example
- 89 -
Full Code Coverage
Example
Excella Consulting
Level 9 – Results
> 80% Line Coverage
+ Code Reviews
Automated Deployments
+ More Code Analysis
- 90 -
Excella Consulting
1 2 3
4 5 6
7 8 9
Go to Green
- 91 -
Excella Consulting
Overall – Results
Continuous Integration
CI Server
Code Analysis
Triggered by SCM
- 92 -
Excella Consulting
Overall – Results
Code Reviews
Conducted Regularly
Issues Tracked
Issues Resolved
- 93 -
Excella Consulting
Overall – Results
Automated Builds and
Deployments
Automated Deployment
Automated Testing
Code Analysis...
Excella Consulting
Overall – Results
Automated Unit Testing
Code Coverage: > 80%
Mocking Framework
Passing Tests: Priority...
Excella Consulting
Follow On – Goals
Retrospectives
Presentations
- 96 -
Upcoming SlideShare
Loading in …5
×

Overview of .NET Best Practices

485 views

Published on

An overview of .NET best practices.

Published in: Technology
  • Be the first to comment

Overview of .NET Best Practices

  1. 1. An Overview of .NET Best Practices Stephen D. Ritchie Rappahannock Area Developers .NET Users Group 17 Mar 2015
  2. 2. Excella Consulting Overall – Challenges Continuous Integration No CI Server No Code Analysis Not Triggered by SCM - 2 -
  3. 3. Excella Consulting Overall – Challenges Code Reviews Not Conducted Issues Not Tracked Issues Dropped - 3 -
  4. 4. Excella Consulting Current – Challenges Automated Builds and Deployments Manual Deployment No Automated Testing No Code Analysis - 4 -
  5. 5. Excella Consulting Current – Challenges Automated Unit Testing Low Code Coverage No Mocking Framework Failing or Ignored Tests - 5 -
  6. 6. Excella Consulting Opportunities - 6 - Best Practices Matrix Complexity Risk Cost Value
  7. 7. Excella Consulting Minimal, Essential Source Control - 7 -
  8. 8. Excella Consulting TFS - 8 -
  9. 9. Excella Consulting SVN - 9 -
  10. 10. Excella Consulting Mercurial - 10 -
  11. 11. Excella Consulting Git - 11 -
  12. 12. Excella Consulting Level Metaphor - 12 -
  13. 13. Excella Consulting 32 4 5 6 7 8 9 1 Go to Green - 13 -
  14. 14. Excella Consulting Level 1 – Goals Build Script - 14 -
  15. 15. Excella Consulting Level 1 – Starting Point Manual Builds - 15 -
  16. 16. Excella Consulting MSBuild - 16 -
  17. 17. Excella Consulting NAnt - 17 -
  18. 18. Excella Consulting PowerShell - 18 -
  19. 19. Excella Consulting Extensions - 19 -
  20. 20. Excella Consulting Level 1 – Example - 20 - Example Build Script
  21. 21. Excella Consulting Level 1 – Result One Script, Builds Everything - 21 - “Run the Runner” Build Script
  22. 22. Excella Consulting 32 4 5 6 7 8 9 1 Go to Green - 22 -
  23. 23. Excella Consulting Level 2 – Goals Continuous Integration - 23 -
  24. 24. Excella Consulting Level 2 – Starting Point No CI Server - 24 -
  25. 25. Excella Consulting Level 2 – To Do Install CI Server Triggered by Code Push “Run the Runner” - 25 -
  26. 26. Excella Consulting TFS - 26 -
  27. 27. Excella Consulting CC.NET - 27 -
  28. 28. Excella Consulting Jenkins - 28 -
  29. 29. Excella Consulting TeamCity - 29 -
  30. 30. Excella Consulting Level 2 – Example - 30 - CI Server Example
  31. 31. Excella Consulting Level 2 – Result Observe & Report - 31 -
  32. 32. Excella Consulting 3 4 5 6 7 8 9 1 2 Go to Green - 32 -
  33. 33. Excella Consulting Level 3 – Goals Code Analysis - 33 -
  34. 34. Excella Consulting Level 3 – Starting Point No Code Analysis - 34 -
  35. 35. Excella Consulting Level 3 – To Do Analysis Tool Static Code Analysis Run with CI Server - 35 -
  36. 36. Excella Consulting FxCop - 36 -
  37. 37. Excella Consulting Gendarme - 37 -
  38. 38. Excella Consulting StyleCop - 38 -
  39. 39. Excella Consulting NDepend - 39 -
  40. 40. Excella Consulting Simian - 40 -
  41. 41. Excella Consulting Sonar - 41 -
  42. 42. Excella Consulting Level 3 – Example FxCop 10 - 42 - Analysis Tool Example
  43. 43. Excella Consulting Level 3 – Result Analyze, Improve, Monitor - 43 -
  44. 44. Excella Consulting 4 5 6 7 8 9 1 2 3 Go to Green - 44 -
  45. 45. Excella Consulting Level 4 – Goals Automate Testing - 45 -
  46. 46. Excella Consulting Level 4 – Starting Point No Tests - 46 -
  47. 47. Excella Consulting Level 4 – To Do Testing Framework Run with Runner Run with CI Server - 47 -
  48. 48. Excella Consulting MSTest - 48 -
  49. 49. Excella Consulting MBUnit - 49 -
  50. 50. Excella Consulting xUnit.net - 50 -
  51. 51. Excella Consulting NUnit - 51 -
  52. 52. Excella Consulting Level 4 – To Do Mocking Framework Isolation Interaction Testing - 52 -
  53. 53. Excella Consulting Rhino Mocks - 53 -
  54. 54. Excella Consulting Moq - 54 -
  55. 55. Excella Consulting Level 4 – Example - 55 - Automate Testing Example
  56. 56. Excella Consulting Level 4 – Results Passing Tests - 56 -
  57. 57. Excella Consulting 5 6 7 8 9 1 2 3 4 Go to Green - 57 -
  58. 58. Excella Consulting Level 5 – Goals Code Coverage + More Tests + More Code Analysis - 58 -
  59. 59. Excella Consulting Level 5 – To Do Coverage Tool Run in Visual Studio Run with CI Server - 59 -
  60. 60. Excella Consulting NCover - 60 -
  61. 61. Excella Consulting OpenCover - 61 -
  62. 62. Excella Consulting dotCover - 62 -
  63. 63. Excella Consulting Level 5 – Example - 63 - Code Coverage Example
  64. 64. Excella Consulting Level 5 – Results 100% Class Coverage + More Code Analysis - 64 -
  65. 65. Excella Consulting 6 7 8 9 1 2 3 4 5 Go to Green - 65 -
  66. 66. Excella Consulting Level 6 – Goals Code Review + More Tests + More Code Analysis - 66 -
  67. 67. Excella Consulting Level 6 – To Do Pick Approach Share Opinions Track Issues - 67 -
  68. 68. Excella Consulting Pairing - 68 -
  69. 69. Excella Consulting Group - 69 -
  70. 70. Excella Consulting Peer - 70 -
  71. 71. Excella Consulting Level 6 – Example Peer - 71 - Code Review Example
  72. 72. Excella Consulting Level 6 – Results Reviewed Code 100% Method Coverage + More Code Analysis - 72 -
  73. 73. Excella Consulting 7 8 9 1 2 3 4 5 6 Go to Green - 73 -
  74. 74. Excella Consulting Level 7 – Goals Packaging + More Coverage + More Code Analysis + More Tests - 74 -
  75. 75. Excella Consulting MSI - 75 -
  76. 76. Excella Consulting Web Deploy - 76 -
  77. 77. Excella Consulting Octopus - 77 -
  78. 78. Excella Consulting Zip Archive - 78 -
  79. 79. Excella Consulting Level 7 – Example Zip - 79 - Packaging Example
  80. 80. Excella Consulting Level 7 – Results Packaged Deliverable Code Reviews 40% Line Coverage + More Code Analysis - 80 -
  81. 81. Excella Consulting 8 9 1 2 3 4 5 6 7 Go to Green - 81 -
  82. 82. Excella Consulting Level 8 – Goals Automated Deployments + More Tests + More Line Coverage + More Code Analysis - 82 -
  83. 83. Excella Consulting Script - 83 -
  84. 84. Excella Consulting Level 8 – Example MSBuild - 84 - Automated Deployment Example
  85. 85. Excella Consulting Level 8 – Results Automated Deployments + Code Reviews + 60% Line Coverage + More Code Analysis - 85 -
  86. 86. Excella Consulting 9 1 2 3 4 5 6 7 8 Go to Green - 86 -
  87. 87. Excella Consulting Level 9 – Goals Full Code Coverage + More Tests + More Coverage + More Code Analysis - 87 -
  88. 88. Excella Consulting Testing - 88 -
  89. 89. Excella Consulting Level 9 – Example - 89 - Full Code Coverage Example
  90. 90. Excella Consulting Level 9 – Results > 80% Line Coverage + Code Reviews Automated Deployments + More Code Analysis - 90 -
  91. 91. Excella Consulting 1 2 3 4 5 6 7 8 9 Go to Green - 91 -
  92. 92. Excella Consulting Overall – Results Continuous Integration CI Server Code Analysis Triggered by SCM - 92 -
  93. 93. Excella Consulting Overall – Results Code Reviews Conducted Regularly Issues Tracked Issues Resolved - 93 -
  94. 94. Excella Consulting Overall – Results Automated Builds and Deployments Automated Deployment Automated Testing Code Analysis - 94 -
  95. 95. Excella Consulting Overall – Results Automated Unit Testing Code Coverage: > 80% Mocking Framework Passing Tests: Priority - 95 -
  96. 96. Excella Consulting Follow On – Goals Retrospectives Presentations - 96 -

×