SlideShare a Scribd company logo
Test Driven
Development
LE ANH
APOLLO13.VN
Outline
 Overview about TDD
 Why use TDD ?
 How to do ?
 TDD by Example
 Common mistakes in TDD
 When we use TDD ?
 Q&A
Overview about TDD
TDD stand for Test Driven Development (Test Driven Design)
Overview about TDD
Regardless of the programming language
Overview about TDD
TDD is a strong methodology
Without TDD TDD
Why use TDD ?
Clean code
Why use TDD ?
Without TDD Prevent bugs by TDD
Why use TDD ?
Design document
Why use TDD ?
Maintainable, flexible, easily extensible
Why use TDD ?
TDD change your mindset a bout programming & testing. You can
become a better programmer
How to do TDD?
Do it in baby stepsIs TDD Difficult ?
How to do TDD?
Mantra of TDD is “Red/Green/Refactor”
How to do TDD?
Red text is 3C rule. They help raise your idea
How to do TDD?
 We have a user story, use 3C rule to make your idea (baby
requirement)
Allow user input a
string to set the
display name when
he login. Max length
of string is 125
characters
How to do TDD?
 String can contain special characters ?
 What kind of special characters (!@#$%^&...) ?
 String can contain space ?
 String can contain number ?
 Min length of string ?
 String can not contain select, delete, update
because of SQL injection
 String can be duplicate ?
Note : Don’t think the requirement is very simple therefore we don’t
need to confirm with PO. Confirmation is a way to prevent bugs
TDD by examples
 Example 1: write a method that reverse last 2
characters of string.
 If null  return null, if empty  return empty, if
length of string equal 1  return itself
 Ex: “A”  “A”, “” “”, null  null, “AB” “BA”,
“RAIN”  “RANI”
TDD by examples
 Create first test case
TDD by examples
 Can not compile because StringHelper class is not created
TDD by examples
 After StringHelper class is created, run ALL TEST CASE to see
they(or one of them) fail
TDD by examples
 Make a litte change to pass this test cases
Question : Who has a better implementation ?
TDD by examples
 Run ALL TEST CASES to see they pass
TDD by examples
 We have just finished a baby step of TDD cycle. Repeat it
again.
TDD by examples
 After StringHelper class is created, run ALL TEST CASE to see
they(or one of them) fail
TDD by examples
 Refactor code to pass this test case
TDD by examples
 Run all test cases to see they pass
TDD by examples
 Refactor test code if necessary
TDD by examples
 Add new test case
TDD by examples
 After StringHelper class is created, run ALL TEST CASE to see
they(or one of them) fail
TDD by examples
 Refractor code to pass the test case
TDD by examples
 Run all test cases to see they pass
TDD by examples
 Add new test case, this test case will be pass without any
changes
TDD by examples
 Add new test case, this test case will be fail
TDD by examples
 Refactor code
TDD by examples
 Run all test cases, if they pass and you don’t have any test
case. The TDD cycle is completed. Refactor code if necessary
TDD by examples
Example 2: Refer the below link
http://technologyconversations.com/2013/12/20/test-driven-
development-tdd-example-walkthrough/
Common mistakes in TDD
Summary
Q&A
 What is the position of tester in agile test (TDD) ?
 What is BDD/ATDD ?
 What are the skill of tester, developer in scrum ?
 When we use TDD ?
 Is TDD dead ?
 Some questions from audiences…..

More Related Content

What's hot

Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
guestc8093a6
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)
nedirtv
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And MockingJoe Wilson
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentDhaval Dalal
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
Sergey Podolsky
 
Agile Test Driven Development
Agile Test Driven DevelopmentAgile Test Driven Development
Agile Test Driven Development
Viraf Karai
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
Nayanda Haberty
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
Derek Smith
 
JUnit 5
JUnit 5JUnit 5
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
Md. Enamul Haque Chowdhury
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
Naresh Jain
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
John Blum
 
Junit
JunitJunit
A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD)
CodeOps Technologies LLP
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable Design
Victor Rentea
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
Anuj Arora
 
Understanding Unit Testing
Understanding Unit TestingUnderstanding Unit Testing
Understanding Unit Testing
ikhwanhayat
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
Onkar Deshpande
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
Dror Helper
 
Introduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed ShreefIntroduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed Shreef
Ahmed Shreef
 

