SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
Apex Test Classes
@testsetup
Paris Salesforce Developer Group
03/06/2015
Fabien Taillon
@FabienTaillon
In every Test Class you should :
 Create your own test data
 Test your code
 Assert the results of your test
What is a Test Class
Test Class
Usual Test Class
Method 1
Create Data
Execute Test 1
Assert Results 1
Method 2
Create Data
Execute Test 2
Assert Results 2
Method 3
Create Data
Execute Test 3
Assert Results 3
Test Class
Usual Test Class
Method 1
Create Data
Execute Test 1
Assert Results 1
Method 2
Create Data
Execute Test 2
Assert Results 2
Method 3
Create Data
Execute Test 3
Assert Results 3
Execute Test 1
Assert Results 1
Execute Test 2
Assert Results 2
Execute Test 3
Assert Results 3
This is the aim and heart of your tests
Test Class
Usual Test Class
Method 1
Create Data
Execute Test 1
Assert Results 1
Method 2
Create Data
Execute Test 2
Assert Results 2
Method 3
Create Data
Execute Test 3
Assert Results 3
Create Data Create Data Create Data
This must be done, but potentially doing X times the same thing !!
Test Class
Usual Test Class
Method 1
Create Data
Execute Test 1
Assert Results 1
Method 2
Create Data
Execute Test 2
Assert Results 2
Method 3
Create Data
Execute Test 3
Assert Results 3
ex: 30s ex: 30s ex: 30s
This must be done, but potentially doing X times the same thing !!
Meaning execution time lost for nothing !!
ex: 1mn30 instead of 30s
Create Data Create Data Create Data
What if we could do the same job
only once ?
What if we could do the same job
only once ?
Here comes @testsetup !
Test Class
Usual Test Class
Method 1
Create Data
Execute Test 1
Assert Results 1
Method 2
Create Data
Execute Test 2
Assert Results 2
Method 3
Create Data
Execute Test 3
Assert Results 3
Test Class
@testsetup
Method 1
Execute Test 1
Assert Results 1
@testsetup method : Create Data
Method 2
Execute Test 2
Assert Results 2
Method 3
Execute Test 3
Assert Results 3
Test Class
@testsetup
Method 1
Execute Test 1
Assert Results 1
@testsetup method : Create Data
Method 2
Execute Test 2
Assert Results 2
Method 3
Execute Test 3
Assert Results 3
@testsetup method : Create Data
• Creation of test data is now common to all methods
• Executed once
• Rollbacked between all methods
 Test classes execute faster !!
DEMO
 Test setup methods are supported only with the default data
isolation mode for a test class
 Multiple test setup methods are allowed in a test class, but the
order in which they’re executed by the testing framework isn’t
guaranteed
 If a fatal error occurs during the execution of a test setup method,
the entire test class fails, and no further tests in the class are
executed
 If a test setup method calls a non-test method of another class, no
code coverage is calculated for the non-test method
What else ?
Meetup 06/2015 - @testsetup

Weitere ähnliche Inhalte

Was ist angesagt?

Testing All the Way Down, and Other Directions
Testing All the Way Down, and Other DirectionsTesting All the Way Down, and Other Directions
Testing All the Way Down, and Other DirectionsJames Thomas
 
Custom Validation PHP
Custom Validation PHPCustom Validation PHP
Custom Validation PHPProdigyView
 
Physics lab rubric
Physics lab rubricPhysics lab rubric
Physics lab rubricjsawyer3434
 
Pairwise Software Test Design - What exactly is pairwise coverage? What is 3-...
Pairwise Software Test Design - What exactly is pairwise coverage? What is 3-...Pairwise Software Test Design - What exactly is pairwise coverage? What is 3-...
Pairwise Software Test Design - What exactly is pairwise coverage? What is 3-...Justin Hunter
 
How To Use Ignore Annotation In JUnit
How To Use Ignore Annotation In JUnitHow To Use Ignore Annotation In JUnit
How To Use Ignore Annotation In JUnitBugRaptors
 
