SlideShare a Scribd company logo
1 of 82
Software Quality
           and
      Test Strategies
            for
Ruby and Rails Applications
        - Bhavin Javia




        May 29th, 2011
About Me
          Ex ThoughtWorker

Agile/RoR Consultant - Ennova, Australia

        Founder - Ennova, India
bhavinjavia

  @bhavinjavia

bhavin@ennova.in
Co-Author


   Dr Adrian Smith
Managing Director - Technology
        Agile Coach
             @
Content
          Software Quality
            Test Strategy
  Ruby/Rails Testing Ecosystem
Quality and Testing for Rails Projects
Software Quality
Importance of Quality
“Quality is the most important factor for deriving

   long term value from a software product”


        - Jim Highsmith (Co-Author of Agile Manifesto)
”Continuous attention to quality can help

maintain velocity, maintain the ability to deliver,

      without it the team will slow down”


         - Robert C. Martin (Author of Clean Code)
Why worry ?
                Needs to be built in (implicitly)

    Needs to be defined (to prioritize vs cost/scope/time)

Agile project delivery relies on continuous attention to quality

                   Begins at the code level
code_quality != "App Quality"
Internal Quality
       vs

External Quality
External Quality
( Quality as perceived by users )

        interface design

         performance

            defects

        user experience
Internal Quality
( Quality of the implementation and system architecture )

                      duplication

                      complexity

                        coupling

                     test coverage
“Technical Debt may be costing you more than you imagined!”
                        - Jim Highsmith
The trade-off
Managing Quality
Managing Quality
             Set Goals
       "Max 3 clicks to any page"

             Measure
        "Page X takes 5 clicks"

             Prioritize
 "Make page X reachable in <= 3 clicks"
How to achieve Quality ?
TEST TEST TEST
What/When/How to Test ?
" Test Strategy "
Test Strategy Template
Test Strategy Template
   Not a Waterfall style document

A template to structure the discussion

   Prompts for things to consider

           Flexible format
Purpose
Create a shared understanding of
             approach
              tools
              targets
              timing

        of test activities
Guiding Principles
               Shared Responsibility
        Everyone is Responsible for Testing and Quality

                   Test Automation
All types of tests should be automated (except exploratory tests)

                  Data Management
        Production data must be obfuscated before use

                  Test Management
    Tests, documents and data treated as production code
Quality and Test Objectives
          Correctness
            Integrity
        Maintainability
          Availability
        Interoperability
          Performance
Quality and Test Objectives
                   Correctness
        Features and functions work as intended
                  e.g. 0 Critical Defects

                      Integrity
     Prevent unauthorized access or information loss
     e.g. All access via HTTPS, Encrypted passwords

                Maintainability
         Easy to add new features or fix defects
   e.g. Code Complexity < 8, Unit Test Coverage > 80%

                            ...
Quality and Test Objectives
                          Availability
                     Planned uptime percentage
                       e.g. 99.99 % availability

                       Interoperability
          Ease of information exchange with other systems
e.g. Published & versioned API, Supports - IE 8, FF 3.5, Chrome 11 etc

                         Performance
             Responsiveness & Scalability of the system
          e.g. Apdex Score > 0.9, Response Time < 200ms
Quality and Test Objectives
           Target
          Measure
          Prioritize
Test Scope
      Systems and features in and out of scope
         Test both business processes and the technical solution
           Specify regions and sub-regions included in testing
                  Identify interfaces with other systems
System / feature / integration / region / environment /dependency / service

                              In Scope
                   Things to be tested with automation
                      Things to be tested manually

                           Out of Scope
              Things we can't test e.g. Third Party systems
Test Approach
    Identify the test types

       Identify the tools

Include the timing of execution
Test Types
      Unit
  Functional
  Integration
  Acceptance
 Performance
Data Conversion
Test Approach
              Identify Tools
            e.g. rspec, cucumber etc

    Decide Timing of Execution
e.g. dev machine, CI server, after each commit etc
Test Automation Pyramid
Test Preparation
  Use requirements captured in user stories

   Include acceptance criteria in user story

Decide approach to prepare and execute tests
Example
Acceptance Test
Environments
                   Development
            Unit, Functional, Acceptance tests

                    Integration
