SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
ASYOU MEANT IT

‹
NFluent: the craft you needed ‹
to boost yourTDD‹
Brown Bag Lunch - 2014	

!
!
@tpierrain @cyrdup
WHO ARE WE?
use case driven (blog) Many Cores (blog)
UNITTESTS FROMTHE
TRENCHES

COMMENTS?
IDEAL WORLD
HARD FACT #1	

Tests assertions are needlessly difïŹcult to write
!
HARD FACT #1	

Tests assertions are needlessly difïŹcult to write
!
HARD FACT #1	

Tests assertions are needlessly difïŹcult to write
!
HARD FACT #1	

CONSEQUENCES
error-prone‹
reluctance to write tests‹
relevance of tests?
Tests assertions are needlessly difïŹcult to write
!
#1:WE DESERVE NO BRAINER
ASSERTIONS!
HARD FACT #2
Test intentions may be difïŹcult to grasp
HARD FACT #2
CONSEQUENCES
tests are hard to maintain‹
loss of trust in existing tests‹
Removal of failing tests?
Test intentions may be difïŹcult to grasp
#2: TESTS INTENTIONS
SHOULD BE OBVIOUS!
HARD FACT #3	

When reliable
 error messages are often unhelpful
HARD FACT #3	

CONSEQUENCES
Need to debug the failing test to understand‹
slowwww
 TDD feedback loop‹
Poor efïŹciency?!?	

When reliable
 error messages are often unhelpful
#3:WE WANTTRUSTWORTHY	

& HELPFUL ERROR MESSAGES!
#3:WE WANTTRUSTWORTHY	

& HELPFUL ERROR MESSAGES!
TDD IS NOT EASY

TDD IS NOT EASY