Duplicate Contact Trigger || Trigger Logic Building || #ApexTrigger #Salesforce
Duplicate Contact Trigger || Trigger Logic Building || #ApexTrigger #SalesforceDuplicate Contact Trigger || Trigger Logic Building || #ApexTrigger #Salesforce
Duplicate Contact Trigger || Trigger Logic Building || #ApexTrigger #SalesforceAmit Singh
 
Icse2014 v3
Icse2014 v3Icse2014 v3
Icse2014 v3SAIL_QU
 
Automated
AutomatedAutomated
Automatedingveb
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practicesnickokiss
 
Resource Leaks in Java
Resource Leaks in JavaResource Leaks in Java
Resource Leaks in JavaCoverity
 
Test Design For Everyone
Test Design For EveryoneTest Design For Everyone
Test Design For EveryoneAlan Page
 
Concurrency Errors in Java
Concurrency Errors in JavaConcurrency Errors in Java
Concurrency Errors in JavaCoverity
 
There is NO test automation
There is NO test automationThere is NO test automation
There is NO test automationEddy Bruin
 
OSS Java Analysis - What You Might Be Missing
OSS Java Analysis - What You Might Be MissingOSS Java Analysis - What You Might Be Missing
OSS Java Analysis - What You Might Be MissingCoverity
 

Was ist angesagt? (19)

Testing All the Way Down, and Other Directions
Testing All the Way Down, and Other DirectionsTesting All the Way Down, and Other Directions
Testing All the Way Down, and Other Directions
 
Ecet330 lab rubric
Ecet330 lab rubricEcet330 lab rubric
Ecet330 lab rubric
 
Custom Validation PHP
Custom Validation PHPCustom Validation PHP
Custom Validation PHP
 
Physics lab rubric
Physics lab rubricPhysics lab rubric
Physics lab rubric
 
Unit testing
Unit testingUnit testing
Unit testing
 
Pairwise Software Test Design - What exactly is pairwise coverage? What is 3-...
Pairwise Software Test Design - What exactly is pairwise coverage? What is 3-...Pairwise Software Test Design - What exactly is pairwise coverage? What is 3-...
Pairwise Software Test Design - What exactly is pairwise coverage? What is 3-...
 
How To Use Ignore Annotation In JUnit
How To Use Ignore Annotation In JUnitHow To Use Ignore Annotation In JUnit
How To Use Ignore Annotation In JUnit
 
Duplicate Contact Trigger || Trigger Logic Building || #ApexTrigger #Salesforce
Duplicate Contact Trigger || Trigger Logic Building || #ApexTrigger #SalesforceDuplicate Contact Trigger || Trigger Logic Building || #ApexTrigger #Salesforce
Duplicate Contact Trigger || Trigger Logic Building || #ApexTrigger #Salesforce
 
Icse2014 v3
Icse2014 v3Icse2014 v3
Icse2014 v3
 
Automated
AutomatedAutomated
Automated
 
Testing &ampdebugging
Testing &ampdebuggingTesting &ampdebugging
Testing &ampdebugging
 
What is testing
What is testingWhat is testing
What is testing
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
 
Resource Leaks in Java
Resource Leaks in JavaResource Leaks in Java
Resource Leaks in Java
 
Making method calls_simpler
Making method calls_simplerMaking method calls_simpler
Making method calls_simpler
 
Test Design For Everyone
Test Design For EveryoneTest Design For Everyone
Test Design For Everyone
 
Concurrency Errors in Java
Concurrency Errors in JavaConcurrency Errors in Java
Concurrency Errors in Java
 
There is NO test automation
There is NO test automationThere is NO test automation
There is NO test automation
 
OSS Java Analysis - What You Might Be Missing
OSS Java Analysis - What You Might Be MissingOSS Java Analysis - What You Might Be Missing
OSS Java Analysis - What You Might Be Missing
 

Andere mochten auch

Responsive Web Design with Visualforce
Responsive Web Design with VisualforceResponsive Web Design with Visualforce
Responsive Web Design with VisualforceKeir Bowden
 