Continuous Integration - Unit, Functional, Acceptance tests
                  Code Analysis/Metrics

                       Staging
                  For exploratory testing
                   Demos to customers

                     Production
             Smoke/Sanity tests & Monitoring
Test Execution
steps in preparation for deployment/release

            Build the system
       Populate test/reference data
         Execute automated tests
     Generate test report/code metrics
Test Data Management
 System and user acceptance tests
       Use subset of production data

 Performance/volume/stress test
        Use full size production files
      Generate large volumes of data
begin

  database.load! "Sensitive Production Data"

ensure

  database.obfuscate! "Sensitive Data"

end
Defect Management
Why defects ?
:missing_tests => "Defects"
Defect Management
Defects only raised when not fixed immediately
       Capture conditions and severity
         Capture steps to reproduce

                 Critical
                 Major
                 Minor
                 Trivial
Defect LifeCycle
         Identify
         Prioritize
        Assign Severity

          Analyze
    Write test to reproduce

          Resolve
   Fix code to pass the test

            Verify
  Run all tests, verify manually

            Close
Test Strategy Example
Principles and Objectives
Test Scope
Test Approach
Ruby/Rails
Testing Ecosystem
What's different
      in
 Ruby/Rails ?
Advantages
     Testing built right-in

    Passionate developers

Vibrant open source community

    Excellent tools support
So what are our options ?
There are ...
      23 Testing Frameworks
  8 Javascript Testing Frameworks
   8 Browser Testing Frameworks
 8 Distributed Testing Frameworks
   6 Object Mocking Frameworks
    7 Web Mocking Frameworks
 2 Continuous Testing Frameworks
7 Continuous Integration Frameworks
   12 Code Metrics Frameworks
         and many more ...
raise "OMG !!"
What to Test ?
Anything that could possibly break

   Public interface of each layer

      Whole application stack

Depends on what else you're testing
What NOT to test ?
Cost of test > 10 * Cost of breakage (very rare)

           Internal implementation

               Framework code
You're doing it wrong if
     Fixing tests all the time

  Tests that always fail together

       Tests that never fail
What to Test ?
     Models
    Controllers
      Views
     Helpers
     Libraries
       APIs
Testing Options
                  Models
         Test::Unit (Ruby 1.8, built-in)
MiniTest (Ruby 1.9, built-in, replaces Test::Unit)
     Unit Tests (ActiveSupport::TestCase)
             Model Specs (rspec)

               Controllers
           Functional Tests (built-in)
            Controller Specs (rspec)
Testing Options
          Views
   assert_select (built-in)
    View Specs (rspec)

        Helpers
   ActionView::TestCase
   Helper Specs (rspec)
Testing Options
         Routes
   assert_routing (built-in)
   Routing specs (rspec)

         Mailers
     Unit Tests (built-in)
  Functional Tests (built-in)
Testing Options
       Workflow
  Integration Tests (built-in)
   Request Specs (rspec)

            BDD
   Cucumber + Capybara
     Cucumber + Rspec
Testing Options
      Performance
  Performance Tests (built-in)
           NewRelic
Testing Helpers
    Data Setup
    Fixtures (built-in)
       factory_girl
       Machinist
Testing Helpers
   Mocks/Stubs
     Rspec mocks
        Mocha
       Flexmock

 API / Web Services
         VCR
       Fakeweb
      Webmock
Testing Helpers
           Speed
            NullDB
  Autotest/Infinity Test/Watchr
             Spork
         parallel_tests
              TLB

              CI
             cijoe
   cruisecontrol.rb/goldberg
           integrity
Quality/Metrics
   Test Coverage
          rcov
       SimpleCov

   Code Analysis
        metric_fu
        Metrical
   Rails Best Practices
Which is the Best ?
 Even the God(s) Can't Say !!
Which is the Best for Me ?
IMHO
WHATS_BEST = {
                 :newbie => "Start with built-ins",
                 :intermediate => "Checkout alternatives",

                 :expert => "Venture into the obscure"
            }
WHATS_BEST[:god] = "Write your own !"
References
 http://ennova.com.au/blog
       http://www.jimhighsmith.com
