SlideShare a Scribd company logo
Dror Helper - http://blogs.microsoft.co.il/blogs/dhelper
Doron Peretz – http://twitter.com/doronp
Typemock Ltd.




                                                           Typemock™
Typemock™

 Typemock Isolator
 Established 2005, privately owned
 Thousands of customers (Fortune 500)
 Tens of thousands licenses sold




                                   Typemock™
Agenda
   Using TDD for Fun & Profit

   A day in the life of TDD developer

   Testing difficult scenarios

   Share the Pain!

                                         Typemock™
`




How to implement unit testing in your development team




                                                         Typemock™
Sounds Familiar?
20:00 – One bug left before release
20:01 - Done!
20:02 - Send version to QA, call wife
20:05 - On the way to the elevator.
          QA: It doesn’t work!

22:50 - What have I done?!

                                        Typemock™
Unit testing for Fun & Profit
 Short Overview: Unit Test, TDD
 Why unit test?
 Things you thought you knew
 Tools you need to know about




                                   Typemock™
Overview


What is Unit Test?
   Verifies an atomic piece of code
   Tests one specific behavior
   Each Test is autonomous

[TestMethod]
public void CheckPassword_ValidUser_ReturnTrue()
{
   bool result = CheckPassword(“user”, “pass”);

    Assert.IsTrue(result);
}
                                             Typemock™
Overview


Test Driven Development
                          Write
                          new
                          Test


                                           Run
           Refactor
                                          Tests




                   Run            Write
                  Tests           code

                                                  Typemock™
Why Unit Test?


Why not use Unit Test
Testing is for QA

Time = Cost

Integration Testing find more bugs
Manual Testing find more bugs

It’s like writing the code twice
                                     Typemock™
Why Unit Test?


Is TDD a Waste of Time?
              Time taken to code a feature
140%                         135%
             120%                                    125%
120%                                       115%

100%
80%
60%
40%
20%
 0%
       IBM: Drivers    MS: Windows     MS: MSN    MS: VS
                      WithoutTDD     Using TDD
                                                       Typemock™
Why Unit Test?


Is TDD a Waste of Time?
                Using Test Driven Design
140%
120%
100%
80%
              61%
60%
                            38%
40%
                                            24%
20%                                                          9%
 0%
       IBM: Drivers   MS: Windows     MS: MSN          MS: VS
 Major quality improvement for minor time investment
         Time To Code Feature       Defect density of team
                                                              Typemock™
Why Unit Test?


So Why Unit Test?
                                            Where does it hurt?
                    100%                                                                          10
                                            The pain is here!             This is too late…       9

                    80%                                                                           8
% defects created




                                                                                                  7




                                                                                                       Thousand $s
                    60%                                                                           6

                                                                                                  5

                    40%                                                                           4

                                                                                                  3

                    20%                                                                           2

                                                                                                  1

                     0%                                                                           0
                           Requirements    Coding      Integration        Testing
                                                                                            Typemock™
                                                                                        Support

                                    % of Defects Introduced          Cost to Fix a Defect
Misconceptions


TDD is not about testing
   TDD is about design and development

   By testing first you design your code




                                            Typemock™
Misconceptions

Unit Tests are written by
developers!
 Increase confidence in code
 Fearlessly change your code
 Document requirements
 Discover usability issues early




                                           Typemock™
Misconceptions
Unit Tests are Not
Integration
   Unit tests should be:
     Small
     Atomic
     Test a single functional unit
     Isolated!


   Integration tests are used to test system
    wide functionality

                                                 Typemock™
Tools


Unit Testing Frameworks
 Consensus – NUnit
 Integrated – MSTest
 New kid on the block – XUnit
 Performance oriented – Zenebug
 Meta framework- Gallio (MBUnit)




                                    Typemock™
Tools


Mocking / Isolation
   Each unit test MUST be isolated

   How do we test business logic without
    Database calls?




                                        Typemock™
Tools


Isolation – Mocking frameowrks
Open Source:
 NMock2
 Moq
 Rhino Mocks


Commercial (costs money but worth it)
 Typemock Isolator


                                        Typemock™
Tools


Visual Studio Integration
Refactoring
 Code Rush
 R#


Unit test runners
 TestDriven.NET
 R# Test Runner


                            Typemock™
Tools


Continuous Integration                         Build Server
                                                (TeamCity)
                                What’s new?

     Commit
                               There you go

              Source Control
                  (SVN)

                                              We automatically got
                                              •Error reports & logs
                                              •New version installer
                                              •Help files
                                              •More…



                         Build Agents                Typemock™
                         (FinalBuilder)
Tools


Continuous Integration
                                     Computer
                                     Says NO!
Build Automation Tools
 NAnt
 MSBuild
 FinalBuilder

CI Servers
 CCnet
 TeamCity
 Team System / Team Foundation Server
 FinalBuilder Server
                                         Typemock™
`