What's hot (20)

Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Agile Test Driven Development
Agile Test Driven DevelopmentAgile Test Driven Development
Agile Test Driven Development
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
JUnit 5
JUnit 5JUnit 5
JUnit 5
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Junit
JunitJunit
Junit
 
A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD) A Not-So-Serious Introduction to Test Driven Development (TDD)
A Not-So-Serious Introduction to Test Driven Development (TDD)
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable Design
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Understanding Unit Testing
Understanding Unit TestingUnderstanding Unit Testing
Understanding Unit Testing
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
Introduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed ShreefIntroduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed Shreef
 

Viewers also liked

Test-Driven Development (TDD)
Test-Driven Development (TDD)Test-Driven Development (TDD)
Test-Driven Development (TDD)
Brian Rasmussen
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Zohirul Alam Tiemoon
 
TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And Refactoring
Naresh Jain
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven developmenttoteb5
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Elad Elrom
 
TDD Overview
TDD OverviewTDD Overview
TDD Overview
Naresh Jain
 
Test driven development
Test driven developmentTest driven development
Test driven development
Nascenia IT
 
Tdd
TddTdd
ATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven DevelopmentATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven Development
Naresh Jain
 
Test Driven Development - For Girl Geeks Night Sydney
Test Driven Development - For Girl Geeks Night SydneyTest Driven Development - For Girl Geeks Night Sydney
Test Driven Development - For Girl Geeks Night SydneyJo Cranford
 
TDD-based workflow: Optimizing Development Process
TDD-based workflow: Optimizing Development ProcessTDD-based workflow: Optimizing Development Process
TDD-based workflow: Optimizing Development Process
Akbar Hidayat
 
Pragmatic agile model driven development using smart use cases
Pragmatic agile model driven development using smart use casesPragmatic agile model driven development using smart use cases
Pragmatic agile model driven development using smart use cases
Sander Hoogendoorn
 
Nhập môn BDD
Nhập môn BDDNhập môn BDD
Nhập môn BDDNgoc Dao
 
TDD and mock objects
TDD and mock objectsTDD and mock objects
TDD and mock objects
Steve Zhang
 
Using of TDD practices for Magento
Using of TDD practices for MagentoUsing of TDD practices for Magento
Using of TDD practices for Magento
Ivan Chepurnyi
 
TDD - Pós Graduação em Engenharia de Software Ágil
TDD - Pós Graduação em Engenharia de Software ÁgilTDD - Pós Graduação em Engenharia de Software Ágil
TDD - Pós Graduação em Engenharia de Software Ágil
Bruno Eustáquio
 
SITSP Developers 2016 - ABAP c/ TDD
SITSP Developers 2016 - ABAP c/ TDDSITSP Developers 2016 - ABAP c/ TDD
SITSP Developers 2016 - ABAP c/ TDD
Jose Nunes
 
Sms pro - bulk SMS sending software
Sms pro - bulk SMS sending softwareSms pro - bulk SMS sending software
Sms pro - bulk SMS sending software
Live Tecnologies
 

Viewers also liked (20)

Test-Driven Development (TDD)
Test-Driven Development (TDD)Test-Driven Development (TDD)
Test-Driven Development (TDD)
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
 
TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And Refactoring
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven development
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
 
TDD Overview
TDD OverviewTDD Overview
TDD Overview
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Tdd
TddTdd
Tdd
 
ATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven DevelopmentATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven Development
 
Test Driven Development - For Girl Geeks Night Sydney
Test Driven Development - For Girl Geeks Night SydneyTest Driven Development - For Girl Geeks Night Sydney
Test Driven Development - For Girl Geeks Night Sydney
 
TDD-based workflow: Optimizing Development Process
TDD-based workflow: Optimizing Development ProcessTDD-based workflow: Optimizing Development Process
TDD-based workflow: Optimizing Development Process
 
Pragmatic agile model driven development using smart use cases
Pragmatic agile model driven development using smart use casesPragmatic agile model driven development using smart use cases
Pragmatic agile model driven development using smart use cases
 
Nhập môn BDD
Nhập môn BDDNhập môn BDD
Nhập môn BDD
 
TDD and mock objects
TDD and mock objectsTDD and mock objects
TDD and mock objects
 