http://www.mountaingoatsoftware.com/tools
     http://www.informit.com/articles
     http://www.agileacademy.com.au
            http://railsrx.com
     http://www.bootspring.com/blog
Questions ?

http://sqats-rubyconfindia2011.heroku.com


              bhavinjavia

             @bhavinjavia

          bhavin@ennova.in

More Related Content

What's hot

DevOps to DevSecOps Journey..
DevOps to DevSecOps Journey..DevOps to DevSecOps Journey..
DevOps to DevSecOps Journey..Siddharth Joshi
 
Successfully Implementing DEV-SEC-OPS in the Cloud
Successfully Implementing DEV-SEC-OPS in the CloudSuccessfully Implementing DEV-SEC-OPS in the Cloud
Successfully Implementing DEV-SEC-OPS in the CloudAmazon Web Services
 
Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...
Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...
Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...Edureka!
 
Accelerate your Application Delivery with DevOps and Microservices
Accelerate your Application Delivery with DevOps and MicroservicesAccelerate your Application Delivery with DevOps and Microservices
Accelerate your Application Delivery with DevOps and MicroservicesAmazon Web Services
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Securitysedukull
 
DevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and ProcessesDevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and ProcessesAmazon Web Services
 
Testing with Microsoft Technologies - Kick Off Session
Testing with Microsoft Technologies - Kick Off SessionTesting with Microsoft Technologies - Kick Off Session
Testing with Microsoft Technologies - Kick Off SessionMoataz Nabil
 
8 Tips for Deploying DevSecOps
8 Tips for Deploying DevSecOps8 Tips for Deploying DevSecOps
8 Tips for Deploying DevSecOpsFelicia Haggarty
 
Agile & DevOps - It's all about project success
Agile & DevOps - It's all about project successAgile & DevOps - It's all about project success
Agile & DevOps - It's all about project successAdam Stephensen
 
Presentation 1 open source tools in continuous integration environment v1.0
Presentation 1   open source tools in continuous integration environment v1.0Presentation 1   open source tools in continuous integration environment v1.0
Presentation 1 open source tools in continuous integration environment v1.0Jasmine Conseil
 
Scale security for a dollar or less
Scale security for a dollar or lessScale security for a dollar or less
Scale security for a dollar or lessMohammed A. Imran
 
Connect Ops and Security with Flexible Web App and API Protection
Connect Ops and Security with Flexible Web App and API ProtectionConnect Ops and Security with Flexible Web App and API Protection
Connect Ops and Security with Flexible Web App and API ProtectionDevOps.com
 
CS meetup 2020 - Introduction to DevOps
CS meetup 2020 - Introduction to DevOpsCS meetup 2020 - Introduction to DevOps
CS meetup 2020 - Introduction to DevOpsRidwan Fadjar
 
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...RightScale
 

What's hot (20)

DevOps to DevSecOps Journey..
DevOps to DevSecOps Journey..DevOps to DevSecOps Journey..
DevOps to DevSecOps Journey..
 
Why Serverless?
Why Serverless?Why Serverless?
Why Serverless?
 
Successfully Implementing DEV-SEC-OPS in the Cloud
Successfully Implementing DEV-SEC-OPS in the CloudSuccessfully Implementing DEV-SEC-OPS in the Cloud
Successfully Implementing DEV-SEC-OPS in the Cloud
 
Demystifying DevOps
Demystifying DevOpsDemystifying DevOps
Demystifying DevOps
 
Introduction to DevSecOps
Introduction to DevSecOpsIntroduction to DevSecOps
Introduction to DevSecOps
 
Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...
Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...
Introduction to DevOps Tools | DevOps Training | DevOps Tutorial for Beginner...
 
Accelerate your Application Delivery with DevOps and Microservices
Accelerate your Application Delivery with DevOps and MicroservicesAccelerate your Application Delivery with DevOps and Microservices
Accelerate your Application Delivery with DevOps and Microservices
 
DevSecOps
DevSecOpsDevSecOps
DevSecOps
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Security
 
DevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and ProcessesDevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and Processes
 