Force.com Friday : Intro to Visualforce
Force.com Friday : Intro to VisualforceForce.com Friday : Intro to Visualforce
Force.com Friday : Intro to VisualforceSalesforce Developers
 
Visualforce in Salesforce1: Optimizing your User Interface for Mobile
Visualforce in Salesforce1: Optimizing your User Interface for MobileVisualforce in Salesforce1: Optimizing your User Interface for Mobile
Visualforce in Salesforce1: Optimizing your User Interface for MobileSalesforce Developers
 
Making External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceMaking External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceSalesforce Developers
 
Salesforce Presentation
Salesforce PresentationSalesforce Presentation
Salesforce PresentationChetna Purohit
 

Andere mochten auch (10)

Introducing Visualforce
Introducing VisualforceIntroducing Visualforce
Introducing Visualforce
 
Responsive Web Design with Visualforce
Responsive Web Design with VisualforceResponsive Web Design with Visualforce
Responsive Web Design with Visualforce
 
Force.com Friday : Intro to Visualforce
Force.com Friday : Intro to VisualforceForce.com Friday : Intro to Visualforce
Force.com Friday : Intro to Visualforce
 
Force.com Friday - Intro to Visualforce
Force.com Friday - Intro to VisualforceForce.com Friday - Intro to Visualforce
Force.com Friday - Intro to Visualforce
 
Visualforce in Salesforce1: Optimizing your User Interface for Mobile
Visualforce in Salesforce1: Optimizing your User Interface for MobileVisualforce in Salesforce1: Optimizing your User Interface for Mobile
Visualforce in Salesforce1: Optimizing your User Interface for Mobile
 
Making External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceMaking External Web Pages Interact With Visualforce
Making External Web Pages Interact With Visualforce
 
Introduction to Visualforce
Introduction to VisualforceIntroduction to Visualforce
Introduction to Visualforce
 
Introduction to Visualforce Webinar
Introduction to Visualforce WebinarIntroduction to Visualforce Webinar
Introduction to Visualforce Webinar
 
Introduction to Visualforce
Introduction to VisualforceIntroduction to Visualforce
Introduction to Visualforce
 
Salesforce Presentation
Salesforce PresentationSalesforce Presentation
Salesforce Presentation
 

Ähnlich wie Meetup 06/2015 - @testsetup

Dev labs alliance top 20 testng interview questions for sdet
Dev labs alliance top 20 testng interview questions for sdetDev labs alliance top 20 testng interview questions for sdet
Dev labs alliance top 20 testng interview questions for sdetdevlabsalliance
 
Testclass [Autosaved]
Testclass [Autosaved]Testclass [Autosaved]
Testclass [Autosaved]Suraj Singh
 
Getting started with Test Driven Development
Getting started with Test Driven DevelopmentGetting started with Test Driven Development
Getting started with Test Driven DevelopmentFerdous Mahmud Shaon
 
Unit testing in Force.com platform
Unit testing in Force.com platformUnit testing in Force.com platform
Unit testing in Force.com platformChamil Madusanka
 
Getting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud ShaonGetting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud ShaonCefalo
 
TestNG introduction
TestNG introductionTestNG introduction
TestNG introductionDenis Bazhin
 
Test driven development - JUnit basics and best practices
Test driven development - JUnit basics and best practicesTest driven development - JUnit basics and best practices
Test driven development - JUnit basics and best practicesNarendra Pathai
 
An Introduction to unit testing
An Introduction to unit testingAn Introduction to unit testing
An Introduction to unit testingSteven Casey
 
TestNG Session presented in PB
TestNG Session presented in PBTestNG Session presented in PB
TestNG Session presented in PBAbhishek Yadav
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration TestingDavid Berliner
 
Automated Unit Testing
Automated Unit TestingAutomated Unit Testing
Automated Unit TestingMike Lively
 
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...Fabio Palomba
 
Dreamforce Campfire - Apex Testing Tips and Tricks
Dreamforce Campfire - Apex Testing Tips and TricksDreamforce Campfire - Apex Testing Tips and Tricks
Dreamforce Campfire - Apex Testing Tips and TricksDaniel Ballinger
 
