SlideShare a Scribd company logo
7 Years In Testing
Tamás Tompa (Digital Natives)
tamas.tompa@digitalnatives.hu
Budapest Ruby Meetup 2013
11/09/2013
Thursday, September 12, 13
§ 7 years in ruby, rails
§ 7 years in webapp testing
§ 5 years in agile development
§ 5 years in automated testing
Thursday, September 12, 13
Looking for testing
best practices
Thursday, September 12, 13
Short version
INTEGRATE
AUTOMATE
Thursday, September 12, 13
Short version
INTEGRATE
AUTOMATE
(everything)
Thursday, September 12, 13
Human VS Machine
§ Use humans for thinking
§ Use machines for executing
§ Humans can forgive, forget things
§ Machines are strict, consequent
Thursday, September 12, 13
Theory
Thursday, September 12, 13
Development Workflow
Resolved Deployed
Testing /
Working
Testing /
Not
working
In
progress Stable
for feature based development
Thursday, September 12, 13
Automating steps
Resolved Deployed
Testing /
Working
Testing /
Not
working
In
progress Stable
Manual Automatic Manual Automatic
Thursday, September 12, 13
Automated Testing
§ rspec
§ turnip
§ cucumber
§ capybara
§ selenium -> phantomjs
§ factory girl
§ jenkins / cloud CI
TOOLS
Thursday, September 12, 13
Working, bug free software is
priceless...
Thursday, September 12, 13
Working, bug free software is
more expensive...
Thursday, September 12, 13
... but only if you don’t know
how to test
and maintain your code
Thursday, September 12, 13
Write tests for those parts of the
code which are...
§ the most often used
§ changing frequently
§ changing data and working with
financial data
§ more likely to fail
Thursday, September 12, 13
Instrumentation
§ Instrumentation means that the code gets enhanced with
flags, and when the execution passes a certain flag, it
gets set. When a test code coverage measurement is
made then the tool:
§ instruments the code - places these flags
§ runs the test cases - flags get set
§ and finally prints out the result - how many flags have
been set
§ During usage coverage measurement, test execution is
replaced by customer interaction.
Thursday, September 12, 13
Most often used code
§ Instrument the code base and deliver
it to the testers / customer
§ Turn on coverage measurement in your
(staging) application
§ Deploy it
§ Do manual testing of critical functions
§ Summarize and analyze metrics
§ Write tests for highly covered classes
Thursday, September 12, 13
Frequently changing code
§ Use version control system logs
§ Gitinspector
§ StatSVN
§ Find out which files change often!
Thursday, September 12, 13
Working with data
§ Make code reviews
§ Re-prioritize classes and methods
§ Add more priority when data is critical
§ Move to top when working with money
Thursday, September 12, 13
Failing, problematic code
§ Find and analyze bugs in your Issue
Tracker System
§ Write test before fixing the issue
§ Review CI server logs
§ collect often failing tests
§ Refactor unstable code
§ refactor your tests also
Thursday, September 12, 13
Git branching
§ Work only with feature branches
§ Test the branches separately
§ Use Pull Requests to integrate
feature branches to a development
branch
§ Do more (manual) testing on
development branch
§ Merge easily to stable,
than finally to production
Thursday, September 12, 13
Methods
§ TDD - it’s up to you :)
§ BDD - based on TDD + domain
specific acceptance criterias
§ CDD - for prototypes, spikes
Thursday, September 12, 13
In practice...
Thursday, September 12, 13
Manual Testing
§ Plan your test cases
§ at Sprint Planning Meetings
§ Allocate a good Tester to the team
§ If you can’t, test all User Story after
completion, within team, but between
team members
§ Try to measure coverage during
manual testing
Thursday, September 12, 13
Continuous Integration
§ Jenkins server
§ Cloud alternatives: travis-ci, circleci, drone.io
§ Parallel job execution (queues / executors)
§ Main branches VS Feature branches
§ Instant builds VS Daily builds
§ Conflicting databases and shared resources
§ CI rake task in the project
§ Re-run logic for Cucumber tests
§ Long running jobs
Thursday, September 12, 13
CI - Ruby, Rails
§ Jenkins / RVM Plugin
§ RVM-managed environment:
ruby-1.9.3-p392@PROJECTNAME
§ Jenkins / Ruby Metrics Plugin
§ Rcov coverage report
§ Other stats
§ Bundler integration
Thursday, September 12, 13
Thursday, September 12, 13
CI - Feature branches
§ Jenkins / Git Plugin
§ Branches to build:
^(?!.*master|stable|development|origin/HEAD).*$
§ Jenkins / Version Number Plugin
§ Version Number Format String:
#${BUILD_NUMBER}-${GIT_BRANCH}
Thursday, September 12, 13
CI - Build types
§ Instant builds
§ Higher priority
§ Immediately after commit
§ Build trigger: Poll SCM
§ Daily builds
§ Once a day
§ Long running tests
§ Build trigger: Build periodically
Thursday, September 12, 13
CI - Rake
task :commit => :clean do
Rake::Task['db:migrate'].invoke
Rake::Task['db:test:load'].invoke
Rake::Task['db:test:purge'].invoke
Rake::Task['ci:build:rspec_internal'].invoke
Rake::Task['ci:build:cucumber_internal'].invoke
end
rake ci:build:commit
> Example: https://gist.github.com/tompata/6513021
Thursday, September 12, 13
CI - Rerun
§ Re-run only previously failing tests
§ Re-try the randomly failing tests
§ Built-in support in Cucumber
§ Easy integration with Jenkins
§ Save resources and time
> Example: https://gist.github.com/tompata/6513060
Thursday, September 12, 13
CI - Integration
§ Bitbucket
§ Redmine
§ Notifiers (HipChat, Email, Desktop)
§ Deployment (Capistrano)
§ Monitoring (Airbrake, New Relic)
Thursday, September 12, 13
Thursday, September 12, 13
Thursday, September 12, 13
Thursday, September 12, 13
Thursday, September 12, 13
Thursday, September 12, 13
Browser tests
§ integration tests
§ cucumber / capybara
§ responsive design
§ phantomjs / screen sizes
§ cross browser (design)
§ mtest (npm) - multiplatform
§ saucelabs / cloud
§ 162 device/os/browser platforms
Thursday, September 12, 13
Responsive design
§ PhantomJS
§ Screen resolutions (window_size)
§ Cucumber profiles
> Example: https://gist.github.com/tompata/6512905
Thursday, September 12, 13
Stress tests
§ penetration / load testing before
releases
§ use separated, dedicated
environments (staging test)
§ use virtual instances (ec2)
§ monitor instances (new relic)
§ use online tools (loadimpact,
loader.io) or local (jmeter)
Thursday, September 12, 13
Coverage, Quality
§ rcov
§ simple cov
§ the magical 80%
§ code climate - code analysis, quality
Thursday, September 12, 13
INTEGRATE
AUTOMATE
Thursday, September 12, 13
Resources
§ http://zsoltfabok.com/blog/2011/05/narrow-down-what-to-test/
§ http://nvie.com/posts/a-successful-git-branching-model/
§ http://jenkins-ci.org/
§ https://wiki.jenkins-ci.org/display/JENKINS/Ruby+Metrics+Plugin
§ https://saucelabs.com/
§ https://github.com/digitalnatives/
§ https://github.com/digitalnatives/mtest
§ https://gist.github.com/tompata/6513021
§ https://gist.github.com/tompata/6513060
§ https://gist.github.com/tompata/6512905
§ https://codeclimate.com/
§ http://loadimpact.com/
Thursday, September 12, 13
We’re hiring!
http://digitalnatives.hu/jobs
Thursday, September 12, 13

