SlideShare a Scribd company logo
Developer Testing
Code Quality and You
If it builds, ship it
• Was young and foolish
• Talk to a BA? QA? Never!
• Just focused on writing code – not on quality
code
• Bugs and bugs, oh my!
In all fairness
• Was young and naïve
• “It worked on my machine”
• Still a start-up with a start-up mentality where
the “Wild west” was accepted
• But still there had to be a better way…
Ta-da!
Unit Tests
• Focuses on the smallest
testable part of an
application
• Independent
Unit Testing
• Cheap!
• Finds problems early
• Facilitates changes
• Promotes decoupling
• Living Documentation
Example Unit Test
Integration Tests
• Verifies functional, performance, and
reliability
– Do all the individual “units” work together?
– Do all the combined “units” work in a performant
manner?
– Do all the “units” work with external resources
and/or dependencies?
Integration Test Example
Acceptance Tests
• Higher-level tests that verify completeness of
a user story
• Written in Gherkin:
Given that I’m Product Owner,
When the sprint ends,
Then all of the stories should meet my requirements
• Highly collaborative between customers,
Product Owners, BAs, QAs and Devs
Acceptance Tests
• A user story is not considered complete until
the acceptance tests have passed
Acceptance Test Example
UI & Manual Tests
• Harder to automate
• Still need to do exploratory testing
But what about…
• Regression Testing?
– Rerun all of the tests we created previously
• Smoke Testing?
– Rerun a subset of the tests we created previously
• Performance Testing?
– Rerun a focused subset of the tests we created
previously with concurrency and load against a
benchmark
Composition of the Tests
• Happy Paths
• Sad Paths
• “Woah, wasn’t expecting that” Paths
Testing Anti-Patterns
• But aren’t code reviews a substitute?
• But we are near the end of Project XYZ; why
should we add tests now?
• But couldn’t we “break” the code by adding
tests?
• But it will take a longer time to complete
• But our code-base is too large/complex to add
tests
Test Driven Development (TDD)
• Write a Test that fails
• Write some code
• Make all Tests pass
• Refactor
• Rinse and Repeat
Behaviour Driven Development (BDD)
• Write a Test* that fails
• Write some code
• Make all Tests pass
• Refactor
• Rinse and Repeat
*With a different purpose in mind; acceptance
TDD v BDD
• If I am doing BDD then do I need to do TDD or
vice versa?
– Absolutely!
– TDD makes sure you are writing the thing right;
BDD makes sure you are writing the right thing
What about Code Reviews?
• Absolutely!
• But the first question needs to be “show me
the passing tests”
• Make sure we are getting better at writing
tests
The Who
• Quality is everyone’s responsibility
– Devs
– QAs
– BAs
– UX
– Product Owners
The When
• During each sprint:
– BA, Dev & QA all collaborating and following each
story to completion
• Today!
Developer Testing
• “How do I sell my executive team on doing this
stuff? Don't. Just do it. They don't know what
you're doing anyway” —Jim Highsmith
Developer Testing

More Related Content

What's hot (20)

PPTX
Agile Testing in Enterprise: Way to transform - SQA Days 2014
Andrey Rebrov
 
PDF
How technical excellence helps in LeSS adoption
Anton Bevzuk
 
PDF
How testers add value to the organization appium conf
Corina Pip
 
PPT
How engineering practices help business
Andrey Rebrov
 
PPT
Definition Of Done
Wei Zhu
 
PPTX
ALE15 The real value of a definition of done
Christian Vos
 
PDF
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
QA or the Highway
 
PPTX
Behavior-Driven Design: One Team's Exploration
dtcoutu
 
PPT
Trends in Agile Testing by Lisa Crispin
Directi Group
 
PPTX
Definition of done training
Monica Yap
 
PPTX
Test Automation Canvas
Andrey Rebrov
 
PPTX
Implementing automation in definition of done is team effort
Anand Narayan Shirkande
 
PDF
TDD for Testers Workshop
Sarah Usher
 
PPTX
Approval Tests in Action: A LEGO Exercise and an Experience Report
houseofyin
 
PDF
Testing for Agility: Bringing Testing into Everything
Camille Bell
 
PDF
Growing Manual Testers into Automators
Camille Bell
 
