SlideShare une entreprise Scribd logo
1  sur  21
Salesforce
Developer Group
Bilbao, 11 de Marzo, 2016
Agenda
 Bienvenidos!!
 Presentaciones - ¿tenemos nuevos miembros?
 Unit tests – ApexMocks – David van Alphen
 Descanso
 ¿Qué os interesa en el próximo SDG?
 Comunidad
Bienvenidos!!!
 ¿Qué es SDG? (aka DUG)
 ¿Nuevos miembros?
ApexMocks
by
David van Alphen
Dev/Test Theory
 OO Principles – SOLID
 Dependency Injection
 Enterprise Patterns
 Separation of Concerns
 Mocking / Stubbing
 Mockito, NSubstitute, etc
SOLID
 Wikipedia - SOLID
 SRP – Single Responsibility Principle
 A class should have one responsibility
 O – Open/Closed Principle
 Open for extension, closed for modification
 L – Liskov Substitution Principle
 Objects should be replaceable by subtypes without affecting correctness of
application
 I – Interface Separation Principle
 Many specific interfaces are better than one general interface
 D – Dependency Injection Principle
 Depend on abstract, not concrete classes
Dependency Injection
 Wikipedia - Dependency Injection
 No Static methods (workaround available)
 Constructors
 Setters
Salesforce & Testing
 Apex tests
 System or integration tests
 Unit tests
 Apexmocks framework
 Mix and Match
Mockito vs Apexmocks
 Apex vs Java
 No Generics, explicit typing
 Concrete classes
 Compile on platform
Apexmocks Generator
 interfacemocks.properties
 IMyClass=MyClass:MyParentClassOrInterface
 Mocks.cls
 .gitignore (or equivalent)
Code example 1
Code example 2
Test Structure
 Given
 Arrange things needed for the test
 When
 Trigger the behavior we want to test
 Then
 Confirm the results are what we expected
Code example 3
Things to Avoid
 Always focus on testing public / interface behaviour
 Use the framework wisely - don’t verify more behaviour
than you need to
 Don’t mock too deeply - if you find your unit test having
to set up a lot of mocking before you even trigger the
behaviour under test, that’s probably a hint that your
design could be better
Documentation and Help
 Examples found in ApexMocks classes and tests
 Code4cloud
 GitHub
 Andyinthecloud.com - Unit Testing, Apex Enterprise Patterns
and ApexMocks Part 1
 Andyinthecloud.com - Unit Testing, Apex Enterprise Patterns
and ApexMocks Part 2
 Feature Enhancements – fork repo on GitHub
Questions?
Video recording
Comunidad de Salesforce
 Customer Success Community en Español
 Después de uniros haced un comentario en chatter
nombrando a @Carolina Ruiz Medina
(FinancialForce.com) y preguntad por MVP hours
 Spanish Developers Success Community
 Spanish User Group
 StackExchange – Preguntas y respuestas
 Developer Forums y otros
 Slides Share
Sorteo
Platform Developer I
Salesforce Certification
¡¡GRACIAS!!
Nos vemos en el
próximo SGD

Contenu connexe

Tendances

How to get the most out of code reviews
How to get the most out of code reviewsHow to get the most out of code reviews
How to get the most out of code reviewsJavaDayUA
 
Geecon09: SOLID Design Principles
Geecon09: SOLID Design PrinciplesGeecon09: SOLID Design Principles
Geecon09: SOLID Design PrinciplesBruno Bossola
 
UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...
UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...
UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...UXDXConf
 
SpecFlow Executable Specifications
SpecFlow Executable SpecificationsSpecFlow Executable Specifications
SpecFlow Executable SpecificationsSam Leach
 
TDD and the Terminator: An Introduction to Test-Driven Development
TDD and the Terminator: An Introduction to Test-Driven DevelopmentTDD and the Terminator: An Introduction to Test-Driven Development
TDD and the Terminator: An Introduction to Test-Driven DevelopmentVMware Tanzu
 
The Solid Principles
The Solid PrinciplesThe Solid Principles
The Solid PrinciplesLuke Smith
 
Unwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingUnwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingLemi Orhan Ergin
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentbhochhi
 
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...mCloud
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestableRoyKlein
 
A journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanA journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanJaehoon Oh
 
Aceu2009 Open Source For Interoperability
Aceu2009 Open Source For InteroperabilityAceu2009 Open Source For Interoperability
Aceu2009 Open Source For Interoperabilityguest60ed0b
 

Tendances (13)

Regression Suite Optimization
Regression Suite OptimizationRegression Suite Optimization
Regression Suite Optimization
 
How to get the most out of code reviews
How to get the most out of code reviewsHow to get the most out of code reviews
How to get the most out of code reviews
 
Geecon09: SOLID Design Principles
Geecon09: SOLID Design PrinciplesGeecon09: SOLID Design Principles
Geecon09: SOLID Design Principles
 
UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...
UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...
UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...
 
SpecFlow Executable Specifications
SpecFlow Executable SpecificationsSpecFlow Executable Specifications
SpecFlow Executable Specifications
 
TDD and the Terminator: An Introduction to Test-Driven Development
TDD and the Terminator: An Introduction to Test-Driven DevelopmentTDD and the Terminator: An Introduction to Test-Driven Development
TDD and the Terminator: An Introduction to Test-Driven Development
 
The Solid Principles
The Solid PrinciplesThe Solid Principles
The Solid Principles
 
Unwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingUnwritten Manual for Pair Programming
Unwritten Manual for Pair Programming
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestable
 
A journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanA journey to_be_a_software_craftsman
A journey to_be_a_software_craftsman
 
Aceu2009 Open Source For Interoperability
Aceu2009 Open Source For InteroperabilityAceu2009 Open Source For Interoperability
Aceu2009 Open Source For Interoperability
 

Similaire à 11th Salesforce Developer Group meeting in Bilbao

ITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons LearnedITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons LearnedJoão Pedro Martins
 
Strengthen and Scale Security for a dollar or less
Strengthen and Scale Security for a dollar or lessStrengthen and Scale Security for a dollar or less
Strengthen and Scale Security for a dollar or lessMohammed A. Imran
 
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
 
Unit Testing Full@
Unit Testing Full@Unit Testing Full@
Unit Testing Full@Alex Borsuk
 
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014Jwooldridge
 
Lublin Startup Festival - Mobile Architecture Design Patterns
Lublin Startup Festival - Mobile Architecture Design PatternsLublin Startup Festival - Mobile Architecture Design Patterns
Lublin Startup Festival - Mobile Architecture Design PatternsKarol Szmaj
 
Strengthen and Scale Security Using DevSecOps - OWASP Indonesia
Strengthen and Scale Security Using DevSecOps - OWASP IndonesiaStrengthen and Scale Security Using DevSecOps - OWASP Indonesia
Strengthen and Scale Security Using DevSecOps - OWASP IndonesiaMohammed A. Imran
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship ChecklistRyan Polk
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionKnoldus Inc.
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016Joe Ferguson
 
So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...Joe Ferguson
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsBasavaraj Patil
 
30 days or less: New Features to Production
30 days or less: New Features to Production30 days or less: New Features to Production
30 days or less: New Features to ProductionKarthik Gaekwad
 
Elevate Tel Aviv
Elevate Tel AvivElevate Tel Aviv
Elevate Tel Avivsready
 
Continuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software WestContinuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software WestCory Foy
 
DevOps Maturity Curve v5
DevOps Maturity Curve v5DevOps Maturity Curve v5
DevOps Maturity Curve v5Paul Peissner
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principlesdeonpmeyer
 
Devops Powered by Splunk
Devops Powered by SplunkDevops Powered by Splunk
Devops Powered by SplunkSplunk
 

Similaire à 11th Salesforce Developer Group meeting in Bilbao (20)

ITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons LearnedITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
 
Strengthen and Scale Security for a dollar or less
Strengthen and Scale Security for a dollar or lessStrengthen and Scale Security for a dollar or less
Strengthen and Scale Security for a dollar or less
 
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
 
Unit Testing Full@
Unit Testing Full@Unit Testing Full@
Unit Testing Full@
 
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
 
Lublin Startup Festival - Mobile Architecture Design Patterns
Lublin Startup Festival - Mobile Architecture Design PatternsLublin Startup Festival - Mobile Architecture Design Patterns
Lublin Startup Festival - Mobile Architecture Design Patterns
 
Strengthen and Scale Security Using DevSecOps - OWASP Indonesia
Strengthen and Scale Security Using DevSecOps - OWASP IndonesiaStrengthen and Scale Security Using DevSecOps - OWASP Indonesia
Strengthen and Scale Security Using DevSecOps - OWASP Indonesia
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship Checklist
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test Automaion
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016
 
So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatterns
 
30 days or less: New Features to Production
30 days or less: New Features to Production30 days or less: New Features to Production
30 days or less: New Features to Production
 
Elevate Tel Aviv
Elevate Tel AvivElevate Tel Aviv
Elevate Tel Aviv
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Continuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software WestContinuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software West
 
Practical DevOps
Practical DevOpsPractical DevOps
Practical DevOps
 
DevOps Maturity Curve v5
DevOps Maturity Curve v5DevOps Maturity Curve v5
DevOps Maturity Curve v5
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 
Devops Powered by Splunk
Devops Powered by SplunkDevops Powered by Splunk
Devops Powered by Splunk
 

Plus de northspainsalesforcedevelopergroup