Testing with Microsoft Technologies - Kick Off Session
Testing with Microsoft Technologies - Kick Off SessionTesting with Microsoft Technologies - Kick Off Session
Testing with Microsoft Technologies - Kick Off Session
 
8 Tips for Deploying DevSecOps
8 Tips for Deploying DevSecOps8 Tips for Deploying DevSecOps
8 Tips for Deploying DevSecOps
 
An introduction to DevOps
An introduction to DevOpsAn introduction to DevOps
An introduction to DevOps
 
Agile & DevOps - It's all about project success
Agile & DevOps - It's all about project successAgile & DevOps - It's all about project success
Agile & DevOps - It's all about project success
 
Presentation 1 open source tools in continuous integration environment v1.0
Presentation 1   open source tools in continuous integration environment v1.0Presentation 1   open source tools in continuous integration environment v1.0
Presentation 1 open source tools in continuous integration environment v1.0
 
Scale security for a dollar or less
Scale security for a dollar or lessScale security for a dollar or less
Scale security for a dollar or less
 
From Continuous Integration to DevOps
From Continuous Integration to DevOpsFrom Continuous Integration to DevOps
From Continuous Integration to DevOps
 
Connect Ops and Security with Flexible Web App and API Protection
Connect Ops and Security with Flexible Web App and API ProtectionConnect Ops and Security with Flexible Web App and API Protection
Connect Ops and Security with Flexible Web App and API Protection
 
CS meetup 2020 - Introduction to DevOps
CS meetup 2020 - Introduction to DevOpsCS meetup 2020 - Introduction to DevOps
CS meetup 2020 - Introduction to DevOps
 
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...
RightScale Webinar: Continuous Integration and Delivery in the Cloud - How Ri...
 

Similar to Software Quality and Test Strategies for Ruby and Rails Applications

Lightning Talks by Globant - Automation (This app runs by itself )
Lightning Talks by Globant -  Automation (This app runs by itself ) Lightning Talks by Globant -  Automation (This app runs by itself )
Lightning Talks by Globant - Automation (This app runs by itself ) Globant
 
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databases#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databasesAlessandro Alpi
 
Building functional Quality Gates with ReportPortal
Building functional Quality Gates with ReportPortalBuilding functional Quality Gates with ReportPortal
Building functional Quality Gates with ReportPortalDmitriy Gumeniuk
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lessonSadaaki Emura
 
Enforcing Quality with DevOps Pipeline Gates
Enforcing Quality with DevOps Pipeline GatesEnforcing Quality with DevOps Pipeline Gates
Enforcing Quality with DevOps Pipeline GatesMichael King
 
No Devops Without Continuous Testing
No Devops Without Continuous TestingNo Devops Without Continuous Testing
No Devops Without Continuous TestingParasoft
 
Neotys PAC 2018 - Ramya Ramalinga Moorthy
Neotys PAC 2018 - Ramya Ramalinga MoorthyNeotys PAC 2018 - Ramya Ramalinga Moorthy
Neotys PAC 2018 - Ramya Ramalinga MoorthyNeotys_Partner
 
Exploratory testing using heuristics
Exploratory testing using heuristicsExploratory testing using heuristics
Exploratory testing using heuristicsMichelle Lagare, CSM
 
Beginners overview of automated testing with Rspec
Beginners overview of automated testing with RspecBeginners overview of automated testing with Rspec
Beginners overview of automated testing with Rspecjeffrey1ross
 
Neev Independent Testing Services
Neev Independent Testing ServicesNeev Independent Testing Services
Neev Independent Testing ServicesNeev Technologies
 
Automation testing
Automation testingAutomation testing
Automation testingTomy Rhymond
 
Netserv Software Testing
Netserv Software TestingNetserv Software Testing
Netserv Software Testingsthicks14
 
Neotys PAC 2018 - Tingting Zong
Neotys PAC 2018 - Tingting ZongNeotys PAC 2018 - Tingting Zong
Neotys PAC 2018 - Tingting ZongNeotys_Partner
 
Enhancing Software Quality
Enhancing Software QualityEnhancing Software Quality
Enhancing Software QualityAnand Prabhala
 
QA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab ManagementQA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab ManagementRofiqi Setiawan
 
