SlideShare una empresa de Scribd logo
1 de 24
Intro to Test Driven Development (TDD) 
Consulting/Training
Consulting/Training 
About Me 
 Microsoft Client Development MVP 
 ASPInsider 
 Twitter: @joelcochran 
 Email: joelcochran@gmail.com 
 Blog: joelcochran.com 
 Lead Developer, WintellectNOW
Consulting/Training 
About Wintellect 
Founded by top experts on Microsoft – Jeffrey Richter, Jeff Prosise, and John Robbins – we pull out all the stops 
to help our customers achieve their goals through advanced software-based consulting and training solutions. 
consulting 
Wintellect helps you build better software, faster, 
tackling the tough projects and solving the software 
and technology questions that help you transform 
your business. 
 Architecture, Analysis and Design 
 Full lifecycle software development 
 Debugging and Performance tuning 
 Database design and development 
training 
Wintellect's courses are written and taught by some of 
the biggest and most respected names in the Microsoft 
programming industry. 
 Learn from the best. Access the same training 
Microsoft’s developers enjoy 
 Real world knowledge and solutions on both current 
and cutting edge technologies 
 Flexibility in training options – onsite, virtual, on 
demand 
who we are
Wintellect’s On-Demand Video Training Solution 
Try it free 
Code: <INSERT CODE HERE> WintellectNOW.com 
COCHRAN-13 
Authors Enjoy: 
 Royalty Income 
 Personal Branding 
 Cross-Sell Opps 
 Free library access 
Subscribers Enjoy: 
 Expert Instructors 
 Quality Content 
 Practical Application 
 All Devices 
Consulting/Training Individuals | Businesses | Enterprise Organizations
Interview with a Method 
Consulting/Training
The Multiply Method Signature 
Int32 Multiply(Int32[] values) 
Consulting/Training
Consulting/Training 
Question #1 
What parameter(s) do you take? 
An Array of Int32
Consulting/Training 
Question #2 
What value type do you return? 
Int32
Consulting/Training 
Question #3 
What happens when I pass you: 
[3, 4]? 
I don’t know
Consulting/Training 
Question #4 
What happens when I pass you: 
[7]? 
I don’t know
Consulting/Training 
Question #5 
What happens when I pass you: 
[-5, 12, 10, -3]? 
I don’t know
Consulting/Training 
Question #6 
What happens when I pass you: 
null? 
I don’t know
Consulting/Training 
Question #7 
What happens when I pass you: 
[23, Int32.MaxValue]? 
I don’t know
Consulting/Training 
Question #8 
You don’t seem to know much… 
If you don’t know the answer to these 
questions, who does? 
The Unit Tests
Consulting/Training 
What is a Unit Test? 
 Code that tests code 
 Small discrete chunks (units) 
 One test, one condition 
 Based on assumptions 
 Should be automated and repeatable
What a Unit Test is Not 
Consulting/Training 
 An end-to-end test 
 Connected to live data 
 Performing external functions (like sending an Email) 
 User tests
Consulting/Training 
Why write Unit Tests? 
 Test code to ensure proper functionality given certain assumptions 
 Exercise code without running the app 
 Write once, run a million times 
 Guards against unintended consequences 
 Tests define success
Consulting/Training 
What is TDD? 
 Unit Tests are written before the code 
 Helps shape the code to the task at hand 
 Provides focus (YAGNI) 
 The test defines success 
 Run all tests every time
Consulting/Training 
TDD Pattern 
RED 
write a failing test 
GREEN 
write enough code 
to pass 
REFACTOR 
engineer the code
Anatomy of a Unit Test 
Consulting/Training 
Arrange 
• Assumptions 
• Expectations 
Act 
• Execute 
• Results 
Assert 
• Compare 
• Report
Consulting/Training 
TDD Kata 
 Daily exercise – 30 minutes or less 
 Roy Osherove, author of “The Art of Unit Testing”, Manning 
