Introduction to VSTS Introduction to Visual Studio 2008 Development Edition Understanding code complexity using Code Metrics
Visual Studio Team System
Development Edition Features Unit testing with code coverage Static Code Analysis Code Profiling Code Metrics
Integrated Unit Testing Integrated Static Code analysis Security Errors Localization problems Memory issues … Integrated Profiler Performance problems Memory problems Potential Sql Injection attack Object not Disposed Localization Issue Improving Code Quality
Who allocates the most Objects Who allocates the most memory Who is called the most? Who runs for the longest What do you have the most of? What is taking up the most memory Improving Quality: Profiler
Performance Report Summary
Gives a snapshot of software health Understand your code complexity Quickly compare code to find potential trouble spots Reduce risk & improve maintainability Understand complexity of inherited code Code metrics
# of Dependencies Between Types
Ripple effect?
# of Executing Lines of Code static class Program { #region Application Entry Point /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Workflow(args); } #endregion #region Static Methods /// Primary workflow for the application. /// Command line arguments. private static void Workflow(string[] cmdargs) { // Collect the list of command line arguments List args = new List (cmdargs); // Show usage syntax if the user so asks if (UseArg(args, "/?")) { ShowAbout(); return; }
, bool ParseCommandLine(string[] args) { if (args.Length == 0) ShowHelp(); return; for (int i = 0; i < args.Length; i++) switch (args[i]) { case "/?" : ShowHelp(); return false; case "/input" : if (args.Length > i && File.Exists(args[i + 1])) InputFile = args[i++]; break; case "/c" : Colapse = true; break; } return true; } # of branches of Code
Overall indication of complexity by aggregation of several factors Lines of Code Cyclomatic Complexity Computational Complexity Used on the Windows Code Base Metric: Maintainability Index
Demonstration
Questions
Thank You