Advanced Code Analysis In .NET

Stephen Ritchie
Stephen RitchieManaging Consultant at Excella Consulting
Advanced Code Analysis in .NET




                                                                                                                                                          Stephen Ritchie
                                                                                                                                                                July 10, 2012



Stephen D. Ritchie – Senior Consultant – Excella Consulting, Inc., 2300 Wilson Blvd, Suite 630, Arlington, VA 22201 – 703.840.8600 – http://excella.com
Blueprint




Stephen D. Ritchie   2
Toolbox




Stephen D. Ritchie   3
Da Vinci Code … Analyzer




Stephen D. Ritchie   4
Code Analysis


Static
                     versus




Stephen D. Ritchie            5
Static Analysis




Stephen D. Ritchie   6
But wait …




Stephen D. Ritchie   7
1940 Tacoma Narrows Bridge

• Video
       – http://archive.org/download/SF121/SF121_51
         2kb.mp4




Stephen D. Ritchie         9
Static Analysis


Source   Visualizations
Code            Checks
Assembly       Metrics
            Detections
Stephen D. Ritchie   10
Dynamic Analysis


                     Visualizations
                            Checks
                           Metrics
                        Detections
Stephen D. Ritchie   11
Code Analysis: Objection 1

            Sweating the small stuff
       Nitpicking           Useless
       “Don’t make the
       same mistake once.”
Stephen D. Ritchie     12
Code Analysis: Objection 2

            Not worth the effort
  Low ROI No Bandwidth

       “Crawl, Walk, Run”
Stephen D. Ritchie     13
Code Analysis: Objection 3

                     No authorization
  Forbidden
         Can’t Fix Issues
“Speak truth to power.”
Stephen D. Ritchie          14
Blueprint

                                     1

                               Analyze



                                                   2

                     Monitor             Improve
                     3




Stephen D. Ritchie              15
Toolbox


                      FxCop
Detections
Checks
                      Visual
                      Studio
       http://blogs.msdn.com/b/codeanalysis/
Stephen D. Ritchie           16
Toolbox


                      StyleCop
Detections
Checks


       http://stylecop.codeplex.com/
Stephen D. Ritchie            17
Toolbox


                        ReSharper
                        http://www.jetbrains.com/resharper/
Detections
Checks
                        Gendarme
                     http://www.mono-project.com/Gendarme

Stephen D. Ritchie                18
The Master Craft




Stephen D. Ritchie   19
Toolbox


                                 Simian
Detections

       http://www.harukizaemon.com/simian/



Stephen D. Ritchie          20
The Master Craft

                        Duplicates Finder .NET


       http://www.jetbrains.com/teamcity/

                     Clone Doctor
                     Semantic Designs
       http://www.semdesigns.com/Products/Clone/
Stephen D. Ritchie            21
Dynamic Analysis




                     Code Coverage
Stephen D. Ritchie      22
Toolbox


                     dotCover


       http://www.jetbrains.com/dotcover/



Stephen D. Ritchie           23
Toolbox


                     Open Cover


       http://nuget.org/packages/OpenCover



Stephen D. Ritchie          24
The Master Craft




       http://www.ncover.com/



Stephen D. Ritchie          25
Dynamic Analysis




                            Sampling
                     Instrumentation
Stephen D. Ritchie        26
Toolbox


                     Performance




Stephen D. Ritchie      27
Toolbox


                     Performance


                     http://www.jetbrains.com/profiler/

Stephen D. Ritchie           28
The Master Craft




Stephen D. Ritchie   29
The Master Craft


                     Memory
                     Queries
                     Logging
                     Security
Stephen D. Ritchie       30
Static Analysis


Source   Visualizations
Code            Checks
Assembly       Metrics
            Detections
Stephen D. Ritchie   31
The Master Craft


                     Code Quality
Visualizations         http://www.ndepend.com/
Checks
Metrics
Detections             http://www.lattix.com/

Stephen D. Ritchie      32
Hanselman’s Placemat




       http://bit.ly/LwKfwK
