Top Banner
March 17, 2011 – Developer Track 1 Baskin I. Tapkan Advanced Technology Software Group Imation Corp. @baskint http://tapkan.blogspot.com/ [email protected]
36
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

1

Baskin I. Tapkan Advanced Technology Software Group Imation Corp.

@baskint

http://tapkan.blogspot.com/

[email protected]

Page 2: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

2

Developer - Consultant - Architect BS & MS degrees in Electrical Engineering, IEEE member, MS-Certified

Page 3: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

3

Page 4: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

4

Board Sports

Page 5: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

5

Should have bought a snow blower

Page 6: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

6

1. Reasons behind testing and why you should care

2. Development and testing with VS-2010

3. Something-Driven styles and contrasts

4. Types of testing

5. Coded UI testing – demo

6. Database Unit testing - demo

7. Continuous Integration Practices

8. Unit test & TeamCity - demo

9. Conclusion & References

Page 7: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

7

Bugs are expensive – over $59 billion/year

On average, 100 errors per 1,000 lines of code

Cancelled and over-ran projects combined cost around $88 billion in 2009

A few examples…

Page 8: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

8

Code Re-use Conversion from 64-bit to 16-bit signed int caused overflow, exception handling was disabled for some other reason – COST > $370 million (‘96 dollars)

Page 9: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

9

Crossed international dateline the first time on the way to Japan, computers crashed losing all navigation and communication systems. Luckily with clear weather, it followed tankers back to Hawaii

Page 10: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

10

Failed to wake up users during Daylight Savings Time change

Page 11: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

11

Testing is no longer just about keeping defects from the users; instead it is about helping the team understand the

features users need and deliver them reliably and predictably

Writing tests first help write better code

Process of writing a test first helps to see when a design is too rigid or unfocused

Page 12: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

12

Repeated cycles of activity Each cycle adds new features and team gets feedback

Each cycle deploys work to some kind of environment

Every deploy, team has an opportunity to check the assumptions against reality

Without deployment, the feedback is not complete

Page 13: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

13

RequirementsFeature codingPair programmingStand-upsUnit testingDeploymentIntegration testingReleases

Page 14: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

14

Incremental development builds a system feature,

instead of building layers and components and integrating

them at the end.

Each feature is implemented as an end-to-end “slice”.

System is always integrated and ready for deployment

Iterative development progressively refines the

implementation of features in response to feedback

until they are good enough.

In other words, reacting to the “anticipating to the

unanticipated”

Page 15: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

15

Development

Test

Release

Page 16: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

16

Development

Test

Release

Pushing quality upstream

Page 18: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

18

The catch is that few developers enjoy testing their code. Many see writing automated tests is seen as not “real” work

compared to adding features. They find it boring. It takes a different mind set and takes time to learn and master.

TDD makes coding a design activity. Use tests to clarify ideas about what the code should do.

Having tests during development process can build up a safety net of automated regression tests.

These tests give confidence to make changes. All of a sudden, you are doing “Red – Green – Refactor”

“… you have nothing to lose but your bugs”

Page 19: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

19

Evolution of TDD Test method names should be sentences

Writing tests that matter “Given, When, Then”

Concept of executable specifications

Page 20: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

20

MSDN Article: http://msdn.microsoft.com/en-us/magazine/gg490346.aspx

Start feature with an acceptance test

Develop from the inputs & outputs

Page 21: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

21

Unit / Integration / Acceptance Tests

Database Unit Test

Coded UI Tests

Web Performance and Load Tests

Page 22: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

22

TailSpin project lab

http://blogs.msdn.com/b/briankel/archive/2010/06/25/now-available-visual-studio-2010-rtm-virtual-machine-with-sample-data-and-hands-on-labs.aspx

Page 23: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

23

SP1 is available Help viewer updates

Silverlight 4 support

Unit testing for .NET 3.5

IIS Express support

SQL Server CE Support

Razor support

Feature Pack 2 Code visualization and modeling

Improved Coded UI Testing

“Pimp my IDE” check out http://studiostyl.es

Page 24: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

24

SQL Server 2008

http://blogs.msdn.com/b/atverma/archive/2010/07/28/how-to-unit-test-sql-server-2008-database-using-visual-studio-2010.aspx

Page 25: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

25

A unit test is a piece

of code that invokes another piece of code,

resides in another assembly

SUT : System Under Test (CUT : Code under Test)

: Class under Test)

Is Automated and repeatable

Is Easy to implement

Should remain for future use

Is run by anyone

Should run with a push of a button

Runs quickly

Page 26: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

26

Real Life Example

Page 27: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

27

Architecture

•Architecture Explorer

•Layer Diagram

•Use case designer

•Activity designer

•Component diagram

•Logical class designer

•Sequence diagram

•Modeling project system

•UML Model Explorer

•Architecture validation during build

Development & Database

•Historical debugging

•Test impact analysis

•Improved code analysis

•Improved profiling (incl. multi-tier)

•Database extensibility

Lab Management

•Multi-tier environment creation and management

•Automated deployment

•Easily manage machine pools

•Network fencing

•Checkpoints

Test

•Test planning

•Test case management

•Test prioritization

•Run management & reporting

•Project quality reports

•Manual test execution

•Diagnostic recording (environment, video, etc.)

•UI Automation recording

•Coded UI tests

TFS

•Work item hierarchy & link types

•Improved Agile template

•MOSS & WSS dashboards

•Simplified reporting

•Improved support for parallel development

•Rollback

•Build queuing and pooling

•Gated check-in

•Simplified setup

•Scale out of web and data tiers

•Admin console

•Project move/archive/restore

Page 28: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

28

Maintain a Single Source Repository

http://martinfowler.com/articles/continuousIntegration.html

Automate the Build

Make Your Build Self-Testing

Keep the Build Fast

Everyone can see what's happening

Automate Deployment

Page 29: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

29

Page 30: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

30

Page 31: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

31

Page 32: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

32

Page 33: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

33

Page 34: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

34

Goal is to ship to “less” buggy, rigid software. TDD and BDD will help.

Just keep an open mind!

Continuous Integration is more than “nice to have” any more. If you are serious about what

you are doing, you should have it.

VS-2010 has many other features on various testing mechanisms. Take the time to learn and master them.

Don’t hesitate looking at other platforms for ideas.

Page 35: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

35

Page 36: Tech fuse11 toolingtestingci-vs2010teamcity

March 17, 2011 – Developer Track

36

Speaker Rate: http://speakerrate.com/talks/5834-tooling-testing-and-continuous-integration-using-vs-2010-and-teamcity