Planning & building scalable test infrastructure
Planning  & building scalable test infrastructurePlanning  & building scalable test infrastructure
Planning & building scalable test infrastructureVijayan Reddy
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsQuontra Solutions
 

Similar to Software Quality and Test Strategies for Ruby and Rails Applications (20)

Lightning Talks by Globant - Automation (This app runs by itself )
Lightning Talks by Globant -  Automation (This app runs by itself ) Lightning Talks by Globant -  Automation (This app runs by itself )
Lightning Talks by Globant - Automation (This app runs by itself )
 
Agile testing
Agile testingAgile testing
Agile testing
 
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databases#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
 
Building functional Quality Gates with ReportPortal
Building functional Quality Gates with ReportPortalBuilding functional Quality Gates with ReportPortal
Building functional Quality Gates with ReportPortal
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lesson
 
Enforcing Quality with DevOps Pipeline Gates
Enforcing Quality with DevOps Pipeline GatesEnforcing Quality with DevOps Pipeline Gates
Enforcing Quality with DevOps Pipeline Gates
 
No Devops Without Continuous Testing
No Devops Without Continuous TestingNo Devops Without Continuous Testing
No Devops Without Continuous Testing
 
Neotys PAC 2018 - Ramya Ramalinga Moorthy
Neotys PAC 2018 - Ramya Ramalinga MoorthyNeotys PAC 2018 - Ramya Ramalinga Moorthy
Neotys PAC 2018 - Ramya Ramalinga Moorthy
 
Exploratory testing using heuristics
Exploratory testing using heuristicsExploratory testing using heuristics
Exploratory testing using heuristics
 
Beginners overview of automated testing with Rspec
Beginners overview of automated testing with RspecBeginners overview of automated testing with Rspec
Beginners overview of automated testing with Rspec
 
Neev Independent Testing Services
Neev Independent Testing ServicesNeev Independent Testing Services
Neev Independent Testing Services
 
Automation testing
Automation testingAutomation testing
Automation testing
 
Netserv Software Testing
Netserv Software TestingNetserv Software Testing
Netserv Software Testing
 
Neotys PAC 2018 - Tingting Zong
Neotys PAC 2018 - Tingting ZongNeotys PAC 2018 - Tingting Zong
Neotys PAC 2018 - Tingting Zong
 
Enhancing Software Quality
Enhancing Software QualityEnhancing Software Quality
Enhancing Software Quality
 
QA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab ManagementQA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab Management
 
Planning & building scalable test infrastructure
Planning  & building scalable test infrastructurePlanning  & building scalable test infrastructure
Planning & building scalable test infrastructure
 
Pariksha testing services
Pariksha testing servicesPariksha testing services
Pariksha testing services
 
Neev QA Offering
Neev QA OfferingNeev QA Offering
Neev QA Offering
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
 

More from Bhavin Javia

Make ruby talk to your users - literally
Make ruby talk to your users - literallyMake ruby talk to your users - literally
Make ruby talk to your users - literallyBhavin Javia
 
Write your Ruby in Style
Write your Ruby in StyleWrite your Ruby in Style
Write your Ruby in StyleBhavin Javia
 
Agile for Startups
Agile for StartupsAgile for Startups
Agile for StartupsBhavin Javia
 
Get on "The Cloud" with AWS
Get on "The Cloud" with AWSGet on "The Cloud" with AWS
Get on "The Cloud" with AWSBhavin Javia
 
Agile Team Dynamics
Agile Team DynamicsAgile Team Dynamics
Agile Team DynamicsBhavin Javia
 
Continuous Integration and Builds
Continuous Integration and BuildsContinuous Integration and Builds
Continuous Integration and BuildsBhavin Javia
 
Productive Programmer - Using IDE effectively and various small practices to ...
Productive Programmer - Using IDE effectively and various small practices to ...Productive Programmer - Using IDE effectively and various small practices to ...
Productive Programmer - Using IDE effectively and various small practices to ...Bhavin Javia
 

More from Bhavin Javia (7)

Make ruby talk to your users - literally
Make ruby talk to your users - literallyMake ruby talk to your users - literally
Make ruby talk to your users - literally
 