Publications 
 http://osherove.com/tdd-kata-1/ 
 Let’s code!
The String Calculator Kata 
Consulting/Training
Consulting/Training 
StringCalculator Kata
Consulting/Training 
Questions? 
joelcochran@gmail.com

Más contenido relacionado

La actualidad más candente

Mca5020 advanced software engineering-de
Mca5020   advanced software engineering-deMca5020   advanced software engineering-de
Mca5020 advanced software engineering-desmumbahelp
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentJosh Candish
 
Programming interview preparation
Programming interview preparationProgramming interview preparation
Programming interview preparationbigdata trunk
 
Level Up Your Automated Tests
Level Up Your Automated TestsLevel Up Your Automated Tests
Level Up Your Automated TestsTrisha Gee
 
2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming liveJohannes Brodwall
 
Agile Testing 20021015
Agile Testing 20021015Agile Testing 20021015
Agile Testing 20021015Raghu Karnati
 
Should you be your own judge?
Should you be your own judge?Should you be your own judge?
Should you be your own judge?Achyut Pokhrel
 
Level Up Your Automated Tests
Level Up Your Automated TestsLevel Up Your Automated Tests
Level Up Your Automated TestsTrisha Gee
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven DevelopmentMichael Denomy
 
Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect coupleStephen Tucker
 
Test driven developement
Test driven developementTest driven developement
Test driven developementBhavik Panchal
 
Pair programming and introduction to TDD
Pair programming and introduction to TDDPair programming and introduction to TDD
Pair programming and introduction to TDDArati Joshi
 
TDD and more than 9000 tries to sell it to a customer
TDD and more than 9000 tries to sell it to a customerTDD and more than 9000 tries to sell it to a customer
TDD and more than 9000 tries to sell it to a customerAnuar Nurmakanov
 
Istqb foundation level
Istqb foundation levelIstqb foundation level
Istqb foundation levelLe Trung Hieu
 
Stop fearing legacy code
Stop fearing legacy codeStop fearing legacy code
Stop fearing legacy codeYaki Koren
 

La actualidad más candente (20)

Mca5020 advanced software engineering-de
Mca5020   advanced software engineering-deMca5020   advanced software engineering-de
Mca5020 advanced software engineering-de
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Programming interview preparation
Programming interview preparationProgramming interview preparation
Programming interview preparation
 
Level Up Your Automated Tests
Level Up Your Automated TestsLevel Up Your Automated Tests
Level Up Your Automated Tests
 
2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live
 
Agile Testing 20021015
Agile Testing 20021015Agile Testing 20021015
Agile Testing 20021015
 
Should you be your own judge?
Should you be your own judge?Should you be your own judge?
Should you be your own judge?
 
Level Up Your Automated Tests
Level Up Your Automated TestsLevel Up Your Automated Tests
Level Up Your Automated Tests
 
(A)TDD The what, why and how
(A)TDD The what, why and how(A)TDD The what, why and how
(A)TDD The what, why and how
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect couple
 
TDD talk
TDD talkTDD talk
TDD talk
 
Test driven developement
Test driven developementTest driven developement
Test driven developement
 
Refactoring legacy code
Refactoring legacy codeRefactoring legacy code
Refactoring legacy code
 
Pair programming and introduction to TDD
Pair programming and introduction to TDDPair programming and introduction to TDD
Pair programming and introduction to TDD
 
Design talk
Design talkDesign talk
Design talk
 
TDD and more than 9000 tries to sell it to a customer
TDD and more than 9000 tries to sell it to a customerTDD and more than 9000 tries to sell it to a customer
TDD and more than 9000 tries to sell it to a customer
 
Istqb foundation level
Istqb foundation levelIstqb foundation level
Istqb foundation level
 
Stop fearing legacy code
Stop fearing legacy codeStop fearing legacy code
Stop fearing legacy code
 
Xtreme Programming
Xtreme ProgrammingXtreme Programming
Xtreme Programming
 

Destacado

