SlideShare uma empresa Scribd logo
1 de 34
Real-world TDD on App
Engine
Mistakes Made and Lessons Learned
Adewale Oshineye




Developer Advocate @ Google
Projects and Examples


JaikuEngine: http://code.google.com/p/jaikuengine/
FeedParser: http://code.google.com/p/feedparser/
Streamer: http://github.com/adewale/streamer
TDD Is Hard
Especially On App Engine
What makes TDD on App
     Engine hard?
Models are Active Records


Models have a lifecycle (transient to persistent)
Tests need datastore
Keys are usually auto-generated
Platform and services


 System services are opaque
 Development environment isn’t an exact mirror of
 production environment
What should we do?
What should we do?




http://en.wikipedia.org/wiki/File:John_Major,_October_2007.jpg
What should we do?
                                              “We will do precisely what
                                              the British nation has
                                              done all through its history
                                              when it had its back to the
                                              wall — turn round and
                                              fight for the things it
                                              believes in, and that is
                                              what I shall do.”

http://en.wikipedia.org/wiki/File:John_Major,_October_2007.jpg
What did I do?
Exploration


 New to App Engine
 New App Engine services
Exploration


 Mock-up the UI
 Write handlers
 Get it working
Exploration


 Realisation
 Regret
 Refactor
Exploration


 Add tests
 Extract testable classes
 Add more tests
What should you do?
2 books
Exploitation

 Vertical slice for one feature
 Mock-up the UI
 Refine
Exploitation




 Write functional tests at the WSGI level
Exploitation




 Sketch out handlers
Exploitation

 Write unit tests
 Write domain classes
Exploitation
 Passing unit tests
 Passing functional tests
Exploitation



 Red-Green-Refactor
Exploitation


 UI does the right thing
 Repeat for next feature
Ways and means

Find a good testing framework
  nosegae and gae-testbed
  learn how to use stubs for the various platform
  services
  learn how to cycle between functional and unit tests
Heuristics

  Domain objects don’t have to be model objects
  Use simple factories for model objects
Heuristics


   If in doubt, write a test
   Testability requires work
   If it’s hard to test it’s probably broken
Heuristics


   Some things can only be understood in production
   End-to-end is further than you think
     even if you take this into account
References

gae-testbed http://github.com/jgeewax/gaetestbed/
nose-gae http://code.google.com/p/nose-gae/
nose http://code.google.com/p/python-nose/
Webtest http://pythonpaste.org/webtest/

Mais conteúdo relacionado

Semelhante a TDD Mistakes and Lessons Learned on App Engine

Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test AutomationNaveen Kumar Singh
 
Puppet Camp Paris 2014: Achieving Continuous Delivery and DevOps with Puppet
Puppet Camp Paris 2014: Achieving Continuous Delivery and DevOps with Puppet Puppet Camp Paris 2014: Achieving Continuous Delivery and DevOps with Puppet
Puppet Camp Paris 2014: Achieving Continuous Delivery and DevOps with Puppet Puppet
 
Achieving Continuous Delivery with Puppet
Achieving Continuous Delivery with PuppetAchieving Continuous Delivery with Puppet
Achieving Continuous Delivery with PuppetDevoteam Revolve
 
Acceptance Testing of Web UI
Acceptance Testing of Web UIAcceptance Testing of Web UI
Acceptance Testing of Web UIVladimir Tsukur
 
ROI & Business Value of CI, CD, DevOps, DevSecOps, & Microservices
ROI & Business Value of CI, CD, DevOps, DevSecOps, & MicroservicesROI & Business Value of CI, CD, DevOps, DevSecOps, & Microservices
ROI & Business Value of CI, CD, DevOps, DevSecOps, & MicroservicesDavid Rico
 
Business Value of CI, CD, & DevOps(Sec)
Business Value of CI, CD, & DevOps(Sec)Business Value of CI, CD, & DevOps(Sec)
Business Value of CI, CD, & DevOps(Sec)David Rico
 