GCSE ICT TESTING
GCSE ICT TESTING GCSE ICT TESTING
GCSE ICT TESTING morgan98
 

Ähnlich wie Meetup 06/2015 - @testsetup (20)

Dev labs alliance top 20 testng interview questions for sdet
Dev labs alliance top 20 testng interview questions for sdetDev labs alliance top 20 testng interview questions for sdet
Dev labs alliance top 20 testng interview questions for sdet
 
Test ng
Test ngTest ng
Test ng
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 
Testing with Junit4
Testing with Junit4Testing with Junit4
Testing with Junit4
 
Test ng tutorial
Test ng tutorialTest ng tutorial
Test ng tutorial
 
Testclass [Autosaved]
Testclass [Autosaved]Testclass [Autosaved]
Testclass [Autosaved]
 
Getting started with Test Driven Development
Getting started with Test Driven DevelopmentGetting started with Test Driven Development
Getting started with Test Driven Development
 
Unit testing in Force.com platform
Unit testing in Force.com platformUnit testing in Force.com platform
Unit testing in Force.com platform
 
TDD Best Practices
TDD Best PracticesTDD Best Practices
TDD Best Practices
 
Getting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud ShaonGetting started with Test Driven Development - Ferdous Mahmud Shaon
Getting started with Test Driven Development - Ferdous Mahmud Shaon
 
TestNG introduction
TestNG introductionTestNG introduction
TestNG introduction
 
Test driven development - JUnit basics and best practices
Test driven development - JUnit basics and best practicesTest driven development - JUnit basics and best practices
Test driven development - JUnit basics and best practices
 
An Introduction to unit testing
An Introduction to unit testingAn Introduction to unit testing
An Introduction to unit testing
 
TestNG Session presented in PB
TestNG Session presented in PBTestNG Session presented in PB
TestNG Session presented in PB
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration Testing
 
Testing
TestingTesting
Testing
 
Automated Unit Testing
Automated Unit TestingAutomated Unit Testing
Automated Unit Testing
 
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
On the Diffusion of Test Smells in Automatically Generated Test Code: An Empi...
 
Dreamforce Campfire - Apex Testing Tips and Tricks
Dreamforce Campfire - Apex Testing Tips and TricksDreamforce Campfire - Apex Testing Tips and Tricks
Dreamforce Campfire - Apex Testing Tips and Tricks
 
GCSE ICT TESTING
GCSE ICT TESTING GCSE ICT TESTING
GCSE ICT TESTING
 

Mehr von Paris Salesforce Developer Group

La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !
La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !
La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !Paris Salesforce Developer Group
 
Scratch orgs...vous pensiez en avoir terminé avec les sandboxes ?
Scratch orgs...vous pensiez en avoir terminé avec les sandboxes ?Scratch orgs...vous pensiez en avoir terminé avec les sandboxes ?
Scratch orgs...vous pensiez en avoir terminé avec les sandboxes ?Paris Salesforce Developer Group
 
Mon Expérience avec le Certified Technical Architect Review Board
 Mon Expérience avec le Certified Technical Architect Review Board Mon Expérience avec le Certified Technical Architect Review Board
Mon Expérience avec le Certified Technical Architect Review BoardParis Salesforce Developer Group
 
DX@Scale: Optimizing Salesforce Development and Deployment for large scale pr...
DX@Scale: Optimizing Salesforce Development and Deployment for large scale pr...DX@Scale: Optimizing Salesforce Development and Deployment for large scale pr...
DX@Scale: Optimizing Salesforce Development and Deployment for large scale pr...Paris Salesforce Developer Group
 
Pratiques administration avancées et techniques de développement
Pratiques administration avancées et techniques de développementPratiques administration avancées et techniques de développement
Pratiques administration avancées et techniques de développementParis Salesforce Developer Group
 
