SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Technical Practices in Agile-TDD
by
Prashant Pund
Certified SAFe Program Consultant
CSM, Agile Coach
AgileSoft Methodologies,Pune
prashant.pund@agilesoft.in
+919923073192
www.agilesoft.in
Event Backlog
• Theme: Agile Technical Practices
• Epic: TDD implementation
• Stories:
1. Context of TDD
2. What is TDD
3. Response of Developers to TDD implementation
4. Practices complimenting TDD
5. Success with TDD
www.agilesoft.in
Backlog…
• Stories:
1. Context of TDD
2. What is TDD
3. Response of Developers to TDD
implementation
4. Practices complimenting TDD
5. Success with TDD
www.agilesoft.in
www.agilesoft.in
We are uncovering better ways of developing software by
doing it and helping others do it.
Through this work we have come to value:
• Individuals and interactions over processes and
tools
• Working software over comprehensive
documentation
• Customer collaboration over contract
negotiation
• Responding to change over following a plan
That is, while there is value in the items on the right, we
value the items on the left more.
We follow these principles:
• Our highest priority is to satisfy the customer
through early and continuous delivery
of valuable software.
• Welcome changing requirements, even late in
development. Agile processes harness change for
the customer's competitive advantage.
• Deliver working software frequently, from a
couple of weeks to a couple of months, with a
preference to the shorter timescale.
• Business people and developers must work
together daily throughout the project.
• Build projects around motivated individuals.
Give them the environment and support they need,
and trust them to get the job done.
• The most efficient and effective method of
conveying information to and within a development
team is face-to-face conversation.
• Working software is the primary measure of
progress.
• Agile processes promote sustainable development.
The sponsors, developers, and users should be able
to maintain a constant pace indefinitely.
• Continuous attention to technical excellence
and good design enhances agility.
• Simplicity--the art of maximizing the amount
of work not done--is essential.
• The best architectures, requirements, and designs
emerge from self-organizing teams.
• At regular intervals, the team reflects on how
to become more effective, then tunes and adjusts
its behaviour accordingly.
TDD, DDD,
UML modeling,
BDD, Pair
Programming,
Refactoring
CI……..
Credit: www.agilemanifesto.org
Change for Agile adoption-Our 3D
approach to implementation
www.agilesoft.in
Project Management
Technical Practices
Mindset
S
t
op
Roles,Goals,Reasons
• PO: I want to get functionality implemented
so that I can get the business value.
• Developer: I want to write the code so that it
passes all the tests.
• Tester: I want to test the functionality so that
no defects go undetected.
We together want to develop
functionality so that PO gets
business value.
Change in goal prompts change in
Technical Practices
• You move from Planned Development to
Evolutionary Incremental Development.
• Hence traditional practices such as Big Bang
Testing/Integration phase will not work.
www.agilesoft.in
Backlog…
• Stories:
1. Context of TDD
2. What is TDD
3. Response of Developers to TDD
implementation
4. Practices complimenting TDD
5. Success with TDD
www.agilesoft.in
Just to ensure that everyone is on the
same page….
www.agilesoft.in
What is TDD?
• Useful practice of code development to have
simple, encapsulated, minimal, scalable code.
(Ron Jeffries says, “Clean Code that works”.)
• Input: User story
• Output: Accepted User story
• Process: Red-Green-Refactor
• Role: Developer
• Environment: Unit testing and coding
www.agilesoft.in
Red Green Refactor
www.agilesoft.in
Write a
failing test
Make the
test pass
Refactor
Quickly add
a failing test
Make all the
tests pass
Refactor
Backlog…
• Stories:
1. Context of TDD
2. What is TDD
3. Response of Developers to TDD
implementation
4. Practices complimenting TDD
5. Success with TDD
www.agilesoft.in
Overheard about TDD in the pantry….
• Why should Test be the driver rather than Design?
• Give me the design… how can I write code without it?
Don’t tell me you don’t need to think of a class before
a method…
• Come on…I can see the whole logic…let me code it....
why tests?
• Writing tests every time is time-consuming.
• Worse is to see the test failing… what is there to see?
• By now, I could have finished with this code without
TDD.
Backlog…
• Stories:
1. Context of TDD
2. What is TDD
3. Response of Developers to TDD
implementation
4. Practices complimenting TDD
5. Success with TDD
www.agilesoft.in
TDD is not about only test first…
• It is about development as a whole.
Development involves whatever that is needed
to turn the Product Backlog into potentially
shippable product. (Ref: Scrum Guide) So, it
has coding and design and testing and build
and integration… associated with it.
• Do you remember, in XP, they say the practices
don’t work in isolation; they work in synergy.
Practices that compliment TDD
• ATDD/BDD
• Refactoring
• Clean Code
• SOLID principles
• Design Patterns
• Design metrics (by static analysis)
• Emergent Design
• Domain Driven Design
• Continuous Integration
…. And perhaps more
www.agilesoft.in
Backlog…
• Stories:
1. Context of TDD
2. What is TDD
3. Response of Developers to TDD
implementation
4. Practices complimenting TDD
5. Success with TDD
www.agilesoft.in
Challenges in TDD implementations
• “It's probably the one thing we're struggling
the most with."
"We do a lot of unit and function test
automation in general, and we're getting
better with integration testing, but it's a
mindset! Developers like to develop code;
they don't necessarily like to test.”
-Sue McKinney, vice president of IBM's development
transformation
Challenges in TDD implementations
• "We struggle with a large code base not written
using TDD. It's difficult to … be test-driven in a
legacy code base.”
• "I have concerns if it's doable in a code base not
designed to work that way. We have some
architectural issues before we get there. I'm not
philosophically opposed; I just don't want to
make our jobs harder.”
-Chris Kinsman, vice president and chief architect at AMS
Services, a provider of insurance agency automation products
What does it take to succeed with TDD
• Input: User story--- Acceptance
Criteria/Scenarios
• Output: Accepted User story--- Know the DoD
• Process: Red-Green-Refactor---Environment
supporting the Process like Xunit, Static
Analysis Tool, Refactoring support
• Role: Developer--- Acquire skills
• Environment: Unit testing and coding–
Combine with CI, ATDD/BDD
www.agilesoft.in
Input
• Do you have Acceptance Criteria or Scenarios
written for the User Story under
development? (The third C-Confirmation of
US) Want to use tools for it?
• Do you think the format Given-when-then
gives you better retention of understanding?
• How much is the doubt about the User Story?
www.agilesoft.in
Output
• Do you have the Acceptance Criteria and
Definition Of Done for the user story?
• Do you have the opportunity to show the
developed user story to PO and seek the
feedback?
www.agilesoft.in
Process
• Do you have the macro cycle of ATDD around the
Unit TDD?
• Do you watch the test failing?
• Oh, do you REALLY write a test before code?
• Do you know how to write effective and efficient
test cases ?
• Do you REALLY refactor the code before adding
next functionality or are you happy with Green
bar? (Do you have the guts to change the code
that has passed the tests?)
www.agilesoft.in
Role: Behavior of Developers forced to
TDD
• Writing huge code as the logic is understood
• Failure to refactor as the code is “WORKING”
• Writing tests initially (religiously) and then
continuing without them to create larger codes.
• Believing that the TDD is time consuming as the
“FULL & FINAL” code can be seen only later.
• I am OK with the present; change is a
disturbance! (Inertia due to comfort zone)
• What is in it for me?- WIIFM the famous
marketing phrase
www.agilesoft.in
Role: Developer’s Skills for TDD
• Refactoring Patterns
• SOLID principles
• GOF Design Patterns
• Clean Code
www.agilesoft.in
Refactoring
• In case of TDD, the code refactoring as well as
design level refactoring is needed. As the code
gets added, the design evolves; a higher
abstraction level refactoring becomes necessary.
• Code level refactoring: long method, naming of
methods/parameters which make code
“readable”
• Design Refactoring: As the functionality gets
added, we need to leave the “design”(not just the
design of code, real “design”) in the simplest
possible, scalable state.
Example of code refactoring
Before
double getPrice() {
int basePrice = _quantity *
_itemPrice;
double discountFactor;
if (basePrice > 1000)
discountFactor = 0.95;
else discountFactor = 0.98;
return basePrice *
discountFactor;
}
After
double getPrice() {
return basePrice() *
discountFactor();
}
www.agilesoft.in
Design Refactoring
• It may perhaps start only with a few simple
techniques like extract interface, extract class
etc and further may use SOLID principles and
further, Design Patterns.
Example of Design Refactoring
www.agilesoft.in
Before After
Environment
• Do you have CI environment set up?
• Does your development environment allow
you quick and easy refactoring?
www.agilesoft.in
Typical CI set up
credit: Continuous Integration , book by Paul Duvall page 26
www.agilesoft.in
Other challenges…
• How do I convince my manager on the cost of
TDD….say on environment and time?
• We have schedule pressure, the PO won’t
allow the time investment
• We don’t develop new code; we maintain
legacy system…where does TDD fit in?
www.agilesoft.in
Probable answers
• Unfortunately we are driven more by external
data than own experience. You can’t convince
someone across the table on methodology. But
perhaps, better design metrics and reduction in
defect injection can help convince.
• For existing system, Michael Feathers has
discussed the development approach in his
famous book, “Working effectively with Legacy
code” where TDD is a part of the approach.
www.agilesoft.in
The Legacy Code Change Algorithm
1. Identify change points.
2. Find test points.
3. Break dependencies.
4. Write tests.
5. Make changes and refactor.
Case study: Legacy System
Changes needed
In these methods
Credit: Working Effectively
with Legacy Code-Michael Feathers
Fig2.1 and 2.2
Isolating for tests
• We need to know the collaborators, in this case
InvoiceUpdateServlet and DBConnection
• You need their objects but setting them for
testing purpose can be time-consuming and
costly.
• Fake DBConnection by extracting interface (and
introducing Fake object of DBConnection)
• Provide data ListInvoiceIDs from
InvoiceUpdateServlet instead of the whole
object.
www.agilesoft.in
Case Study: Legacy Code
Interface extracted
Credit: Working Effectively
with Legacy Code-Michael Feathers
Fig2.1 and 2.2
Backlog…
• Stories:
1. Context of TDD
2. What is TDD
3. Response of Developers to TDD
implementation
4. Practices complimenting TDD
5. Success with TDD
www.agilesoft.in
prashant.pund@agilesoft.in
+919923073192
www.agilesoft.in