Testing in a DevOps team
Testing in a DevOps teamTesting in a DevOps team
Testing in a DevOps teamLaurent PY
 
Agile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAgile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAdam Getchell
 
Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"GoIT
 
Onion layered Agile test practice Map to Continuous Delivery
Onion layered Agile test practice Map to Continuous DeliveryOnion layered Agile test practice Map to Continuous Delivery
Onion layered Agile test practice Map to Continuous DeliveryDr. Anish Cheriyan (PhD)
 
Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1willmation
 
Effective User Story Writing
Effective User Story WritingEffective User Story Writing
Effective User Story WritingAhmed Misbah
 
iOS Testing With Appium at Gilt
iOS Testing With Appium at GiltiOS Testing With Appium at Gilt
iOS Testing With Appium at GiltGilt Tech Talks
 
Product owner
Product ownerProduct owner
Product ownerMrSnow76
 
From 0 to DevOps in 80 Days [Webinar Replay]
From 0 to DevOps in 80 Days [Webinar Replay]From 0 to DevOps in 80 Days [Webinar Replay]
From 0 to DevOps in 80 Days [Webinar Replay]Dynatrace
 
The Agile Drupalist - Methodologies & Techniques for Running Effective Drupal...
The Agile Drupalist - Methodologies & Techniques for Running Effective Drupal...The Agile Drupalist - Methodologies & Techniques for Running Effective Drupal...
The Agile Drupalist - Methodologies & Techniques for Running Effective Drupal...Adrian Jones
 
Agile Testing at eBay
Agile Testing at eBayAgile Testing at eBay
Agile Testing at eBayDominik Dary
 

Semelhante a TDD Mistakes and Lessons Learned on App Engine (20)

Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test Automation
 
Puppet Camp Paris 2014: Achieving Continuous Delivery and DevOps with Puppet
Puppet Camp Paris 2014: Achieving Continuous Delivery and DevOps with Puppet Puppet Camp Paris 2014: Achieving Continuous Delivery and DevOps with Puppet
Puppet Camp Paris 2014: Achieving Continuous Delivery and DevOps with Puppet
 
Achieving Continuous Delivery with Puppet
Achieving Continuous Delivery with PuppetAchieving Continuous Delivery with Puppet
Achieving Continuous Delivery with Puppet
 
Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
Acceptance Testing of Web UI
Acceptance Testing of Web UIAcceptance Testing of Web UI
Acceptance Testing of Web UI
 
ROI & Business Value of CI, CD, DevOps, DevSecOps, & Microservices
ROI & Business Value of CI, CD, DevOps, DevSecOps, & MicroservicesROI & Business Value of CI, CD, DevOps, DevSecOps, & Microservices
ROI & Business Value of CI, CD, DevOps, DevSecOps, & Microservices
 
Business Value of CI, CD, & DevOps(Sec)
Business Value of CI, CD, & DevOps(Sec)Business Value of CI, CD, & DevOps(Sec)
Business Value of CI, CD, & DevOps(Sec)
 
Testing in a DevOps team
Testing in a DevOps teamTesting in a DevOps team
Testing in a DevOps team
 
Agile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAgile Secure Cloud Application Development Management
Agile Secure Cloud Application Development Management
 
Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"
 
Onion layered Agile test practice Map to Continuous Delivery
Onion layered Agile test practice Map to Continuous DeliveryOnion layered Agile test practice Map to Continuous Delivery
Onion layered Agile test practice Map to Continuous Delivery
 
Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1
 
Effective User Story Writing
Effective User Story WritingEffective User Story Writing
Effective User Story Writing
 
iOS Testing With Appium at Gilt
iOS Testing With Appium at GiltiOS Testing With Appium at Gilt
iOS Testing With Appium at Gilt
 
Product owner
Product ownerProduct owner
Product owner
 