Software Testing and Quality Assurance Assignment 2
Software Testing and Quality Assurance Assignment 2Software Testing and Quality Assurance Assignment 2
Software Testing and Quality Assurance Assignment 2Gurpreet singh
 
Seeking Assignments in QA/QC , Project Site , Piping Welding/Fabrication , In...
Seeking Assignments in QA/QC , Project Site , Piping Welding/Fabrication , In...Seeking Assignments in QA/QC , Project Site , Piping Welding/Fabrication , In...
Seeking Assignments in QA/QC , Project Site , Piping Welding/Fabrication , In...Shadab Haider Zaidi
 
Software Testing and Quality Assurance Assignment 3
Software Testing and Quality Assurance Assignment 3Software Testing and Quality Assurance Assignment 3
Software Testing and Quality Assurance Assignment 3Gurpreet singh
 
Software Testing Interview Q&A – part 1
Software Testing Interview Q&A – part 1Software Testing Interview Q&A – part 1
Software Testing Interview Q&A – part 1Khoa Bui
 
Multiplateform testing
Multiplateform testingMultiplateform testing
Multiplateform testingGurpreet singh
 
Fundamentals of Testing 2
Fundamentals of Testing 2Fundamentals of Testing 2
Fundamentals of Testing 2Hoang Nguyen
 
Software project management
Software project managementSoftware project management
Software project managementSaumya Sahu
 
Some Commonly Asked Question For Software Testing
Some Commonly Asked Question For Software TestingSome Commonly Asked Question For Software Testing
Some Commonly Asked Question For Software TestingKumari Warsha Goel
 
Fresher interview question for software testing (QA) manual + basic automation
Fresher interview question for software testing (QA) manual + basic automationFresher interview question for software testing (QA) manual + basic automation
Fresher interview question for software testing (QA) manual + basic automationRakesh Hansalia
 
Testing Software Solutions
Testing Software SolutionsTesting Software Solutions
Testing Software Solutionsgavhays
 
Software testing - basics
Software testing - basicsSoftware testing - basics
Software testing - basicsPrasad Gali
 
Software testing quiz questions and answers
Software testing quiz questions and answersSoftware testing quiz questions and answers
Software testing quiz questions and answersRajendraG
 
ISTQB Foundation level Sample Paper - Part 3
ISTQB Foundation level Sample Paper - Part 3 ISTQB Foundation level Sample Paper - Part 3
ISTQB Foundation level Sample Paper - Part 3 Parul Chotalia
 
Software Requirement Specification
Software Requirement SpecificationSoftware Requirement Specification
Software Requirement SpecificationVishal Singh
 
Software testing objective_types
Software testing objective_typesSoftware testing objective_types
Software testing objective_typessangeeswaran
 

Destacado (18)

Software Testing and Quality Assurance Assignment 2
Software Testing and Quality Assurance Assignment 2Software Testing and Quality Assurance Assignment 2
Software Testing and Quality Assurance Assignment 2
 
Seeking Assignments in QA/QC , Project Site , Piping Welding/Fabrication , In...
Seeking Assignments in QA/QC , Project Site , Piping Welding/Fabrication , In...Seeking Assignments in QA/QC , Project Site , Piping Welding/Fabrication , In...
Seeking Assignments in QA/QC , Project Site , Piping Welding/Fabrication , In...
 
Software Testing and Quality Assurance Assignment 3
Software Testing and Quality Assurance Assignment 3Software Testing and Quality Assurance Assignment 3
Software Testing and Quality Assurance Assignment 3
 
Software Testing Interview Q&A – part 1
Software Testing Interview Q&A – part 1Software Testing Interview Q&A – part 1
Software Testing Interview Q&A – part 1
 
Multiplateform testing
Multiplateform testingMultiplateform testing
Multiplateform testing
 
Fundamentals of Testing 2
Fundamentals of Testing 2Fundamentals of Testing 2
Fundamentals of Testing 2
 