Salesforce Elevate - Bilbao '17 - Separación de Conceptos - SoC
Salesforce Elevate - Bilbao '17 - Separación de Conceptos - SoCSalesforce Elevate - Bilbao '17 - Separación de Conceptos - SoC
Salesforce Elevate - Bilbao '17 - Separación de Conceptos - SoCnorthspainsalesforcedevelopergroup
 
Salesforce Elevate - Bilbao '17 - Process automation with and without code
Salesforce Elevate - Bilbao '17 - Process automation with and without codeSalesforce Elevate - Bilbao '17 - Process automation with and without code
Salesforce Elevate - Bilbao '17 - Process automation with and without codenorthspainsalesforcedevelopergroup
 
Salesforce Elevate - Bilbao '17 - Introducción FinancialForce
Salesforce Elevate - Bilbao '17 - Introducción FinancialForceSalesforce Elevate - Bilbao '17 - Introducción FinancialForce
Salesforce Elevate - Bilbao '17 - Introducción FinancialForcenorthspainsalesforcedevelopergroup
 
Salesforce Bilbao Elevate 2015 - Presentación principal y FinancialForce
Salesforce Bilbao Elevate 2015 - Presentación principal y FinancialForceSalesforce Bilbao Elevate 2015 - Presentación principal y FinancialForce
Salesforce Bilbao Elevate 2015 - Presentación principal y FinancialForcenorthspainsalesforcedevelopergroup
 

Plus de northspainsalesforcedevelopergroup (20)

17th Salesforce Developer Group meeting in Bilbao
17th Salesforce Developer Group meeting in Bilbao17th Salesforce Developer Group meeting in Bilbao
17th Salesforce Developer Group meeting in Bilbao
 
Salesforce Elevate - Bilbao '17 - Separación de Conceptos - SoC
Salesforce Elevate - Bilbao '17 - Separación de Conceptos - SoCSalesforce Elevate - Bilbao '17 - Separación de Conceptos - SoC
Salesforce Elevate - Bilbao '17 - Separación de Conceptos - SoC
 
Salesforce Elevate - Bilbao '17 - Process automation with and without code
Salesforce Elevate - Bilbao '17 - Process automation with and without codeSalesforce Elevate - Bilbao '17 - Process automation with and without code
Salesforce Elevate - Bilbao '17 - Process automation with and without code
 
Salesforce Elevate - Bilbao '17 - Introducción FinancialForce
Salesforce Elevate - Bilbao '17 - Introducción FinancialForceSalesforce Elevate - Bilbao '17 - Introducción FinancialForce
Salesforce Elevate - Bilbao '17 - Introducción FinancialForce
 
Salesforce Elevate - Bilbao '17 - Introducción NTS
Salesforce Elevate - Bilbao '17 - Introducción NTSSalesforce Elevate - Bilbao '17 - Introducción NTS
Salesforce Elevate - Bilbao '17 - Introducción NTS
 
Salesforce Elevate - Bilbao '17 - Chatbot y Salesforce
Salesforce Elevate - Bilbao '17 - Chatbot y SalesforceSalesforce Elevate - Bilbao '17 - Chatbot y Salesforce
Salesforce Elevate - Bilbao '17 - Chatbot y Salesforce
 
Salesforce Elevate - Bilbao '17 - Introducción Salesforce
Salesforce Elevate - Bilbao '17 - Introducción SalesforceSalesforce Elevate - Bilbao '17 - Introducción Salesforce
Salesforce Elevate - Bilbao '17 - Introducción Salesforce
 
14th Salesforce Developer Group meeting in Bilbao
14th Salesforce Developer Group meeting in Bilbao14th Salesforce Developer Group meeting in Bilbao
14th Salesforce Developer Group meeting in Bilbao
 
12th Salesforce Developer Group meeting in Bilbao
12th Salesforce Developer Group meeting in Bilbao12th Salesforce Developer Group meeting in Bilbao
12th Salesforce Developer Group meeting in Bilbao
 
13th Salesforce Developer Group meeting in Bilbao
13th Salesforce Developer Group meeting in Bilbao13th Salesforce Developer Group meeting in Bilbao
13th Salesforce Developer Group meeting in Bilbao
 
9th Salesforce Developer Group meeting in Bilbao
9th Salesforce Developer Group meeting in Bilbao9th Salesforce Developer Group meeting in Bilbao
9th Salesforce Developer Group meeting in Bilbao
 
8th Salesforce Developer Group meeting in Bilbao
8th Salesforce Developer Group meeting in Bilbao8th Salesforce Developer Group meeting in Bilbao
8th Salesforce Developer Group meeting in Bilbao
 
6th Salesforce Developer Group - Bilbao
6th Salesforce Developer Group - Bilbao6th Salesforce Developer Group - Bilbao
6th Salesforce Developer Group - Bilbao
 