Weitere ähnliche Inhalte

Was ist angesagt?

Agile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer PerspectiveAgile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer PerspectiveWee Witthawaskul
 
Agile Software Development Process Practice in Thai Culture
Agile Software Development Process Practice in Thai CultureAgile Software Development Process Practice in Thai Culture
Agile Software Development Process Practice in Thai CultureWee Witthawaskul
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDDKnoldus Inc.
 
Explore Events of Scrum Framework
Explore Events of Scrum FrameworkExplore Events of Scrum Framework
Explore Events of Scrum FrameworkNaveen Kumar Singh
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationJohn Ferguson Smart Limited
 
Understanding Agile Hardware
Understanding Agile HardwareUnderstanding Agile Hardware
Understanding Agile HardwareCprime
 
QA team transition to agile testing at Alcatel Lucent
QA team transition to agile testing at Alcatel LucentQA team transition to agile testing at Alcatel Lucent
QA team transition to agile testing at Alcatel LucentAgileSparks
 
Introduction to Agile - Scrum, Kanban, and everything in between
Introduction to Agile - Scrum, Kanban, and everything in betweenIntroduction to Agile - Scrum, Kanban, and everything in between
Introduction to Agile - Scrum, Kanban, and everything in betweenPravin Kumar Singh, PMP, PSM
 
