Building quality software on target Marcel de Vries marcelvinfosupport'com http:blogs'infosupport'co - PowerPoint PPT Presentation

1 / 126
About This Presentation
Title:

Building quality software on target Marcel de Vries marcelvinfosupport'com http:blogs'infosupport'co

Description:

'Tools today don't work well together' 'I need to be able to predict the ... M. Anderson, Design for Manufacturability: Optimizing Cost, Quality, and Time ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 127
Provided by: downloadM
Category:

less

Transcript and Presenter's Notes

Title: Building quality software on target Marcel de Vries marcelvinfosupport'com http:blogs'infosupport'co


1
Building quality software on target Marcel de
Vriesmarcelv_at_infosupport.comhttp//blogs.infosup
port.com/marcelv
2
Agenda
  • 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

3
The 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

4
Project 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
5
Development Teams
6
Communication Barriers
  • Pockets of information within disciplines
  • Unclear delineation of responsibilities
  • Conflicting best practices and architectures
  • Conflicting strategic goals and objectives

7
Core 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

8
Challenges 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

9
Challenges of Building IT Solutions
  • Ill-fitting process
  • Little automatic guidance
  • Heavy burden
  • Disappointing ROI
  • Lack of Visibility
  • Lack of Predictability

10
Process 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)
12
Development 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?

13
Developer 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

14
Tester Needs?
  • Version control for test artifacts
  • Notification of available bug fixes
  • Release notes for individual builds

15
Project 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

16
Improving the Software Lifecycle
  • Better communication across roles
  • Simplified reporting
  • MS Project integration for Project managers
  • Distributed Systems Designers for architect to
    developer communication

17
Improving the Software Lifecycle
  • Reporting and automated collection of data
  • Integrated Tools
  • Integrated Workflow and Process
  • Improved ROI

18
Expanding Visual Studio
19
Visual Studio 2005Personalized productivity
Testers
Architects
Enterprise Devs
Consultants
Professionals
VB6 Devs
Part-Timers
Hobbyists
Students
Enthusiasts
Novices
20
Visual Studio Team System
Visual StudioTeam Architect
Visual StudioTeam Developer
Visual StudioTeam Test
Visual StudioTeam Foundation
21
Agenda
  • 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

22
Team 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

23
What is VS Team Foundation?
Integrated Platform for Collaborating on Software
Development Projects.
24
Guiding 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
25
Team 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

26
Configuring 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.

27
Configuring Team Foundation Server
28
Team Project
  • A bucket on a TFS
  • Work items
  • Source code
  • Build data
  • Test results
  • Reference to project portal documents

29
Demo Create and examine a Team Project
30
Agenda
  • 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

31
Project 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

32
Projects have lots of lists
  • What kind of lists do you have?
  • Requirements
  • Programming Tasks
  • Documentation Tasks
  • Bug Lists
  • Risks
  • Etc.

33
Managing Lists
  • Using Microsoft Project
  • Integrated with Team Foundation Server
  • Data Validation

34
Managing Lists
  • Using Microsoft Excel
  • Integrated with Team Foundation Server
  • Data Validation

35
Team Foundation Work Item Tracking
36
Work Items
  • Very similar to task list in MS Project
  • Work should be done based off tasks
  • Different types of tasks
  • Requirement
  • Bug
  • XX
  • YY

37
Working 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

38
Demo
  • Synchronize MS Project/Excel with Work Items

39
Agenda
  • 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

40
Team Architect Problem Space
  • Distributed systems and SOA increase development
    and deployment complexity
  • Communication problems exist between
  • Architects and Developers
  • Development and Infrastructure Architects

41
Lessons 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
42
Modeling 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

43
System 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
44
System Definition ModelLayers
Applications
Application Hosting
Logical Machines Network Topology
Hardware
45
Application 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

46
Application Designer
  • Used to define or visualize applications in a VS
    Solution and how they are connected

47
System Designer
  • Used to define a specific configuration of
    applications and other systems

48
Logical Datacenter Modeling
  • Physical network diagrams are not aimed at
    developers!

49
Logical 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

50
Logical Datacenter Designer
  • Used to define a logical model of a datacenter
  • Provides a developers perspective

51
Deployment Designer
  • Defines how applications in a system will be
    deployed in a datacenter

52
Demo
  • Application Designers