Salesforce Bilbao Elevate 2015 - Presentación principal y FinancialForce
Salesforce Bilbao Elevate 2015 - Presentación principal y FinancialForceSalesforce Bilbao Elevate 2015 - Presentación principal y FinancialForce
Salesforce Bilbao Elevate 2015 - Presentación principal y FinancialForce
 
Salesforce Elevate Bilbao 2015 - Desuto Presentación
Salesforce Elevate Bilbao 2015 - Desuto PresentaciónSalesforce Elevate Bilbao 2015 - Desuto Presentación
Salesforce Elevate Bilbao 2015 - Desuto Presentación
 
Salesforce Bilbao Elevate 2015 - Nts cloud computing y sfdc
Salesforce Bilbao Elevate 2015 - Nts cloud computing y sfdcSalesforce Bilbao Elevate 2015 - Nts cloud computing y sfdc
Salesforce Bilbao Elevate 2015 - Nts cloud computing y sfdc
 
Salesforce Bilbao Elevate '15 - 4th developer workshop
Salesforce Bilbao Elevate '15 - 4th developer workshopSalesforce Bilbao Elevate '15 - 4th developer workshop
Salesforce Bilbao Elevate '15 - 4th developer workshop
 
Salesforce Bilbao Elevate '15 - 3rd developer workshop
Salesforce Bilbao Elevate '15 - 3rd developer workshopSalesforce Bilbao Elevate '15 - 3rd developer workshop
Salesforce Bilbao Elevate '15 - 3rd developer workshop
 
Salesforce Bilbao Elevate '15 - 2nd developer workshop
Salesforce Bilbao Elevate '15 - 2nd developer workshopSalesforce Bilbao Elevate '15 - 2nd developer workshop
Salesforce Bilbao Elevate '15 - 2nd developer workshop
 
Salesforce Bilbao Elevate '15 - 1st developer workshop
Salesforce Bilbao Elevate '15 - 1st developer workshopSalesforce Bilbao Elevate '15 - 1st developer workshop
Salesforce Bilbao Elevate '15 - 1st developer workshop
 

Dernier

Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 

Dernier (20)

Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 

11th Salesforce Developer Group meeting in Bilbao

  • 2. Agenda  Bienvenidos!!  Presentaciones - ¿tenemos nuevos miembros?  Unit tests – ApexMocks – David van Alphen  Descanso  ¿Qué os interesa en el próximo SDG?  Comunidad
  • 3. Bienvenidos!!!  ¿Qué es SDG? (aka DUG)  ¿Nuevos miembros?
  • 5. Dev/Test Theory  OO Principles – SOLID  Dependency Injection  Enterprise Patterns  Separation of Concerns  Mocking / Stubbing  Mockito, NSubstitute, etc
  • 6. SOLID  Wikipedia - SOLID  SRP – Single Responsibility Principle  A class should have one responsibility  O – Open/Closed Principle  Open for extension, closed for modification  L – Liskov Substitution Principle  Objects should be replaceable by subtypes without affecting correctness of application  I – Interface Separation Principle  Many specific interfaces are better than one general interface  D – Dependency Injection Principle  Depend on abstract, not concrete classes
  • 7. Dependency Injection  Wikipedia - Dependency Injection  No Static methods (workaround available)  Constructors  Setters
  • 8. Salesforce & Testing  Apex tests  System or integration tests  Unit tests  Apexmocks framework  Mix and Match
  • 9. Mockito vs Apexmocks  Apex vs Java  No Generics, explicit typing  Concrete classes  Compile on platform
  • 10. Apexmocks Generator  interfacemocks.properties  IMyClass=MyClass:MyParentClassOrInterface  Mocks.cls  .gitignore (or equivalent)
  • 13. Test Structure  Given  Arrange things needed for the test  When  Trigger the behavior we want to test  Then  Confirm the results are what we expected
  • 15. Things to Avoid  Always focus on testing public / interface behaviour  Use the framework wisely - don’t verify more behaviour than you need to  Don’t mock too deeply - if you find your unit test having to set up a lot of mocking before you even trigger the behaviour under test, that’s probably a hint that your design could be better
  • 16. Documentation and Help  Examples found in ApexMocks classes and tests  Code4cloud  GitHub  Andyinthecloud.com - Unit Testing, Apex Enterprise Patterns and ApexMocks Part 1  Andyinthecloud.com - Unit Testing, Apex Enterprise Patterns and ApexMocks Part 2  Feature Enhancements – fork repo on GitHub
  • 19. Comunidad de Salesforce  Customer Success Community en Español  Después de uniros haced un comentario en chatter nombrando a @Carolina Ruiz Medina (FinancialForce.com) y preguntad por MVP hours  Spanish Developers Success Community  Spanish User Group  StackExchange – Preguntas y respuestas  Developer Forums y otros  Slides Share
  • 21. ¡¡GRACIAS!! Nos vemos en el próximo SGD