Stephen D. Ritchie            33
Shameless Self-promotion


                          http://amzn.to/v8TD8E




Stephen D. Ritchie   34
Stephen’s Contact Info

• Twitter: @ruthlesshelp

• Email: stephen.ritchie@excella.com

• Blog:              http://ruthlesslyhelpful.net

• LinkedIn:
     http://www.linkedin.com/in/sritchie

Stephen D. Ritchie              35
1 of 34

Recommended

Continuous Integration: Blueprint, Toolbox, Master Craft by
Continuous Integration: Blueprint, Toolbox, Master CraftContinuous Integration: Blueprint, Toolbox, Master Craft
Continuous Integration: Blueprint, Toolbox, Master CraftStephen Ritchie
7.6K views22 slides
Advanced Code Analysis with .NET by
Advanced Code Analysis with .NETAdvanced Code Analysis with .NET
Advanced Code Analysis with .NETStephen Ritchie
1.8K views32 slides
Continuous Integration DCAEC12 by
Continuous Integration DCAEC12Continuous Integration DCAEC12
Continuous Integration DCAEC12Stephen Ritchie
293 views22 slides
Test Driven Development: Blueprint, Toolbox, and Master Craft by
Test Driven Development: Blueprint, Toolbox, and Master CraftTest Driven Development: Blueprint, Toolbox, and Master Craft
Test Driven Development: Blueprint, Toolbox, and Master CraftStephen Ritchie
1.1K views54 slides
Continuous Integration - NoVA CodeCamp 2014-10-11 by
Continuous Integration - NoVA CodeCamp 2014-10-11Continuous Integration - NoVA CodeCamp 2014-10-11
Continuous Integration - NoVA CodeCamp 2014-10-11Stephen Ritchie
421 views22 slides
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16 by
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16Rafael Dohms
1.4K views75 slides

More Related Content

What's hot

“Writing code that lasts” … or writing code you won’t hate tomorrow. by
“Writing code that lasts” … or writing code you won’t hate tomorrow.“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.Rafael Dohms
2.8K views74 slides
“Writing code that lasts” … or writing code you won’t hate tomorrow. by
“Writing code that lasts” … or writing code you won’t hate tomorrow.“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.Rafael Dohms
3.4K views70 slides
Writing code that lasts - JAB14 by
Writing code that lasts - JAB14Writing code that lasts - JAB14
Writing code that lasts - JAB14Rafael Dohms
24.8K views69 slides
.NET Fest 2018. Dylan Beattie. Ctrl-Alt-Del: Learning to Love Legacy Code by
.NET Fest 2018. Dylan Beattie. Ctrl-Alt-Del: Learning to Love Legacy Code.NET Fest 2018. Dylan Beattie. Ctrl-Alt-Del: Learning to Love Legacy Code
.NET Fest 2018. Dylan Beattie. Ctrl-Alt-Del: Learning to Love Legacy CodeNETFest
341 views46 slides
Java Generics Adoption: How New Features are Introduced Championed or Ignored by
Java Generics Adoption: How New Features are Introduced Championed or IgnoredJava Generics Adoption: How New Features are Introduced Championed or Ignored
Java Generics Adoption: How New Features are Introduced Championed or IgnoredChris Parnin
598 views24 slides
DevTechDocsOps by
DevTechDocsOpsDevTechDocsOps
DevTechDocsOpsVMware Tanzu
334 views17 slides

What's hot(6)