PPTX
DevOps in Action: How Nedbank went from quarterly to weekly releases in no ti...
Agile Software Community of India
 
PPTX
Spec By Example or How to teach people talk to each other
Andrey Rebrov
 
PDF
What is Agile Testing?
Dr. Alexander Schwartz
 
PPTX
Continuous Integration: Finding problems soonest
Shawn Jones
 
Agile Testing in Enterprise: Way to transform - SQA Days 2014
Andrey Rebrov
 
How technical excellence helps in LeSS adoption
Anton Bevzuk
 
How testers add value to the organization appium conf
Corina Pip
 
How engineering practices help business
Andrey Rebrov
 
Definition Of Done
Wei Zhu
 
ALE15 The real value of a definition of done
Christian Vos
 
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
QA or the Highway
 
Behavior-Driven Design: One Team's Exploration
dtcoutu
 
Trends in Agile Testing by Lisa Crispin
Directi Group
 
Definition of done training
Monica Yap
 
Test Automation Canvas
Andrey Rebrov
 
Implementing automation in definition of done is team effort
Anand Narayan Shirkande
 
TDD for Testers Workshop
Sarah Usher
 
Approval Tests in Action: A LEGO Exercise and an Experience Report
houseofyin
 
Testing for Agility: Bringing Testing into Everything
Camille Bell
 
Growing Manual Testers into Automators
Camille Bell
 
DevOps in Action: How Nedbank went from quarterly to weekly releases in no ti...
Agile Software Community of India
 
Spec By Example or How to teach people talk to each other
Andrey Rebrov
 
What is Agile Testing?
Dr. Alexander Schwartz
 
Continuous Integration: Finding problems soonest
Shawn Jones
 

Viewers also liked (8)

PDF
Presentation Relocation SRS México
SRS Relocation
 
PPTX
районы киева
stepanoff_ua
 
PDF
Ordinare il Front Panel con gli splitter in LabVIEW
Nicola Bavarone
 
PPTX
Premio innova s@lute2016
Idelfo Borgo
 
PPTX
Tugas aplikom
Rytha Indrianti
 
PPTX
Community language learning
Rytha Indrianti
 
PDF
B2B Magento vs. Hybris
Urszula Urban
 
Presentation Relocation SRS México
SRS Relocation
 
районы киева
stepanoff_ua
 
Ordinare il Front Panel con gli splitter in LabVIEW
Nicola Bavarone
 
Premio innova s@lute2016
Idelfo Borgo
 
Tugas aplikom
Rytha Indrianti
 
Community language learning
Rytha Indrianti
 
B2B Magento vs. Hybris
Urszula Urban
 
Ad

Similar to Developer Testing (20)

PDF
Software Testing Basic Concepts
wesovi
 
PPTX
Software presentation
JennaPrengle
 
PPTX
Testing 101
Noam Barkai
 
PPTX
Unit testing & TDD concepts with best practice guidelines.
Mohamed Taman
 
PPTX
An Introduction To Software Development - Test Driven Development, Part 1
Blue Elephant Consulting
 
PPTX
Software testing and quality assurance
Benjamin Baumann
 
PDF
Unit testing - An introduction
Alejandro Claro Mosqueda
 
PPTX
Creating change from within - Agile Practitioners 2012
Dror Helper
 
PDF
What CS Class Didn't Teach About Testing
Camille Bell
 
PPTX
The Test way
Mikhail Grinfeld
 
PDF
Test Driven Development (TDD)
David Ehringer
 
PPTX
Development without Testers: Myth or Real Option?
Mikalai Alimenkou
 
PPTX
Development without Testers: Myth or Real Option? (ConfeT&QA conference)
Mikalai Alimenkou
 
PPTX
90 days to make a difference - approach
Stuart Creasey
 
PPTX
{10.0} Test Driven Development.pptx
AmalEldhose2
 
PPTX
Binary Studio Academy: .NET Code Testing
Binary Studio
 
PDF
Unit testing (Exploring the other side as a tester)
Abhijeet Vaikar
 
PPTX
An introduction to Software Testing and Test Management
Anuraj S.L
 
PDF
Testing practicies not only in scala
Paweł Panasewicz
 
PDF
Agile testing practice
Mary Jiang
 
Software Testing Basic Concepts
wesovi
 
Software presentation
JennaPrengle
 