Examples, demonstrations & fun




                                     Typemock™
A Day in the Life of a
TDD'er
 The tools we use at Typemock
 Writing some code
 OK, who broke the Build?!
 Too much spare time…




                                 Typemock™
Our Tools


The Tools We Use
 Unit testing – MSTest/NUnit
 Build automation – FinalBuilder




                                    Typemock™
Our Tools


Build Script at a Glance




                           Typemock™
Our Tools


The Tools We Use
 Unit testing – MSTest/NUnit
 Build automation – FinalBuilder
 Continuous Integration – TeamCity




                                      Typemock™
Our Tools


TeamCity at a Glance




                       Typemock™
Our Tools


The Tools We Use
 Unit testing – MSTest/NUnit
 Build automation – FinalBuilder
 Continuous Integration – TeamCity
 Integrated tools – R#, TestDriven.NET
 Isolation Framework – Isolator (surprise!)
 Build Bunny!




                                         Typemock™
Write Code


Writing Some Code
   We begin with a clean slate

                          Write
                         new test


                                             Run
         Refactor
                                            tests




               Run All              Write
                tests               code
                                                    Typemock™
Write Code


Writing Some Code
   An exercise in futility…

                           Write
                          new test


                                              Run
          Refactor
                                             tests




                Run all              Write
                 tests               code
                                                     Typemock™
Write Code


Writing Some Code
   Now we get our hands dirty
                         Write
                         new
                         Test


                                          Run
         Refactor
                                         tests




               Run all           Write
                tests            code
                                                 Typemock™
Write Code


Writing Some Code
   Make sure everything’s fine…
                         Write
                         new
                         Test


                                          Run
         Refactor
                                         tests




               Run all           Write
                tests            code
                                                 Typemock™
Write Code


Writing Some Code
   … and make it perform/look better

                          Write
                         new test


                                             Run
         Refactor
                                            tests




               Run all              Write
                tests               code
                                                    Typemock™
Write Code


Writing Some Code
   Lets take her out for another spin…
                         Write
                         new
                         Test


                                          Run
         Refactor
                                         tests




               Run all           Write
                tests            code
                                                 Typemock™
Broken Build


OK, Who Broke the Build?
   Something went horribly wrong!
     And it’s easy to find who to blame 
     But it’s easy to find out what happened


   Why is this important?
     The project heartbeat
     Healthy build == easy to release



                                                Typemock™
Spare Time


Too Much Spare Time
 The foosball table
 The build bunny
 The Shooting of The Zombies
 Helping children with computer skills




                                          Typemock™
Not everything in life is easy…




                                  Typemock™
Examples from the real
world
 Hard to unit test scenarios
 How to solve this problem
 Examples




                                Typemock™
Difficult scenarios to Unit
Test
 Client – server architecture
 Databases
 Legacy Code
 Closed Object Models
  (Sharepoint, Silverlight)
 GUI interaction




                                 Typemock™
Possible solutions
   First - better understand the problem

 Design for Testability
 Refactoring for Testability
 Reflection
 Mocks / Isolation


   Last resort - Integration tests instead
                                              Typemock™
Example Unit Testing WCF
Client
Class: WCF Client
Method: string GetSourceList(string source);

Problem: Server connection is not possible




                                       Typemock™
Unit Testing WCF Client
Overview:



 DataProviderClient

                                       DataProviderServer




 ISourceListProvider   GetSourceList



                                               Typemock™
Unit Testing Windows
Forms

                                              Database


Registration Form          Business
                            Logic




                    Registration Controller      Typemock™
Share The Pain
   Your unit testing stories

   Q&A




                                Typemock™
Thank you
Want to learn more?

Read about Test Driven Development &
  Isolation at the Typemock Insiders blog

Follow up on twitter.com/Typemock

Take a card and drop us an email!
                                       Typemock™

More Related Content