ISTQB Agile Extension
ISTQB Agile ExtensionISTQB Agile Extension
ISTQB Agile ExtensionDavis Thomas
 
Effective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentEffective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentRaj Indugula
 
Introduction to Agile Methods
Introduction to Agile MethodsIntroduction to Agile Methods
Introduction to Agile MethodsSiddhi
 
The Role of a BA on a Scrum Team IIBA Presentation 2010
The Role of a BA on a Scrum Team IIBA Presentation 2010The Role of a BA on a Scrum Team IIBA Presentation 2010
The Role of a BA on a Scrum Team IIBA Presentation 2010scrummasternz
 
Software Development Guide To Accelerate Performance
Software Development Guide To Accelerate PerformanceSoftware Development Guide To Accelerate Performance
Software Development Guide To Accelerate PerformanceZaid Shabbir
 
Why Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My TeamWhy Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My TeamRob Curry
 

Was ist angesagt? (20)

Agile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer PerspectiveAgile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer Perspective
 
Agile Software Development Process Practice in Thai Culture
Agile Software Development Process Practice in Thai CultureAgile Software Development Process Practice in Thai Culture
Agile Software Development Process Practice in Thai Culture
 
Introduction to BDD
Introduction to BDDIntroduction to BDD
Introduction to BDD
 