Testing 101
Noam Barkai
 
Unit testing & TDD concepts with best practice guidelines.
Mohamed Taman
 
An Introduction To Software Development - Test Driven Development, Part 1
Blue Elephant Consulting
 
Software testing and quality assurance
Benjamin Baumann
 
Unit testing - An introduction
Alejandro Claro Mosqueda
 
Creating change from within - Agile Practitioners 2012
Dror Helper
 
What CS Class Didn't Teach About Testing
Camille Bell
 
The Test way
Mikhail Grinfeld
 
Test Driven Development (TDD)
David Ehringer
 
Development without Testers: Myth or Real Option?
Mikalai Alimenkou
 
Development without Testers: Myth or Real Option? (ConfeT&QA conference)
Mikalai Alimenkou
 
90 days to make a difference - approach
Stuart Creasey
 
{10.0} Test Driven Development.pptx
AmalEldhose2
 
Binary Studio Academy: .NET Code Testing
Binary Studio
 
Unit testing (Exploring the other side as a tester)
Abhijeet Vaikar
 
An introduction to Software Testing and Test Management
Anuraj S.L
 
Testing practicies not only in scala
Paweł Panasewicz
 
Agile testing practice
Mary Jiang
 
Ad

Recently uploaded (20)

PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 

Developer Testing

  • 2. If it builds, ship it • Was young and foolish • Talk to a BA? QA? Never! • Just focused on writing code – not on quality code • Bugs and bugs, oh my!
  • 3. In all fairness • Was young and naïve • “It worked on my machine” • Still a start-up with a start-up mentality where the “Wild west” was accepted • But still there had to be a better way…
  • 5. Unit Tests • Focuses on the smallest testable part of an application • Independent
  • 6. Unit Testing • Cheap! • Finds problems early • Facilitates changes • Promotes decoupling • Living Documentation
  • 8. Integration Tests • Verifies functional, performance, and reliability – Do all the individual “units” work together? – Do all the combined “units” work in a performant manner? – Do all the “units” work with external resources and/or dependencies?
  • 10. Acceptance Tests • Higher-level tests that verify completeness of a user story • Written in Gherkin: Given that I’m Product Owner, When the sprint ends, Then all of the stories should meet my requirements • Highly collaborative between customers, Product Owners, BAs, QAs and Devs
  • 11. Acceptance Tests • A user story is not considered complete until the acceptance tests have passed
  • 13. UI & Manual Tests • Harder to automate • Still need to do exploratory testing
  • 14. But what about… • Regression Testing? – Rerun all of the tests we created previously • Smoke Testing? – Rerun a subset of the tests we created previously • Performance Testing? – Rerun a focused subset of the tests we created previously with concurrency and load against a benchmark
  • 15. Composition of the Tests • Happy Paths • Sad Paths • “Woah, wasn’t expecting that” Paths
  • 16. Testing Anti-Patterns • But aren’t code reviews a substitute? • But we are near the end of Project XYZ; why should we add tests now? • But couldn’t we “break” the code by adding tests? • But it will take a longer time to complete • But our code-base is too large/complex to add tests
  • 17. Test Driven Development (TDD) • Write a Test that fails • Write some code • Make all Tests pass • Refactor • Rinse and Repeat
  • 18. Behaviour Driven Development (BDD) • Write a Test* that fails • Write some code • Make all Tests pass • Refactor • Rinse and Repeat *With a different purpose in mind; acceptance
  • 19. TDD v BDD • If I am doing BDD then do I need to do TDD or vice versa? – Absolutely! – TDD makes sure you are writing the thing right; BDD makes sure you are writing the right thing
  • 20. What about Code Reviews? • Absolutely! • But the first question needs to be “show me the passing tests” • Make sure we are getting better at writing tests
  • 21. The Who • Quality is everyone’s responsibility – Devs – QAs – BAs – UX – Product Owners
  • 22. The When • During each sprint: – BA, Dev & QA all collaborating and following each story to completion • Today!
  • 23. Developer Testing • “How do I sell my executive team on doing this stuff? Don't. Just do it. They don't know what you're doing anyway” —Jim Highsmith