More Related Content

What's hot (20)

KEY
Scale like a pro with Gearman
Amal Raghav
 
KEY
Gearman
Brian Moon
 
PDF
Lunch and learn: Cucumber and Capybara
Marc Seeger
 
PPTX
Automated Testing with Cucumber, PhantomJS and Selenium
Dev9Com
 
PDF
The Mysteries Of JavaScript-Fu (RailsConf Ediition)
danwrong
 
PPTX
Untangling spring week11
Derek Jacoby
 
PDF
Show an Open Source Project Some Love and Start Using Travis-CI
Joel Byler
 
PPTX
Lets cook cucumber !!
vodQA
 
PDF
Managing Complexity with Module::Release
brian d foy
 
PDF
Groovy on Google App Engine with Gaelyk
Kevin H.A. Tan
 
PDF
Trunk-Based Development and Toggling
Bryan Liu
 
PDF
Continuous delivery of your legacy application
ColdFusionConference
 
PDF
Test Driving a jQuery Plugin
Naresh Jain
 
PDF
JVM Web Frameworks Exploration
Kevin H.A. Tan
 
PDF
Jest: Frontend Testing leicht gemacht @EnterJS2018
Holger Grosse-Plankermann
 
PDF
The Power Of Refactoring (PHPNW)
Stefan Koopmanschap
 
