Beruflich Dokumente
Kultur Dokumente
Overview
4
Visual Studio Team System 2008 Development Edition
Agenda
• Code Analysis
• Code Coverage
• Profiling
6
Agenda
• Code Analysis
• Code Coverage
• Profiling
7
Code Analysis
8
Code Analysis for Managed Code
• Based on FxCop
• Customizable
– Which checks to include
– Whether to report as error or warning
– Create custom rules
9
Custom Code Analysis Rules
• Create using a VS Class Library
– Reference FxCopSdk.dll and Microsoft.Cci.dll
– Add a rules definition XML file
– Inherit from BaseIntrospectionRule
– Override the Check method
• See http://blogs.msdn.com/fxcop/
10
Agenda
• Code Analysis
• Code Coverage
• Profiling
11
Code Coverage
• Measure test effectiveness
• Line-by-line
• Block-by-Block
12
Agenda
• Code Analysis
• Code Coverage
• Profiling
13
Profiling
• Gather information on application timing and performance
14
Agenda
• Code Analysis
• Code Coverage
• Profiling
15
New Features for 2008
• Code metrics
• Improved profiling
– “Hot Pathing” to pinpoint problem
– WCF support
– Load/Web test integration
– Baseline support
• Saving analysis
16
The 5 Code Metrics
Metric: Class Coupling
# of Dependencies Between Types
Business
Logic
GUI Transaction
Customer Account
18
Metric: Class Inheritance
# of Base Types
Component
Control
ListControl Label
19
Metric: Lines of Code
20
Metric: Cyclomatic Complexity
# of Branches
21
Metric: Maintainability Index
– Lines of Code
– Cyclomatic Complexity
– Computational Complexity [Halstead 1]
• Used on the Windows Code Base
22
Visual Studio Team System 2008 Database Edition
Product Overview
24
24
Database Development Life Cycle
The cycle of life for database developers
Database
Project
Database
Template Create New Project Project
SQL
Script Reverse engineer existing .SQL script files (*)
25
25
Database Development Life Cycle
The cycle of life for database developers
Edit
Refactor
Compare
Database
Deploy Build
Project
Data
Generation
Test
Compare 26
26
Database Development Life Cycle
The cycle of life for database developers
Build project
Database
Database
Project
Create New Project Project
Template
Deploy project
SQL
SQL Server
Script Reverse engineer existing .SQL script files Database
27
27
Visual Studio Team System 2008 Test Edition
Agenda
• Web Tests
• Load Tests
• Ordered Tests
29
Web Testing
• Very easy to create basic web tests
– Record/playback scenario
– Can be converted to coded tests
– Can be data-driven
30
Visual Studio Integration
31
Agenda
• Web Tests
• Load Tests
• Ordered Tests
32
Key Benefits – Load Testing
• Scale out load generation
– Enables multiple commodity machines to be used to drive load
– One controller, add agent machines as needed
33
Load Testing
• A load test can contain any automated test
– Web tests, unit tests
• Load test agents and load test agent controllers used when scaling out
– Load test agent controller runs as a service
– Each load test agent can test about 1000 users
34
Ordered Tests
36
Questions?