“Writing code that lasts” … or writing code you won’t hate tomorrow. by Rafael Dohms
“Writing code that lasts” … or writing code you won’t hate tomorrow.“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.
Rafael Dohms2.8K views
“Writing code that lasts” … or writing code you won’t hate tomorrow. by Rafael Dohms
“Writing code that lasts” … or writing code you won’t hate tomorrow.“Writing code that lasts” … or writing code you won’t hate tomorrow.
“Writing code that lasts” … or writing code you won’t hate tomorrow.
Rafael Dohms3.4K views
Writing code that lasts - JAB14 by Rafael Dohms
Writing code that lasts - JAB14Writing code that lasts - JAB14
Writing code that lasts - JAB14
Rafael Dohms24.8K views
.NET Fest 2018. Dylan Beattie. Ctrl-Alt-Del: Learning to Love Legacy Code by NETFest
.NET Fest 2018. Dylan Beattie. Ctrl-Alt-Del: Learning to Love Legacy Code.NET Fest 2018. Dylan Beattie. Ctrl-Alt-Del: Learning to Love Legacy Code
.NET Fest 2018. Dylan Beattie. Ctrl-Alt-Del: Learning to Love Legacy Code
NETFest341 views
Java Generics Adoption: How New Features are Introduced Championed or Ignored by Chris Parnin
Java Generics Adoption: How New Features are Introduced Championed or IgnoredJava Generics Adoption: How New Features are Introduced Championed or Ignored
Java Generics Adoption: How New Features are Introduced Championed or Ignored
Chris Parnin598 views

Similar to Advanced Code Analysis In .NET

Continuous Integration: Toolbox, Blueprint, Master Craft by
Continuous Integration: Toolbox, Blueprint, Master CraftContinuous Integration: Toolbox, Blueprint, Master Craft
Continuous Integration: Toolbox, Blueprint, Master CraftDC Agile Engineering Conference
276 views22 slides
Continuous Integration: Blueprint, Toolbox, Master Craft by
Continuous Integration: Blueprint, Toolbox, Master CraftContinuous Integration: Blueprint, Toolbox, Master Craft
Continuous Integration: Blueprint, Toolbox, Master CraftExcella
886 views22 slides
DevOps Requires Agility by
DevOps Requires AgilityDevOps Requires Agility
DevOps Requires AgilityStephen Ritchie
1K views29 slides
SF Bay Area Splunk User Group Meeting October 5, 2022 by
SF Bay Area Splunk User Group Meeting October 5, 2022SF Bay Area Splunk User Group Meeting October 5, 2022
SF Bay Area Splunk User Group Meeting October 5, 2022Becky Burwell
56 views17 slides
Petcube. How to build a hardware startup from scratch by
Petcube. How to build a hardware startup from scratchPetcube. How to build a hardware startup from scratch
Petcube. How to build a hardware startup from scratchAlex Neskin
5.8K views24 slides
Metrics for aglie teams by
Metrics for aglie teamsMetrics for aglie teams
Metrics for aglie teamsRichard Fichtner
176 views48 slides

Similar to Advanced Code Analysis In .NET(10)

Continuous Integration: Blueprint, Toolbox, Master Craft by Excella
Continuous Integration: Blueprint, Toolbox, Master CraftContinuous Integration: Blueprint, Toolbox, Master Craft
Continuous Integration: Blueprint, Toolbox, Master Craft
Excella886 views
SF Bay Area Splunk User Group Meeting October 5, 2022 by Becky Burwell
SF Bay Area Splunk User Group Meeting October 5, 2022SF Bay Area Splunk User Group Meeting October 5, 2022
SF Bay Area Splunk User Group Meeting October 5, 2022
Becky Burwell56 views
Petcube. How to build a hardware startup from scratch by Alex Neskin
Petcube. How to build a hardware startup from scratchPetcube. How to build a hardware startup from scratch
Petcube. How to build a hardware startup from scratch
Alex Neskin5.8K views
Semantics And Multimedia by Peter Berger
Semantics And MultimediaSemantics And Multimedia
Semantics And Multimedia
Peter Berger2.6K views
Blue team reboot - HackFest by Haydn Johnson
Blue team reboot - HackFest Blue team reboot - HackFest
Blue team reboot - HackFest
Haydn Johnson592 views

More from Stephen Ritchie