PPTX
CI/CD doesn’t necessarily mean Jenkins - Omer Hamerman - DevOpsDays Tel Aviv ...
DevOpsDays Tel Aviv
 
PDF
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
Gavin Pickin
 
PPTX
Untangling spring week10
Derek Jacoby
 
PPTX
Speed = $$$
Peter Gfader
 
Scale like a pro with Gearman
Amal Raghav
 
Gearman
Brian Moon
 
Lunch and learn: Cucumber and Capybara
Marc Seeger
 
Automated Testing with Cucumber, PhantomJS and Selenium
Dev9Com
 
The Mysteries Of JavaScript-Fu (RailsConf Ediition)
danwrong
 
Untangling spring week11
Derek Jacoby
 
Show an Open Source Project Some Love and Start Using Travis-CI
Joel Byler
 
Lets cook cucumber !!
vodQA
 
Managing Complexity with Module::Release
brian d foy
 
Groovy on Google App Engine with Gaelyk
Kevin H.A. Tan
 
Trunk-Based Development and Toggling
Bryan Liu
 
Continuous delivery of your legacy application
ColdFusionConference
 
Test Driving a jQuery Plugin
Naresh Jain
 
JVM Web Frameworks Exploration
Kevin H.A. Tan
 
Jest: Frontend Testing leicht gemacht @EnterJS2018
Holger Grosse-Plankermann
 
The Power Of Refactoring (PHPNW)
Stefan Koopmanschap
 
CI/CD doesn’t necessarily mean Jenkins - Omer Hamerman - DevOpsDays Tel Aviv ...
DevOpsDays Tel Aviv
 
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
Gavin Pickin
 
Untangling spring week10
Derek Jacoby
 
Speed = $$$
Peter Gfader
 

Viewers also liked (20)

PDF
Introduction to Reactive
Cantina
 
ODP
Agille Testing Meetup 1
Nathan Bain
 
KEY
Acunu Cassandra London Meetup
Acunu
 
PDF
Agile Testing Alliance Chapter and Meetup Details - June 2016
Agile Testing Alliance
 
PPTX
Peer Meetup introduction & networking by Safaraz Ali delivered on 18th Nov 2016
The Pathway Group
 
PPTX
Paris Qa meetup - The testing family
Kenaz Lee
 
PPTX
Puppet meetup testing
Phil Zimmerman
 
PDF
Ata pune 12 meetup 17 September 2016 - Introduction by Amol Deshpande
Agile Testing Alliance
 
PDF
Integration Testing for Polyglot Ecosystems
David Worth
 
PDF
Ata pune 12 meetup Future of testing 17 sep 2016 by sanjay upadhyay
Agile Testing Alliance
 
PPTX
Paris Qa Meetup - Testing Family
Kenaz Lee
 
PDF
Java Beginners Meetup February 2017: Testing and TDD
Patrick Kostjens
 
PDF
Meetup kickoff slides - Perfecto Mobile, September 2014
Perfecto Mobile
 
PPTX
DevOps Columbus Meetup Kickoff - Infrastructure as Code
Michael Ducy
 
PPTX
RST - Makati Testers Meetup
Michele Playfair
 
PPTX
Meetup Testing Workshop 2016 - Gatling para pruebas de performance - Federico...
Federico Toledo
 
PDF
Helsinki Legal Tech Meetup introduction
Anna Ronkainen
 
PDF
NoVA UX Meetup: Product Testing and Data-informed Design
Jim Lane
 
PPTX
Tundra at Agile Mississauga Meetup Kick off Event
Abiodun Osoba
 
PDF
The Invisible Art Of Software Testing
Noah Sussman
 
Introduction to Reactive
Cantina
 
Agille Testing Meetup 1
Nathan Bain
 
Acunu Cassandra London Meetup
Acunu
 
Agile Testing Alliance Chapter and Meetup Details - June 2016
Agile Testing Alliance
 
Peer Meetup introduction & networking by Safaraz Ali delivered on 18th Nov 2016
The Pathway Group
 
Paris Qa meetup - The testing family
Kenaz Lee
 