Explore Events of Scrum Framework
Explore Events of Scrum FrameworkExplore Events of Scrum Framework
Explore Events of Scrum Framework
 
Agile Testing
Agile Testing  Agile Testing
Agile Testing
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world application
 
Understanding Agile Hardware
Understanding Agile HardwareUnderstanding Agile Hardware
Understanding Agile Hardware
 
Are we done yet?
Are we done yet?Are we done yet?
Are we done yet?
 
QA team transition to agile testing at Alcatel Lucent
QA team transition to agile testing at Alcatel LucentQA team transition to agile testing at Alcatel Lucent
QA team transition to agile testing at Alcatel Lucent
 
Introduction to Agile - Scrum, Kanban, and everything in between
Introduction to Agile - Scrum, Kanban, and everything in betweenIntroduction to Agile - Scrum, Kanban, and everything in between
Introduction to Agile - Scrum, Kanban, and everything in between
 
ISTQB Agile Extension
ISTQB Agile ExtensionISTQB Agile Extension
ISTQB Agile Extension
 
Effective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentEffective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile Environment
 
Introduction to Agile Methods
Introduction to Agile MethodsIntroduction to Agile Methods
Introduction to Agile Methods
 
Agile Methodology - Agile Project Management Training
Agile Methodology - Agile Project Management TrainingAgile Methodology - Agile Project Management Training
Agile Methodology - Agile Project Management Training
 
The Role of a BA on a Scrum Team IIBA Presentation 2010
The Role of a BA on a Scrum Team IIBA Presentation 2010The Role of a BA on a Scrum Team IIBA Presentation 2010
The Role of a BA on a Scrum Team IIBA Presentation 2010
 
Agile testing
Agile testingAgile testing
Agile testing
 
Software Development Guide To Accelerate Performance
Software Development Guide To Accelerate PerformanceSoftware Development Guide To Accelerate Performance
Software Development Guide To Accelerate Performance
 
Intro To Scrum
Intro To ScrumIntro To Scrum
Intro To Scrum
 
Why Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My TeamWhy Isn't Clean Coding Working For My Team
Why Isn't Clean Coding Working For My Team
 
Agile course Part 1
Agile course Part 1Agile course Part 1
Agile course Part 1
 

Ähnlich wie Prashant technical practices-tdd for xebia event

Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQASymphony
 
DevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDaysJKT
 
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanBehavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanQA or the Highway
 
An Agile Overview @ ShoreTel Sky
An Agile Overview @ ShoreTel SkyAn Agile Overview @ ShoreTel Sky
An Agile Overview @ ShoreTel Skygirabrent
 
"X" Driven-Development Methodologies
"X" Driven-Development Methodologies"X" Driven-Development Methodologies
"X" Driven-Development MethodologiesDamian T. Gordon
 
Critical Capabilities to Shifting Left the Right Way
Critical Capabilities to Shifting Left the Right WayCritical Capabilities to Shifting Left the Right Way
Critical Capabilities to Shifting Left the Right WaySmartBear
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentnikhil sreeni
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): RevistedMike Harris
 
Introduction to Agile Software Development Process
Introduction to Agile Software Development ProcessIntroduction to Agile Software Development Process
Introduction to Agile Software Development ProcessSoftware Park Thailand
 
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Perfecto Mobile
 
Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015Steve Mercier
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersSPC Adriatics
 
