SlideShare a Scribd company logo
Introducing FxCop Practical Help for Code Reviews
Background FxCop is used to analyze code based on the generated assembly regardless of the language Automate validation of established standards Create rules to validate custom standards and guidelines
Agenda The need for Code Validation Using FxCop Interpreting the Results Reviewing the Existing Rules Creating Rules Fitting FxCop into the Life Cycle
Why Code Validation Ensure adherence to standards Ensure consistency Ensure following “Best Practices” Give guidance to new team members Automate Code Reviews
Coding Standards There are established standards for Class Library Developers http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconnetframeworkdesignguidelines.asp These guidelines are implemented as pre built rules for FxCop You can build rules for your own standards
Using FxCop Start the Utility Select Assemblies to validate Add custom rules if you have them Analyze  Review the results Exclude Rules as Appropriate Make Code Changes as Appropriate Save the FxCop Project
Interpreting the Results Add the “New” Column to track whether an issue is new or not Navigate through the “Targets” to find only the violations by type, method, property, etc Navigate through the “Rules” to find only the violations for that rule “ Jump to Source” to have FxCop try to find the source code
The Standard Rules Design Rules Globalization Rules Interoperability Rules Mobility Rules Naming Rules Performance Rules Portability Rules Security Rules Usage Rules
Creating Your Own Rules Introspection SDK is not documented! Use Reflector to review existing rules Find an existing rule that does something similar Start with the existing rule and understand how it works Mold it to your needs
Fitting FxCop Into Your Life Cycle FxCopCmd is command line utility Add FxCopCmd as an External Tool Output is sent to the “Output” window Run FxCop without leaving the IDE Review the output with each build
Adding FxCop as an External Tool
Using FxCop Reports Specify a Style Sheet for the Report “ Save Report As” from the File Menu View the resulting XML file.  May need to save it as “HTML” Write your own XSLT to change the format Include the report with migration requests Include the report with Code Reviews Include the report with project documentation
Summary FxCop is used to automate the code review process FxCop includes rules for detecting over 200 different defects You can create your own rules to validate your own standards FxCop easily fits into your development life cycle
Where to Get More Information http://aspnet.4guysfromrolla.com/articles/060204-1.aspx http://www.futureware.biz/blog/index.php?title=writing_your_own_fxcop_rules_library http://msdn.microsoft.com/msdnmag/issues/04/09/Bugslayer/ http://www.biasecurities.com/blogs/jim/archive/2004/12/29/818.aspx http://www.gotdotnet.com/team/fxcop/ http://blogs.msdn.com/fxcop/archive/2004/01/09/49287.aspx http://www.gotdotnet.com/team/fxcop/docs/UsingFxCop.htm http://www.geekswithblogs.net/nharrison http://www.aisto.com/roeder/dotnet/   Reflector!

More Related Content

PPTX
StyleCop breaking down the barriers to entry
PPTX
Intro to Stylecop
PPT
Keyword Driven Testing using TestComplete
PPT
Script Driven Testing using TestComplete
PPTX
Automated testing - how?
PPTX
Test Driven Development #sitFRA
PPTX
Custom audit rules in Jdeveloper extension
PPTX
Jdev Extensions & Custom Audit Rules
StyleCop breaking down the barriers to entry
Intro to Stylecop
Keyword Driven Testing using TestComplete
Script Driven Testing using TestComplete
Automated testing - how?
Test Driven Development #sitFRA
Custom audit rules in Jdeveloper extension
Jdev Extensions & Custom Audit Rules

What's hot (20)

PDF
Kristian Karl
PPTX
Xray for Jira 3.0 - What's New?
PDF
Hp quick test professional 10
PDF
Web Service Testing using TestComplete
PPT
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
PDF
Keyword Driven Testing
PPTX
Cypress test techniques cucumber bdd framework,tdd,api tests course
PPS
Introduction To Testlink
PDF
Automated testing in javascript
PPTX
Testing OSGi-based Applications with DA-Testing
PDF
Api testing
PPTX
Test automation
PPT
TestLink introduction
PPSX
Test Complete
PPTX
Being Lean Agile
PDF
Automation Testing and its importance
PPTX
API Testing – Keeping a Check on Agile Software Development
PPSX
TESTLINK INTEGRATOR
PPS
Few minutes To better Code - Refactoring
PPT
Testing_with_TestComplete
Kristian Karl
Xray for Jira 3.0 - What's New?
Hp quick test professional 10
Web Service Testing using TestComplete
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
Keyword Driven Testing
Cypress test techniques cucumber bdd framework,tdd,api tests course
Introduction To Testlink
Automated testing in javascript
Testing OSGi-based Applications with DA-Testing
Api testing
Test automation
TestLink introduction
Test Complete
Being Lean Agile
Automation Testing and its importance
API Testing – Keeping a Check on Agile Software Development
TESTLINK INTEGRATOR
Few minutes To better Code - Refactoring
Testing_with_TestComplete
Ad

Viewers also liked (7)