Software project management
Software project managementSoftware project management
Software project management
 
Some Commonly Asked Question For Software Testing
Some Commonly Asked Question For Software TestingSome Commonly Asked Question For Software Testing
Some Commonly Asked Question For Software Testing
 
Fresher interview question for software testing (QA) manual + basic automation
Fresher interview question for software testing (QA) manual + basic automationFresher interview question for software testing (QA) manual + basic automation
Fresher interview question for software testing (QA) manual + basic automation
 
Testing Software Solutions
Testing Software SolutionsTesting Software Solutions
Testing Software Solutions
 
Manual Testing.
Manual Testing.Manual Testing.
Manual Testing.
 
Gosecure Software Testing
Gosecure Software TestingGosecure Software Testing
Gosecure Software Testing
 
Software testing - basics
Software testing - basicsSoftware testing - basics
Software testing - basics
 
Software testing quiz questions and answers
Software testing quiz questions and answersSoftware testing quiz questions and answers
Software testing quiz questions and answers
 
ISTQB Foundation level Sample Paper - Part 3
ISTQB Foundation level Sample Paper - Part 3 ISTQB Foundation level Sample Paper - Part 3
ISTQB Foundation level Sample Paper - Part 3
 
Software engineering-quiz
Software engineering-quizSoftware engineering-quiz
Software engineering-quiz
 
Software Requirement Specification
Software Requirement SpecificationSoftware Requirement Specification
Software Requirement Specification
 
Software testing objective_types
Software testing objective_typesSoftware testing objective_types
Software testing objective_types
 

Similar a Intro to Test Driven Development (TDD) and the String Calculator Kata

Bcc exceed ste_cert
Bcc exceed ste_certBcc exceed ste_cert
Bcc exceed ste_certSusan L.
 
This isn't what you think it is
This isn't what you think it isThis isn't what you think it is
This isn't what you think it isJoel Cochran
 
Automated Unit Testing and TDD
Automated Unit Testing and TDDAutomated Unit Testing and TDD
Automated Unit Testing and TDDGreg Sohl
 
Full Stack Software Development
Full Stack Software DevelopmentFull Stack Software Development
Full Stack Software DevelopmentLearnbay
 
Continuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software WestContinuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software WestCory Foy
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingUtkarsh Khare
 
Tom van Ees - Academic and Commercial software Development
Tom van Ees - Academic and Commercial software DevelopmentTom van Ees - Academic and Commercial software Development
Tom van Ees - Academic and Commercial software DevelopmentDavinci software
 
Developers Nepal Meetup #4 Report
Developers Nepal Meetup #4 ReportDevelopers Nepal Meetup #4 Report
Developers Nepal Meetup #4 ReportPunit Jajodia
 
DevOps Roadtrip Final Speaking Deck
DevOps Roadtrip Final Speaking Deck DevOps Roadtrip Final Speaking Deck
DevOps Roadtrip Final Speaking Deck VictorOps
 
I Don't Code, Am I No Longer Useful
I Don't Code, Am I No Longer UsefulI Don't Code, Am I No Longer Useful
I Don't Code, Am I No Longer UsefulMaaret Pyhäjärvi
 
CETS 2011, Mark Steiner, Top 10 Ways to Make Your eLearning Project Successful
CETS 2011, Mark Steiner, Top 10 Ways to Make Your eLearning Project SuccessfulCETS 2011, Mark Steiner, Top 10 Ways to Make Your eLearning Project Successful
CETS 2011, Mark Steiner, Top 10 Ways to Make Your eLearning Project SuccessfulChicago eLearning & Technology Showcase
 
How agile is your team
How agile is your teamHow agile is your team
How agile is your teamPhani Bhushan
 
Career Counseling for Embedded Systems Wannabes
Career Counseling for Embedded Systems WannabesCareer Counseling for Embedded Systems Wannabes
Career Counseling for Embedded Systems WannabesVeda Solutions
 
