SlideShare a Scribd company logo
1 of 23
Download to read offline
Test-driven Development
Practices in White Box Test
Automation
Ervin Loh
ALM Program Manager
K365Labs Sdn Bhd
Typical result?
What is Test-driven Development?
“Test-Driven Development seeks specification, not
   validation, letting you think through your design
   before you write your functional code”
      - Scott Ambler

“Test-Driven Development is a powerful way to produce
   well designed code with fewer defects”
      - Martin Fowler
Test-driven Development Stages
 In Extreme Programming Explored (The Green
 Book), Bill Wake describes the test / code cycle:
   Write a single test
   Compile it. It shouldn’t compile because you’ve not
   written the implementation code
   Implement just enough code to get the test to compile
   Run the test and see it fail
   Implement just enough code to get the test to pass
   Run the test and see it pass
   Refactor for clarity and “once and only once”
   Repeat
Test Driven Development
The motto "Red, Green, Refactor."
Get Agile – Test Driven
Development                    Practices




Tools For Agility, Kent Beck      Tools
The Demo Scenario
 The Configuration
   An application, Tailspin Toys that builds in Visual
   Studio 2010
   A fully configured Visual Studio 2010 Premium and
   Team Foundation Server 2010 environment
 What’s Needed
   A lot: tests and builds
Step 1: Unit Test

A method by
which individual
units of source
code are tested to
determine if they
are fit for use.
Unit Tests with Visual Studio
            2010
Step 2: Test Impact Analysis

A method to
identify the tests
that need to be
run for the latest
code change.
Integrating Unit Tests and
Test Impact Analysis with
    Visual Studio 2010
Step 3: Code Coverage

A method to
describe the
degree to which
the source code
of a program has
been tested.
Integrating Unit Tests and
Code Coverage with Visual
       Studio 2010
Step 4: Build Automation

An act of
automating a
wide variety of
tasks such as
compiling
computer source
code into binary
code, packaging
binary code, and
running tests.
Integrating Build Automation
        and Unit Tests
Quality Indicators
                                                               91


                                                  80
        76

                                     71


                      60


        51             56


                                     40

                                                 32.5




        20             19

                                     18
                                                  12
                                                                9

                                                                8


     Iteration 1   Iteration 2   Iteration 3   Iteration 4   Iteration 5
Starting Test Driven Development
Creating a cultural change is hard…
                      ….. and it can be done
Questions & Answers
Resources
Brian Marick’s Site
http://www.testdriven.com


Guidelines for Test-Driven Development
http://msdn.microsoft.com/en-us/library/aa730844(v=vs.80).aspx


Using TDD with ASP.NET MVC
http://msdn.microsoft.com/en-us/library/ff847525.aspx


Apply Test-Driven Development to your Database Projects
http://msdn.microsoft.com/en-us/magazine/cc164243.aspx

Improve the Design and Flexibility of Your Project with Extreme Programming
Techniques
http://msdn.microsoft.com/en-us/magazine/cc163982.aspx
Recommended Books
        test-driven development: A Practical Guide
        Dave Astels
        Prentice-Hall/Pearson Education, 2003
        ISBN 0-13-101649-0

        Review available on my web-site
        ______________________________________

        Test-Driven Development: By Example
        Kent Beck
        Addison-Wesley, 2003
        ISBN 0-321-14653-0
Recommanded Books
Refactoring: Improving the Design of Existing
    Code
Martin Fowler
Addison-Wesley, 1999
ISBN 0-201-48567-2

__________________________________

Test-Driven Development in Microsoft.NET
James W. Newkirk; Alexei A. Vorontsov
Microsoft Press, 2004
ISBN 0-7356-1948-4

xUnit.net & xUnit Test Pattern
We value your feedback!


Please remember to complete the
overall conference evaluation form and
return it to the Registration Counter.

More Related Content

Similar to Test-driven Development Practices in White Box Test Automation

Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learned
Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learnedSwiss Testing Day - Testautomation, 10 (sometimes painful) lessons learned
Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learned
Michael Palotas
 
Pg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docxPg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docx
JUST36
 
Pg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docxPg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docx
karlhennesey
 
Testingfor continuousdeliverywithvisualstudio2012
Testingfor continuousdeliverywithvisualstudio2012Testingfor continuousdeliverywithvisualstudio2012
Testingfor continuousdeliverywithvisualstudio2012
Steve Xu
 
Benefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real WorldBenefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real World
Dror Helper
 
0) rad 255 test overview
0) rad 255 test overview0) rad 255 test overview
0) rad 255 test overview
techbed
 
Employee Info Starter Kit
Employee Info Starter KitEmployee Info Starter Kit
Employee Info Starter Kit
joycsc
 
Continuous delivery applied
Continuous delivery appliedContinuous delivery applied
Continuous delivery applied
Mike McGarr
 

Similar to Test-driven Development Practices in White Box Test Automation (20)

Full Stack Web Development Course - Brochure - Manojkumar C - Fresh Spar Tech...
Full Stack Web Development Course - Brochure - Manojkumar C - Fresh Spar Tech...Full Stack Web Development Course - Brochure - Manojkumar C - Fresh Spar Tech...
Full Stack Web Development Course - Brochure - Manojkumar C - Fresh Spar Tech...
 
Refactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationRefactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test Automation
 
Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learned
Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learnedSwiss Testing Day - Testautomation, 10 (sometimes painful) lessons learned
Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learned
 
Introduction to Unit Tests and TDD
Introduction to Unit Tests and TDDIntroduction to Unit Tests and TDD
Introduction to Unit Tests and TDD
 
What's new in Visual Studio 2022
What's new in Visual Studio 2022What's new in Visual Studio 2022
What's new in Visual Studio 2022
 
