slide deck from my tccc10 presentation. please use the URL's and references for the source code and other technologies which are discussed but not covered.
2. 2
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
April 9, 2011 – TCCC‐10
5. 5
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
April 9, 2011 – TCCC‐10
7. 7
Writing tests first help write better code
Process of writing a test first helps to see when a
design is too rigid or unfocused
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
April 9, 2011 – TCCC‐10
8. 8
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
April 9, 2011 – TCCC‐10
10. 10
Incremental development
Iterative development
builds a system feature,
progressively refines the
instead of building layers and
implementation of features
components and integrating
in response to feedback
them at the end.
until they are good enough.
Each feature is implemented
In other words, reacting to
as an end‐to‐end “slice”.
the “anticipating to the
System is always integrated
unanticipated”
and ready for deployment
April 9, 2011 – TCCC‐10
11. 11
Release
Test
Development
April 9, 2011 – TCCC‐10
14. 14
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”
April 9, 2011 – TCCC‐10
15. 15
Evolution of TDD Test method names should be sentences
Writing tests that matter “Given, When, Then”
Concept of executable specifications
April 9, 2011 – TCCC‐10
16. 16
Start feature with an acceptance test
Develop from the inputs & outputs
MSDN Article: http://msdn.microsoft.com/en‐us/magazine/gg490346.aspx
April 9, 2011 – TCCC‐10
19. 19
SP1 is available
Help viewer updates
Silverlight 4 support
Unit testing for .NET 3.5
IIS Express support
SQL Server CE Support
Razor support “Pimp my IDE” check out
http://studiostyl.es
Feature Pack 2
Code visualization and modeling
Improved Coded UI Testing
April 9, 2011 – TCCC‐10
20. 20
using 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
April 9, 2011 – TCCC‐10
21. 21
A unit test is a piece
of code that invokes
another piece of code,
Is Automated and repeatable
resides in another
assembly
Is Easy to implement
Should remain for future use
Is run by anyone
Should run with a push of a button
Runs quickly
SUT : System Under Test
(CUT : Code under Test)
: Class under Test)
April 9, 2011 – TCCC‐10
22. 22
Development &
Architecture Lab Management Test TFS
Database
•Architecture Explorer •Historical debugging •Multi‐tier •Test planning •Work item hierarchy
•Layer Diagram •Test impact analysis environment creation •Test case & link types
•Use case designer •Improved code and management management •Improved Agile
•Activity designer analysis •Automated •Test prioritization template
•Improved profiling deployment •Run management & •MOSS & WSS
•Component diagram
(incl. multi‐tier) •Easily manage reporting dashboards
•Logical class designer
•Database extensibility machine pools •Project quality •Simplified reporting
•Sequence diagram
•Network fencing reports •Improved support for
•Modeling project
•Checkpoints •Manual test parallel development
system
execution •Rollback
•UML Model Explorer
•Diagnostic recording •Build queuing and
•Architecture
(environment, video, pooling
validation during
etc.) •Gated check‐in
build
•UI Automation •Simplified setup
recording •Scale out of web and
•Coded UI tests data tiers
•Admin console
•Project
move/archive/restore
April 9, 2011 – TCCC‐10
24. 24
Maintain a Single Source Repository
Automate the Build
Make Your Build Self‐Testing
Keep the Build Fast
Everyone can see what's happening
Automate Deployment
http://martinfowler.com/articles/continuousIntegration.html
April 9, 2011 – TCCC‐10
30. 30
Goal is to ship to “less” buggy, rigid
software. TDD and BDD will help.
Keep an open mind and try out!
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.
Continuous Integration is more than “nice to have” any more. If
you are serious about development, you should have it.
April 9, 2011 – TCCC‐10