Microsoft SQL Server Training, ASP.NET Training, SQL Server, .NET 4.0 - Syner...
Microsoft SQL Server Training, ASP.NET Training, SQL Server, .NET 4.0 - Syner...Microsoft SQL Server Training, ASP.NET Training, SQL Server, .NET 4.0 - Syner...
Microsoft SQL Server Training, ASP.NET Training, SQL Server, .NET 4.0 - Syner...Synergetics Learning and Cloud Consulting
 
Quality Metrics: The Dirty Word in the Room
Quality Metrics: The Dirty Word in the RoomQuality Metrics: The Dirty Word in the Room
Quality Metrics: The Dirty Word in the RoomJosiah Renaudin
 

Similar a Intro to Test Driven Development (TDD) and the String Calculator Kata (20)

Fakes
FakesFakes
Fakes
 
Bcc exceed ste_cert
Bcc exceed ste_certBcc exceed ste_cert
Bcc exceed ste_cert
 
This isn't what you think it is
This isn't what you think it isThis isn't what you think it is
This isn't what you think it is
 
StarCanada_EB-Final
StarCanada_EB-FinalStarCanada_EB-Final
StarCanada_EB-Final
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
 
Automated Unit Testing and TDD
Automated Unit Testing and TDDAutomated Unit Testing and TDD
Automated Unit Testing and TDD
 
Skilling Entry Level Engineers in IoT - A Practical Approach
Skilling Entry Level Engineers in IoT - A Practical ApproachSkilling Entry Level Engineers in IoT - A Practical Approach
Skilling Entry Level Engineers in IoT - A Practical Approach
 
Full Stack Software Development
Full Stack Software DevelopmentFull Stack Software Development
Full Stack Software Development
 
Continuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software WestContinuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software West
 
Agile testing
Agile testingAgile testing
Agile testing
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
 
Tom van Ees - Academic and Commercial software Development
Tom van Ees - Academic and Commercial software DevelopmentTom van Ees - Academic and Commercial software Development
Tom van Ees - Academic and Commercial software Development
 
Developers Nepal Meetup #4 Report
Developers Nepal Meetup #4 ReportDevelopers Nepal Meetup #4 Report
Developers Nepal Meetup #4 Report
 
DevOps Roadtrip Final Speaking Deck
DevOps Roadtrip Final Speaking Deck DevOps Roadtrip Final Speaking Deck
DevOps Roadtrip Final Speaking Deck
 
I Don't Code, Am I No Longer Useful
I Don't Code, Am I No Longer UsefulI Don't Code, Am I No Longer Useful
I Don't Code, Am I No Longer Useful
 
CETS 2011, Mark Steiner, Top 10 Ways to Make Your eLearning Project Successful
CETS 2011, Mark Steiner, Top 10 Ways to Make Your eLearning Project SuccessfulCETS 2011, Mark Steiner, Top 10 Ways to Make Your eLearning Project Successful
CETS 2011, Mark Steiner, Top 10 Ways to Make Your eLearning Project Successful
 
How agile is your team
How agile is your teamHow agile is your team
How agile is your team
 
Career Counseling for Embedded Systems Wannabes
Career Counseling for Embedded Systems WannabesCareer Counseling for Embedded Systems Wannabes
Career Counseling for Embedded Systems Wannabes
 
Microsoft SQL Server Training, ASP.NET Training, SQL Server, .NET 4.0 - Syner...
Microsoft SQL Server Training, ASP.NET Training, SQL Server, .NET 4.0 - Syner...Microsoft SQL Server Training, ASP.NET Training, SQL Server, .NET 4.0 - Syner...
Microsoft SQL Server Training, ASP.NET Training, SQL Server, .NET 4.0 - Syner...
 
Quality Metrics: The Dirty Word in the Room
Quality Metrics: The Dirty Word in the RoomQuality Metrics: The Dirty Word in the Room
Quality Metrics: The Dirty Word in the Room
 

Último

What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 

Último (20)

What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 

