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 Test Driven Development on Google App Engine

Acceptance Testing of Web UI
Acceptance Testing of Web UIAcceptance Testing of Web UI
Acceptance Testing of Web UI
Vladimir Tsukur
 
Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"Встреча "QA: в каких направлениях может найти себя тестировщик?"
Встреча "QA: в каких направлениях может найти себя тестировщик?"
GoIT
 
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
 
Agile Testing at eBay
Agile Testing at eBayAgile Testing at eBay
Agile Testing at eBay
Dominik Dary
 

Semelhante a Test Driven Development on Google 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

Guardian devexp and_discovery
Guardian devexp and_discoveryGuardian devexp and_discovery
Guardian devexp and_discovery
Ade 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

Último (20)

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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?
 
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
 
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
 
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
 
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
 
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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
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
 
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)
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Test Driven Development on Google App Engine

Notas do Editor