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

PPTX
Agile testingandautomation
PDF
Test Driven Development
PPTX
Unit testing for project managers
ODP
Definition of Done
PDF
TDD and BDD in Sky Deutschland
PDF
Promoting Agility with Running Tested Features - Lightening Talk
PPTX
Definition of Done and Product Backlog refinement
PDF
Inside Behavior Driven Development
Agile testingandautomation
Test Driven Development
Unit testing for project managers
Definition of Done
TDD and BDD in Sky Deutschland
Promoting Agility with Running Tested Features - Lightening Talk
Definition of Done and Product Backlog refinement
Inside Behavior Driven Development

What's hot (20)

PPTX
Agile Testing in Enterprise: Way to transform - SQA Days 2014
PDF
How technical excellence helps in LeSS adoption
PDF
How testers add value to the organization appium conf
PPT
How engineering practices help business
PPT
Definition Of Done
PPTX
ALE15 The real value of a definition of done
PDF
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
PPTX
Behavior-Driven Design: One Team's Exploration
PPT
Trends in Agile Testing by Lisa Crispin
PPTX
Definition of done training
PPTX
Test Automation Canvas
PPTX
Implementing automation in definition of done is team effort
PDF
TDD for Testers Workshop
PPTX
Approval Tests in Action: A LEGO Exercise and an Experience Report
PDF
Testing for Agility: Bringing Testing into Everything
PDF
Growing Manual Testers into Automators
PPTX
DevOps in Action: How Nedbank went from quarterly to weekly releases in no ti...
PPTX
Spec By Example or How to teach people talk to each other
PDF
What is Agile Testing?
PPTX
Continuous Integration: Finding problems soonest
Agile Testing in Enterprise: Way to transform - SQA Days 2014
How technical excellence helps in LeSS adoption
How testers add value to the organization appium conf
How engineering practices help business
Definition Of Done
ALE15 The real value of a definition of done
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior-Driven Design: One Team's Exploration
Trends in Agile Testing by Lisa Crispin
Definition of done training
Test Automation Canvas
Implementing automation in definition of done is team effort
TDD for Testers Workshop
Approval Tests in Action: A LEGO Exercise and an Experience Report
Testing for Agility: Bringing Testing into Everything
Growing Manual Testers into Automators
DevOps in Action: How Nedbank went from quarterly to weekly releases in no ti...
Spec By Example or How to teach people talk to each other
What is Agile Testing?
Continuous Integration: Finding problems soonest
Ad

Viewers also liked (8)

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

Similar to Developer Testing (20)

PPTX
{10.0} Test Driven Development.pptx
PDF
Agile testing
PPTX
Creating change from within - Agile Practitioners 2012
PPTX
Jasmine
PPTX
Understanding Why Testing is Importaint
PDF
Agile process
PDF
Tester Challenges in Agile ?
KEY
Driving application development through behavior driven development
PDF
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
PPTX
Test Driven Development on Android (Kotlin Kenya)
PPT
Test Driven Development and Automation
PDF
Completely Test-Driven
PPTX
Test Driven Development with Laravel
PPTX
An Introduction To Software Development - Test Driven Development, Part 1
PPT
Tester career path
PDF
eXtreme Programming
PDF
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
PDF
Tdd - Test Driven Development
KEY
Bahaviour Driven Development
{10.0} Test Driven Development.pptx
Agile testing
Creating change from within - Agile Practitioners 2012
Jasmine
Understanding Why Testing is Importaint
Agile process
Tester Challenges in Agile ?
Driving application development through behavior driven development
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development and Automation
Completely Test-Driven
Test Driven Development with Laravel
An Introduction To Software Development - Test Driven Development, Part 1
Tester career path
eXtreme Programming
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Tdd - Test Driven Development
Bahaviour Driven Development

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
KodekX | Application Modernization Development
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Cloud computing and distributed systems.
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
“AI and Expert System Decision Support & Business Intelligence Systems”
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Understanding_Digital_Forensics_Presentation.pptx
KodekX | Application Modernization Development
Dropbox Q2 2025 Financial Results & Investor Presentation
MIND Revenue Release Quarter 2 2025 Press Release
Per capita expenditure prediction using model stacking based on satellite ima...
Big Data Technologies - Introduction.pptx
Programs and apps: productivity, graphics, security and other tools
Chapter 3 Spatial Domain Image Processing.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Cloud computing and distributed systems.
Network Security Unit 5.pdf for BCA BBA.
Spectral efficient network and resource selection model in 5G networks
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

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