Intro to Test Driven Development (TDD) and the String Calculator Kata

  • 1. Intro to Test Driven Development (TDD) Consulting/Training
  • 2. Consulting/Training About Me  Microsoft Client Development MVP  ASPInsider  Twitter: @joelcochran  Email: joelcochran@gmail.com  Blog: joelcochran.com  Lead Developer, WintellectNOW
  • 3. Consulting/Training About Wintellect Founded by top experts on Microsoft – Jeffrey Richter, Jeff Prosise, and John Robbins – we pull out all the stops to help our customers achieve their goals through advanced software-based consulting and training solutions. consulting Wintellect helps you build better software, faster, tackling the tough projects and solving the software and technology questions that help you transform your business.  Architecture, Analysis and Design  Full lifecycle software development  Debugging and Performance tuning  Database design and development training Wintellect's courses are written and taught by some of the biggest and most respected names in the Microsoft programming industry.  Learn from the best. Access the same training Microsoft’s developers enjoy  Real world knowledge and solutions on both current and cutting edge technologies  Flexibility in training options – onsite, virtual, on demand who we are
  • 4. Wintellect’s On-Demand Video Training Solution Try it free Code: <INSERT CODE HERE> WintellectNOW.com COCHRAN-13 Authors Enjoy:  Royalty Income  Personal Branding  Cross-Sell Opps  Free library access Subscribers Enjoy:  Expert Instructors  Quality Content  Practical Application  All Devices Consulting/Training Individuals | Businesses | Enterprise Organizations
  • 5. Interview with a Method Consulting/Training
  • 6. The Multiply Method Signature Int32 Multiply(Int32[] values) Consulting/Training
  • 7. Consulting/Training Question #1 What parameter(s) do you take? An Array of Int32
  • 8. Consulting/Training Question #2 What value type do you return? Int32
  • 9. Consulting/Training Question #3 What happens when I pass you: [3, 4]? I don’t know
  • 10. Consulting/Training Question #4 What happens when I pass you: [7]? I don’t know
  • 11. Consulting/Training Question #5 What happens when I pass you: [-5, 12, 10, -3]? I don’t know
  • 12. Consulting/Training Question #6 What happens when I pass you: null? I don’t know
  • 13. Consulting/Training Question #7 What happens when I pass you: [23, Int32.MaxValue]? I don’t know
  • 14. Consulting/Training Question #8 You don’t seem to know much… If you don’t know the answer to these questions, who does? The Unit Tests
  • 15. Consulting/Training What is a Unit Test?  Code that tests code  Small discrete chunks (units)  One test, one condition  Based on assumptions  Should be automated and repeatable
  • 16. What a Unit Test is Not Consulting/Training  An end-to-end test  Connected to live data  Performing external functions (like sending an Email)  User tests
  • 17. Consulting/Training Why write Unit Tests?  Test code to ensure proper functionality given certain assumptions  Exercise code without running the app  Write once, run a million times  Guards against unintended consequences  Tests define success
  • 18. Consulting/Training What is TDD?  Unit Tests are written before the code  Helps shape the code to the task at hand  Provides focus (YAGNI)  The test defines success  Run all tests every time
  • 19. Consulting/Training TDD Pattern RED write a failing test GREEN write enough code to pass REFACTOR engineer the code
  • 20. Anatomy of a Unit Test Consulting/Training Arrange • Assumptions • Expectations Act • Execute • Results Assert • Compare • Report
  • 21. Consulting/Training TDD Kata  Daily exercise – 30 minutes or less  Roy Osherove, author of “The Art of Unit Testing”, Manning Publications  http://osherove.com/tdd-kata-1/  Let’s code!
  • 22. The String Calculator Kata Consulting/Training

Notas del editor

  1. Actual result == Int32.MaxValue – (multiplier – 1) == 2147483625 Int32.MaxValue = 2147483647 Every time you multiply (except for * 1) you overflow the Integer value Subtract 1 for the value of 0 every time this happens