Your SlideShare is downloading. ×
0
Visual Studio Code Metrics
Visual Studio Code Metrics
Visual Studio Code Metrics
Visual Studio Code Metrics
Visual Studio Code Metrics
Visual Studio Code Metrics
Visual Studio Code Metrics
Visual Studio Code Metrics
Visual Studio Code Metrics
Visual Studio Code Metrics
Visual Studio Code Metrics
Visual Studio Code Metrics
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Visual Studio Code Metrics

1,758

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,758
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
25
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • http://www.amazon.com/Coding-Faster-Getting-Productive-Microsoft/dp/0735649928/
  • CA1502http://msdn.microsoft.com/en-us/library/ms182212.aspx
  • CA1501http://msdn.microsoft.com/en-us/library/ms182213.aspx
  • CA1506http://msdn.microsoft.com/en-us/library/bb397994.aspxhttp://blogs.msdn.com/b/codeanalysis/archive/2007/11/15/code-metrics-as-check-in-policy.aspx
  • CA1506http://msdn.microsoft.com/en-us/library/bb397994.aspxhttp://blogs.msdn.com/b/codeanalysis/archive/2007/11/15/code-metrics-as-check-in-policy.aspx
  • Transcript

    • 1. Code MetricsWhat are they?Why should I care?Lines of Code (LOC)Cyclomatic ComplexityClass Coupling / Coupling Between Objects (CBO)Depth of Inheritance Tree (DIT)Maintainability IndexUsing the Tool Window
    • 2. What are they?“[…]a measure of some property of a piece of softwareor its specifications […]”http://en.wikipedia.org/wiki/Software_metric“[…] a set of software measures […]”http://msdn.microsoft.com/en-us/library/bb385914.aspx
    • 3. Why should I care?Find those areas that are (statistically) more likely toproduce problemsDetermine where to focus limited resourcesUnderstand the current state of a solution / projectKeep track of where we have been and where we aregoing
    • 4. Lines of Code (LOC)Basic Info Raw count of IL lines Not a good measure by itselfStats N/A when used aloneCode Analysis N/A http://academic.research.microsoft.com/Paper/2101790.aspx
    • 5. Cyclomatic ComplexityBasic Info Count of decisions More decisions means more errors Used often with LOCStats 10 Suggested upper limitCode Analysis CA1502 Avoid excessive complexity 25 http://www.mccabe.com/pdf/mccabe-nist235r.pdf
    • 6. Depth of Inheritance (DIT)Basic Info The maximum length from the node to the root of the inheritance tree Three assumptions Deeper == harder to predict behavior Deeper == greater design complexity Deeper == more reuse of codeStats Low Less complex Less reuse of code High More complex More reuse of code 5 or 6 for upper limitCode Analysis CA1501 Avoid excessive inheritance http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricFor 4 OOD_ChidamberKemerer94.pdf
    • 7. Class Coupling /Coupling Between Objects (CBO)Basic Info Number of classes a single class usesStats 9 Upper limitCode Analysis CA1506 Avoid excessive class coupling 80 for class 30 for method http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricForOOD_Chidamber Kemerer94.pdf
    • 8. Maintainability IndexBasic Info Calculates an index value between 0 and 100 that represents the relative ease of maintaining the codeStats High == good Low == bad Ratings Green (20 – 100) Yellow (10 – 19) Red (0 – 9)Code Analysis CA1505 Avoid unmaintainable code 19 or lower
    • 9. Using the Tool Window

    ×