Using of TDD practices for Magento
Using of TDD practices for MagentoUsing of TDD practices for Magento
Using of TDD practices for Magento
 
TDD - Pós Graduação em Engenharia de Software Ágil
TDD - Pós Graduação em Engenharia de Software ÁgilTDD - Pós Graduação em Engenharia de Software Ágil
TDD - Pós Graduação em Engenharia de Software Ágil
 
SITSP Developers 2016 - ABAP c/ TDD
SITSP Developers 2016 - ABAP c/ TDDSITSP Developers 2016 - ABAP c/ TDD
SITSP Developers 2016 - ABAP c/ TDD
 
TDD para Java EE
TDD para Java EETDD para Java EE
TDD para Java EE
 
Sms pro - bulk SMS sending software
Sms pro - bulk SMS sending softwareSms pro - bulk SMS sending software
Sms pro - bulk SMS sending software
 
Web Config
Web ConfigWeb Config
Web Config
 

Similar to TDD - Test Driven Development

Lập trình hướng kiểm thử - Test Driven development
Lập trình hướng kiểm thử - Test Driven developmentLập trình hướng kiểm thử - Test Driven development
Lập trình hướng kiểm thử - Test Driven development
Anh Lê
 
TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012
Pietro Di Bello
 
Journey's diary developing a framework using tdd
Journey's diary   developing a framework using tddJourney's diary   developing a framework using tdd
Journey's diary developing a framework using tdd
eduardomg23
 
TDD Walkthrough - Encryption
TDD Walkthrough - EncryptionTDD Walkthrough - Encryption
TDD Walkthrough - Encryption
PeterKha2
 
JavaScript Unit Testing
JavaScript Unit TestingJavaScript Unit Testing
JavaScript Unit Testing
L&T Technology Services Limited
 
TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019
Paulo Clavijo
 
Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017
Xavi Hidalgo
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
Michael Denomy
 
TDD and Getting Paid
TDD and Getting PaidTDD and Getting Paid
TDD and Getting Paid
Rowan Merewood
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentSamnang Chhun
 
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd   seven years afterIan Cooper webinar for DDD Iran: Kent beck style tdd   seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
Iranian Domain-Driven Design Community
 
Getting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud ShaonGetting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud Shaon
Cefalo
 
The ten commandments of TDD
The ten commandments of TDDThe ten commandments of TDD
The ten commandments of TDDHernan Wilkinson
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentbhochhi
 
TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25Jeremy Kendall
 
Getting started with Test Driven Development
Getting started with Test Driven DevelopmentGetting started with Test Driven Development
Getting started with Test Driven Development
Ferdous Mahmud Shaon
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven DevelopmentLim Chanmann
 
BDD style Unit Testing
BDD style Unit TestingBDD style Unit Testing
BDD style Unit TestingWen-Tien Chang
 
TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012
Alan Christensen
 

Similar to TDD - Test Driven Development (20)

Lập trình hướng kiểm thử - Test Driven development
Lập trình hướng kiểm thử - Test Driven developmentLập trình hướng kiểm thử - Test Driven development
Lập trình hướng kiểm thử - Test Driven development
 
TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012
 
Journey's diary developing a framework using tdd
Journey's diary   developing a framework using tddJourney's diary   developing a framework using tdd
Journey's diary developing a framework using tdd
 
TDD Walkthrough - Encryption
TDD Walkthrough - EncryptionTDD Walkthrough - Encryption
TDD Walkthrough - Encryption
 
JavaScript Unit Testing
JavaScript Unit TestingJavaScript Unit Testing
JavaScript Unit Testing
 
TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019
 
Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
TDD and Getting Paid
TDD and Getting PaidTDD and Getting Paid
TDD and Getting Paid
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd   seven years afterIan Cooper webinar for DDD Iran: Kent beck style tdd   seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
 
Getting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud ShaonGetting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud Shaon
 
The ten commandments of TDD
The ten commandments of TDDThe ten commandments of TDD
The ten commandments of TDD
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25TDD in PHP - Memphis PHP 2011-08-25
TDD in PHP - Memphis PHP 2011-08-25
 
Getting started with Test Driven Development
Getting started with Test Driven DevelopmentGetting started with Test Driven Development
Getting started with Test Driven Development
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
Simple testable code
Simple testable codeSimple testable code
Simple testable code
 