Editor's Notes

  • #3: First job out of University:Consolidated tracking across 100+ websites in classic aspWanted to prove myselfLots of different websites worked differently; meant my framework needed to backwards compatible and cater for 15 ways of doing the same thingEnded up introducing a lot of bugs
  • #4: New Development Manager started and he called me into after a particularly bad weekSaid: “Prove to me your code works”
  • #5: He introduced me to Unit and Integration testsAcceptance and UI picked up laterCost of Execution/Cost of MaintenanceExecution Time also takes longer at each layerAs we get lower the closer into the code we getTherefore we can automate more and moreThus we want to place most of the effort the lower we can
  • #6: SMALLEST partSmaller than a method1 line of code; 1 statementIndependent of the rest of the systemIndependent of the databaseIndependent of any other testRather than praying the code works
  • #7: Cheap to create, cheap to maintain, cheap to runDoes it build, earliest we can catch issuesDo all these test pass – second earliest (no waiting for deployment, QA, etc)Can lean on the testsFear of breaking changes goes awayNew startersSeparation of concernsSimplifies codeRemoved “magic”Tell us what the system doesDon’t have to “dig into the code”Writing them in business language
  • #8: Focused on making sure that one line of code worksArrange, Act, AssertAlso Business Speak, Given, When, Then (covered later with Acceptance Tests)
  • #9: Once we start putting each part together does the system still work?Once we start putting each part together does it all perform as we would expect Can we catch issues lower than Page XYZ is “slow”Can we access the database, a schema change hasn’t broken the codeBuilds upon Unit Tests:Still relatively cheap – may need an environment to execute inShould still be independent!
  • #11: Ah Business Value!Meets the customers requirements
  • #12: No sense if building the swing on the left if the customer wants the swing on the right
  • #14: Yvette’s Fashion and Costume shop – meets all the acceptances tests and works bug free; however…Exploratory testing to discover new scenarios and test casesBut once repeatable lets automate it!
  • #16: Happy Kenau - The scenarios we want to happen; the expected behaviour of the system - Positive casesSad Kenau - The scenarios where it won’t work - Negative casesWoahKenau - Extreme edge cases, ie Database connection dies, out of disk space, etc
  • #17: Code Reviews: No, they are still manual and therefore inherently unrepeatable Can they catch every possible scenario?End of Project: Is it the end of the application’s lifecycle? How much longer will we need to support it? If we have to do any change, we need testsBreak by Adding tests Absolutely; however, we can write a test for that! Couldn’t you break the code by adding new code anyway?Longer to complete Does it really take longer? Imagine if you didn’t have to go back and fix any bugs or have QA fail a user story and you have to figure out why There is an upfront cost; however, quality will always make you pay – and that can be pay me now or pay me later (and later is always more costly) Similar to we have to deliver by date x Then this is all the more reason not an excuse to throw them outLarge/Complex If it is too large/complex to test then it is too large/complex to add any kind of change We need to simplify and testing helps us achieve that
  • #18: Testing is a first class citizenVIP of our code baseWe test as we go firstWe clean up as we goWe are constantly simplifying
  • #20: TDD – the thing rightBDD – the right thing
  • #22: Devs - You are the closes to the code and the ones making the changes - Measure twice before cuttingQAs - You are our ultimately quality gatekeepers; ensuring that the functionally produced meets the requirementsBAs - Get in there, help write acceptance tests for Devs and QAs to work fromUX - Test frameworks for javascript - UI from the beginningProduct Owners - need to understand that delivery on scope and on time sacrifices quality - delivering quality on time while sacrificing scope is always betterEveryone else -
  • #23: During each sprint, let’s collaborate for each story. As the BA is flushing out the acceptance criteria the Dev is writing the unit, integration tests and ultimately the code for it and the QA is writing the acceptance test for it.Let’s stop catapulting over the walls!A lot of these practises we can start today! They aren’t technology dependent.Any new development initiatives/projects, lets start incorporating these methods.Any existing let’s start looking at how we can make them testableThose using .net, your lives will be easierThose not, there is hope
  • #24: *They expect you are doing anywayAny code in your project – regardless if you wrote it – is YOUR codeYour career - Check Job BoardsDo your own researchRead from our Library:The Pragmatic ProgrammerClean CodeTest Driven DevelopmentTrainingWhat else?Try it; what doyou have to lose?Understand and embrace that proving the code quality is beneficial to everyone
  • #25: Prove to each other your code works