SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
Email (samnang.chhun@gmail.com)
Blog (http://tech.wowkhmer.com)
Rails Developer
.NET Developer
About Testing!
Test Last or DDD (Design Driven Tests)
Short development iterations
Is a design process
Based on requirement and pre-written test
cases
Tests are your first users
The goal is to produce working clean code that
fulfills requirements
If TDD hurts then you're doing it wrong
Unnecessary Codes
Unchangeable Codes
Unintelligible Code
Makes you think about required behavior.
Provides documentation.
Improves quality.
Reduces speculative code.
Less time debugging.
Confidence in change
Discover usability issues early
I don’t have time to unit test.
The client pays me to develop code, not write
unit test.
I am supporting a legacy application without
unit tests.
QA and User Acceptance Testing is far more
effective in finding bugs.
I don’t know how to unit test, or I don’t know
how to write good unit tests.
It forces you to really understand the code.
It forces you to really understand the tests
It forces you to create code that is truly reusable
and modular and testable
These forces drive you to keep your code and
your tests simple and easy to understand.
Enabling TDD
TDD Cycle
Choosing the First Test?
Green Bar Patterns
State-based vs. Interaction-based Unit Testing
NUnit         Resharper
MbUnit        TDD.NET
VSTS          Refactor Pro!
xUnit.net     Visual Studio
Moq
Rhino Mocks
create a
              failing
               test




 remove                   write
duplicatio                 just
 n clarify              enough
  intent                 to pass
RED




Refactor         Green
The simplest.
The essence.




If you need to write code that is untested,
choose a simpler test.
If the essence approach takes to much time to
implement, choose a simpler test.
Small and focused
Intention revealing
Repeatable
Independent
Have no side-effects
Description should be
• Domain-specific
• Suitable for customer comprehension
• Understandable in absence of code
Writing descriptions
• Think about behavior
• Think about the context of the behavior
• Focus on the words, not the implementation
Fake It(Til You Make It)
   Start with hardcoded results and wait until later
   tests to force them to become real.
Triangulate To Abstraction
   Make the code abstract only when you have two or
   more examples.
Obvious Implementation
   aka Don't Be Stupid
   If you really, really, honestly know the right way to
   implement it, then write it that way.
Test Driven Development
Test Driven Development

Weitere ähnliche Inhalte

Was ist angesagt?

Best Practices of Software Development
Best Practices of Software DevelopmentBest Practices of Software Development
Best Practices of Software DevelopmentFolio3 Software
 
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
 
Level Up Your Automated Tests
Level Up Your Automated TestsLevel Up Your Automated Tests
Level Up Your Automated TestsTrisha Gee
 
Test-Driven Development Reference Card
Test-Driven Development Reference CardTest-Driven Development Reference Card
Test-Driven Development Reference CardSeapine Software
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentbhochhi
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolatorMaslowB
 
Roy Osherove TDD From Scratch
Roy Osherove TDD From ScratchRoy Osherove TDD From Scratch
Roy Osherove TDD From ScratchRoy Osherove
 
Training methdology testers to developers
Training methdology   testers to developersTraining methdology   testers to developers
Training methdology testers to developersGurumurthy Ramamurthy
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentShawn Jones
 
Code Review Best Practices
Code Review Best PracticesCode Review Best Practices
Code Review Best PracticesTrisha Gee
 
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 developmentAnh Lê
 
YAGNI Principle and Clean Code
YAGNI Principle and Clean CodeYAGNI Principle and Clean Code
YAGNI Principle and Clean CodeLuan Reffatti
 
TDD- Test Driven Development
TDD- Test Driven DevelopmentTDD- Test Driven Development
TDD- Test Driven DevelopmentLiza Antoun
 
Good Unit Tests Ask For Quality Code
Good Unit Tests Ask For Quality CodeGood Unit Tests Ask For Quality Code
Good Unit Tests Ask For Quality CodeFlorin Coros
 

Was ist angesagt? (20)

Best Practices of Software Development
Best Practices of Software DevelopmentBest Practices of Software Development
Best Practices of Software Development
 
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
 
Level Up Your Automated Tests
Level Up Your Automated TestsLevel Up Your Automated Tests
Level Up Your Automated Tests
 
Test-Driven Development Reference Card
Test-Driven Development Reference CardTest-Driven Development Reference Card
Test-Driven Development Reference Card
 
Clean code
Clean codeClean code
Clean code
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Code Review
Code ReviewCode Review
Code Review
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolator
 
Roy Osherove TDD From Scratch
Roy Osherove TDD From ScratchRoy Osherove TDD From Scratch
Roy Osherove TDD From Scratch
 
Best pratice
Best praticeBest pratice
Best pratice
 
Training methdology testers to developers
Training methdology   testers to developersTraining methdology   testers to developers
Training methdology testers to developers
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven Development
 
Code Review Best Practices
Code Review Best PracticesCode Review Best Practices
Code Review Best Practices
 
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
 
Testing 101: Three Rules for Testing at Ombu Labs
Testing 101: Three Rules for Testing at Ombu Labs Testing 101: Three Rules for Testing at Ombu Labs
Testing 101: Three Rules for Testing at Ombu Labs
 
YAGNI Principle and Clean Code
YAGNI Principle and Clean CodeYAGNI Principle and Clean Code
YAGNI Principle and Clean Code
 
TDD- Test Driven Development
TDD- Test Driven DevelopmentTDD- Test Driven Development
TDD- Test Driven Development
 
Good Unit Tests Ask For Quality Code
Good Unit Tests Ask For Quality CodeGood Unit Tests Ask For Quality Code
Good Unit Tests Ask For Quality Code
 

Ähnlich wie Test Driven Development

Automated Unit Testing and TDD
Automated Unit Testing and TDDAutomated Unit Testing and TDD
Automated Unit Testing and TDDGreg Sohl
 
Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential SkillsJohn Choi
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven DevelopmentMichael Denomy
 
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development Amir Assad
 
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 2019Paulo Clavijo
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is ImportaintSana Nasar
 
Pairing w developers_stpconpics
Pairing w developers_stpconpicsPairing w developers_stpconpics
Pairing w developers_stpconpicsLanette Creamer
 
Introduction to test programming
Introduction to test programmingIntroduction to test programming
Introduction to test programmingopenfinanceDev
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovSvetlin Nakov
 
Unit testing
Unit testingUnit testing
Unit testingPiXeL16
 
Test Driven Development with Laravel
Test Driven Development with LaravelTest Driven Development with Laravel
Test Driven Development with LaravelTyler Johnston
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingUtkarsh Khare
 
TDD for Testers Workshop
TDD for Testers WorkshopTDD for Testers Workshop
TDD for Testers WorkshopSarah Usher
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionPyxis Technologies
 

Ähnlich wie Test Driven Development (20)

Tdd
TddTdd
Tdd
 
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
 
Intro to TDD
Intro to TDDIntro to TDD
Intro to TDD
 
Automated Unit Testing and TDD
Automated Unit Testing and TDDAutomated Unit Testing and TDD
Automated Unit Testing and TDD
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential Skills
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 
Test-Driven Development
 Test-Driven Development  Test-Driven Development
Test-Driven Development
 
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
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is Importaint
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
 
Pairing w developers_stpconpics
Pairing w developers_stpconpicsPairing w developers_stpconpics
Pairing w developers_stpconpics
 
Introduction to test programming
Introduction to test programmingIntroduction to test programming
Introduction to test programming
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
 
Unit testing
Unit testingUnit testing
Unit testing
 
Test Driven Development with Laravel
Test Driven Development with LaravelTest Driven Development with Laravel
Test Driven Development with Laravel
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
 
TDD for Testers Workshop
TDD for Testers WorkshopTDD for Testers Workshop
TDD for Testers Workshop
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and Adoption
 

Mehr von Samnang Chhun

Software developer career growth
Software developer career growthSoftware developer career growth
Software developer career growthSamnang Chhun
 
Why i love ruby than x
Why i love ruby than xWhy i love ruby than x
Why i love ruby than xSamnang Chhun
 
12 Things Every Programmer Should Know
12 Things Every Programmer Should Know12 Things Every Programmer Should Know
12 Things Every Programmer Should KnowSamnang Chhun
 
The visitor design pattern
The visitor design patternThe visitor design pattern
The visitor design patternSamnang Chhun
 
Peforming Code Katas
Peforming Code KatasPeforming Code Katas
Peforming Code KatasSamnang Chhun
 
Introduction To Share Vision
Introduction To Share VisionIntroduction To Share Vision
Introduction To Share VisionSamnang Chhun
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With SubversionSamnang Chhun
 
NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)Samnang Chhun
 