Puppet meetup testing
Phil Zimmerman
 
Ata pune 12 meetup 17 September 2016 - Introduction by Amol Deshpande
Agile Testing Alliance
 
Integration Testing for Polyglot Ecosystems
David Worth
 
Ata pune 12 meetup Future of testing 17 sep 2016 by sanjay upadhyay
Agile Testing Alliance
 
Paris Qa Meetup - Testing Family
Kenaz Lee
 
Java Beginners Meetup February 2017: Testing and TDD
Patrick Kostjens
 
Meetup kickoff slides - Perfecto Mobile, September 2014
Perfecto Mobile
 
DevOps Columbus Meetup Kickoff - Infrastructure as Code
Michael Ducy
 
RST - Makati Testers Meetup
Michele Playfair
 
Meetup Testing Workshop 2016 - Gatling para pruebas de performance - Federico...
Federico Toledo
 
Helsinki Legal Tech Meetup introduction
Anna Ronkainen
 
NoVA UX Meetup: Product Testing and Data-informed Design
Jim Lane
 
Tundra at Agile Mississauga Meetup Kick off Event
Abiodun Osoba
 
The Invisible Art Of Software Testing
Noah Sussman
 
Ad

Similar to Ruby meetup 7_years_in_testing (20)

PDF
Backbone
Ynon Perek
 
PDF
From naive to agile - software engineering approach
Stayman Hou
 
PDF
Make Your Build Great Again (DroidConSF 2017)
Jared Burrows
 
PDF
Continuous Security Testing
Steven Mak
 
PDF
Building a Single-Page App: Backbone, Node.js, and Beyond
Spike Brehm
 
PDF
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
The Hive
 
PPTX
Serenity BDD Workshop - 9th March 2016
vodqasg
 
PDF
Grunt.js and Yeoman, Continous Integration
David Amend
 
PDF
Cd syd
Michael Neale
 
PDF
Siegfried Goeschl - Performance Testing of a Road Tolling System - EuroSTAR 2012
TEST Huddle
 
PDF
Gradle - the Enterprise Automation Tool
Izzet Mustafaiev
 
PDF
CI/CD for Data - Building Data Development Environment with lakeFS
ScyllaDB
 
PDF
Off the Treadmill: Building a Drupal Platform for Your Organization
Rick Vugteveen
 
PDF
Serverless in production, an experience report (IWOMM)
Yan Cui
 
PPTX
2019-09-10: Testing Contributions at Scale
Allen Wittenauer
 
PDF
Serverless in Production, an experience report (AWS UG South Wales)
Yan Cui
 
PDF
The "Holy Grail" of Dev/Ops
Erik Osterman
 
PDF
Kostentreiber bei der iOS-Entwicklung
xrb
 
PDF
Kostentreiber bei der iOS Entwicklung
Reto Zenger
 
PDF
Serverless in production, an experience report (FullStack 2018)
Yan Cui
 
Backbone
Ynon Perek
 
From naive to agile - software engineering approach
Stayman Hou
 
Make Your Build Great Again (DroidConSF 2017)
Jared Burrows
 
Continuous Security Testing
Steven Mak
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Spike Brehm
 
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
The Hive
 
Serenity BDD Workshop - 9th March 2016
vodqasg
 
Grunt.js and Yeoman, Continous Integration
David Amend
 
Siegfried Goeschl - Performance Testing of a Road Tolling System - EuroSTAR 2012
TEST Huddle
 
Gradle - the Enterprise Automation Tool
Izzet Mustafaiev
 
CI/CD for Data - Building Data Development Environment with lakeFS
ScyllaDB
 
Off the Treadmill: Building a Drupal Platform for Your Organization
Rick Vugteveen
 
Serverless in production, an experience report (IWOMM)
Yan Cui
 
2019-09-10: Testing Contributions at Scale
Allen Wittenauer
 
Serverless in Production, an experience report (AWS UG South Wales)
Yan Cui
 
The "Holy Grail" of Dev/Ops
Erik Osterman
 
Kostentreiber bei der iOS-Entwicklung
xrb
 
Kostentreiber bei der iOS Entwicklung
Reto Zenger
 
Serverless in production, an experience report (FullStack 2018)
Yan Cui
 
Ad

More from Digital Natives (15)

PDF
How to support innovation in organisations @ Startup Safary
Digital Natives
 