Overview of .NET Best Practices by
Overview of .NET Best PracticesOverview of .NET Best Practices
Overview of .NET Best PracticesStephen Ritchie
629 views96 slides
Lightweight Documentation by
Lightweight DocumentationLightweight Documentation
Lightweight DocumentationStephen Ritchie
607 views24 slides
Agile Engineering Sparker GLASScon 2015 by
Agile Engineering Sparker GLASScon 2015Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015Stephen Ritchie
668 views31 slides
Lightweight Documentation: An Agile Approach by
Lightweight Documentation: An Agile ApproachLightweight Documentation: An Agile Approach
Lightweight Documentation: An Agile ApproachStephen Ritchie
3K views29 slides
Continuous Integration: Blueprint, Toolbox, Master Craft by
Continuous Integration: Blueprint, Toolbox, Master CraftContinuous Integration: Blueprint, Toolbox, Master Craft
Continuous Integration: Blueprint, Toolbox, Master CraftStephen Ritchie
952 views22 slides
Dc scrum agile_eng_20130923 by
Dc scrum agile_eng_20130923Dc scrum agile_eng_20130923
Dc scrum agile_eng_20130923Stephen Ritchie
1.1K views21 slides

More from Stephen Ritchie(13)

Agile Engineering Sparker GLASScon 2015 by Stephen Ritchie
Agile Engineering Sparker GLASScon 2015Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015
Stephen Ritchie668 views
Lightweight Documentation: An Agile Approach by Stephen Ritchie
Lightweight Documentation: An Agile ApproachLightweight Documentation: An Agile Approach
Lightweight Documentation: An Agile Approach
Stephen Ritchie3K views
Continuous Integration: Blueprint, Toolbox, Master Craft by Stephen Ritchie
Continuous Integration: Blueprint, Toolbox, Master CraftContinuous Integration: Blueprint, Toolbox, Master Craft
Continuous Integration: Blueprint, Toolbox, Master Craft
Stephen Ritchie952 views
Overcoming the Obstacles, Pitfalls, and Dangers of Unit Testing by Stephen Ritchie
Overcoming the Obstacles, Pitfalls, and Dangers of Unit TestingOvercoming the Obstacles, Pitfalls, and Dangers of Unit Testing
Overcoming the Obstacles, Pitfalls, and Dangers of Unit Testing
Stephen Ritchie1.8K views
An Overview of .NET Best Practices by Stephen Ritchie
An Overview of .NET Best PracticesAn Overview of .NET Best Practices
An Overview of .NET Best Practices
Stephen Ritchie865 views
DCDNUG 10/16/2012 Automated testing obstacles pitfalls dangers by Stephen Ritchie
DCDNUG 10/16/2012 Automated testing obstacles pitfalls dangersDCDNUG 10/16/2012 Automated testing obstacles pitfalls dangers
DCDNUG 10/16/2012 Automated testing obstacles pitfalls dangers
Stephen Ritchie388 views
Automated Testing: Obstacles, Pitfalls, and Dangers by Stephen Ritchie
Automated Testing: Obstacles, Pitfalls, and DangersAutomated Testing: Obstacles, Pitfalls, and Dangers
Automated Testing: Obstacles, Pitfalls, and Dangers
Stephen Ritchie5.6K views

Recently uploaded

What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueShapeBlue
191 views23 slides
NTGapps NTG LowCode Platform by
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform Mustafa Kuğu
287 views30 slides
Uni Systems for Power Platform.pptx by
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptxUni Systems S.M.S.A.
60 views21 slides
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ... by
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...ShapeBlue
52 views10 slides
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...The Digital Insurer
40 views52 slides
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...ShapeBlue
128 views20 slides

Recently uploaded(20)

What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue191 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu287 views
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ... by ShapeBlue
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
ShapeBlue52 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue128 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue154 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue86 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue138 views
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R... by ShapeBlue
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
Setting Up Your First CloudStack Environment with Beginners Challenges - MD R...
ShapeBlue105 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue93 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue134 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10110 views
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by ShapeBlue
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool
ShapeBlue56 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue113 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue48 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue172 views
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE67 views

Advanced Code Analysis In .NET