SlideShare a Scribd company logo
1 of 37
Download to read offline
Top Testing Tips
Data Creation, Web Callouts, and Automation
Ami Assayag, CRM Science, @AmiAssayag
Wes Nolte, Tquila, @WesNolte
Safe Harbor
 Safe harbor statement under the Private Securities Litigation Reform Act of 1995:

 This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties
 materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results
 expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be
 deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other
 financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any
 statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.

 The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new
 functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our
 operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of
 intellectual property and other litigation, risks associated with possible mergers and acquisitions, the immature market in which we
 operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new
 releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization
 and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of
 salesforce.com, inc. is included in our annual report on Form 10-Q for the most recent fiscal quarter ended July 31, 2012. This
 documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of
 our Web site.

 Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently
 available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based
 upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-
 looking statements.
Ami Assayag
Principal Architect, CRM Science
PhillyForce Leader
@AmiAssayag
Wes Nolte
Director of Innovation, Tquila
Force.com MVP
London Dev Group Leader
@WesNolte
Couldn’t make it… 

              Matthew Botos
              Model Metrics
              a salesforce.com company
              @BotosCloud
Our Agenda For Today

• Review our assigned project
• Review top testing tips:
   • Data creation with SmartFactory
   • Testing web callouts with interfaces
   • Automated testing and continuous integration
Our Assigned Project

You've just been hired as a developer on an existing project and
 given this story to implement:



 As a conference attendee, I want to create a Registration for a
 Session, and post it to my Twitter account.
Data Model
Business Logic is Completed!
And Now We Test

• Unit testing
• Integration testing   Acceptance
• Automated testing
                        Integration

                           Unit
Data Creation with
SmartFactory
Let’s Make a Registration




               System.DmlException: Insert failed. First
               exception on row 0; first error:
               REQUIRED_FIELD_MISSING, Required
               fields are missing: [Session__c, Contact__c]:
               [Session__c, Contact__c]
Oops, Let’s Make a Session




              System.DmlException: Insert failed. First
              exception on row 0; first error:
              REQUIRED_FIELD_MISSING, Required
              fields are missing: [Start_Date_Time__c]:
              [Start_Date_Time__c]
Continue Creating Test Data

 • Identify all objects and related objects
    • Identify all required fields
    • Identify valid values for all required fields
    • Populate all required fields
 • Rinse & repeat
 • OR...
SmartFactory for Force.com

 • Apex project
 • Create test objects
 • Autofill fields & lookups



                                         Custom
                   Contact     Account
                                         Object
Let’s Try SmartFactory
SmartFactory for Force.com

 • Several utility methods
 • Looking at metadata
 • bit.ly/SmartFactory
Testing web callouts with
interfaces
Post to Twitter Architecture


                      Business Logic   Callout Utility
      Trigger
                          Class            Class
Integration Test
Post to Twitter Architecture (w/ an interface)

                       Business Logic     Callout Utility
      Trigger
                           Class              Class




                           Mock
                      Implementation
                           Class
                                            Interface
                        Production
                      Implementation
                           Class
It All Starts With an Interface…




 • Only contains method signatures.
 • Implemented by other classes.
 • Implement by providing code for interface methods.
Improve the Callout Class with the Interface




 Suddenly our application logic is looking much cleaner.
Implementation Class #1: Mock




 • Similar code to what we removed from the callout utility
Implementation Class #2: Production




 • Performs actual callout.
Post to Twitter Architecture (w/ an interface)

                       Business Logic     Callout Utility
      Trigger
                           Class              Class




                           Mock
                      Implementation
                           Class
                                            Interface
                        Production
                      Implementation
                           Class
Using The Interface: Test Method
Using The Interface: Business Logic




 • Treat the interface the same here!
Using Interfaces in Apex Testing

• Summary of advantages
  • Tried and tested through Java, .Net and others
  • Interfaces decouple code and provide consistency
  • Fewer hacks to get tests to work correctly
  • Improved code coverage
  • Can test multiple callout situations with different “dummy” data
  • bit.ly/ApexCalloutTest