Write your Ruby in Style
Write your Ruby in StyleWrite your Ruby in Style
Write your Ruby in Style
 
Agile for Startups
Agile for StartupsAgile for Startups
Agile for Startups
 
Get on "The Cloud" with AWS
Get on "The Cloud" with AWSGet on "The Cloud" with AWS
Get on "The Cloud" with AWS
 
Agile Team Dynamics
Agile Team DynamicsAgile Team Dynamics
Agile Team Dynamics
 
Continuous Integration and Builds
Continuous Integration and BuildsContinuous Integration and Builds
Continuous Integration and Builds
 
Productive Programmer - Using IDE effectively and various small practices to ...
Productive Programmer - Using IDE effectively and various small practices to ...Productive Programmer - Using IDE effectively and various small practices to ...
Productive Programmer - Using IDE effectively and various small practices to ...
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 

Software Quality and Test Strategies for Ruby and Rails Applications

  • 1. Software Quality and Test Strategies for Ruby and Rails Applications - Bhavin Javia May 29th, 2011
  • 2. About Me Ex ThoughtWorker Agile/RoR Consultant - Ennova, Australia Founder - Ennova, India
  • 4. Co-Author Dr Adrian Smith Managing Director - Technology Agile Coach @
  • 5. Content Software Quality Test Strategy Ruby/Rails Testing Ecosystem Quality and Testing for Rails Projects
  • 8. “Quality is the most important factor for deriving long term value from a software product” - Jim Highsmith (Co-Author of Agile Manifesto)
  • 9. ”Continuous attention to quality can help maintain velocity, maintain the ability to deliver, without it the team will slow down” - Robert C. Martin (Author of Clean Code)
  • 10. Why worry ? Needs to be built in (implicitly) Needs to be defined (to prioritize vs cost/scope/time) Agile project delivery relies on continuous attention to quality Begins at the code level
  • 12. Internal Quality vs External Quality
  • 13. External Quality ( Quality as perceived by users ) interface design performance defects user experience
  • 14. Internal Quality ( Quality of the implementation and system architecture ) duplication complexity coupling test coverage
  • 15. “Technical Debt may be costing you more than you imagined!” - Jim Highsmith
  • 17.
  • 18.
  • 20. Managing Quality Set Goals "Max 3 clicks to any page" Measure "Page X takes 5 clicks" Prioritize "Make page X reachable in <= 3 clicks"
  • 21. How to achieve Quality ?
  • 26. Test Strategy Template Not a Waterfall style document A template to structure the discussion Prompts for things to consider Flexible format
  • 27. Purpose Create a shared understanding of approach tools targets timing of test activities
  • 28. Guiding Principles Shared Responsibility Everyone is Responsible for Testing and Quality Test Automation All types of tests should be automated (except exploratory tests) Data Management Production data must be obfuscated before use Test Management Tests, documents and data treated as production code
  • 29. Quality and Test Objectives Correctness Integrity Maintainability Availability Interoperability Performance
  • 30. Quality and Test Objectives Correctness Features and functions work as intended e.g. 0 Critical Defects Integrity Prevent unauthorized access or information loss e.g. All access via HTTPS, Encrypted passwords Maintainability Easy to add new features or fix defects e.g. Code Complexity < 8, Unit Test Coverage > 80% ...
  • 31. Quality and Test Objectives Availability Planned uptime percentage e.g. 99.99 % availability Interoperability Ease of information exchange with other systems e.g. Published & versioned API, Supports - IE 8, FF 3.5, Chrome 11 etc Performance Responsiveness & Scalability of the system e.g. Apdex Score > 0.9, Response Time < 200ms
  • 32. Quality and Test Objectives Target Measure Prioritize
  • 33. Test Scope Systems and features in and out of scope Test both business processes and the technical solution Specify regions and sub-regions included in testing Identify interfaces with other systems System / feature / integration / region / environment /dependency / service In Scope Things to be tested with automation Things to be tested manually Out of Scope Things we can't test e.g. Third Party systems
  • 34. Test Approach Identify the test types Identify the tools Include the timing of execution
  • 35. Test Types Unit Functional Integration Acceptance Performance Data Conversion
  • 36. Test Approach Identify Tools e.g. rspec, cucumber etc Decide Timing of Execution e.g. dev machine, CI server, after each commit etc
  • 38. Test Preparation Use requirements captured in user stories Include acceptance criteria in user story Decide approach to prepare and execute tests
  • 41. Environments Development Unit, Functional, Acceptance tests Integration Continuous Integration - Unit, Functional, Acceptance tests Code Analysis/Metrics Staging For exploratory testing Demos to customers Production Smoke/Sanity tests & Monitoring
  • 42. Test Execution steps in preparation for deployment/release Build the system Populate test/reference data Execute automated tests Generate test report/code metrics
  • 43. Test Data Management System and user acceptance tests Use subset of production data Performance/volume/stress test Use full size production files Generate large volumes of data
  • 44. begin database.load! "Sensitive Production Data" ensure database.obfuscate! "Sensitive Data" end
  • 48. Defect Management Defects only raised when not fixed immediately Capture conditions and severity Capture steps to reproduce Critical Major Minor Trivial
  • 49. Defect LifeCycle Identify Prioritize Assign Severity Analyze Write test to reproduce Resolve Fix code to pass the test Verify Run all tests, verify manually Close
  • 51.
  • 55.
  • 57. What's different in Ruby/Rails ?
  • 58.
  • 59. Advantages Testing built right-in Passionate developers Vibrant open source community Excellent tools support
  • 60. So what are our options ?
  • 61.
  • 62. There are ... 23 Testing Frameworks 8 Javascript Testing Frameworks 8 Browser Testing Frameworks 8 Distributed Testing Frameworks 6 Object Mocking Frameworks 7 Web Mocking Frameworks 2 Continuous Testing Frameworks 7 Continuous Integration Frameworks 12 Code Metrics Frameworks and many more ...
  • 64. What to Test ? Anything that could possibly break Public interface of each layer Whole application stack Depends on what else you're testing
  • 65. What NOT to test ? Cost of test > 10 * Cost of breakage (very rare) Internal implementation Framework code
  • 66. You're doing it wrong if Fixing tests all the time Tests that always fail together Tests that never fail
  • 67. What to Test ? Models Controllers Views Helpers Libraries APIs
  • 68. Testing Options Models Test::Unit (Ruby 1.8, built-in) MiniTest (Ruby 1.9, built-in, replaces Test::Unit) Unit Tests (ActiveSupport::TestCase) Model Specs (rspec) Controllers Functional Tests (built-in) Controller Specs (rspec)
  • 69. Testing Options Views assert_select (built-in) View Specs (rspec) Helpers ActionView::TestCase Helper Specs (rspec)
  • 70. Testing Options Routes assert_routing (built-in) Routing specs (rspec) Mailers Unit Tests (built-in) Functional Tests (built-in)
  • 71. Testing Options Workflow Integration Tests (built-in) Request Specs (rspec) BDD Cucumber + Capybara Cucumber + Rspec
  • 72. Testing Options Performance Performance Tests (built-in) NewRelic
  • 73. Testing Helpers Data Setup Fixtures (built-in) factory_girl Machinist
  • 74. Testing Helpers Mocks/Stubs Rspec mocks Mocha Flexmock API / Web Services VCR Fakeweb Webmock
  • 75. Testing Helpers Speed NullDB Autotest/Infinity Test/Watchr Spork parallel_tests TLB CI cijoe cruisecontrol.rb/goldberg integrity
  • 76. Quality/Metrics Test Coverage rcov SimpleCov Code Analysis metric_fu Metrical Rails Best Practices
  • 77. Which is the Best ? Even the God(s) Can't Say !!
  • 78. Which is the Best for Me ?
  • 79. IMHO WHATS_BEST = { :newbie => "Start with built-ins", :intermediate => "Checkout alternatives", :expert => "Venture into the obscure" }
  • 81. References http://ennova.com.au/blog http://www.jimhighsmith.com http://www.mountaingoatsoftware.com/tools http://www.informit.com/articles http://www.agileacademy.com.au http://railsrx.com http://www.bootspring.com/blog
  • 82. Questions ? http://sqats-rubyconfindia2011.heroku.com bhavinjavia @bhavinjavia bhavin@ennova.in