PDF
A termékfejlesztés rögös útja (avagy barangolás a módszertanok és eszközök er...
Digital Natives
 
PDF
Agile és lean workshop @ Startup Safary
Digital Natives
 
PDF
Introduction to GraphQL with Ruby
Digital Natives
 
PDF
A visual introduction to concurrency and parallellism patterns
Digital Natives
 
PPTX
How flat organisations support the innovation
Digital Natives
 
PPTX
CULTURE OF INNOVATION
Digital Natives
 
PDF
Testing in JavaScript
Digital Natives
 
PDF
Basics of Metaprogramming in Ruby
Digital Natives
 
PPT
Digital natives incubation process_2011-11-23_v09
Digital Natives
 
PDF
Evolution of the Software Development Process ad Digital Natives
Digital Natives
 
PPTX
Mixgar in Volt festival 2011
Digital Natives
 
PPTX
Mixgar prezi v1.2
Digital Natives
 
PDF
Budapest.rb 2011/01 - Rails Deployment
Digital Natives
 
PDF
Budapest.rb 201010
Digital Natives
 
How to support innovation in organisations @ Startup Safary
Digital Natives
 
A termékfejlesztés rögös útja (avagy barangolás a módszertanok és eszközök er...
Digital Natives
 
Agile és lean workshop @ Startup Safary
Digital Natives
 
Introduction to GraphQL with Ruby
Digital Natives
 
A visual introduction to concurrency and parallellism patterns
Digital Natives
 
How flat organisations support the innovation
Digital Natives
 
CULTURE OF INNOVATION
Digital Natives
 
Testing in JavaScript
Digital Natives
 
Basics of Metaprogramming in Ruby
Digital Natives
 
Digital natives incubation process_2011-11-23_v09
Digital Natives
 
Evolution of the Software Development Process ad Digital Natives
Digital Natives
 
Mixgar in Volt festival 2011
Digital Natives
 
Mixgar prezi v1.2
Digital Natives
 
Budapest.rb 2011/01 - Rails Deployment
Digital Natives
 
Budapest.rb 201010
Digital Natives
 

Recently uploaded (20)

PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 

Ruby meetup 7_years_in_testing

  • 1. 7 Years In Testing Tamás Tompa (Digital Natives) [email protected] Budapest Ruby Meetup 2013 11/09/2013 Thursday, September 12, 13
  • 2. § 7 years in ruby, rails § 7 years in webapp testing § 5 years in agile development § 5 years in automated testing Thursday, September 12, 13
  • 3. Looking for testing best practices Thursday, September 12, 13
  • 6. Human VS Machine § Use humans for thinking § Use machines for executing § Humans can forgive, forget things § Machines are strict, consequent Thursday, September 12, 13
  • 8. Development Workflow Resolved Deployed Testing / Working Testing / Not working In progress Stable for feature based development Thursday, September 12, 13
  • 9. Automating steps Resolved Deployed Testing / Working Testing / Not working In progress Stable Manual Automatic Manual Automatic Thursday, September 12, 13
  • 10. Automated Testing § rspec § turnip § cucumber § capybara § selenium -> phantomjs § factory girl § jenkins / cloud CI TOOLS Thursday, September 12, 13
  • 11. Working, bug free software is priceless... Thursday, September 12, 13
  • 12. Working, bug free software is more expensive... Thursday, September 12, 13
  • 13. ... but only if you don’t know how to test and maintain your code Thursday, September 12, 13
  • 14. Write tests for those parts of the code which are... § the most often used § changing frequently § changing data and working with financial data § more likely to fail Thursday, September 12, 13
  • 15. Instrumentation § Instrumentation means that the code gets enhanced with flags, and when the execution passes a certain flag, it gets set. When a test code coverage measurement is made then the tool: § instruments the code - places these flags § runs the test cases - flags get set § and finally prints out the result - how many flags have been set § During usage coverage measurement, test execution is replaced by customer interaction. Thursday, September 12, 13
  • 16. Most often used code § Instrument the code base and deliver it to the testers / customer § Turn on coverage measurement in your (staging) application § Deploy it § Do manual testing of critical functions § Summarize and analyze metrics § Write tests for highly covered classes Thursday, September 12, 13
  • 17. Frequently changing code § Use version control system logs § Gitinspector § StatSVN § Find out which files change often! Thursday, September 12, 13
  • 18. Working with data § Make code reviews § Re-prioritize classes and methods § Add more priority when data is critical § Move to top when working with money Thursday, September 12, 13
  • 19. Failing, problematic code § Find and analyze bugs in your Issue Tracker System § Write test before fixing the issue § Review CI server logs § collect often failing tests § Refactor unstable code § refactor your tests also Thursday, September 12, 13
  • 20. Git branching § Work only with feature branches § Test the branches separately § Use Pull Requests to integrate feature branches to a development branch § Do more (manual) testing on development branch § Merge easily to stable, than finally to production Thursday, September 12, 13
  • 21. Methods § TDD - it’s up to you :) § BDD - based on TDD + domain specific acceptance criterias § CDD - for prototypes, spikes Thursday, September 12, 13
  • 23. Manual Testing § Plan your test cases § at Sprint Planning Meetings § Allocate a good Tester to the team § If you can’t, test all User Story after completion, within team, but between team members § Try to measure coverage during manual testing Thursday, September 12, 13
  • 24. Continuous Integration § Jenkins server § Cloud alternatives: travis-ci, circleci, drone.io § Parallel job execution (queues / executors) § Main branches VS Feature branches § Instant builds VS Daily builds § Conflicting databases and shared resources § CI rake task in the project § Re-run logic for Cucumber tests § Long running jobs Thursday, September 12, 13
  • 25. CI - Ruby, Rails § Jenkins / RVM Plugin § RVM-managed environment: ruby-1.9.3-p392@PROJECTNAME § Jenkins / Ruby Metrics Plugin § Rcov coverage report § Other stats § Bundler integration Thursday, September 12, 13
  • 27. CI - Feature branches § Jenkins / Git Plugin § Branches to build: ^(?!.*master|stable|development|origin/HEAD).*$ § Jenkins / Version Number Plugin § Version Number Format String: #${BUILD_NUMBER}-${GIT_BRANCH} Thursday, September 12, 13
  • 28. CI - Build types § Instant builds § Higher priority § Immediately after commit § Build trigger: Poll SCM § Daily builds § Once a day § Long running tests § Build trigger: Build periodically Thursday, September 12, 13
  • 29. CI - Rake task :commit => :clean do Rake::Task['db:migrate'].invoke Rake::Task['db:test:load'].invoke Rake::Task['db:test:purge'].invoke Rake::Task['ci:build:rspec_internal'].invoke Rake::Task['ci:build:cucumber_internal'].invoke end rake ci:build:commit > Example: https://gist.github.com/tompata/6513021 Thursday, September 12, 13
  • 30. CI - Rerun § Re-run only previously failing tests § Re-try the randomly failing tests § Built-in support in Cucumber § Easy integration with Jenkins § Save resources and time > Example: https://gist.github.com/tompata/6513060 Thursday, September 12, 13
  • 31. CI - Integration § Bitbucket § Redmine § Notifiers (HipChat, Email, Desktop) § Deployment (Capistrano) § Monitoring (Airbrake, New Relic) Thursday, September 12, 13
  • 37. Browser tests § integration tests § cucumber / capybara § responsive design § phantomjs / screen sizes § cross browser (design) § mtest (npm) - multiplatform § saucelabs / cloud § 162 device/os/browser platforms Thursday, September 12, 13
  • 38. Responsive design § PhantomJS § Screen resolutions (window_size) § Cucumber profiles > Example: https://gist.github.com/tompata/6512905 Thursday, September 12, 13
  • 39. Stress tests § penetration / load testing before releases § use separated, dedicated environments (staging test) § use virtual instances (ec2) § monitor instances (new relic) § use online tools (loadimpact, loader.io) or local (jmeter) Thursday, September 12, 13
  • 40. Coverage, Quality § rcov § simple cov § the magical 80% § code climate - code analysis, quality Thursday, September 12, 13
  • 42. Resources § http://zsoltfabok.com/blog/2011/05/narrow-down-what-to-test/ § http://nvie.com/posts/a-successful-git-branching-model/ § http://jenkins-ci.org/ § https://wiki.jenkins-ci.org/display/JENKINS/Ruby+Metrics+Plugin § https://saucelabs.com/ § https://github.com/digitalnatives/ § https://github.com/digitalnatives/mtest § https://gist.github.com/tompata/6513021 § https://gist.github.com/tompata/6513060 § https://gist.github.com/tompata/6512905 § https://codeclimate.com/ § http://loadimpact.com/ Thursday, September 12, 13