Technical Excellence Doesn't Just Happen - AgileIndy 2016
Technical Excellence Doesn't Just Happen - AgileIndy 2016Technical Excellence Doesn't Just Happen - AgileIndy 2016
Technical Excellence Doesn't Just Happen - AgileIndy 2016Allison Pollard
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Jason Tice
 

Ähnlich wie Prashant technical practices-tdd for xebia event (20)

Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the Enterprise
 
DevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDays Jakarta Igites
DevOpsDays Jakarta Igites
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
 
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanBehavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
 
An Agile Overview @ ShoreTel Sky
An Agile Overview @ ShoreTel SkyAn Agile Overview @ ShoreTel Sky
An Agile Overview @ ShoreTel Sky
 
"X" Driven-Development Methodologies
"X" Driven-Development Methodologies"X" Driven-Development Methodologies
"X" Driven-Development Methodologies
 
Technical Debt.pptx
Technical Debt.pptxTechnical Debt.pptx
Technical Debt.pptx
 
Critical Capabilities to Shifting Left the Right Way
Critical Capabilities to Shifting Left the Right WayCritical Capabilities to Shifting Left the Right Way
Critical Capabilities to Shifting Left the Right Way
 
TestOps and Shift Left
TestOps and Shift LeftTestOps and Shift Left
TestOps and Shift Left
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): Revisted
 
Introduction to Agile Software Development Process
Introduction to Agile Software Development ProcessIntroduction to Agile Software Development Process
Introduction to Agile Software Development Process
 
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018Mastering BDD - Eran Kinsbruner Workshop Quest 2018
Mastering BDD - Eran Kinsbruner Workshop Quest 2018
 
Bdd with m spec
Bdd with m specBdd with m spec
Bdd with m spec
 
Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill Ayers
 
Technical Excellence Doesn't Just Happen - AgileIndy 2016
Technical Excellence Doesn't Just Happen - AgileIndy 2016Technical Excellence Doesn't Just Happen - AgileIndy 2016
Technical Excellence Doesn't Just Happen - AgileIndy 2016
 
Kku2011
Kku2011Kku2011
Kku2011
 
Introduction to Agile
Introduction to AgileIntroduction to Agile
Introduction to Agile
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
 