Mehr von Samnang Chhun (10)

Find your passion
Find your passionFind your passion
Find your passion
 
Software developer career growth
Software developer career growthSoftware developer career growth
Software developer career growth
 
Why i love ruby than x
Why i love ruby than xWhy i love ruby than x
Why i love ruby than x
 
12 Things Every Programmer Should Know
12 Things Every Programmer Should Know12 Things Every Programmer Should Know
12 Things Every Programmer Should Know
 
The visitor design pattern
The visitor design patternThe visitor design pattern
The visitor design pattern
 
Peforming Code Katas
Peforming Code KatasPeforming Code Katas
Peforming Code Katas
 
Introduction To Share Vision
Introduction To Share VisionIntroduction To Share Vision
Introduction To Share Vision
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With Subversion
 
Layering
LayeringLayering
Layering
 
NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)
 

Kürzlich hochgeladen

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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 FresherRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
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...Martijn de Jong
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Kürzlich hochgeladen (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Test Driven Development

  • 1.
  • 3.
  • 4.
  • 5. About Testing! Test Last or DDD (Design Driven Tests)
  • 6. Short development iterations Is a design process Based on requirement and pre-written test cases Tests are your first users The goal is to produce working clean code that fulfills requirements If TDD hurts then you're doing it wrong
  • 8. Makes you think about required behavior. Provides documentation. Improves quality. Reduces speculative code. Less time debugging. Confidence in change Discover usability issues early
  • 9. I don’t have time to unit test. The client pays me to develop code, not write unit test. I am supporting a legacy application without unit tests. QA and User Acceptance Testing is far more effective in finding bugs. I don’t know how to unit test, or I don’t know how to write good unit tests.
  • 10. It forces you to really understand the code. It forces you to really understand the tests It forces you to create code that is truly reusable and modular and testable These forces drive you to keep your code and your tests simple and easy to understand.
  • 11. Enabling TDD TDD Cycle Choosing the First Test? Green Bar Patterns State-based vs. Interaction-based Unit Testing
  • 12. NUnit Resharper MbUnit TDD.NET VSTS Refactor Pro! xUnit.net Visual Studio Moq Rhino Mocks
  • 13. create a failing test remove write duplicatio just n clarify enough intent to pass
  • 14. RED Refactor Green
  • 15.
  • 16. The simplest. The essence. If you need to write code that is untested, choose a simpler test. If the essence approach takes to much time to implement, choose a simpler test.
  • 17. Small and focused Intention revealing Repeatable Independent Have no side-effects
  • 18. Description should be • Domain-specific • Suitable for customer comprehension • Understandable in absence of code Writing descriptions • Think about behavior • Think about the context of the behavior • Focus on the words, not the implementation
  • 19.
  • 20. Fake It(Til You Make It) Start with hardcoded results and wait until later tests to force them to become real. Triangulate To Abstraction Make the code abstract only when you have two or more examples. Obvious Implementation aka Don't Be Stupid If you really, really, honestly know the right way to implement it, then write it that way.