Product owner
Product ownerProduct owner
Product owner
 
From 0 to DevOps in 80 Days [Webinar Replay]
From 0 to DevOps in 80 Days [Webinar Replay]From 0 to DevOps in 80 Days [Webinar Replay]
From 0 to DevOps in 80 Days [Webinar Replay]
 
The Agile Drupalist - Methodologies & Techniques for Running Effective Drupal...
The Agile Drupalist - Methodologies & Techniques for Running Effective Drupal...The Agile Drupalist - Methodologies & Techniques for Running Effective Drupal...
The Agile Drupalist - Methodologies & Techniques for Running Effective Drupal...
 
CV_pawan
CV_pawanCV_pawan
CV_pawan
 
Agile Testing at eBay
Agile Testing at eBayAgile Testing at eBay
Agile Testing at eBay
 

Mais de Ade Oshineye

Google+ Hangouts at Digital Shoreditch
Google+ Hangouts at Digital ShoreditchGoogle+ Hangouts at Digital Shoreditch
Google+ Hangouts at Digital ShoreditchAde Oshineye
 
Google+: an introduction
Google+: an introductionGoogle+: an introduction
Google+: an introductionAde Oshineye
 
The freedom to be you
The freedom to be youThe freedom to be you
The freedom to be youAde Oshineye
 
Google, Developer Experience and Discovery
Google, Developer Experience and DiscoveryGoogle, Developer Experience and Discovery
Google, Developer Experience and DiscoveryAde Oshineye
 
Guardian devexp and_discovery
Guardian devexp and_discoveryGuardian devexp and_discovery
Guardian devexp and_discoveryAde Oshineye
 
Distributed Backups for friends and communities
Distributed Backups for friends and communitiesDistributed Backups for friends and communities
Distributed Backups for friends and communitiesAde Oshineye
 
Powering the Social Web (at the Dublin GTUG)
Powering the Social Web (at the Dublin GTUG)Powering the Social Web (at the Dublin GTUG)
Powering the Social Web (at the Dublin GTUG)Ade Oshineye
 
What comes after social networking?
What comes after social networking?What comes after social networking?
What comes after social networking?Ade Oshineye
 
Exploring Google's Social APIs
Exploring Google's Social APIsExploring Google's Social APIs
Exploring Google's Social APIsAde Oshineye
 

Mais de Ade Oshineye (10)

Google+ Hangouts at Digital Shoreditch
Google+ Hangouts at Digital ShoreditchGoogle+ Hangouts at Digital Shoreditch
Google+ Hangouts at Digital Shoreditch
 
Google+: an introduction
Google+: an introductionGoogle+: an introduction
Google+: an introduction
 
The freedom to be you
The freedom to be youThe freedom to be you
The freedom to be you
 
Google, Developer Experience and Discovery
Google, Developer Experience and DiscoveryGoogle, Developer Experience and Discovery
Google, Developer Experience and Discovery
 
Guardian devexp and_discovery
Guardian devexp and_discoveryGuardian devexp and_discovery
Guardian devexp and_discovery
 
Distributed Backups for friends and communities
Distributed Backups for friends and communitiesDistributed Backups for friends and communities
Distributed Backups for friends and communities
 
Powering the Social Web (at the Dublin GTUG)
Powering the Social Web (at the Dublin GTUG)Powering the Social Web (at the Dublin GTUG)
Powering the Social Web (at the Dublin GTUG)
 
What comes after social networking?
What comes after social networking?What comes after social networking?
What comes after social networking?
 
Google masterplan
Google masterplanGoogle masterplan
Google masterplan
 
Exploring Google's Social APIs
Exploring Google's Social APIsExploring Google's Social APIs
Exploring Google's Social APIs
 

Último

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
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 

Último (20)

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
 
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)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 

TDD Mistakes and Lessons Learned on App Engine

Notas do Editor