SlideShare a Scribd company logo
1 of 34
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

More Related Content

What's hot

What's hot (6)

“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.
“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.“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 - JAB14
Writing code that lasts - JAB14Writing code that lasts - JAB14
Writing code that lasts - JAB14
 
.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
.NET Fest 2018. Dylan Beattie. Ctrl-Alt-Del: Learning to Love Legacy Code
 
Java Generics Adoption: How New Features are Introduced Championed or Ignored
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
 
DevTechDocsOps
DevTechDocsOpsDevTechDocsOps
DevTechDocsOps
 

Similar to Advanced Code Analysis In .NET

Similar to Advanced Code Analysis In .NET (10)

Continuous Integration: Blueprint, Toolbox, Master Craft
Continuous Integration: Blueprint, Toolbox, Master CraftContinuous Integration: Blueprint, Toolbox, Master Craft
Continuous Integration: Blueprint, Toolbox, Master Craft
 
Continuous Integration: Toolbox, Blueprint, Master Craft
Continuous Integration: Toolbox, Blueprint, Master CraftContinuous Integration: Toolbox, Blueprint, Master Craft
Continuous Integration: Toolbox, Blueprint, Master Craft
 
DevOps Requires Agility
DevOps Requires AgilityDevOps Requires Agility
DevOps Requires Agility
 
SF Bay Area Splunk User Group Meeting October 5, 2022
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
 
Petcube. How to build a hardware startup from scratch
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
 
Metrics for aglie teams
Metrics for aglie teamsMetrics for aglie teams
Metrics for aglie teams
 
Semantics And Multimedia
Semantics And MultimediaSemantics And Multimedia
Semantics And Multimedia
 
Cryptocurrency && Ruby
Cryptocurrency && RubyCryptocurrency && Ruby
Cryptocurrency && Ruby
 
api-driven-development.pdf
api-driven-development.pdfapi-driven-development.pdf
api-driven-development.pdf
 
Blue team reboot - HackFest
Blue team reboot - HackFest Blue team reboot - HackFest
Blue team reboot - HackFest
 

More from Stephen Ritchie

DCDNUG 10/16/2012 Automated testing obstacles pitfalls dangers
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 Ritchie
 
Automated Testing: Obstacles, Pitfalls, and Dangers
Automated Testing: Obstacles, Pitfalls, and DangersAutomated Testing: Obstacles, Pitfalls, and Dangers
Automated Testing: Obstacles, Pitfalls, and Dangers
Stephen Ritchie
 
Automated Testing with Databases
Automated Testing with DatabasesAutomated Testing with Databases
Automated Testing with Databases
Stephen Ritchie
 

More from Stephen Ritchie (13)

Overview of .NET Best Practices
Overview of .NET Best PracticesOverview of .NET Best Practices
Overview of .NET Best Practices
 
Lightweight Documentation
Lightweight DocumentationLightweight Documentation
Lightweight Documentation
 
Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015Agile Engineering Sparker GLASScon 2015
Agile Engineering Sparker GLASScon 2015
 
Lightweight Documentation: An Agile Approach
Lightweight Documentation: An Agile ApproachLightweight Documentation: An Agile Approach
Lightweight Documentation: An Agile Approach
 
Continuous Integration: Blueprint, Toolbox, Master Craft
Continuous Integration: Blueprint, Toolbox, Master CraftContinuous Integration: Blueprint, Toolbox, Master Craft
Continuous Integration: Blueprint, Toolbox, Master Craft
 
Dc scrum agile_eng_20130923
Dc scrum agile_eng_20130923Dc scrum agile_eng_20130923
Dc scrum agile_eng_20130923
 
Agile Testing Best Practices
Agile Testing Best PracticesAgile Testing Best Practices
Agile Testing Best Practices
 
An Overview of .NET Best Practices
An Overview of .NET Best PracticesAn Overview of .NET Best Practices
An Overview of .NET Best Practices
 
Overcoming the Obstacles, Pitfalls, and Dangers of Unit Testing
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
 
An Overview of .NET Best Practices
An Overview of .NET Best PracticesAn Overview of .NET Best Practices
An Overview of .NET Best Practices
 
DCDNUG 10/16/2012 Automated testing obstacles pitfalls dangers
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
 
Automated Testing: Obstacles, Pitfalls, and Dangers
Automated Testing: Obstacles, Pitfalls, and DangersAutomated Testing: Obstacles, Pitfalls, and Dangers
Automated Testing: Obstacles, Pitfalls, and Dangers
 
Automated Testing with Databases
Automated Testing with DatabasesAutomated Testing with Databases
Automated Testing with Databases
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Advanced Code Analysis In .NET