BDD style Unit Testing
BDD style Unit TestingBDD style Unit Testing
BDD style Unit Testing
 
TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012
 

More from Tung Nguyen Thanh

How to become senior .net developer
How to become senior .net developerHow to become senior .net developer
How to become senior .net developer
Tung Nguyen Thanh
 
Docker for .net developer
Docker for .net developerDocker for .net developer
Docker for .net developer
Tung Nguyen Thanh
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
Tung Nguyen Thanh
 
SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6
Tung Nguyen Thanh
 
Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015
Tung Nguyen Thanh
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous Integration
Tung Nguyen Thanh
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL Database
Tung Nguyen Thanh
 
HaNoi Net Group Introduction
HaNoi Net Group IntroductionHaNoi Net Group Introduction
HaNoi Net Group Introduction
Tung Nguyen Thanh
 
Software architecture for high traffic website
Software architecture for high traffic websiteSoftware architecture for high traffic website
Software architecture for high traffic website
Tung Nguyen Thanh
 
Refactoring code in .net
Refactoring code in .netRefactoring code in .net
Refactoring code in .net
Tung Nguyen Thanh
 
Visual studio 2015 ide new features
Visual studio 2015 ide new featuresVisual studio 2015 ide new features
Visual studio 2015 ide new features
Tung Nguyen Thanh
 
Whatmakesoftwareflexible
WhatmakesoftwareflexibleWhatmakesoftwareflexible
Whatmakesoftwareflexible
Tung Nguyen Thanh
 
How to release every week case study of continuous integration
How to release every week case study of continuous integrationHow to release every week case study of continuous integration
How to release every week case study of continuous integration
Tung Nguyen Thanh
 
Xp not windows xp
Xp not windows xpXp not windows xp
Xp not windows xp
Tung Nguyen Thanh
 
Is xp still extreme
Is xp still extremeIs xp still extreme
Is xp still extreme
Tung Nguyen Thanh
 
Workshop fight legacy code write unit test
Workshop fight legacy code write unit testWorkshop fight legacy code write unit test
Workshop fight legacy code write unit test
Tung Nguyen Thanh
 
Windows Phone Introduction
Windows Phone IntroductionWindows Phone Introduction
Windows Phone Introduction
Tung Nguyen Thanh
 
Developing windows phone 7 application with silverlight
Developing windows phone 7 application with silverlightDeveloping windows phone 7 application with silverlight
Developing windows phone 7 application with silverlight
Tung Nguyen Thanh
 
Top 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTop 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and Answers
Tung Nguyen Thanh
 
New in Visual Studio and TFS 2013
New in Visual Studio and TFS 2013New in Visual Studio and TFS 2013
New in Visual Studio and TFS 2013
Tung Nguyen Thanh
 

More from Tung Nguyen Thanh (20)

How to become senior .net developer
How to become senior .net developerHow to become senior .net developer
How to become senior .net developer
 
Docker for .net developer
Docker for .net developerDocker for .net developer
Docker for .net developer
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6SignalR with ASP.NET MVC 6
SignalR with ASP.NET MVC 6
 
Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015Continuous Delivery with VS2015 and TFS2015
Continuous Delivery with VS2015 and TFS2015
 
Agile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous IntegrationAgile .NET Development with BDD and Continuous Integration
Agile .NET Development with BDD and Continuous Integration
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL Database
 
HaNoi Net Group Introduction
HaNoi Net Group IntroductionHaNoi Net Group Introduction
HaNoi Net Group Introduction
 
Software architecture for high traffic website
Software architecture for high traffic websiteSoftware architecture for high traffic website
Software architecture for high traffic website
 
Refactoring code in .net
Refactoring code in .netRefactoring code in .net
Refactoring code in .net
 
Visual studio 2015 ide new features
Visual studio 2015 ide new featuresVisual studio 2015 ide new features
Visual studio 2015 ide new features
 
Whatmakesoftwareflexible
WhatmakesoftwareflexibleWhatmakesoftwareflexible
Whatmakesoftwareflexible
 
How to release every week case study of continuous integration
How to release every week case study of continuous integrationHow to release every week case study of continuous integration
How to release every week case study of continuous integration
 
Xp not windows xp
Xp not windows xpXp not windows xp
Xp not windows xp
 