Kürzlich hochgeladen

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Kürzlich hochgeladen (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Prashant technical practices-tdd for xebia event

  • 1. Technical Practices in Agile-TDD by Prashant Pund Certified SAFe Program Consultant CSM, Agile Coach AgileSoft Methodologies,Pune prashant.pund@agilesoft.in +919923073192 www.agilesoft.in
  • 2. Event Backlog • Theme: Agile Technical Practices • Epic: TDD implementation • Stories: 1. Context of TDD 2. What is TDD 3. Response of Developers to TDD implementation 4. Practices complimenting TDD 5. Success with TDD www.agilesoft.in
  • 3. Backlog… • Stories: 1. Context of TDD 2. What is TDD 3. Response of Developers to TDD implementation 4. Practices complimenting TDD 5. Success with TDD www.agilesoft.in
  • 4. www.agilesoft.in We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value: • Individuals and interactions over processes and tools • Working software over comprehensive documentation • Customer collaboration over contract negotiation • Responding to change over following a plan That is, while there is value in the items on the right, we value the items on the left more. We follow these principles: • Our highest priority is to satisfy the customer through early and continuous delivery of valuable software. • Welcome changing requirements, even late in development. Agile processes harness change for the customer's competitive advantage. • Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale. • Business people and developers must work together daily throughout the project. • Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done. • The most efficient and effective method of conveying information to and within a development team is face-to-face conversation. • Working software is the primary measure of progress. • Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely. • Continuous attention to technical excellence and good design enhances agility. • Simplicity--the art of maximizing the amount of work not done--is essential. • The best architectures, requirements, and designs emerge from self-organizing teams. • At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behaviour accordingly. TDD, DDD, UML modeling, BDD, Pair Programming, Refactoring CI…….. Credit: www.agilemanifesto.org
  • 5. Change for Agile adoption-Our 3D approach to implementation www.agilesoft.in Project Management Technical Practices Mindset S t op
  • 6. Roles,Goals,Reasons • PO: I want to get functionality implemented so that I can get the business value. • Developer: I want to write the code so that it passes all the tests. • Tester: I want to test the functionality so that no defects go undetected. We together want to develop functionality so that PO gets business value.
  • 7. Change in goal prompts change in Technical Practices • You move from Planned Development to Evolutionary Incremental Development. • Hence traditional practices such as Big Bang Testing/Integration phase will not work. www.agilesoft.in
  • 8. Backlog… • Stories: 1. Context of TDD 2. What is TDD 3. Response of Developers to TDD implementation 4. Practices complimenting TDD 5. Success with TDD www.agilesoft.in
  • 9. Just to ensure that everyone is on the same page…. www.agilesoft.in
  • 10. What is TDD? • Useful practice of code development to have simple, encapsulated, minimal, scalable code. (Ron Jeffries says, “Clean Code that works”.) • Input: User story • Output: Accepted User story • Process: Red-Green-Refactor • Role: Developer • Environment: Unit testing and coding www.agilesoft.in
  • 11. Red Green Refactor www.agilesoft.in Write a failing test Make the test pass Refactor Quickly add a failing test Make all the tests pass Refactor
  • 12. Backlog… • Stories: 1. Context of TDD 2. What is TDD 3. Response of Developers to TDD implementation 4. Practices complimenting TDD 5. Success with TDD www.agilesoft.in
  • 13. Overheard about TDD in the pantry…. • Why should Test be the driver rather than Design? • Give me the design… how can I write code without it? Don’t tell me you don’t need to think of a class before a method… • Come on…I can see the whole logic…let me code it.... why tests? • Writing tests every time is time-consuming. • Worse is to see the test failing… what is there to see? • By now, I could have finished with this code without TDD.
  • 14. Backlog… • Stories: 1. Context of TDD 2. What is TDD 3. Response of Developers to TDD implementation 4. Practices complimenting TDD 5. Success with TDD www.agilesoft.in
  • 15. TDD is not about only test first… • It is about development as a whole. Development involves whatever that is needed to turn the Product Backlog into potentially shippable product. (Ref: Scrum Guide) So, it has coding and design and testing and build and integration… associated with it. • Do you remember, in XP, they say the practices don’t work in isolation; they work in synergy.
  • 16. Practices that compliment TDD • ATDD/BDD • Refactoring • Clean Code • SOLID principles • Design Patterns • Design metrics (by static analysis) • Emergent Design • Domain Driven Design • Continuous Integration …. And perhaps more www.agilesoft.in
  • 17. Backlog… • Stories: 1. Context of TDD 2. What is TDD 3. Response of Developers to TDD implementation 4. Practices complimenting TDD 5. Success with TDD www.agilesoft.in
  • 18. Challenges in TDD implementations • “It's probably the one thing we're struggling the most with." "We do a lot of unit and function test automation in general, and we're getting better with integration testing, but it's a mindset! Developers like to develop code; they don't necessarily like to test.” -Sue McKinney, vice president of IBM's development transformation
  • 19. Challenges in TDD implementations • "We struggle with a large code base not written using TDD. It's difficult to … be test-driven in a legacy code base.” • "I have concerns if it's doable in a code base not designed to work that way. We have some architectural issues before we get there. I'm not philosophically opposed; I just don't want to make our jobs harder.” -Chris Kinsman, vice president and chief architect at AMS Services, a provider of insurance agency automation products
  • 20. What does it take to succeed with TDD • Input: User story--- Acceptance Criteria/Scenarios • Output: Accepted User story--- Know the DoD • Process: Red-Green-Refactor---Environment supporting the Process like Xunit, Static Analysis Tool, Refactoring support • Role: Developer--- Acquire skills • Environment: Unit testing and coding– Combine with CI, ATDD/BDD www.agilesoft.in
  • 21. Input • Do you have Acceptance Criteria or Scenarios written for the User Story under development? (The third C-Confirmation of US) Want to use tools for it? • Do you think the format Given-when-then gives you better retention of understanding? • How much is the doubt about the User Story? www.agilesoft.in
  • 22. Output • Do you have the Acceptance Criteria and Definition Of Done for the user story? • Do you have the opportunity to show the developed user story to PO and seek the feedback? www.agilesoft.in
  • 23. Process • Do you have the macro cycle of ATDD around the Unit TDD? • Do you watch the test failing? • Oh, do you REALLY write a test before code? • Do you know how to write effective and efficient test cases ? • Do you REALLY refactor the code before adding next functionality or are you happy with Green bar? (Do you have the guts to change the code that has passed the tests?) www.agilesoft.in
  • 24. Role: Behavior of Developers forced to TDD • Writing huge code as the logic is understood • Failure to refactor as the code is “WORKING” • Writing tests initially (religiously) and then continuing without them to create larger codes. • Believing that the TDD is time consuming as the “FULL & FINAL” code can be seen only later. • I am OK with the present; change is a disturbance! (Inertia due to comfort zone) • What is in it for me?- WIIFM the famous marketing phrase www.agilesoft.in
  • 25. Role: Developer’s Skills for TDD • Refactoring Patterns • SOLID principles • GOF Design Patterns • Clean Code www.agilesoft.in
  • 26. Refactoring • In case of TDD, the code refactoring as well as design level refactoring is needed. As the code gets added, the design evolves; a higher abstraction level refactoring becomes necessary. • Code level refactoring: long method, naming of methods/parameters which make code “readable” • Design Refactoring: As the functionality gets added, we need to leave the “design”(not just the design of code, real “design”) in the simplest possible, scalable state.
  • 27. Example of code refactoring Before double getPrice() { int basePrice = _quantity * _itemPrice; double discountFactor; if (basePrice > 1000) discountFactor = 0.95; else discountFactor = 0.98; return basePrice * discountFactor; } After double getPrice() { return basePrice() * discountFactor(); } www.agilesoft.in
  • 28. Design Refactoring • It may perhaps start only with a few simple techniques like extract interface, extract class etc and further may use SOLID principles and further, Design Patterns.
  • 29. Example of Design Refactoring www.agilesoft.in Before After
  • 30. Environment • Do you have CI environment set up? • Does your development environment allow you quick and easy refactoring? www.agilesoft.in
  • 31. Typical CI set up credit: Continuous Integration , book by Paul Duvall page 26 www.agilesoft.in
  • 32. Other challenges… • How do I convince my manager on the cost of TDD….say on environment and time? • We have schedule pressure, the PO won’t allow the time investment • We don’t develop new code; we maintain legacy system…where does TDD fit in? www.agilesoft.in
  • 33. Probable answers • Unfortunately we are driven more by external data than own experience. You can’t convince someone across the table on methodology. But perhaps, better design metrics and reduction in defect injection can help convince. • For existing system, Michael Feathers has discussed the development approach in his famous book, “Working effectively with Legacy code” where TDD is a part of the approach. www.agilesoft.in
  • 34. The Legacy Code Change Algorithm 1. Identify change points. 2. Find test points. 3. Break dependencies. 4. Write tests. 5. Make changes and refactor.
  • 35. Case study: Legacy System Changes needed In these methods Credit: Working Effectively with Legacy Code-Michael Feathers Fig2.1 and 2.2
  • 36. Isolating for tests • We need to know the collaborators, in this case InvoiceUpdateServlet and DBConnection • You need their objects but setting them for testing purpose can be time-consuming and costly. • Fake DBConnection by extracting interface (and introducing Fake object of DBConnection) • Provide data ListInvoiceIDs from InvoiceUpdateServlet instead of the whole object. www.agilesoft.in
  • 37. Case Study: Legacy Code Interface extracted Credit: Working Effectively with Legacy Code-Michael Feathers Fig2.1 and 2.2
  • 38. Backlog… • Stories: 1. Context of TDD 2. What is TDD 3. Response of Developers to TDD implementation 4. Practices complimenting TDD 5. Success with TDD www.agilesoft.in

Hinweis der Redaktion

  1. Methodologies