Automated testing and
continuous integration
Automated Testing and Continuous Integration

 • Deployed tests are not run
 • New code introduces new bugs
 • Team introduces new bugs


 Early detection of bug requires that you manually “Run All” tests
   or implement full-blown CI… or does it?
Automated Testing for Force.com (App)
 • Free App that installs as a managed package with just a few clicks
 • Runs 100% on the Force.com Platform
Super Easy to Set Up
Test Results in Your Inbox
Open Source

• bit.ly/ForceAutoTest
• Pull requests are welcomed
Ami Assayag              Wes Nolte
Principal Architect   Director of Innovation
  CRM Science                 Tquila
 @AmiAssayag              @WesNolte
Top Testing Tips

More Related Content

What's hot

Framework For Automation Testing Practice Sharing
Framework For Automation Testing Practice SharingFramework For Automation Testing Practice Sharing
Framework For Automation Testing Practice SharingKMS Technology
 
API Integration For Building Software Applications Powerpoint Presentation Sl...
API Integration For Building Software Applications Powerpoint Presentation Sl...API Integration For Building Software Applications Powerpoint Presentation Sl...
API Integration For Building Software Applications Powerpoint Presentation Sl...SlideTeam
 
IGT's Intelligent Automation Framework
IGT's Intelligent Automation FrameworkIGT's Intelligent Automation Framework
IGT's Intelligent Automation Frameworkgreyaudrina
 
Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development IntroductionGanuka Yashantha
 
Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionGanuka Yashantha
 
Susan windsor soft test 16th november 2005
Susan windsor soft test   16th november 2005Susan windsor soft test   16th november 2005
Susan windsor soft test 16th november 2005David O'Dowd
 
Learning's from mobile testing
Learning's from mobile testingLearning's from mobile testing
Learning's from mobile testingVikrant Chauhan
 
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFT
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFTRFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFT
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFTYogindernath Gupta
 
Improving Software quality for the Modern Web
Improving Software quality for the Modern WebImproving Software quality for the Modern Web
Improving Software quality for the Modern WebEuan Garden
 
Why You Need to Care About Automated Functional Testing in 2019
Why You Need to Care About Automated Functional Testing in 2019Why You Need to Care About Automated Functional Testing in 2019
Why You Need to Care About Automated Functional Testing in 2019Sarah Elson
 
Designing a Test Automation Framework By Quontra solutions
Designing a Test Automation Framework By Quontra solutionsDesigning a Test Automation Framework By Quontra solutions
Designing a Test Automation Framework By Quontra solutionsQUONTRASOLUTIONS
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planningSivaprasanthRentala1975
 
A Test Automation Framework
A Test Automation FrameworkA Test Automation Framework
A Test Automation FrameworkGregory Solovey
 
Start Your Automation Journey With Rapise
Start Your Automation Journey With Rapise Start Your Automation Journey With Rapise
Start Your Automation Journey With Rapise Inflectra
 
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2
 
Manual Testing Interview Questions | Edureka
Manual Testing Interview Questions | EdurekaManual Testing Interview Questions | Edureka
Manual Testing Interview Questions | EdurekaEdureka!
 
RFT Tutorial - 9 How To Create A Properties Verification Point In Rft For Tes...
RFT Tutorial - 9 How To Create A Properties Verification Point In Rft For Tes...RFT Tutorial - 9 How To Create A Properties Verification Point In Rft For Tes...
RFT Tutorial - 9 How To Create A Properties Verification Point In Rft For Tes...Yogindernath Gupta
 
TestingWhiz Webinar: Codeless Test Automation for Web & Cloud Apps
TestingWhiz Webinar: Codeless Test Automation for Web & Cloud AppsTestingWhiz Webinar: Codeless Test Automation for Web & Cloud Apps
TestingWhiz Webinar: Codeless Test Automation for Web & Cloud AppsPremal Dave
 
Testing Frameworks
Testing FrameworksTesting Frameworks
Testing FrameworksMoataz Nabil
 

What's hot (20)

Framework For Automation Testing Practice Sharing
Framework For Automation Testing Practice SharingFramework For Automation Testing Practice Sharing
Framework For Automation Testing Practice Sharing
 
