Title: Building quality software on target Marcel de Vries marcelvinfosupport'com http:blogs'infosupport'co
1Building quality software on target Marcel de
Vriesmarcelv_at_infosupport.comhttp//blogs.infosup
port.com/marcelv
2Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
3The Software LifecycleWhat Weve Heard
- Building software today is very difficult
- My team is spread out and specialized
- Tools today dont work well together
- I need to be able to predict the success of my
projects - My organization needs customizable process
guidance
4Project success rates
100
Project failure statistics are scary
90
80
70
Software delivery is still an art, not a
science. It has never been more difficult to
manage delivery of software in a predictable and
reliable manner!
Overall Need Increase the predictability of
quality delivery, on time, and within budget
60
50
40
30
20
10
0
5Development Teams
6Communication Barriers
- Pockets of information within disciplines
- Unclear delineation of responsibilities
- Conflicting best practices and architectures
- Conflicting strategic goals and objectives
7Core Tenets to Success
- Tools need to
- reduce the complexity of delivering modern
service-oriented solutions - be tightly integrated and facilitate better team
collaboration - enable customization and extensibility by
organizations and ISVs
8Challenges of Building IT Solutions
- Communication across diverse teams (Testers,
Architects, Developers, etc.) - Bundled tools, as opposed to integrated tools
- Defect Tracking
- Development
- Test Management
- Task Assignment
9Challenges of Building IT Solutions
- Ill-fitting process
- Little automatic guidance
- Heavy burden
- Disappointing ROI
- Lack of Visibility
- Lack of Predictability
10Process Questions
- What is the process?
- What document should be filled out next?
- What are the requirements?
- What development tasks relate to what
requirements? - What tests relate to what requirements?
- What code relates to what test, that relates to
what requirement? - Are we on schedule?
11(No Transcript)
12Development Questions
- Did we do design?
- What all was considered in the design?
- Did we account for the production environment?
- Do we have coding standards?
- Are developers following standards?
- Are developers testing their code?
- Are you sure?
13Developer Needs?
- Standard version control
- Historical traces from code to work item
- What was the requirement?
- What bug was being fixed?
- Parallel development
- Tools for interruptible workflow
- Remote version control
14Tester Needs?
- Version control for test artifacts
- Notification of available bug fixes
- Release notes for individual builds
15Project Lead Needs?
- Reports on code churn
- Status updates derived from check-ins
- Rapid start-up for new team members
- Change Management assistance
- Simple change migration between branches
- Identify fixes needing migration
- Easily back-out a fix
16Improving the Software Lifecycle
- Better communication across roles
- Simplified reporting
- MS Project integration for Project managers
- Distributed Systems Designers for architect to
developer communication
17Improving the Software Lifecycle
- Reporting and automated collection of data
- Integrated Tools
- Integrated Workflow and Process
- Improved ROI
18Expanding Visual Studio
19Visual Studio 2005Personalized productivity
Testers
Architects
Enterprise Devs
Consultants
Professionals
VB6 Devs
Part-Timers
Hobbyists
Students
Enthusiasts
Novices
20Visual Studio Team System
Visual StudioTeam Architect
Visual StudioTeam Developer
Visual StudioTeam Test
Visual StudioTeam Foundation
21Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
22Team FoundationProblem Space
- Fragmented information
- Cant relate and query work items, work,
processes and artifacts - Tools sets are incomplete or poorly integrated
- Difficulty integrating tools with existing
infrastructure - Communication is manual
- People use the phone or face-to-face
- Information is not captured
- Distributed development aggravates the problem
- Life cycle tools are expensive and complex
- Tools are difficult to learn and use
- Developers view tools as overhead
- Administration costs are high
23What is VS Team Foundation?
Integrated Platform for Collaborating on Software
Development Projects.
24Guiding Principles of VSTS
Productive
- Short learning curve
- Minimal administrative overhead
- Tools integrated tightly
- Automates common tasks
Integrated
Extensible
- Customizable for your process
- Integrates with 3rd party tools
- Remotely accessible
- Robust, secure, scalable
Capable
25Team Foundation Capabilities
- Build automation
- Scripted nightly build
- Reporting
- Integrates many of the Team System tools
- Metrics warehouse
- Automatic data collection
- OLAP reporting
- Trending, aggregation drilldown
- Project portal
- Single place to go for high-level project
information - Web access work items
- WSS based
- Work item tracking
- Easy, Integrated into development process
- Design your own process Fields, Forms, States,
Rules - Extensive linking bugs, reports, artifacts
- Notifications
- Source Code Control
- Easy, integrated into development environment
- Integrated check in experience
- Scalable and robust
- Parallel development
- Notifications
26Configuring rights in TFS
- Team system uses ADAM to store team system groups
- Makes it possible to administer team system
groups independent of the AD - No need to let AD administrator create groups for
the development environment - Just make a mapping between AD and ADAM groups
- Configuration done from the VS.NET IDE
- At this moment (B2) only one domain supported!
- Remote access only trough VPN because user must
be member of the domain.
27Configuring Team Foundation Server
28Team Project
- A bucket on a TFS
- Work items
- Source code
- Build data
- Test results
- Reference to project portal documents
29Demo Create and examine a Team Project
30Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
31Project Management And VSTS
- Keep track of work to do
- Work items
- Let every body work with the tools he likes
- Support for Excel, Project and Visual Studio
- Get reports out of the box
- Zero friction information gathering
32Projects have lots of lists
- What kind of lists do you have?
- Requirements
- Programming Tasks
- Documentation Tasks
- Bug Lists
- Risks
- Etc.
33Managing Lists
- Using Microsoft Project
- Integrated with Team Foundation Server
- Data Validation
34Managing Lists
- Using Microsoft Excel
- Integrated with Team Foundation Server
- Data Validation
35Team Foundation Work Item Tracking
36Work Items
- Very similar to task list in MS Project
- Work should be done based off tasks
- Different types of tasks
- Requirement
- Bug
- XX
- YY
37Working with Work Items
- Project managers can use MS Project or Excel and
synchronize with the work item database - Developers will see work items and interact with
them directly in Visual Studio - Testers will interact with work items using
Visual Studio Team Test - Project Managers could also use Team Foundation
Client
38Demo
- Synchronize MS Project/Excel with Work Items
39Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
40Team Architect Problem Space
- Distributed systems and SOA increase development
and deployment complexity - Communication problems exist between
- Architects and Developers
- Development and Infrastructure Architects
41Lessons from Car Manufacturing
Source David M. Anderson, Design for
Manufacturability Optimizing Cost, Quality, and
Time-to-Market, Second Edition (2001), CIM Press
805-924-0200
42Modeling as the Approach
- Modeling provides a common language
- Focus on key abstractions
- Enables design and communication
- Enables analysis and problem solving
- Challenges
- Keeping models synchronized with the real world
- Designing/choosing the modeling language and tools
43System Definition ModelCreating a living
blueprint of a system
Create a definition of a new or existing System
Operate the System based on its definition
Resources Required
Operations Capabilities
Operational Policies
Automatically allocate and configure resources
using its definition
SDM Document
44System Definition ModelLayers
Applications
Application Hosting
Logical Machines Network Topology
Hardware
45Application Modeling Definitions
- An Application is an individually deployable unit
of function - Which may provide or consume services via
endpoints - A System is a configured set of one or more
applications - Can be composed to create more complex systems
- Is the unit of deployment and management
46Application Designer
- Used to define or visualize applications in a VS
Solution and how they are connected
47System Designer
- Used to define a specific configuration of
applications and other systems
48Logical Datacenter Modeling
- Physical network diagrams are not aimed at
developers!
49Logical Datacenter Modeling Definitions
- A Logical Server describes the application
hosting characteristics of a type of server - A Logical Datacenter is a configured set of
logical servers - A Zone is a logical datacenter boundary
(physical, security, communication etc.) or
security - A Deployment Definition describes the deployment
of a system to a logical datacenter
50Logical Datacenter Designer
- Used to define a logical model of a datacenter
- Provides a developers perspective
51Deployment Designer
- Defines how applications in a system will be
deployed in a datacenter
52Demo
53Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
54Team Foundation Source Code Control
55Visual SourceSafe
- Considered industrys easiest to use version
control tool - Often first SCM tool encountered by developers
- Not considered a full featured SCM tool
- Not appropriate for large scale software
development
56Team Foundation Source Code Control
- 3-tier, web service architecture
- Built on SQL Server for robust, transaction-based
version control - Integration with other VSTS tools for automated
workflow management - Implementation of advanced SCM concepts
- Migrate from
- VSS, ClearCase, Source Depot
57SourceSafe vs Team Foundation
58Source Code ControlFeatures
- Complete version control feature set
- Uses Windows identities (rather than source
control specific) for access. - Innovative new SCC features
- Integrated checkin
- Parallel development
- Atomic checkins
- Remote development
- Integration with other VS Team System tools
59Source Code ControlDifferences compared to VSS
- No sharing
- No pinning
- No Archive and restore features
60Validate Policy Detail
- Policy Definitions
- .NET Assemblies
- Return Pass or Fail and message
- Customer Extensible
- User Over-ridable
61Source Code ControlParallel Development
- Multiple Releases
- Branching
- Merging
- Multiple Checkouts
62Source Code ControlShelving
- Interrupted workflow
- Transfer changes without checkin
- Checkpoint or share work in progress
63Source Code ControlRemote Development
- Remote development is a reality
- Distributed teams, at-home, offshore
- A system built for the Internet
- Web service protocols
- Compatible with proxies and firewalls
- Optimized for high-latency networks
64Demo
65Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
66Class Designer
- Reflects the underlying source file
- Diagram is a view of the code
- Stored at a project level
- Supports inheritance
- Supports associations
- Supports enums and structs
67Use Class Diagrams to
- Understand existing code
- Initial class design
- Review and refactor code
- Diagrams for documentation
68Demo
69Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
70Projects and Testing
- Often an expensive afterthought
- Strategies for minimizing impact
30
25
20
Relative Cost To Fix Bugs...
15
10
5
Coding
Integration
Post-Release
Requirements
Beta Test
National Institute of Software and
Technology(www.nist.gov/director/prog-ofc/report02
-3.pdf)
71Problems...
- It is expensive to find and fix bugs that get
past daily development practices - It is hard to diagnose errors at runtime
- Why does an application run slowly?
- Individual Developers and Testers need to know if
they are on track - Test and development are often out of synch
- Final test phase for shipping is often ad-hoc
- How much testing is enough?
72Defence In Depth
- Microsoft uses a 'defence in depth' strategy
- Unit testing
- Code reviews
- Frequent builds
- Catch bugs early
- Static checks
- Runtime checks
73Unit Testing
- Diagnostic checks during development
- Test script for all public methods on a type
- Basic sanity checking
- Useful for regression testing
public double MethodA() ... public void
TestMethodA() double d MethodA() // is
value correct?
Each method has a corresponding test method
74Code Reviews
- For the Visual Studio 7.0 product cycle
- 86 of bugs occurred in reviewed code
- 60 of all bugs were coding errors
- Static analysis helps catch bugs
- Source code analysis
- PREfast for C and C
- FxCop for .NET
75Static Analysis
- Find errors in your code before you run or deploy
it - A range of checks
- From style to code correctness to security issues
- Integrated into the Team System Build Environment
76PREFast
- Static analysis for C/C code
- Managed and unmanaged C
- Catches common bugs
- Buffer overruns, uninitialized memory
- Memory leaks, null pointer dereference
- Reported as compiler warnings
- Display path to problem
- Use pragma to turn off
77FxCop
- Static analysis for .NET assemblies
- Not just C
- Uses design guidelines
- Customizable
- Which checks to include
- Whether to report as error or warning
- Create custom rules
78Frequent Builds
- Build often to check consistency
- Nightly build script
- 'Buddy building'
- Microsoft enforces checks
- Unit testing and source code analysis at
check-in - Check-in policy for team foundation!
79Testing in VSTS
Visual StudioTeam Architect
Visual StudioTeam Developer
Visual StudioTeam Test
Visual StudioTeam Foundation
80Team System
Dev Writes Unit Tests Dev Writes And Tests
Code Dev Reviews Work Dev Runs Code Analysis Dev
Writes Load Tests Dev Checks In Work
Tester Checks Build Status Tester Runs Load
Test Tester Reports Bug
Dev Diagnoses Fixes Dev Checks In Work
81Integrating Dev and Test
- Tests are just another form of source code
- Stored in source code control
- Versioned with the product
- Test Complete
- Test writing is scheduled along with development
work - Tracked by work items
- Testers are notified when bugs are fixed
82VSTS Test Types
- Unit Tests
- Test class methods
- Web Tests
- Record and playback interactions
- Load Tests
- Simulate multiple users
- Manual Tests
- Provide scripts for manual tasks
- Third-party Tests
- Integrated into VSTS
83Additional Test Types
- Ordered
- Execute a set of existing tests in order
- Generic
- A wrapper for an existing program
84Test Manager and Test View
- Test management tools
- Test View
- Flat list of all tests
- Text Manager
- View and run all tests for a project
85Demo
86Test-Driven Development
- Integrate testing into the development process
- Tests define what code will do
- Tests come from specifications
- Write code to pass tests
- Don't write code that doesn't contribute to
passing a test...
Code
87Test-Driven Development
Write a test
Refactor if needed
88VSTS Unit Testing
- Integrated into VS
- Automatic generation of test classes
- Comprehensive test management
- Code coverage reporting
TestMethod() public void GetValueTest()
double d myObject.getValue() if (d lt
10.0) Assert.Fail("Bad return value")
89Code Coverage
- How much of your class have you tested?
- Percentage or graphical
90Demo
- Test driven development using VSTS
91Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
92Dynamic code analysis
- Gather information on application timing and
performance - Integrated into VSTS
- Used by many internal teams and on customer
engagements - Two measurement methods
- Sampling gathers information at fixed intervals
on whatever is executing - Instrumentation records every call
93Sampling And Instrumentation
- Sampling has low overhead
- Stack polling
- Non-invasive
- Some methods could be missed
- Instrumentation inserts entry/exit probes into
methods - Exact results
- High overhead
94ProfilingInstrumentation
- Adds instructions to your code to monitor
main 001 AMethod 0023 BMethod 0098
95ProfilingSampling
- Analyze without changing your app
main 3
AMethod 6
BMethod 9
2
96Analyzing Performance Data
- Visualize performance data within Visual Studio
- Summary
- Function and caller/callee
- Call stack
- Also export as XML
97Demo
- Instrumentation profiling
98Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
99Team Build Goals
- Make it easier to produce daily builds
- Good build process is hard to achieve
- Support end-to-end build scenario
- Tight integration with team system tools
- Provide flexibility and extensibility
- Support custom steps in the Build process
100Build Scenarios
- Public build lab
- Desktop builds
- Resuming builds after failures
- Publishing build results and build drops
101Features
- Public builds and desktop builds
- Multiple build configurations
- Scheduled recurring builds or on-demand builds
- Resuming builds after failures
- Build status
- Email notifications
- Publishing builds and results
- Build reports
- Storing build results in SQL server
- Historical trend reports using warehouse
- Separate build servers
- Build customization
102Team System Integration
103Team Build Architecture
- Team Build is an end-to-end build solution for
Team Project - Team Build is built upon MSBuild
- Not a new build engine.
- Adds bunch or tasks, targets, and project files
for the end-to-end scenario
104Build customization
- What steps comprise a build? Do you introduce
additional steps in the build? - Customization
- Introduce additional build steps in the build
- Integrate with third party tools
- Override properties
- Through editing a separate XML file
105Build Execution
106Demo
107Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
108Testing Web Applications
- Web applications need testing just like
applications... - What is response time for common tasks?
- Has the upgrade broken basic functionality?
- Do searches still work?
- Many external, third-party solutions
- Variations in capability and flexibility
109Web Tests
- Integrated into Visual Studio
- Just Another Test
- Recorded or code based testing
- With validation
- Not only for ASP.NET
- HTTP-based
- Any web page
- Can be used to test Web Services
110Test Types
- Recorded tests
- XML format
- List of URLs and parameters
- Validation and extraction
- Coded tests
- Extend via program logic
- Convert from recorded tests
111Recording and Playing Tests
- Simple recording via Internet Explorer
- Web test file captures script details
- VS interface allows editing
- Player within VS replays scripts
112Handy Features
- Forms Authentication aware
- Viewstate Tracking
- Cookie Tracking
113Validation and Extraction Rules
- Validate web page access
- Check content or response
- Create custom rules
- Validation can be data-driven
- Extract attributes / parameters
- For use in subsequent requests
114Coded Tests
- Full custom testing solution
// Create a test WebTestRequest request1
new WebTestRequest("http//localhost/StoreCSVS")
request1.ThinkTime 8 // Add a
rule ValidationRuleFindText rule1 new
ValidationRuleFindText() rule1.FailIfTextFound
false rule1.TextToFind "IBuySpy" request1.Vali
dateResponse new ValidateResponseEventHand
ler(rule1.Validate)
115Demo
116Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
117ASP.NET Performance Problems
- How does your application work under load?
- What operations have the greatest impact?
- Processor / disk utilization?
- Do you need to deploy to a production server to
test?
118ASP.NET Load Testing
- Integrated within VS.NET
- Uses testing scripts for scenarios
- Browser / user load / server control (?)
- Result visualization
Graphs
Web Site
Tables
XML
119Demo
120Agenda
- Team System Overview
- Team Foundation
- Project Management
- Distributed systems design
- Team Foundation Source Control
- Class design
- Unit testing
- Dynamic Code analysis
- Team build
- Web testing
- Load testing
- Team System Extensibility
121Visual Studio as a Platform
122Team Foundation Extensibility?
Custom workitem types Custom work flows Custom
Fields
Custom policies Custom file types
Custom Reports
Custom Web parts Site Creation extensibility
Custom Build Steps MS Build extensibility
123Extensibility in Schema
- Work Item Types
- Fields, form, state transitions
- Defined through
- Administration UI
- Import/export between servers
- Scenarios
- Add enterprise specific work item types
- Modify existing work item type forms and rules
- Off the shelf work item types
- TFS will ship with pre-defined types
- Bug, task, risk, work package
124Customizable Methodology TemplatesXML File
- Project Lifecycle
- Phases and Iterations
- Exit Criteria
- Process Guidance
- Document Templates
- Work Item Types and Rules
- Bug, Task, Risk
- Work Packages (Scenario, Feature, Requirement)
- Reports
- Project Groups
125Demo
- Team System Extensibility customization
126 Boek
- Iedere bezoeker krijgt 1 boek
- Alleen te krijgen door je badge in te leveren bij
de uitgang
127Where to find more info
- Articles in .Net magazine
- http//www.microsoft.com
- http//msdn.microsoft.com
- http//www.gotdotnet.com
- Training and consultancy
- http//www.infosupport.nl/training/Default.aspx
- Keywords team system
- 3 day training event on team system (end of March
begin of June) - Dutch Newsgroups
- http//www.infosupport.com/nieuwsgroepen
- MS Dotnet
- My Blog
- Blogs.infosupport.com/marcelv
- Contains lots of information on stuff I do with
Team System and things I discover or learn about
the product.