Introducing salesforce shield - Paris Salesforce Developer Group - Oct 15
Introducing salesforce shield - Paris Salesforce Developer Group - Oct 15Introducing salesforce shield - Paris Salesforce Developer Group - Oct 15
Introducing salesforce shield - Paris Salesforce Developer Group - Oct 15Paris Salesforce Developer Group
 
Versionning et travail en équipe avec Salesforce - 27/11/2014
Versionning et travail en équipe avec Salesforce - 27/11/2014Versionning et travail en équipe avec Salesforce - 27/11/2014
Versionning et travail en équipe avec Salesforce - 27/11/2014Paris Salesforce Developer Group
 
Paris Salesforce Developer Group - 16 09 2014 - Summer '14
Paris Salesforce Developer Group - 16 09 2014 - Summer '14Paris Salesforce Developer Group - 16 09 2014 - Summer '14
Paris Salesforce Developer Group - 16 09 2014 - Summer '14Paris Salesforce Developer Group
 

Mehr von Paris Salesforce Developer Group (19)

Pour Noël, devenez chrome extensioniste!
Pour Noël, devenez chrome extensioniste!Pour Noël, devenez chrome extensioniste!
Pour Noël, devenez chrome extensioniste!
 
GraphQL (la nouvelle API de référence de Salesforce ?!)
GraphQL (la nouvelle API de référence de Salesforce ?!)GraphQL (la nouvelle API de référence de Salesforce ?!)
GraphQL (la nouvelle API de référence de Salesforce ?!)
 
La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !
La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !
La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !
 
Introduction à la plateforme Anypoint de MuleSoft
Introduction à la plateforme Anypoint de MuleSoftIntroduction à la plateforme Anypoint de MuleSoft
Introduction à la plateforme Anypoint de MuleSoft
 
Release spring '22 - Community Groups français
Release spring '22 - Community Groups françaisRelease spring '22 - Community Groups français
Release spring '22 - Community Groups français
 
Scratch orgs...vous pensiez en avoir terminé avec les sandboxes ?
Scratch orgs...vous pensiez en avoir terminé avec les sandboxes ?Scratch orgs...vous pensiez en avoir terminé avec les sandboxes ?
Scratch orgs...vous pensiez en avoir terminé avec les sandboxes ?
 
Mon Expérience avec le Certified Technical Architect Review Board
 Mon Expérience avec le Certified Technical Architect Review Board Mon Expérience avec le Certified Technical Architect Review Board
Mon Expérience avec le Certified Technical Architect Review Board
 
Mieux acheminer les emails avec salesforce
Mieux acheminer les emails avec salesforceMieux acheminer les emails avec salesforce
Mieux acheminer les emails avec salesforce
 
DX@Scale: Optimizing Salesforce Development and Deployment for large scale pr...
DX@Scale: Optimizing Salesforce Development and Deployment for large scale pr...DX@Scale: Optimizing Salesforce Development and Deployment for large scale pr...
DX@Scale: Optimizing Salesforce Development and Deployment for large scale pr...
 
Dreamforce Global Gathering
Dreamforce Global GatheringDreamforce Global Gathering
Dreamforce Global Gathering
 
Getting started with Salesforce DX
Getting started with Salesforce DXGetting started with Salesforce DX
Getting started with Salesforce DX
 
Pratiques administration avancées et techniques de développement
Pratiques administration avancées et techniques de développementPratiques administration avancées et techniques de développement
Pratiques administration avancées et techniques de développement
 
Sensibilisation à la Sécurité Salesforce
Sensibilisation à la Sécurité SalesforceSensibilisation à la Sécurité Salesforce
Sensibilisation à la Sécurité Salesforce
 
Salesforce Performance hacks - Client Side
Salesforce Performance hacks - Client SideSalesforce Performance hacks - Client Side
Salesforce Performance hacks - Client Side
 
Introducing salesforce shield - Paris Salesforce Developer Group - Oct 15
Introducing salesforce shield - Paris Salesforce Developer Group - Oct 15Introducing salesforce shield - Paris Salesforce Developer Group - Oct 15
Introducing salesforce shield - Paris Salesforce Developer Group - Oct 15
 
