SlideShare a Scribd company logo
1 of 27
Beginning developer’s guide to
Automated Testing
By Jeff Ross
Presenter Background
• Originally a Coldfusion Developer
• Converted to Ruby on Rails 1.5 years ago
• Attending DCRug for almost a year
Topics to cover
• Testing Basics
• Benefits of Automated Testing
• Testing Models
• Testing technics
• Resources
• Questions
Testing Types
• Accessibility (508)
• Exploratory
• Integration
• Performance (Load)
• Regression
• Security
• UAT
• Unit
• Usability
Automated Testing Basics
What are unit tests?
A unit test is an automated piece of code that invokes a unit of work in the
system and then checks a single assumption about the behavior of that
unit of work. A unit of work is a single logical functional use case in the
system that can be invoked by some public interface (in most cases).
What is code coverage?
Code coverage is a measure used to describe the degree to
which the source code of a program is tested by a particular
test suite.
Testing Enhancers
• Fixtures
(Fixtures allow you to populate your testing database with predefined data before your tests run. )
• Factory Girl
(allow customization when you instantiate the objects and it aims to ensure that you
have a valid object to work with within your tests)
• Rspec
• Capybara
(Capybara helps you test web applications by simulating how a real user would interact with your
app.)
• Cucumber
• Database cleaner
(Database Cleaner is a set of strategies for cleaning your database
• in Ruby.)
Testing processes
TDD – Test Driven Development
1-write,run,fail test;
2-write minimal amount of code to pass test;
3-re-run test;
4-refactor code;
5-re-run test
Objectives
-Encourages simple design
-forces decoupled code
-creates robust test suite
-Focuses more on functionality
I.e. - Rspec
Testing processes
• BDD – Behavior Driven Development
generally arose from the idea that software development
should be managed by both the business and engineering.
So it seeks to create a common language between the two.
-”Given”, “When”,”[And]”,”Then”
Objectives
-Encourages collaboration
-Mimics user behavior
-delivers meaningful tests
I.e. - Cucumber
Testing Basics
• Where does it fit?
Benefits of Automated Testing
• Organizationally speaking it puts the burden of code
quality on the developers.
• Promotes code collaboration
• Eases resistance and/or fear of technical changes
• Promotes efficiency
• A form of documentation
• Shortens the feedback loop
• Frees up testing resources
Economics of Automated Testing
Technical debt - is a recent metaphor referring to the eventual consequences of poor
system design, software architecture or software development within a codebase. The
debt can be thought of as work that needs to be done before a particular job can be
considered complete or proper
Testing Models
• Agile Test Automation Pyramid
(http://www.velocitypartners.net/blog/2014/01/28/agile-testing-the-agile-test-automation-pyramid/)
• Agile Testing Quadrants
(http://lisacrispin.com/2011/11/08/using-the-agile-testing-quadrants/)
• Google’s: Small, Medium, Large
(http://googletesting.blogspot.com/2010/12/test-sizes.html)
Agile Test Automation Pyramid
Inverted Agile Pyramid
Testing Models
• In the traditional view, most if not
all of the effort was in developing
UI-centric functional tests that
explored the application via the
GUI. There might be some lower-
level tests and a few unit tests, but
teams mostly staid at the upper
tier.
• The first change is taking a whole-
team view. Instead of the testers
being responsible for testing AND
writing all of the test automation,
it becomes a whole-team
responsibility. The developers take
most of the ownership for unit-
level automation, but testers can
operate here as well. The upper
tier focuses on limited UI-based
automation. Usually, these are
longer running, core customer
usage workflows that are best
implemented at this level.
Testing Models and efficiency
TESTING BY LAYERS
Most bang for your buck testing your model thoroughly
Testing Technics
Using design patterns to enhance your tests.
• Fat Model/Skinny Controller
-The idea of developing your code in such a way
that utilizes all the benefits of activeRecord in
your model rather than placing your logic in your
controller.
-Following this pattern lends itself to
better test scripts.
Controllers
• Controllers are pass-through entities
• Mostly boilerplate-biz logic belongs in the
model
• Controllers are “dumb” or “Skinny”
• They follow the “Controller Formula”
• Minimum Valid Object ( Factory Girl )
Controller/Reads Test Pattern
Make a request (with id of record if a single record)
Check rendering
correct template
redirect
status code
content type (html, json, xml,..)
Verify Variable Assignments
required by view
Controller/Reads Test Pattern
Controller Create/Update Test Pattern
• Make request with form fields to be
created/upd’d
• Verify Variable Assignments
• Verify/Check Success
– Variable is saved / record created
• Verify Failure/Error Case
• Rendering
• Variables are defined
• Record not saved
• Verify HTTP Verb protection
Controller Create Spec
Model Testing
THINGS TEST SHOULD COVER
• Verify Validations
• Verify Custom functions
• Verify Associations
• Verify Nested Attributes
• Show example
Testing Views
• Emphasize behavior over display
• Check that the application handles errors
correctly
• Test views for things that could go wrong
badly
Testing Technics
Page Object Pattern
Within your web app's UI there are areas that your tests interact with. A Page Object simply
models these as objects within the test code. This reduces the amount of duplicated code and
means that if the UI changes, the fix need only be applied in one place.
Testing Technics
Design patterns
• SRP – Single Responsibility Principle
(http://www.objectmentor.com/resources/articles/srp.pdf)
• DRY – Don’t Repeat Yourself
• Page Object
• Fat Model/Skinny Controller
• Single-Table Inheritance
(show customer<Person extension)
Resources
• Single-Table Inheritance
http://www.alexreisner.com/code/single-table-inheritance-in-rails
• Page Object Pattern
(http://code.tutsplus.com/articles/maintainable-automated-ui-tests--net-35089)
• Better Rspec
(http://betterspecs.org)

More Related Content

What's hot

Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...
guest0efb5e
 

What's hot (20)

Unit Testing and Tools - ADNUG
Unit Testing and Tools - ADNUGUnit Testing and Tools - ADNUG
Unit Testing and Tools - ADNUG
 
Automated tests to a REST API
Automated tests to a REST APIAutomated tests to a REST API
Automated tests to a REST API
 
Benefits from AATs
Benefits from AATsBenefits from AATs
Benefits from AATs
 
Automated testing in javascript
Automated testing in javascriptAutomated testing in javascript
Automated testing in javascript
 
BDD for APIs
BDD for APIsBDD for APIs
BDD for APIs
 
Automation test scripting techniques
Automation test scripting techniquesAutomation test scripting techniques
Automation test scripting techniques
 
Test automation
Test automationTest automation
Test automation
 
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f..." Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
 
Cypress test techniques cucumber bdd framework,tdd,api tests course
Cypress test techniques cucumber bdd framework,tdd,api tests courseCypress test techniques cucumber bdd framework,tdd,api tests course
Cypress test techniques cucumber bdd framework,tdd,api tests course
 
Unit Testing in Swift
Unit Testing in SwiftUnit Testing in Swift
Unit Testing in Swift
 
Test automation methodologies
Test automation methodologiesTest automation methodologies
Test automation methodologies
 
Functional Testing of RESTful Applications
Functional Testing of RESTful ApplicationsFunctional Testing of RESTful Applications
Functional Testing of RESTful Applications
 
Henk Doornbos & Rix Groenboom - Test Patterns: A New Concept For Testing
Henk Doornbos & Rix Groenboom - Test Patterns: A New Concept For TestingHenk Doornbos & Rix Groenboom - Test Patterns: A New Concept For Testing
Henk Doornbos & Rix Groenboom - Test Patterns: A New Concept For Testing
 
Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...
 
Cypress Test Techniques-Cucumber BDD Framework,TDD,API Tests
Cypress Test Techniques-Cucumber BDD Framework,TDD,API TestsCypress Test Techniques-Cucumber BDD Framework,TDD,API Tests
Cypress Test Techniques-Cucumber BDD Framework,TDD,API Tests
 
Unit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and MoqUnit Testing in Action - C#, NUnit, and Moq
Unit Testing in Action - C#, NUnit, and Moq
 
Test Driven Development - a Practitioner’s Perspective
Test Driven Development - a Practitioner’s PerspectiveTest Driven Development - a Practitioner’s Perspective
Test Driven Development - a Practitioner’s Perspective
 
API Testing with Open Source Code and Cucumber
API Testing with Open Source Code and CucumberAPI Testing with Open Source Code and Cucumber
API Testing with Open Source Code and Cucumber
 
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
 
Gherkin model1
Gherkin model1Gherkin model1
Gherkin model1
 

Similar to Beginners overview of automated testing with Rspec

Into The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsInto The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applications
Ortus Solutions, Corp
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and Challenges
TriTAUG
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1
CIVEL Benoit
 

Similar to Beginners overview of automated testing with Rspec (20)

Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
 
No Devops Without Continuous Testing
No Devops Without Continuous TestingNo Devops Without Continuous Testing
No Devops Without Continuous Testing
 
Software Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails ApplicationsSoftware Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails Applications
 
Choosing right-automation-tool
Choosing right-automation-toolChoosing right-automation-tool
Choosing right-automation-tool
 
Automated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesAutomated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and Challenges
 
Continuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIContinuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CI
 
Into The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsInto The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applications
 
Agile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAgile Secure Cloud Application Development Management
Agile Secure Cloud Application Development Management
 
Testing Angular
Testing AngularTesting Angular
Testing Angular
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and Challenges
 
Unit Testing and role of Test doubles
Unit Testing and role of Test doublesUnit Testing and role of Test doubles
Unit Testing and role of Test doubles
 
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
 
Automation Tool Overview
Automation Tool OverviewAutomation Tool Overview
Automation Tool Overview
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
 
Unit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - KenyaUnit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - Kenya
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software Testing
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1
 
Pm 6 testing
Pm 6 testingPm 6 testing
Pm 6 testing
 

Recently uploaded

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 

Recently uploaded (20)

A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 

Beginners overview of automated testing with Rspec

  • 1. Beginning developer’s guide to Automated Testing By Jeff Ross
  • 2. Presenter Background • Originally a Coldfusion Developer • Converted to Ruby on Rails 1.5 years ago • Attending DCRug for almost a year
  • 3. Topics to cover • Testing Basics • Benefits of Automated Testing • Testing Models • Testing technics • Resources • Questions
  • 4. Testing Types • Accessibility (508) • Exploratory • Integration • Performance (Load) • Regression • Security • UAT • Unit • Usability
  • 5. Automated Testing Basics What are unit tests? A unit test is an automated piece of code that invokes a unit of work in the system and then checks a single assumption about the behavior of that unit of work. A unit of work is a single logical functional use case in the system that can be invoked by some public interface (in most cases). What is code coverage? Code coverage is a measure used to describe the degree to which the source code of a program is tested by a particular test suite.
  • 6. Testing Enhancers • Fixtures (Fixtures allow you to populate your testing database with predefined data before your tests run. ) • Factory Girl (allow customization when you instantiate the objects and it aims to ensure that you have a valid object to work with within your tests) • Rspec • Capybara (Capybara helps you test web applications by simulating how a real user would interact with your app.) • Cucumber • Database cleaner (Database Cleaner is a set of strategies for cleaning your database • in Ruby.)
  • 7. Testing processes TDD – Test Driven Development 1-write,run,fail test; 2-write minimal amount of code to pass test; 3-re-run test; 4-refactor code; 5-re-run test Objectives -Encourages simple design -forces decoupled code -creates robust test suite -Focuses more on functionality I.e. - Rspec
  • 8. Testing processes • BDD – Behavior Driven Development generally arose from the idea that software development should be managed by both the business and engineering. So it seeks to create a common language between the two. -”Given”, “When”,”[And]”,”Then” Objectives -Encourages collaboration -Mimics user behavior -delivers meaningful tests I.e. - Cucumber
  • 10. Benefits of Automated Testing • Organizationally speaking it puts the burden of code quality on the developers. • Promotes code collaboration • Eases resistance and/or fear of technical changes • Promotes efficiency • A form of documentation • Shortens the feedback loop • Frees up testing resources
  • 11. Economics of Automated Testing Technical debt - is a recent metaphor referring to the eventual consequences of poor system design, software architecture or software development within a codebase. The debt can be thought of as work that needs to be done before a particular job can be considered complete or proper
  • 12. Testing Models • Agile Test Automation Pyramid (http://www.velocitypartners.net/blog/2014/01/28/agile-testing-the-agile-test-automation-pyramid/) • Agile Testing Quadrants (http://lisacrispin.com/2011/11/08/using-the-agile-testing-quadrants/) • Google’s: Small, Medium, Large (http://googletesting.blogspot.com/2010/12/test-sizes.html)
  • 15. Testing Models • In the traditional view, most if not all of the effort was in developing UI-centric functional tests that explored the application via the GUI. There might be some lower- level tests and a few unit tests, but teams mostly staid at the upper tier. • The first change is taking a whole- team view. Instead of the testers being responsible for testing AND writing all of the test automation, it becomes a whole-team responsibility. The developers take most of the ownership for unit- level automation, but testers can operate here as well. The upper tier focuses on limited UI-based automation. Usually, these are longer running, core customer usage workflows that are best implemented at this level.
  • 16. Testing Models and efficiency TESTING BY LAYERS Most bang for your buck testing your model thoroughly
  • 17. Testing Technics Using design patterns to enhance your tests. • Fat Model/Skinny Controller -The idea of developing your code in such a way that utilizes all the benefits of activeRecord in your model rather than placing your logic in your controller. -Following this pattern lends itself to better test scripts.
  • 18. Controllers • Controllers are pass-through entities • Mostly boilerplate-biz logic belongs in the model • Controllers are “dumb” or “Skinny” • They follow the “Controller Formula” • Minimum Valid Object ( Factory Girl )
  • 19. Controller/Reads Test Pattern Make a request (with id of record if a single record) Check rendering correct template redirect status code content type (html, json, xml,..) Verify Variable Assignments required by view
  • 21. Controller Create/Update Test Pattern • Make request with form fields to be created/upd’d • Verify Variable Assignments • Verify/Check Success – Variable is saved / record created • Verify Failure/Error Case • Rendering • Variables are defined • Record not saved • Verify HTTP Verb protection
  • 23. Model Testing THINGS TEST SHOULD COVER • Verify Validations • Verify Custom functions • Verify Associations • Verify Nested Attributes • Show example
  • 24. Testing Views • Emphasize behavior over display • Check that the application handles errors correctly • Test views for things that could go wrong badly
  • 25. Testing Technics Page Object Pattern Within your web app's UI there are areas that your tests interact with. A Page Object simply models these as objects within the test code. This reduces the amount of duplicated code and means that if the UI changes, the fix need only be applied in one place.
  • 26. Testing Technics Design patterns • SRP – Single Responsibility Principle (http://www.objectmentor.com/resources/articles/srp.pdf) • DRY – Don’t Repeat Yourself • Page Object • Fat Model/Skinny Controller • Single-Table Inheritance (show customer<Person extension)
  • 27. Resources • Single-Table Inheritance http://www.alexreisner.com/code/single-table-inheritance-in-rails • Page Object Pattern (http://code.tutsplus.com/articles/maintainable-automated-ui-tests--net-35089) • Better Rspec (http://betterspecs.org)

Editor's Notes

  1. Normal SDLC Agile processes with not agile infrastructure. Had to hand hold user stories through to production, explaining how to test at every environment Wanted to give this presentation to deepen my understanding of writing more efficient, relevant, maintainable scripts Speaking from a outsider’s/new comers perspective, crash course I wish I had beyond the basic rspec how-to’s
  2. First thing I had to understand is that I shouldn’t try to cover all the bases with my scripts. There are many types of testing all of which aren’t best to be covered in an automated fashion.
  3. the testers were the ones primarily writing the automation, so their comfort zone was towards functional testing. It didn’t help that the majority of the automated testing tools were focused towards leveraging the functional UI as the point of entry. Ie tools like selenium. ut this strategy is flawed. It’s inherently unstable and brittle; as the application (UI) changes the automation is nearly always impacted. Therefore one problem is automation stability and ongoing maintenance costs.