API Integration For Building Software Applications Powerpoint Presentation Sl...
API Integration For Building Software Applications Powerpoint Presentation Sl...API Integration For Building Software Applications Powerpoint Presentation Sl...
API Integration For Building Software Applications Powerpoint Presentation Sl...
 
IGT's Intelligent Automation Framework
IGT's Intelligent Automation FrameworkIGT's Intelligent Automation Framework
IGT's Intelligent Automation Framework
 
Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development Introduction
 
Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introduction
 
Susan windsor soft test 16th november 2005
Susan windsor soft test   16th november 2005Susan windsor soft test   16th november 2005
Susan windsor soft test 16th november 2005
 
Learning's from mobile testing
Learning's from mobile testingLearning's from mobile testing
Learning's from mobile testing
 
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFT
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFTRFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFT
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFT
 
Improving Software quality for the Modern Web
Improving Software quality for the Modern WebImproving Software quality for the Modern Web
Improving Software quality for the Modern Web
 
Why You Need to Care About Automated Functional Testing in 2019
Why You Need to Care About Automated Functional Testing in 2019Why You Need to Care About Automated Functional Testing in 2019
Why You Need to Care About Automated Functional Testing in 2019
 
Designing a Test Automation Framework By Quontra solutions
Designing a Test Automation Framework By Quontra solutionsDesigning a Test Automation Framework By Quontra solutions
Designing a Test Automation Framework By Quontra solutions
 
BX-D – A Business Component & XML Driven Test Automation Framework
BX-D – A Business Component & XML Driven Test Automation FrameworkBX-D – A Business Component & XML Driven Test Automation Framework
BX-D – A Business Component & XML Driven Test Automation Framework
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
 
A Test Automation Framework
A Test Automation FrameworkA Test Automation Framework
A Test Automation Framework
 
Start Your Automation Journey With Rapise
Start Your Automation Journey With Rapise Start Your Automation Journey With Rapise
Start Your Automation Journey With Rapise
 
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
 
Manual Testing Interview Questions | Edureka
Manual Testing Interview Questions | EdurekaManual Testing Interview Questions | Edureka
Manual Testing Interview Questions | Edureka
 
RFT Tutorial - 9 How To Create A Properties Verification Point In Rft For Tes...
RFT Tutorial - 9 How To Create A Properties Verification Point In Rft For Tes...RFT Tutorial - 9 How To Create A Properties Verification Point In Rft For Tes...
RFT Tutorial - 9 How To Create A Properties Verification Point In Rft For Tes...
 
TestingWhiz Webinar: Codeless Test Automation for Web & Cloud Apps
TestingWhiz Webinar: Codeless Test Automation for Web & Cloud AppsTestingWhiz Webinar: Codeless Test Automation for Web & Cloud Apps
TestingWhiz Webinar: Codeless Test Automation for Web & Cloud Apps
 
Testing Frameworks
Testing FrameworksTesting Frameworks
Testing Frameworks
 

Similar to Top Testing Tips

CookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomationCookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomationKazuaki Matsuo
 
Achieve Intelligent Test Execution: Strategies for Streamlining Regression Te...
Achieve Intelligent Test Execution: Strategies for Streamlining Regression Te...Achieve Intelligent Test Execution: Strategies for Streamlining Regression Te...
Achieve Intelligent Test Execution: Strategies for Streamlining Regression Te...DevOps.com
 
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and Tricks
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and TricksIBM Cognos 10 Framework Manager Metadata Modeling: Tips and Tricks
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and TricksSenturus
 
Microsoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable CodeMicrosoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable CodeAleksandar Bozinovski
 
Test automation design patterns
Test automation design patternsTest automation design patterns
Test automation design patternsVitaly Tatarinov
 
Model-Based Testing for ALM Octane: Better tests, built faster
Model-Based Testing for ALM Octane: Better tests, built faster Model-Based Testing for ALM Octane: Better tests, built faster
Model-Based Testing for ALM Octane: Better tests, built faster Curiosity Software Ireland
 
Simplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless ToolsSimplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless ToolsSauce Labs
 
Refactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationRefactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationStephen Fuqua
 
Failure is an Option: Scaling Resilient Feature Delivery
Failure is an Option: Scaling Resilient Feature DeliveryFailure is an Option: Scaling Resilient Feature Delivery
Failure is an Option: Scaling Resilient Feature DeliveryOptimizely
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsSalesforce Developers
 
Testing in a glance
Testing in a glanceTesting in a glance
Testing in a glanceRajesh Kumar
 
Make synthetic monitoring a critical part of your IT monitoring strategy: Why...
Make synthetic monitoring a critical part of your IT monitoring strategy: Why...Make synthetic monitoring a critical part of your IT monitoring strategy: Why...
Make synthetic monitoring a critical part of your IT monitoring strategy: Why...eG Innovations
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choicetoddbr
 
Salesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce Developers
 
Test Automation Frameworks Final
Test Automation Frameworks   FinalTest Automation Frameworks   Final
Test Automation Frameworks FinalMargaret_Dickman
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lessonSadaaki Emura
 

Similar to Top Testing Tips (20)

CookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomationCookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomation
 
Achieve Intelligent Test Execution: Strategies for Streamlining Regression Te...
Achieve Intelligent Test Execution: Strategies for Streamlining Regression Te...Achieve Intelligent Test Execution: Strategies for Streamlining Regression Te...
Achieve Intelligent Test Execution: Strategies for Streamlining Regression Te...
 
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and Tricks
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and TricksIBM Cognos 10 Framework Manager Metadata Modeling: Tips and Tricks
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and Tricks
 
Microsoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable CodeMicrosoft Fakes, Unit Testing the (almost) Untestable Code
Microsoft Fakes, Unit Testing the (almost) Untestable Code
 
Unit Tests with Microsoft Fakes
Unit Tests with Microsoft FakesUnit Tests with Microsoft Fakes
Unit Tests with Microsoft Fakes
 
Test automation design patterns
Test automation design patternsTest automation design patterns
Test automation design patterns
 
Model-Based Testing for ALM Octane: Better tests, built faster
Model-Based Testing for ALM Octane: Better tests, built faster Model-Based Testing for ALM Octane: Better tests, built faster
Model-Based Testing for ALM Octane: Better tests, built faster
 
Simplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless ToolsSimplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless Tools
 
Resume
ResumeResume
Resume
 
Mayur_Resume (2) (1)
Mayur_Resume (2) (1)Mayur_Resume (2) (1)
Mayur_Resume (2) (1)
 
Refactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationRefactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test Automation
 
Failure is an Option: Scaling Resilient Feature Delivery
Failure is an Option: Scaling Resilient Feature DeliveryFailure is an Option: Scaling Resilient Feature Delivery
Failure is an Option: Scaling Resilient Feature Delivery
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
 
Testing in a glance
Testing in a glanceTesting in a glance
Testing in a glance
 
Make synthetic monitoring a critical part of your IT monitoring strategy: Why...
Make synthetic monitoring a critical part of your IT monitoring strategy: Why...Make synthetic monitoring a critical part of your IT monitoring strategy: Why...
Make synthetic monitoring a critical part of your IT monitoring strategy: Why...
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
 
Salesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep Dive
 
Test Automation Frameworks Final
Test Automation Frameworks   FinalTest Automation Frameworks   Final
Test Automation Frameworks Final
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lesson
 

More from Salesforce Developers

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSalesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceSalesforce Developers
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base ComponentsSalesforce Developers
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsSalesforce Developers
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaSalesforce Developers
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentSalesforce Developers
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsSalesforce Developers
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsSalesforce Developers
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsSalesforce Developers
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and TestingSalesforce Developers
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilitySalesforce Developers
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce dataSalesforce Developers
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionSalesforce Developers
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPSalesforce Developers
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceSalesforce Developers
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureSalesforce Developers
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DXSalesforce Developers
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectSalesforce Developers
 

More from Salesforce Developers (20)

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base Components
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX India
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local Development
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web Components
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
 