Is xp still extreme
Is xp still extremeIs xp still extreme
Is xp still extreme
 
Workshop fight legacy code write unit test
Workshop fight legacy code write unit testWorkshop fight legacy code write unit test
Workshop fight legacy code write unit test
 
Windows Phone Introduction
Windows Phone IntroductionWindows Phone Introduction
Windows Phone Introduction
 
Developing windows phone 7 application with silverlight
Developing windows phone 7 application with silverlightDeveloping windows phone 7 application with silverlight
Developing windows phone 7 application with silverlight
 
Top 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTop 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and Answers
 
New in Visual Studio and TFS 2013
New in Visual Studio and TFS 2013New in Visual Studio and TFS 2013
New in Visual Studio and TFS 2013
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 

TDD - Test Driven Development

  • 2. Outline  Overview about TDD  Why use TDD ?  How to do ?  TDD by Example  Common mistakes in TDD  When we use TDD ?  Q&A
  • 3. Overview about TDD TDD stand for Test Driven Development (Test Driven Design)
  • 4. Overview about TDD Regardless of the programming language
  • 5. Overview about TDD TDD is a strong methodology Without TDD TDD
  • 6. Why use TDD ? Clean code
  • 7. Why use TDD ? Without TDD Prevent bugs by TDD
  • 8. Why use TDD ? Design document
  • 9. Why use TDD ? Maintainable, flexible, easily extensible
  • 10. Why use TDD ? TDD change your mindset a bout programming & testing. You can become a better programmer
  • 11. How to do TDD? Do it in baby stepsIs TDD Difficult ?
  • 12. How to do TDD? Mantra of TDD is “Red/Green/Refactor”
  • 13. How to do TDD? Red text is 3C rule. They help raise your idea
  • 14. How to do TDD?  We have a user story, use 3C rule to make your idea (baby requirement) Allow user input a string to set the display name when he login. Max length of string is 125 characters
  • 15. How to do TDD?  String can contain special characters ?  What kind of special characters (!@#$%^&...) ?  String can contain space ?  String can contain number ?  Min length of string ?  String can not contain select, delete, update because of SQL injection  String can be duplicate ? Note : Don’t think the requirement is very simple therefore we don’t need to confirm with PO. Confirmation is a way to prevent bugs
  • 16. TDD by examples  Example 1: write a method that reverse last 2 characters of string.  If null  return null, if empty  return empty, if length of string equal 1  return itself  Ex: “A”  “A”, “” “”, null  null, “AB” “BA”, “RAIN”  “RANI”
  • 17. TDD by examples  Create first test case
  • 18. TDD by examples  Can not compile because StringHelper class is not created
  • 19. TDD by examples  After StringHelper class is created, run ALL TEST CASE to see they(or one of them) fail
  • 20. TDD by examples  Make a litte change to pass this test cases Question : Who has a better implementation ?
  • 21. TDD by examples  Run ALL TEST CASES to see they pass
  • 22. TDD by examples  We have just finished a baby step of TDD cycle. Repeat it again.
  • 23. TDD by examples  After StringHelper class is created, run ALL TEST CASE to see they(or one of them) fail
  • 24. TDD by examples  Refactor code to pass this test case
  • 25. TDD by examples  Run all test cases to see they pass
  • 26. TDD by examples  Refactor test code if necessary
  • 27. TDD by examples  Add new test case
  • 28. TDD by examples  After StringHelper class is created, run ALL TEST CASE to see they(or one of them) fail
  • 29. TDD by examples  Refractor code to pass the test case
  • 30. TDD by examples  Run all test cases to see they pass
  • 31. TDD by examples  Add new test case, this test case will be pass without any changes
  • 32. TDD by examples  Add new test case, this test case will be fail
  • 33. TDD by examples  Refactor code
  • 34. TDD by examples  Run all test cases, if they pass and you don’t have any test case. The TDD cycle is completed. Refactor code if necessary
  • 35. TDD by examples Example 2: Refer the below link http://technologyconversations.com/2013/12/20/test-driven- development-tdd-example-walkthrough/
  • 38. Q&A  What is the position of tester in agile test (TDD) ?  What is BDD/ATDD ?  What are the skill of tester, developer in scrum ?  When we use TDD ?  Is TDD dead ?  Some questions from audiences…..