SlideShare ist ein Scribd-Unternehmen logo
1 von 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/

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von Ade Oshineye

Guardian devexp and_discovery
Guardian devexp and_discoveryGuardian devexp and_discovery
Guardian devexp and_discovery
Ade Oshineye
 

Mehr von 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
 

Kürzlich hochgeladen

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
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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...
 
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?
 

Test Driven Development on Google App Engine

Hinweis der Redaktion