PPTX
An Introduction to Unit Testing
PDF
Unit Test + Functional Programming = Love
PPTX
Unit Testing And Mocking
PDF
Unit testing (workshop)
PPTX
Unit tests & TDD
PDF
How and what to unit test
PPTX
Unit Testing Concepts and Best Practices
PDF
Clean Unit Test Patterns
An Introduction to Unit Testing
Unit Test + Functional Programming = Love
Unit Testing And Mocking
Unit testing (workshop)
Unit tests & TDD
How and what to unit test
Unit Testing Concepts and Best Practices
Clean Unit Test Patterns

What's hot (20)

PPTX
Understanding Unit Testing
PPS
Unit Testing
PPTX
Unit Testing
KEY
Unit Testing Your Application
PPTX
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
PPTX
Unit testing
PDF
Unit and integration Testing
PPTX
Test driven development in .Net - 2010 + Eclipse
PPTX
Unit Testing (C#)
PDF
Is this how you hate unit testing?
PPTX
Software Quality via Unit Testing
PPTX
Java Unit Test and Coverage Introduction
PPTX
Unit test
PPT
Unit testing
PDF
Unit Testing Guidelines
PPTX
Unit Tests And Automated Testing
PDF
Unit Testing Fundamentals
PDF
Unit Testing
PDF
Workshop unit test
PPT
Unit Testing
Understanding Unit Testing
Unit Testing
Unit Testing
Unit Testing Your Application
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
Unit testing
Unit and integration Testing
Test driven development in .Net - 2010 + Eclipse
Unit Testing (C#)
Is this how you hate unit testing?
Software Quality via Unit Testing
Java Unit Test and Coverage Introduction
Unit test
Unit testing
Unit Testing Guidelines
Unit Tests And Automated Testing
Unit Testing Fundamentals
Unit Testing
Workshop unit test
Unit Testing
Ad

Viewers also liked (15)

PPT
Software development slides
PDF
구글테스트
PDF
Improve Communications in the Workplace
PPT
How To Improve Communication Skill
PDF
Unit-testing and E2E testing in JS
PPTX
Exactpro Systems for KSTU Students in Kostroma
PDF
Rundeck's History and Future
PDF
How do I do DevOps when all I have is Ops?
PDF
How will DevOps benefit enterprise?
PPTX
C++ 프로젝트에 단위 테스트 도입하기
PDF
KGC2010 - 낡은 코드에 단위테스트 넣기
PPT
Behavior Driven Development Pros and Cons
PDF
Product Teardown for SaaS companies at #SaaSx4
PPTX
10 Tips for Making Beautiful Slideshow Presentations by www.visuali.se
PDF
8 Tips for an Awesome Powerpoint Presentation
Software development slides
구글테스트
Improve Communications in the Workplace
How To Improve Communication Skill
Unit-testing and E2E testing in JS
Exactpro Systems for KSTU Students in Kostroma
Rundeck's History and Future
How do I do DevOps when all I have is Ops?
How will DevOps benefit enterprise?
C++ 프로젝트에 단위 테스트 도입하기
KGC2010 - 낡은 코드에 단위테스트 넣기
Behavior Driven Development Pros and Cons
Product Teardown for SaaS companies at #SaaSx4
10 Tips for Making Beautiful Slideshow Presentations by www.visuali.se
8 Tips for an Awesome Powerpoint Presentation
Ad

Similar to Benefit From Unit Testing In The Real World (20)

PPTX
Test-Driven Development (TDD)
PPTX
Quality Coding with Visual Studio 2012
PPTX
Quality Coding: What's New with Visual Studio 2012
PPTX
Quality Coding: What’s New with Visual Studio 2012
PPTX
PHX - Session #2 Test Driven Development: Improving .NET Application Performa...
PPT
Automated testing overview
PDF
TDD sharevison team
PDF
Introduction to Automated Testing
PDF
Introduction to-automated-testing
PDF
Inverting The Testing Pyramid
PDF
Test and Behaviour Driven Development (TDD/BDD)
PPTX
Test Driven Development:Unit Testing, Dependency Injection, Mocking
PPT
Paper PsUpload
PPT
justin presentation upload PPT june 19
PPT
justin presentation Slideshare PPT upload June 25 Final one
PPT
Justin Presentation PPT Upload June 25 adv
PPT
justin for ppt1 by browse button
PPT
upload ppt by browse button
PPT
upload ppt by browse button
PPT
Paper Ps
Test-Driven Development (TDD)
Quality Coding with Visual Studio 2012
Quality Coding: What's New with Visual Studio 2012
Quality Coding: What’s New with Visual Studio 2012
PHX - Session #2 Test Driven Development: Improving .NET Application Performa...
Automated testing overview
TDD sharevison team
Introduction to Automated Testing
Introduction to-automated-testing
Inverting The Testing Pyramid
Test and Behaviour Driven Development (TDD/BDD)
Test Driven Development:Unit Testing, Dependency Injection, Mocking
Paper PsUpload
justin presentation upload PPT june 19
justin presentation Slideshare PPT upload June 25 Final one
Justin Presentation PPT Upload June 25 adv
justin for ppt1 by browse button
upload ppt by browse button
upload ppt by browse button
Paper Ps

More from Dror Helper (20)

PPTX
Unit testing patterns for concurrent code
PPTX
The secret unit testing tools no one ever told you about
PPTX
Debugging with visual studio beyond 'F5'
PPTX
From clever code to better code
PPTX
From clever code to better code
PPTX
A software developer guide to working with aws
PPTX
The secret unit testing tools no one has ever told you about
PPTX
The role of the architect in agile
PDF
Harnessing the power of aws using dot net core
PPTX
Developing multi-platform microservices using .NET core
PPTX
Harnessing the power of aws using dot net
PPTX
Secret unit testing tools no one ever told you about
PPTX
C++ Unit testing - the good, the bad & the ugly
PPTX
Working with c++ legacy code
PPTX
Visual Studio tricks every dot net developer should know
PPTX
Secret unit testing tools
PPTX
Electronics 101 for software developers
PPTX
Navigating the xDD Alphabet Soup
PPTX
Building unit tests correctly
PPTX
Who’s afraid of WinDbg
Unit testing patterns for concurrent code
The secret unit testing tools no one ever told you about
Debugging with visual studio beyond 'F5'
From clever code to better code
From clever code to better code
A software developer guide to working with aws
The secret unit testing tools no one has ever told you about
The role of the architect in agile
Harnessing the power of aws using dot net core
Developing multi-platform microservices using .NET core
Harnessing the power of aws using dot net
Secret unit testing tools no one ever told you about
C++ Unit testing - the good, the bad & the ugly
Working with c++ legacy code
Visual Studio tricks every dot net developer should know
Secret unit testing tools
Electronics 101 for software developers
Navigating the xDD Alphabet Soup
Building unit tests correctly
Who’s afraid of WinDbg

Recently uploaded (20)

PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Cloud computing and distributed systems.
PPT
Teaching material agriculture food technology
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
CIFDAQ's Market Insight: SEC Turns Pro Crypto
The Rise and Fall of 3GPP – Time for a Sabbatical?
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
The AUB Centre for AI in Media Proposal.docx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Building Integrated photovoltaic BIPV_UPV.pdf
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Understanding_Digital_Forensics_Presentation.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Review of recent advances in non-invasive hemoglobin estimation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
20250228 LYD VKU AI Blended-Learning.pptx
Cloud computing and distributed systems.
Teaching material agriculture food technology
Machine learning based COVID-19 study performance prediction
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication

Benefit From Unit Testing In The Real World

  • 1. Dror Helper - http://blogs.microsoft.co.il/blogs/dhelper Doron Peretz – http://twitter.com/doronp Typemock Ltd. Typemock™
  • 2. Typemock™  Typemock Isolator  Established 2005, privately owned  Thousands of customers (Fortune 500)  Tens of thousands licenses sold Typemock™
  • 3. Agenda  Using TDD for Fun & Profit  A day in the life of TDD developer  Testing difficult scenarios  Share the Pain! Typemock™
  • 4. ` How to implement unit testing in your development team Typemock™
  • 5. Sounds Familiar? 20:00 – One bug left before release 20:01 - Done! 20:02 - Send version to QA, call wife 20:05 - On the way to the elevator. QA: It doesn’t work! 22:50 - What have I done?! Typemock™
  • 6. Unit testing for Fun & Profit  Short Overview: Unit Test, TDD  Why unit test?  Things you thought you knew  Tools you need to know about Typemock™
  • 7. Overview What is Unit Test?  Verifies an atomic piece of code  Tests one specific behavior  Each Test is autonomous [TestMethod] public void CheckPassword_ValidUser_ReturnTrue() { bool result = CheckPassword(“user”, “pass”); Assert.IsTrue(result); } Typemock™
  • 8. Overview Test Driven Development Write new Test Run Refactor Tests Run Write Tests code Typemock™
  • 9. Why Unit Test? Why not use Unit Test Testing is for QA Time = Cost Integration Testing find more bugs Manual Testing find more bugs It’s like writing the code twice Typemock™
  • 10. Why Unit Test? Is TDD a Waste of Time? Time taken to code a feature 140% 135% 120% 125% 120% 115% 100% 80% 60% 40% 20% 0% IBM: Drivers MS: Windows MS: MSN MS: VS WithoutTDD Using TDD Typemock™
  • 11. Why Unit Test? Is TDD a Waste of Time? Using Test Driven Design 140% 120% 100% 80% 61% 60% 38% 40% 24% 20% 9% 0% IBM: Drivers MS: Windows MS: MSN MS: VS Major quality improvement for minor time investment Time To Code Feature Defect density of team Typemock™
  • 12. Why Unit Test? So Why Unit Test? Where does it hurt? 100% 10 The pain is here! This is too late… 9 80% 8 % defects created 7 Thousand $s 60% 6 5 40% 4 3 20% 2 1 0% 0 Requirements Coding Integration Testing Typemock™ Support % of Defects Introduced Cost to Fix a Defect
  • 13. Misconceptions TDD is not about testing  TDD is about design and development  By testing first you design your code Typemock™
  • 14. Misconceptions Unit Tests are written by developers!  Increase confidence in code  Fearlessly change your code  Document requirements  Discover usability issues early Typemock™
  • 15. Misconceptions Unit Tests are Not Integration  Unit tests should be:  Small  Atomic  Test a single functional unit  Isolated!  Integration tests are used to test system wide functionality Typemock™
  • 16. Tools Unit Testing Frameworks  Consensus – NUnit  Integrated – MSTest  New kid on the block – XUnit  Performance oriented – Zenebug  Meta framework- Gallio (MBUnit) Typemock™
  • 17. Tools Mocking / Isolation  Each unit test MUST be isolated  How do we test business logic without Database calls? Typemock™
  • 18. Tools Isolation – Mocking frameowrks Open Source:  NMock2  Moq  Rhino Mocks Commercial (costs money but worth it)  Typemock Isolator Typemock™
  • 19. Tools Visual Studio Integration Refactoring  Code Rush  R# Unit test runners  TestDriven.NET  R# Test Runner Typemock™
  • 20. Tools Continuous Integration Build Server (TeamCity) What’s new? Commit There you go Source Control (SVN) We automatically got •Error reports & logs •New version installer •Help files •More… Build Agents Typemock™ (FinalBuilder)
  • 21. Tools Continuous Integration Computer Says NO! Build Automation Tools  NAnt  MSBuild  FinalBuilder CI Servers  CCnet  TeamCity  Team System / Team Foundation Server  FinalBuilder Server Typemock™
  • 22. ` Examples, demonstrations & fun Typemock™
  • 23. A Day in the Life of a TDD'er  The tools we use at Typemock  Writing some code  OK, who broke the Build?!  Too much spare time… Typemock™
  • 24. Our Tools The Tools We Use  Unit testing – MSTest/NUnit  Build automation – FinalBuilder Typemock™
  • 25. Our Tools Build Script at a Glance Typemock™
  • 26. Our Tools The Tools We Use  Unit testing – MSTest/NUnit  Build automation – FinalBuilder  Continuous Integration – TeamCity Typemock™
  • 27. Our Tools TeamCity at a Glance Typemock™
  • 28. Our Tools The Tools We Use  Unit testing – MSTest/NUnit  Build automation – FinalBuilder  Continuous Integration – TeamCity  Integrated tools – R#, TestDriven.NET  Isolation Framework – Isolator (surprise!)  Build Bunny! Typemock™
  • 29. Write Code Writing Some Code  We begin with a clean slate Write new test Run Refactor tests Run All Write tests code Typemock™
  • 30. Write Code Writing Some Code  An exercise in futility… Write new test Run Refactor tests Run all Write tests code Typemock™
  • 31. Write Code Writing Some Code  Now we get our hands dirty Write new Test Run Refactor tests Run all Write tests code Typemock™
  • 32. Write Code Writing Some Code  Make sure everything’s fine… Write new Test Run Refactor tests Run all Write tests code Typemock™
  • 33. Write Code Writing Some Code  … and make it perform/look better Write new test Run Refactor tests Run all Write tests code Typemock™
  • 34. Write Code Writing Some Code  Lets take her out for another spin… Write new Test Run Refactor tests Run all Write tests code Typemock™
  • 35. Broken Build OK, Who Broke the Build?  Something went horribly wrong!  And it’s easy to find who to blame   But it’s easy to find out what happened  Why is this important?  The project heartbeat  Healthy build == easy to release Typemock™
  • 36. Spare Time Too Much Spare Time  The foosball table  The build bunny  The Shooting of The Zombies  Helping children with computer skills Typemock™
  • 37. Not everything in life is easy… Typemock™
  • 38. Examples from the real world  Hard to unit test scenarios  How to solve this problem  Examples Typemock™
  • 39. Difficult scenarios to Unit Test  Client – server architecture  Databases  Legacy Code  Closed Object Models (Sharepoint, Silverlight)  GUI interaction Typemock™
  • 40. Possible solutions  First - better understand the problem  Design for Testability  Refactoring for Testability  Reflection  Mocks / Isolation  Last resort - Integration tests instead Typemock™
  • 41. Example Unit Testing WCF Client Class: WCF Client Method: string GetSourceList(string source); Problem: Server connection is not possible Typemock™
  • 42. Unit Testing WCF Client Overview: DataProviderClient DataProviderServer ISourceListProvider GetSourceList Typemock™
  • 43. Unit Testing Windows Forms Database Registration Form Business Logic Registration Controller Typemock™
  • 44. Share The Pain  Your unit testing stories  Q&A Typemock™
  • 45. Thank you Want to learn more? Read about Test Driven Development & Isolation at the Typemock Insiders blog Follow up on twitter.com/Typemock Take a card and drop us an email! Typemock™

Editor's Notes

  • #4: The lecture today will be divided into four parts:1 Overview of Unit tests and TDD and how it could save money for companies and improve software development process2 Typical day (but nor all day) of a software developer that uses TDD3 Real examples of Unit testing in non trivial cases4 Answer questions from the audience about the lecture, TDD & Unit testing in their companies
  • #5: How a software company can benefit from unit testing Question to audience:Who knows what are unit tests?Who uses unit tests?Who practices TDD?
  • #7: Why unit test:Define unit testing, define isolationMotivationWhy not do unit testing?Benefits: regression, confidence in changeStatistics Examples of companies that unit testCommon misconceptions:Not all tests are unit tests (integration vs. unit testing)Unit tests are for developers, not QAIntroducing TDDTools:Unit testing frameworksR#Mocking frameworksTeamCity/Team SystemFinalBuilder/msbuild/ccnet
  • #8: Show unit test parts:Declaration (attribute)Run code under testAssertion – did satisfy condition Usually we have an additional part that arrange the needed componentsShould this be a new slide? What does unit test test?Functional requirememts
  • #9: First explain - Difference between unit testing – how and tdd - methodologyTest Driven Development (or test driven design) is a methodology.Write a test that failsRun tests – why should we – to make sure the test actually checks the right thingWrite codeRefactorRepeat if nessesary
  • #10: No that we understand what is unit testing and TDD I’d like
  • #11: Taken from http://research.microsoft.com/en-us/projects/esm/nagappan_tdd.pdfRealizing quality improvement through test driven development: results and experiences of four industrial teamsPublished online: 27 February 2008
  • #13: - One known fact is that most of the bugs are introduced during the development stage.Another known fact is that the cost to fix a defect increases exponentially over stages.When bug is found at Testing phase the application needs to go back to development and it actually takes more time!It would be better to find/fix/not create bugs during development afterward it’s too late.We get a costly fix and frustrated clients.Show bugs in testing/supprt – where did they come from? Every few defects fixed a new defect is introducedOur pain in at the dev stage however many companies invest most of their money on QA & support
  • #15: Give example about massive refactoring of new code.Function/code afraid to touch…
  • #16: Examples DB, WCF
  • #17: Has Teardown/Setup functionalityRun Unit tests
  • #18: How to test part of a whole system
  • #21: The backbone of TDD (and development)Show how CI & script runner run the test suite – perhaps publish results to web
  • #22: Continuous integration is the backbone of TDD. Without test runner that runs each time code changes it is impossible to make sure that nothing was broken.
  • #30: Should show:? Get code from server ?MSTest/NUnit
  • #31: Should show:NUnit
  • #34: Resharper