Meetup Custom Metadata - 1st Part
Meetup Custom Metadata - 1st PartMeetup Custom Metadata - 1st Part
Meetup Custom Metadata - 1st Part
 
Lightning week - Paris DUG
Lightning week - Paris DUGLightning week - Paris DUG
Lightning week - Paris DUG
 
Versionning et travail en équipe avec Salesforce - 27/11/2014
Versionning et travail en équipe avec Salesforce - 27/11/2014Versionning et travail en équipe avec Salesforce - 27/11/2014
Versionning et travail en équipe avec Salesforce - 27/11/2014
 
Paris Salesforce Developer Group - 16 09 2014 - Summer '14
Paris Salesforce Developer Group - 16 09 2014 - Summer '14Paris Salesforce Developer Group - 16 09 2014 - Summer '14
Paris Salesforce Developer Group - 16 09 2014 - Summer '14
 

Kürzlich hochgeladen

Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
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
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
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
 

Kürzlich hochgeladen (20)

Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
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)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
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)
 
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!
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
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
 

Meetup 06/2015 - @testsetup

  • 1. Apex Test Classes @testsetup Paris Salesforce Developer Group 03/06/2015 Fabien Taillon @FabienTaillon
  • 2. In every Test Class you should :  Create your own test data  Test your code  Assert the results of your test What is a Test Class
  • 3. Test Class Usual Test Class Method 1 Create Data Execute Test 1 Assert Results 1 Method 2 Create Data Execute Test 2 Assert Results 2 Method 3 Create Data Execute Test 3 Assert Results 3
  • 4. Test Class Usual Test Class Method 1 Create Data Execute Test 1 Assert Results 1 Method 2 Create Data Execute Test 2 Assert Results 2 Method 3 Create Data Execute Test 3 Assert Results 3 Execute Test 1 Assert Results 1 Execute Test 2 Assert Results 2 Execute Test 3 Assert Results 3 This is the aim and heart of your tests
  • 5. Test Class Usual Test Class Method 1 Create Data Execute Test 1 Assert Results 1 Method 2 Create Data Execute Test 2 Assert Results 2 Method 3 Create Data Execute Test 3 Assert Results 3 Create Data Create Data Create Data This must be done, but potentially doing X times the same thing !!
  • 6. Test Class Usual Test Class Method 1 Create Data Execute Test 1 Assert Results 1 Method 2 Create Data Execute Test 2 Assert Results 2 Method 3 Create Data Execute Test 3 Assert Results 3 ex: 30s ex: 30s ex: 30s This must be done, but potentially doing X times the same thing !! Meaning execution time lost for nothing !! ex: 1mn30 instead of 30s Create Data Create Data Create Data
  • 7. What if we could do the same job only once ?
  • 8. What if we could do the same job only once ? Here comes @testsetup !
  • 9. Test Class Usual Test Class Method 1 Create Data Execute Test 1 Assert Results 1 Method 2 Create Data Execute Test 2 Assert Results 2 Method 3 Create Data Execute Test 3 Assert Results 3
  • 10. Test Class @testsetup Method 1 Execute Test 1 Assert Results 1 @testsetup method : Create Data Method 2 Execute Test 2 Assert Results 2 Method 3 Execute Test 3 Assert Results 3
  • 11. Test Class @testsetup Method 1 Execute Test 1 Assert Results 1 @testsetup method : Create Data Method 2 Execute Test 2 Assert Results 2 Method 3 Execute Test 3 Assert Results 3 @testsetup method : Create Data • Creation of test data is now common to all methods • Executed once • Rollbacked between all methods  Test classes execute faster !!
  • 12. DEMO
  • 13.  Test setup methods are supported only with the default data isolation mode for a test class  Multiple test setup methods are allowed in a test class, but the order in which they’re executed by the testing framework isn’t guaranteed  If a fatal error occurs during the execution of a test setup method, the entire test class fails, and no further tests in the class are executed  If a test setup method calls a non-test method of another class, no code coverage is calculated for the non-test method What else ?