Pg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docxPg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docx
 
Pg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docxPg. 03Question Three Assignment 3Deadline Sunda.docx
Pg. 03Question Three Assignment 3Deadline Sunda.docx
 
CookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomationCookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomation
 
Testingfor continuousdeliverywithvisualstudio2012
Testingfor continuousdeliverywithvisualstudio2012Testingfor continuousdeliverywithvisualstudio2012
Testingfor continuousdeliverywithvisualstudio2012
 
Accelerating DevOps at the SF DevOps MeetUp
Accelerating DevOps at the SF DevOps MeetUpAccelerating DevOps at the SF DevOps MeetUp
Accelerating DevOps at the SF DevOps MeetUp
 
Benefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real WorldBenefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real World
 
Staying connected: An Overview of Announcements from Microsoft’s Connect();
Staying connected: An Overview of Announcements from Microsoft’s Connect();Staying connected: An Overview of Announcements from Microsoft’s Connect();
Staying connected: An Overview of Announcements from Microsoft’s Connect();
 
0) rad 255 test overview
0) rad 255 test overview0) rad 255 test overview
0) rad 255 test overview
 
How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...
How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...
How to Use Sim CFD (to your advantage): A Primer for Computational Fluid Dyna...
 
Kentico Connection 2014 Boston Upgrade Like a Pro
Kentico Connection 2014 Boston Upgrade Like a ProKentico Connection 2014 Boston Upgrade Like a Pro
Kentico Connection 2014 Boston Upgrade Like a Pro
 
Employee Info Starter Kit
Employee Info Starter KitEmployee Info Starter Kit
Employee Info Starter Kit
 
TDD with BizTalk
TDD with BizTalkTDD with BizTalk
TDD with BizTalk
 
Continuous delivery applied
Continuous delivery appliedContinuous delivery applied
Continuous delivery applied
 
Visual Studio 2010 Testing Overview
Visual Studio 2010 Testing OverviewVisual Studio 2010 Testing Overview
Visual Studio 2010 Testing Overview
 
Unit Testing in VS2012
Unit Testing in VS2012Unit Testing in VS2012
Unit Testing in VS2012
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

Test-driven Development Practices in White Box Test Automation

  • 1.
  • 2. Test-driven Development Practices in White Box Test Automation Ervin Loh ALM Program Manager K365Labs Sdn Bhd
  • 4. What is Test-driven Development? “Test-Driven Development seeks specification, not validation, letting you think through your design before you write your functional code” - Scott Ambler “Test-Driven Development is a powerful way to produce well designed code with fewer defects” - Martin Fowler
  • 5. Test-driven Development Stages In Extreme Programming Explored (The Green Book), Bill Wake describes the test / code cycle: Write a single test Compile it. It shouldn’t compile because you’ve not written the implementation code Implement just enough code to get the test to compile Run the test and see it fail Implement just enough code to get the test to pass Run the test and see it pass Refactor for clarity and “once and only once” Repeat
  • 6. Test Driven Development The motto "Red, Green, Refactor."
  • 7. Get Agile – Test Driven Development Practices Tools For Agility, Kent Beck Tools
  • 8. The Demo Scenario The Configuration An application, Tailspin Toys that builds in Visual Studio 2010 A fully configured Visual Studio 2010 Premium and Team Foundation Server 2010 environment What’s Needed A lot: tests and builds
  • 9. Step 1: Unit Test A method by which individual units of source code are tested to determine if they are fit for use.
  • 10. Unit Tests with Visual Studio 2010
  • 11. Step 2: Test Impact Analysis A method to identify the tests that need to be run for the latest code change.
  • 12. Integrating Unit Tests and Test Impact Analysis with Visual Studio 2010
  • 13. Step 3: Code Coverage A method to describe the degree to which the source code of a program has been tested.
  • 14. Integrating Unit Tests and Code Coverage with Visual Studio 2010
  • 15. Step 4: Build Automation An act of automating a wide variety of tasks such as compiling computer source code into binary code, packaging binary code, and running tests.
  • 17. Quality Indicators 91 80 76 71 60 51 56 40 32.5 20 19 18 12 9 8 Iteration 1 Iteration 2 Iteration 3 Iteration 4 Iteration 5
  • 18. Starting Test Driven Development Creating a cultural change is hard… ….. and it can be done
  • 20. Resources Brian Marick’s Site http://www.testdriven.com Guidelines for Test-Driven Development http://msdn.microsoft.com/en-us/library/aa730844(v=vs.80).aspx Using TDD with ASP.NET MVC http://msdn.microsoft.com/en-us/library/ff847525.aspx Apply Test-Driven Development to your Database Projects http://msdn.microsoft.com/en-us/magazine/cc164243.aspx Improve the Design and Flexibility of Your Project with Extreme Programming Techniques http://msdn.microsoft.com/en-us/magazine/cc163982.aspx
  • 21. Recommended Books test-driven development: A Practical Guide Dave Astels Prentice-Hall/Pearson Education, 2003 ISBN 0-13-101649-0 Review available on my web-site ______________________________________ Test-Driven Development: By Example Kent Beck Addison-Wesley, 2003 ISBN 0-321-14653-0
  • 22. Recommanded Books Refactoring: Improving the Design of Existing Code Martin Fowler Addison-Wesley, 1999 ISBN 0-201-48567-2 __________________________________ Test-Driven Development in Microsoft.NET James W. Newkirk; Alexei A. Vorontsov Microsoft Press, 2004 ISBN 0-7356-1948-4 xUnit.net & xUnit Test Pattern
  • 23. We value your feedback! Please remember to complete the overall conference evaluation form and return it to the Registration Counter.