‹‹

 but NFluent will greatly help you
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
(source: http://www.thefreedictionary.com/ïŹ‚uent)	

UBIQUITOUS LANGUAGE
Fluent [ËˆïŹ‚uːənt]
adj
1. spoken or written with ease: ïŹ‚uent French.	

2. able to speak or write smoothly, easily, or readily: ïŹ‚uent
in three languages.	

3. smooth; easy; graceful: ïŹ‚uent motion	

4. ïŹ‚owing or capable of ïŹ‚owing; ïŹ‚uid	

!
[from Latin: ïŹ‚uere to ïŹ‚ow, stream]
#1: NO BRAINER ASSERTIONS!	

NFLUENT’S ANSWERS
#2: OBVIOUSTESTS INTENTIONS!	

#3:TRUSTWORTHY & HELPFUL ‹
ERROR MESSAGES!
#1: NO BRAINER ASSERTIONS!	

NFLUENT’S ANSWERS
A unique entry point for assertions (Check.That)‹‹
IntelliSense guided writing (a.k.a. the super-duper-happy dot xp)
#2: OBVIOUSTESTS INTENTIONS!	

#3:TRUSTWORTHY & HELPFUL ‹
ERROR MESSAGES!
#1: NO BRAINER ASSERTIONS!	

NFLUENT’S ANSWERS
Natural language assertions
A unique entry point for assertions (Check.That)‹‹
IntelliSense guided writing (a.k.a. the super-duper-happy dot xp)
#2: OBVIOUSTESTS INTENTIONS!	

#3:TRUSTWORTHY & HELPFUL ‹
ERROR MESSAGES!
#1: NO BRAINER ASSERTIONS!	

NFLUENT’S ANSWERS
Natural language assertions
A unique entry point for assertions (Check.That)‹‹
IntelliSense guided writing (a.k.a. the super-duper-happy dot xp)
Non ambiguous, contextualized and explicit error messages
#2: OBVIOUSTESTS INTENTIONS!	

#3:TRUSTWORTHY & HELPFUL ‹
ERROR MESSAGES!
COMBINING THOSE 3 WISHES, 	

WE CAN REACH OUR IDEAL:‹
EFFICIENT TDD!
!
!
!
!
!
!
!
NFLUENT SAMPLES
DEMO
‱ NFluent is	

‱ An OSS .NET library for ïŹ‚uent assertions	

‱ Independent and compliant with all major .NET test runners	

‱ Directly inspired by the awesome Java FEST assert library	

‱ Available on
IN A FEW WORDS
‱ A fully extensible model
‱ No need to wait the NFluent team to add your own
assertions on any kind of ‘value’	

‱ The opportunity to use your own ubiquitous language
(DSL) from within your tests	

!
‱ Some extra candies	

‱ Like the Properties extension method for IEnumerable	

‱ The HasFieldsWithSameValues(anonymous class)
BONUS FEATURES
!
!
‹
‹
‹
‹
‹
	

INTHE WILD
tpierrain malatrhwydupdob
FINAL QUESTION
!
!
!
!
!
‹
Does your test framework dictate the way you work,
or is it the other way around?
FINAL QUESTION
APPLYTDD!
APPLYTDD!
Use NFluent!
APPLYTDD!
Use NFluent!
APPLYTDD!
Use NFluent!
http://www.n-ïŹ‚uent.net
APPENDIX
TDD:A WORKFLOW
(like: FluentAssertion, SharpTests Ex, etc.)‹
‱ Their usage of lambda expression predicates hurts the ïŹ‚uent
experience	

	

 	

 new[] { 1, 2, 3 }.Should().Contain(item => item > 3, "at least {0} item should be larger than 3", 1);	

‱ (Red is dead, but) Should is weak
	

‱ We aim to be more ambitious in term of ïŹ‚uentness
NFLUENT VS. OTHER
ASSERTION LIBRARIES?
‱ For NFluent contributors
‱ No warning (all warn as ERROR)	

‱ No StyleCop warning (full rules)	

‱ 100% of test coverage - all test passed of course!
‱ The entire build lasts less than a minute (including all unit
tests)
DEFINITION OF DONE
!
!
!
!
!
!
!
BYTEST DEVELOPMENT DRIVEN IS?
‹
Use NFluent!
!
!
!
!
WRITEVALUABLETESTS
(NFluent logo © rhwy)	

!
http://www.n-ïŹ‚uent.net
Thank you!

Weitere Àhnliche Inhalte

Mehr von Thomas Pierrain

The 9 rules of debugging
The 9 rules of debuggingThe 9 rules of debugging
The 9 rules of debuggingThomas Pierrain
 
Hexagonal architecture vs Functional core / Imperative shell
Hexagonal architecture vs Functional core / Imperative shellHexagonal architecture vs Functional core / Imperative shell
Hexagonal architecture vs Functional core / Imperative shellThomas Pierrain
 
Une nuit dans l'hexagone
Une nuit dans l'hexagoneUne nuit dans l'hexagone
Une nuit dans l'hexagoneThomas Pierrain
 
As time goes by (episode 2)
As time goes by (episode 2)As time goes by (episode 2)
As time goes by (episode 2)Thomas Pierrain
 
Et si on parlait Éthique ?
Et si on parlait Éthique ?Et si on parlait Éthique ?
Et si on parlait Éthique ?Thomas Pierrain
 
Sortir de notre zone de confort
Sortir de notre zone de confortSortir de notre zone de confort
Sortir de notre zone de confortThomas Pierrain
 
L'Agilité a grande échelle : conserver l'esprit, pas la lettre
L'Agilité a grande échelle : conserver l'esprit, pas la lettreL'Agilité a grande échelle : conserver l'esprit, pas la lettre
L'Agilité a grande échelle : conserver l'esprit, pas la lettreThomas Pierrain
 
Legacy club (english version)
Legacy club (english version)Legacy club (english version)
Legacy club (english version)Thomas Pierrain
 
The art of Software Design
The art of Software DesignThe art of Software Design
The art of Software DesignThomas Pierrain
 
CQRS without event sourcing
CQRS without event sourcingCQRS without event sourcing
CQRS without event sourcingThomas Pierrain
 
Async await...oh wait!
Async await...oh wait!Async await...oh wait!
Async await...oh wait!Thomas Pierrain
 
Decouvrir CQRS (sans Event sourcing) par la pratique
Decouvrir CQRS (sans Event sourcing) par la pratiqueDecouvrir CQRS (sans Event sourcing) par la pratique
Decouvrir CQRS (sans Event sourcing) par la pratiqueThomas Pierrain
 
Decouvrir son sujet grace Ă  l'event storming
Decouvrir son sujet grace Ă  l'event stormingDecouvrir son sujet grace Ă  l'event storming
Decouvrir son sujet grace Ă  l'event stormingThomas Pierrain
 
Ddd reboot (english version)
Ddd reboot (english version)Ddd reboot (english version)
Ddd reboot (english version)Thomas Pierrain
 
Culture craft humantalks
Culture craft humantalksCulture craft humantalks
Culture craft humantalksThomas Pierrain
 
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureCoder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureThomas Pierrain
 
TDD is dead?!? Let's do an autospy (ncrafts.io)
TDD is dead?!? Let's do an autospy (ncrafts.io)TDD is dead?!? Let's do an autospy (ncrafts.io)
TDD is dead?!? Let's do an autospy (ncrafts.io)Thomas Pierrain
 
Culture Craft Devoxx 2015
Culture Craft Devoxx 2015Culture Craft Devoxx 2015
Culture Craft Devoxx 2015Thomas Pierrain
 
Faible latence, haut debit PerfUG (Septembre 2014)
Faible latence, haut debit PerfUG (Septembre 2014)Faible latence, haut debit PerfUG (Septembre 2014)
Faible latence, haut debit PerfUG (Septembre 2014)Thomas Pierrain
 

Mehr von Thomas Pierrain (20)

The 9 rules of debugging
The 9 rules of debuggingThe 9 rules of debugging
The 9 rules of debugging
 
Hexagonal architecture vs Functional core / Imperative shell
Hexagonal architecture vs Functional core / Imperative shellHexagonal architecture vs Functional core / Imperative shell
Hexagonal architecture vs Functional core / Imperative shell
 
Une nuit dans l'hexagone
Une nuit dans l'hexagoneUne nuit dans l'hexagone
Une nuit dans l'hexagone
 
Equiper sa voie
Equiper sa voieEquiper sa voie
Equiper sa voie
 
As time goes by (episode 2)
As time goes by (episode 2)As time goes by (episode 2)
As time goes by (episode 2)
 
Et si on parlait Éthique ?
Et si on parlait Éthique ?Et si on parlait Éthique ?
Et si on parlait Éthique ?
 
Sortir de notre zone de confort
Sortir de notre zone de confortSortir de notre zone de confort
Sortir de notre zone de confort
 
L'Agilité a grande échelle : conserver l'esprit, pas la lettre
L'Agilité a grande échelle : conserver l'esprit, pas la lettreL'Agilité a grande échelle : conserver l'esprit, pas la lettre
L'Agilité a grande échelle : conserver l'esprit, pas la lettre
 
Legacy club (english version)
Legacy club (english version)Legacy club (english version)
Legacy club (english version)
 
The art of Software Design
The art of Software DesignThe art of Software Design
The art of Software Design
 
CQRS without event sourcing
CQRS without event sourcingCQRS without event sourcing
CQRS without event sourcing
 
Async await...oh wait!
Async await...oh wait!Async await...oh wait!
Async await...oh wait!
 
Decouvrir CQRS (sans Event sourcing) par la pratique
Decouvrir CQRS (sans Event sourcing) par la pratiqueDecouvrir CQRS (sans Event sourcing) par la pratique
Decouvrir CQRS (sans Event sourcing) par la pratique
 
Decouvrir son sujet grace Ă  l'event storming
Decouvrir son sujet grace Ă  l'event stormingDecouvrir son sujet grace Ă  l'event storming
Decouvrir son sujet grace Ă  l'event storming
 
Ddd reboot (english version)
Ddd reboot (english version)Ddd reboot (english version)
Ddd reboot (english version)
 
Culture craft humantalks
Culture craft humantalksCulture craft humantalks
Culture craft humantalks
 
Coder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architectureCoder sans peur du changement avec la meme pas mal hexagonal architecture
Coder sans peur du changement avec la meme pas mal hexagonal architecture
 
TDD is dead?!? Let's do an autospy (ncrafts.io)
TDD is dead?!? Let's do an autospy (ncrafts.io)TDD is dead?!? Let's do an autospy (ncrafts.io)
TDD is dead?!? Let's do an autospy (ncrafts.io)
 
Culture Craft Devoxx 2015
Culture Craft Devoxx 2015Culture Craft Devoxx 2015
Culture Craft Devoxx 2015
 
Faible latence, haut debit PerfUG (Septembre 2014)
Faible latence, haut debit PerfUG (Septembre 2014)Faible latence, haut debit PerfUG (Septembre 2014)
Faible latence, haut debit PerfUG (Septembre 2014)
 

KĂŒrzlich hochgeladen

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžDelhi Call girls
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfWilly Marroquin (WillyDevNET)
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

KĂŒrzlich hochgeladen (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Vip Call Girls Noida âžĄïž Delhi âžĄïž 9999965857 No Advance 24HRS Live
Vip Call Girls Noida âžĄïž Delhi âžĄïž 9999965857 No Advance 24HRS LiveVip Call Girls Noida âžĄïž Delhi âžĄïž 9999965857 No Advance 24HRS Live
Vip Call Girls Noida âžĄïž Delhi âžĄïž 9999965857 No Advance 24HRS Live
 
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Call Girls In Mukherjee Nagar đŸ“± 9999965857 đŸ€© Delhi đŸ«Š HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar đŸ“±  9999965857  đŸ€© Delhi đŸ«Š HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar đŸ“±  9999965857  đŸ€© Delhi đŸ«Š HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar đŸ“± 9999965857 đŸ€© Delhi đŸ«Š HOT AND SEXY VVIP 🍎 SE...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

NFluent Brown bag lunch January 2014