Live coding with LWC
Live coding with LWCLive coding with LWC
Live coding with LWC
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCP
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in Salesforce
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data Capture
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DX
 
Get Into Lightning Flow Development
Get Into Lightning Flow DevelopmentGet Into Lightning Flow Development
Get Into Lightning Flow Development
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS Connect
 

Top Testing Tips

  • 1. Top Testing Tips Data Creation, Web Callouts, and Automation Ami Assayag, CRM Science, @AmiAssayag Wes Nolte, Tquila, @WesNolte
  • 2. Safe Harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of intellectual property and other litigation, risks associated with possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-Q for the most recent fiscal quarter ended July 31, 2012. This documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward- looking statements.
  • 3. Ami Assayag Principal Architect, CRM Science PhillyForce Leader @AmiAssayag
  • 4. Wes Nolte Director of Innovation, Tquila Force.com MVP London Dev Group Leader @WesNolte
  • 5. Couldn’t make it…  Matthew Botos Model Metrics a salesforce.com company @BotosCloud
  • 6. Our Agenda For Today • Review our assigned project • Review top testing tips: • Data creation with SmartFactory • Testing web callouts with interfaces • Automated testing and continuous integration
  • 7. Our Assigned Project You've just been hired as a developer on an existing project and given this story to implement: As a conference attendee, I want to create a Registration for a Session, and post it to my Twitter account.
  • 9. Business Logic is Completed!
  • 10. And Now We Test • Unit testing • Integration testing Acceptance • Automated testing Integration Unit
  • 12. Let’s Make a Registration System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Session__c, Contact__c]: [Session__c, Contact__c]
  • 13. Oops, Let’s Make a Session System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Start_Date_Time__c]: [Start_Date_Time__c]
  • 14. Continue Creating Test Data • Identify all objects and related objects • Identify all required fields • Identify valid values for all required fields • Populate all required fields • Rinse & repeat • OR...
  • 15. SmartFactory for Force.com • Apex project • Create test objects • Autofill fields & lookups Custom Contact Account Object
  • 17. SmartFactory for Force.com • Several utility methods • Looking at metadata • bit.ly/SmartFactory
  • 18. Testing web callouts with interfaces
  • 19. Post to Twitter Architecture Business Logic Callout Utility Trigger Class Class
  • 21. Post to Twitter Architecture (w/ an interface) Business Logic Callout Utility Trigger Class Class Mock Implementation Class Interface Production Implementation Class
  • 22. It All Starts With an Interface… • Only contains method signatures. • Implemented by other classes. • Implement by providing code for interface methods.
  • 23. Improve the Callout Class with the Interface Suddenly our application logic is looking much cleaner.
  • 24. Implementation Class #1: Mock • Similar code to what we removed from the callout utility
  • 25. Implementation Class #2: Production • Performs actual callout.
  • 26. Post to Twitter Architecture (w/ an interface) Business Logic Callout Utility Trigger Class Class Mock Implementation Class Interface Production Implementation Class
  • 27. Using The Interface: Test Method
  • 28. Using The Interface: Business Logic • Treat the interface the same here!
  • 29. Using Interfaces in Apex Testing • Summary of advantages • Tried and tested through Java, .Net and others • Interfaces decouple code and provide consistency • Fewer hacks to get tests to work correctly • Improved code coverage • Can test multiple callout situations with different “dummy” data • bit.ly/ApexCalloutTest
  • 31. Automated Testing and Continuous Integration • Deployed tests are not run • New code introduces new bugs • Team introduces new bugs Early detection of bug requires that you manually “Run All” tests or implement full-blown CI… or does it?
  • 32. Automated Testing for Force.com (App) • Free App that installs as a managed package with just a few clicks • Runs 100% on the Force.com Platform
  • 33. Super Easy to Set Up
  • 34. Test Results in Your Inbox
  • 35. Open Source • bit.ly/ForceAutoTest • Pull requests are welcomed
  • 36. Ami Assayag Wes Nolte Principal Architect Director of Innovation CRM Science Tquila @AmiAssayag @WesNolte