53
Agenda
  • 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

54
Team Foundation Source Code Control
55
Visual 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

56
Team 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

57
SourceSafe vs Team Foundation
58
Source 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

59
Source Code ControlDifferences compared to VSS
  • No sharing
  • No pinning
  • No Archive and restore features

60
Validate Policy Detail
  • Policy Definitions
  • .NET Assemblies
  • Return Pass or Fail and message
  • Customer Extensible
  • User Over-ridable

61
Source Code ControlParallel Development
  • Multiple Releases
  • Branching
  • Merging
  • Multiple Checkouts

62
Source Code ControlShelving
  • Interrupted workflow
  • Transfer changes without checkin
  • Checkpoint or share work in progress

63
Source 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

64
Demo
  • Source code Control

65
Agenda
  • 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

66
Class 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

67
Use Class Diagrams to
  • Understand existing code
  • Initial class design
  • Review and refactor code
  • Diagrams for documentation

68
Demo
  • Class Designer

69
Agenda
  • 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

70
Projects 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)
71
Problems...
  • 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?

72
Defence In Depth
  • Microsoft uses a 'defence in depth' strategy
  • Unit testing
  • Code reviews
  • Frequent builds
  • Catch bugs early
  • Static checks
  • Runtime checks

73
Unit 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
74
Code 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

75
Static 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

76
PREFast
  • 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

77
FxCop
  • 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

78
Frequent 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!

79
Testing in VSTS
Visual StudioTeam Architect
Visual StudioTeam Developer
Visual StudioTeam Test
Visual StudioTeam Foundation
80
Team 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
81
Integrating 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

82
VSTS 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

83
Additional Test Types
  • Ordered
  • Execute a set of existing tests in order
  • Generic
  • A wrapper for an existing program

84
Test Manager and Test View
  • Test management tools
  • Test View
  • Flat list of all tests
  • Text Manager
  • View and run all tests for a project

85
Demo
  • Manual Testing

86
Test-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
87
Test-Driven Development
Write a test
Refactor if needed
88
VSTS 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")
89
Code Coverage
  • How much of your class have you tested?
  • Percentage or graphical

90
Demo
  • Test driven development using VSTS

91
Agenda
  • 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

92
Dynamic 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

93
Sampling 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

94
ProfilingInstrumentation
  • Adds instructions to your code to monitor

main 001 AMethod 0023 BMethod 0098
95
ProfilingSampling
  • Analyze without changing your app

main 3
AMethod 6
BMethod 9
2
96
Analyzing Performance Data
  • Visualize performance data within Visual Studio
  • Summary
  • Function and caller/callee
  • Call stack
  • Also export as XML

97
Demo
  • Instrumentation profiling

98
Agenda
  • 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

99
Team 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

100
Build Scenarios
  • Public build lab
  • Desktop builds
  • Resuming builds after failures
  • Publishing build results and build drops

101
Features
  • 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

102
Team System Integration
103
Team 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

104
Build 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

105
Build Execution
106
Demo
  • Team Build

107
Agenda
  • 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

108
Testing 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

109
Web 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

110
Test Types
  • Recorded tests
  • XML format
  • List of URLs and parameters
  • Validation and extraction
  • Coded tests
  • Extend via program logic
  • Convert from recorded tests

111
Recording and Playing Tests
  • Simple recording via Internet Explorer
  • Web test file captures script details
  • VS interface allows editing
  • Player within VS replays scripts

112
Handy Features
  • Forms Authentication aware
  • Viewstate Tracking
  • Cookie Tracking

113
Validation 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

114
Coded 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)
115
Demo
  • Web Application Testing

116
Agenda
  • 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

117
ASP.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?

118
ASP.NET Load Testing
  • Integrated within VS.NET
  • Uses testing scripts for scenarios
  • Browser / user load / server control (?)
  • Result visualization

Graphs
Web Site
Tables
XML
119
Demo
  • Web Load Testing

120
Agenda
  • 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

121
Visual Studio as a Platform
122
Team 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
123
Extensibility 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

124
Customizable 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

125
Demo
  • Team System Extensibility customization

126
Boek
  • Iedere bezoeker krijgt 1 boek
  • Alleen te krijgen door je badge in te leveren bij
    de uitgang

127
Where 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.
Write a Comment
User Comments (0)
About PowerShow.com