PPT
Refactoring Workshop
PPTX
Metric driven refactoring
PPT
Reflecting On The Code Dom
PPT
Refactoring workshop
PPTX
Code Inventory
PPT
Revisiting Refactoring
PPTX
Visual basic coding
Refactoring Workshop
Metric driven refactoring
Reflecting On The Code Dom
Refactoring workshop
Code Inventory
Revisiting Refactoring
Visual basic coding
Ad

Similar to Introducing fx cop (20)

PPT
Codingstandards matiar
PPT
Automating C# Coding Standards using StyleCop and FxCop
PPT
Rhapsody Software
PDF
Agile Tools
PDF
How to Build Your Own Product-Modeling Environment?
PPT
Continuous Code Quality Improvement
PPT
Comparing the code quality of ECMs
PPT
Automation Techniques In Documentation
PPTX
Dev ops presentation
ODP
Building Scalable Development Environments
PPTX
Robot framework Gowthami Goli
PDF
Software Development Standard Operating Procedure
PPTX
Code analysis tools (for PHP)
PPTX
Patterns for automating API delivery. API conference
PDF
How to Create Your Own Product-Modeling Environment
PDF
MVC 3.0 KU Day 1 v 1.1
PDF
Joomla Code Quality Control and Automation Testing
PDF
Presentation Verification & Validation
PPTX
Babel.pptx
PPTX
Presentation 1(Compiler Construction).pptx
Codingstandards matiar
Automating C# Coding Standards using StyleCop and FxCop
Rhapsody Software
Agile Tools
How to Build Your Own Product-Modeling Environment?
Continuous Code Quality Improvement
Comparing the code quality of ECMs
Automation Techniques In Documentation
Dev ops presentation
Building Scalable Development Environments
Robot framework Gowthami Goli
Software Development Standard Operating Procedure
Code analysis tools (for PHP)
Patterns for automating API delivery. API conference
How to Create Your Own Product-Modeling Environment
MVC 3.0 KU Day 1 v 1.1
Joomla Code Quality Control and Automation Testing
Presentation Verification & Validation
Babel.pptx
Presentation 1(Compiler Construction).pptx

Introducing fx cop

  • 1. Introducing FxCop Practical Help for Code Reviews
  • 2. Background FxCop is used to analyze code based on the generated assembly regardless of the language Automate validation of established standards Create rules to validate custom standards and guidelines
  • 3. Agenda The need for Code Validation Using FxCop Interpreting the Results Reviewing the Existing Rules Creating Rules Fitting FxCop into the Life Cycle
  • 4. Why Code Validation Ensure adherence to standards Ensure consistency Ensure following “Best Practices” Give guidance to new team members Automate Code Reviews
  • 5. Coding Standards There are established standards for Class Library Developers http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconnetframeworkdesignguidelines.asp These guidelines are implemented as pre built rules for FxCop You can build rules for your own standards
  • 6. Using FxCop Start the Utility Select Assemblies to validate Add custom rules if you have them Analyze Review the results Exclude Rules as Appropriate Make Code Changes as Appropriate Save the FxCop Project
  • 7. Interpreting the Results Add the “New” Column to track whether an issue is new or not Navigate through the “Targets” to find only the violations by type, method, property, etc Navigate through the “Rules” to find only the violations for that rule “ Jump to Source” to have FxCop try to find the source code
  • 8. The Standard Rules Design Rules Globalization Rules Interoperability Rules Mobility Rules Naming Rules Performance Rules Portability Rules Security Rules Usage Rules
  • 9. Creating Your Own Rules Introspection SDK is not documented! Use Reflector to review existing rules Find an existing rule that does something similar Start with the existing rule and understand how it works Mold it to your needs
  • 10. Fitting FxCop Into Your Life Cycle FxCopCmd is command line utility Add FxCopCmd as an External Tool Output is sent to the “Output” window Run FxCop without leaving the IDE Review the output with each build
  • 11. Adding FxCop as an External Tool
  • 12. Using FxCop Reports Specify a Style Sheet for the Report “ Save Report As” from the File Menu View the resulting XML file. May need to save it as “HTML” Write your own XSLT to change the format Include the report with migration requests Include the report with Code Reviews Include the report with project documentation
  • 13. Summary FxCop is used to automate the code review process FxCop includes rules for detecting over 200 different defects You can create your own rules to validate your own standards FxCop easily fits into your development life cycle
  • 14. Where to Get More Information http://aspnet.4guysfromrolla.com/articles/060204-1.aspx http://www.futureware.biz/blog/index.php?title=writing_your_own_fxcop_rules_library http://msdn.microsoft.com/msdnmag/issues/04/09/Bugslayer/ http://www.biasecurities.com/blogs/jim/archive/2004/12/29/818.aspx http://www.gotdotnet.com/team/fxcop/ http://blogs.msdn.com/fxcop/archive/2004/01/09/49287.aspx http://www.gotdotnet.com/team/fxcop/docs/UsingFxCop.htm http://www.geekswithblogs.net/nharrison http://www.aisto.com/roeder/dotnet/ Reflector!