SlideShare a Scribd company logo
Finding a good development partner
Kevin Poorman
Principle Architect
@CodeFriar
Kevin Poorman
Principal Architect
Agenda
•Why you need a good development partner
•Terms and Conditions
•What to look for in your partner and in the code
•Questions, Comments and Snide Remarks
Why do you need a good development partner?
•Strategy v. Tactics
•Code is strategic by nature.
•Cost of maintaining code is always the largest expense
of a software project. (cf. Code Complete, by Steve McConnell)
•In other words, you want a developer who writes code
as if the person who ends up maintaining it is a violent
psychopath who knows where they live.
Terms and Conditions
•Single Framework Structure
•Test Coverage
•Assertion
•Comments
Terms and Conditions
Single Framework Structure
SingleTrigger Calls class method(s)
A
Calls class method(s)
B, C and F
Calls class methods
X, Y, and A
Terms and Conditions
Single Framework Structure – Why you want this!
• This allows you to set the order of operations for your trigger code!
• Makes it far easier to test!
• Much easier to follow the code down to where a problem may be
Terms and Conditions
Test Coverage
75% 85% 95%
Minimum
Requirement
to deploy
Rest easy at
night
Psychopath
never looks
up your
address
Terms and Conditions
Assertions
• Until we have Siri in Salesforce, we can’t just ask if our code is working right.
• We use assertions to tell Salesforce what the expected response is
• We could, for instance, assert that Dreamforce14 = Awesome when we run
code that asks is Dreamforce14 Awesome?
• Three Assert methods:
• Assert()
• AssertEquals()
• AssertNotEquals()
Terms and Conditions
Assertions
Tests without Assertions are wasted money. You’ve paid someone to write them
so you can deploy, but their purpose is to prove the code works as expected.
Having tests without asserts is the new buying a picture frame and never
replacing the example family photo that came with it.
Terms and Conditions
Comments – what the what?
• Comments are how developers leave notes to future psychopaths, admins and
anyone else brave enough to venture into the code.
• Two flavors of Apex code comments // & /* */
What to look for in a good development partner
Coding Standard:
Written document describing how the code will be written:
– Good:
• Defines what is to be tested, what “dialect” will be used, and what / how code will be commented
– Better:
• Also describes naming conventions for files, classes and methods
• Provides example comment blocks & establishes rules for a single trigger per object, with all trigger logic in
classes!!
– Best:
• Additionally describes code coverage requirements and specifically mentions that tests will include
positive, negative and permissions based tests.
What to look for in a good development partner
Testing Standard:
Written document describing how the code will be tested:
– Good:
• Defines a minimum requirement of 80% code coverage. (Why 80%? Because you probably inherited some
badly tested code!)
– Better:
• Also requires that all tests generate their own test data and that no tests use @seeAllData
• Enforces no i++ tests
• Increases the minimum code coverage requirement to 85%
– Best:
• Additionally demands that all test methods call at least one Assertion
• Requires a minimum code coverage of 90%
What to look for in a good development partner
Trust but verify
– Your Coding standard should specify naming conventions for files and classes, and as such you
should be able to easily identify your test classes and what they’re testing.
What to look for in a good development partner
Trust but verify
– When reviewing test classes, you should read through them, not necessarily for comprehension,
but to ensure that they are firing assertions.
What to look for in a good development partner
Trust but verify: SeeAllData will hurt you when you least expect it.
– As you can probably imagine, the @seeAllData annotation allows your test to access all the data
in the org you’re running the test in.
– This is a bad thing. (repeat after me) This is a bad thing!
– More often than not, this results in tests *expecting* data to be present in an org.
• If the data is only present in one org… the test will fail in other orgs.
– Instead, each test should create and insert it’s own records.
– Almost never truly needed
What to look for in a good development partner
Trust but verify: Faking Code Coverage
– You can fake code coverage. You shouldn’t. You shouldn’t allow the very concept to be floated in
your presence. This is generally done by creating a class with a method that consists of nothing
but lines incrementing a given variable. Ie: i++; for a long time, follwed by a quick test method
asserting that I = 3000;
– Tar and feather developers you’ve found who do this. It only serves to foster a false sense of
security.
Comments Test Coverage Single Triggers Test Data
Top of Every File 85% or higher aggregate 1 trigger per object
All tests generate their
own Data!
Above every method
85% or higher on all new
classes
Uses an established
Trigger framework
Use a TestFactory Class
Around any complex logic
blocks or apex-shorthand
CodeCoverage report
card with each code
submission
Clear and concise
comments on how triggers
Custom Assertion
methods –
Assertions.recordDidFailV
alidation()
You should be capable of
reading the comments in
the file and following the
flow of data
Verify coverage in the
Developer console.
Trigger logic classes are
bulk tested
Positive, Negative and
Permissions based
testing.
Coding & Testing Standards
My opinionated requirements.
Questions & Answers
If you don’t ask questions … I will.
Questions & Answers
Finding a good development partner

More Related Content

What's hot

Code Review Matters and Manners
Code Review Matters and MannersCode Review Matters and Manners
Code Review Matters and Manners
Trisha Gee
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven Development
Shawn Jones
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
Mireia Sangalo
 
Test driven-development
Test driven-developmentTest driven-development
Test driven-development
David Paluy
 
Clean code - Getting your R&D on board
Clean code - Getting your R&D on boardClean code - Getting your R&D on board
Clean code - Getting your R&D on board
Ruth Sperer
 
Unit testing - the hard parts
Unit testing - the hard partsUnit testing - the hard parts
Unit testing - the hard parts
Shaun Abram
 
Unit tests benefits
Unit tests benefitsUnit tests benefits
Unit tests benefits
Kate Semizhon
 
Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and When
Paul Gower
 
Working with Legacy Code
Working with Legacy CodeWorking with Legacy Code
Working with Legacy Code
Eyal Golan
 
Code review
Code reviewCode review
Code review
Abhishek Sur
 
Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief exampleJeremy Kendall
 
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
JavaDayUA
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
guest5639fa9
 
Code review guidelines
Code review guidelinesCode review guidelines
Code review guidelines
Lalit Kale
 
TDD That Was Easy!
TDD   That Was Easy!TDD   That Was Easy!
TDD That Was Easy!
Kaizenko
 
2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easier2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easier
Christian Hujer
 
Test-Driven Development In Action
Test-Driven Development In ActionTest-Driven Development In Action
Test-Driven Development In Action
Jon Kruger
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and Adoption
Pyxis Technologies
 
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
Roy Osherove on Unit Testing Good Practices and Horrible MistakesRoy Osherove on Unit Testing Good Practices and Horrible Mistakes
Roy Osherove on Unit Testing Good Practices and Horrible MistakesRoy Osherove
 
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
AgileNetwork
 

What's hot (20)

Code Review Matters and Manners
Code Review Matters and MannersCode Review Matters and Manners
Code Review Matters and Manners
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven Development
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Test driven-development
Test driven-developmentTest driven-development
Test driven-development
 
Clean code - Getting your R&D on board
Clean code - Getting your R&D on boardClean code - Getting your R&D on board
Clean code - Getting your R&D on board
 
Unit testing - the hard parts
Unit testing - the hard partsUnit testing - the hard parts
Unit testing - the hard parts
 
Unit tests benefits
Unit tests benefitsUnit tests benefits
Unit tests benefits
 
Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and When
 
Working with Legacy Code
Working with Legacy CodeWorking with Legacy Code
Working with Legacy Code
 
Code review
Code reviewCode review
Code review
 
Tdd in php a brief example
Tdd in php   a brief exampleTdd in php   a brief example
Tdd in php a brief example
 
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
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
 
Code review guidelines
Code review guidelinesCode review guidelines
Code review guidelines
 
TDD That Was Easy!
TDD   That Was Easy!TDD   That Was Easy!
TDD That Was Easy!
 
2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easier2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easier
 
Test-Driven Development In Action
Test-Driven Development In ActionTest-Driven Development In Action
Test-Driven Development In Action
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and Adoption
 
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
Roy Osherove on Unit Testing Good Practices and Horrible MistakesRoy Osherove on Unit Testing Good Practices and Horrible Mistakes
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
 
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...Agile Mumbai 2020 Conference |  How to get the best ROI on Your Test Automati...
Agile Mumbai 2020 Conference | How to get the best ROI on Your Test Automati...
 

Similar to Finding a good development partner

Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and Automation
Mahesh Salaria
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
Sergey Aganezov
 
An Introduction to unit testing
An Introduction to unit testingAn Introduction to unit testing
An Introduction to unit testingSteven Casey
 
Getting Started with Test-Driven Development at PHPtek 2023
Getting Started with Test-Driven Development at PHPtek 2023Getting Started with Test-Driven Development at PHPtek 2023
Getting Started with Test-Driven Development at PHPtek 2023
Scott Keck-Warren
 
Beginners overview of automated testing with Rspec
Beginners overview of automated testing with RspecBeginners overview of automated testing with Rspec
Beginners overview of automated testing with Rspec
jeffrey1ross
 
QA and scrum
QA and scrumQA and scrum
QA and scrum
clintonbosch
 
Awesome Test Automation Made Simple w/ Dave Haeffner
Awesome Test Automation Made Simple w/ Dave HaeffnerAwesome Test Automation Made Simple w/ Dave Haeffner
Awesome Test Automation Made Simple w/ Dave Haeffner
Sauce Labs
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
Dave Cross
 
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Into...
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Into...Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Into...
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Into...
Ortus Solutions, Corp
 
An Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewAn Introduction To Software Development - Final Review
An Introduction To Software Development - Final Review
Blue Elephant Consulting
 
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Adob...
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Adob...Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Adob...
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Adob...
Uma Ghotikar
 
Unit Testing Best Practices
Unit Testing Best PracticesUnit Testing Best Practices
Unit Testing Best PracticesTomaš Maconko
 
Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023
Scott Keck-Warren
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
.NET Conf UY
 
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
Aleksandar Bozinovski
 
Unit Tests with Microsoft Fakes
Unit Tests with Microsoft FakesUnit Tests with Microsoft Fakes
Unit Tests with Microsoft Fakes
Aleksandar Bozinovski
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
toddbr
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven DevelopmentMeilan Ou
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
ZendCon
 
An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1
Blue Elephant Consulting
 

Similar to Finding a good development partner (20)

Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and Automation
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
An Introduction to unit testing
An Introduction to unit testingAn Introduction to unit testing
An Introduction to unit testing
 
Getting Started with Test-Driven Development at PHPtek 2023
Getting Started with Test-Driven Development at PHPtek 2023Getting Started with Test-Driven Development at PHPtek 2023
Getting Started with Test-Driven Development at PHPtek 2023
 
Beginners overview of automated testing with Rspec
Beginners overview of automated testing with RspecBeginners overview of automated testing with Rspec
Beginners overview of automated testing with Rspec
 
QA and scrum
QA and scrumQA and scrum
QA and scrum
 
Awesome Test Automation Made Simple w/ Dave Haeffner
Awesome Test Automation Made Simple w/ Dave HaeffnerAwesome Test Automation Made Simple w/ Dave Haeffner
Awesome Test Automation Made Simple w/ Dave Haeffner
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Into...
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Into...Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Into...
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Into...
 
An Introduction To Software Development - Final Review
An Introduction To Software Development - Final ReviewAn Introduction To Software Development - Final Review
An Introduction To Software Development - Final Review
 
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Adob...
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Adob...Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Adob...
Introduction to Unit Testing, BDD and Mocking using TestBox & MockBox at Adob...
 
Unit Testing Best Practices
Unit Testing Best PracticesUnit Testing Best Practices
Unit Testing Best Practices
 
Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
 
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
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1
 

More from Kevin Poorman

10 Principles of Apex Testing
10 Principles of Apex Testing10 Principles of Apex Testing
10 Principles of Apex TestingKevin Poorman
 
10 principles of apex testing
10 principles of apex testing10 principles of apex testing
10 principles of apex testing
Kevin Poorman
 
Mac gyver df14 - final
Mac gyver   df14 - finalMac gyver   df14 - final
Mac gyver df14 - final
Kevin Poorman
 
Ionic on visualforce and sf1 df14
Ionic on visualforce and sf1   df14Ionic on visualforce and sf1   df14
Ionic on visualforce and sf1 df14
Kevin Poorman
 
Ci of js and apex using jasmine, phantom js and drone io df14
Ci of js and apex using jasmine, phantom js and drone io   df14Ci of js and apex using jasmine, phantom js and drone io   df14
Ci of js and apex using jasmine, phantom js and drone io df14
Kevin Poorman
 
Apex for humans
Apex for humansApex for humans
Apex for humans
Kevin Poorman
 
Apex 10 commandments df14
Apex 10 commandments df14Apex 10 commandments df14
Apex 10 commandments df14
Kevin Poorman
 
Connecting with the enterprise - The how and why of connecting to Enterprise ...
Connecting with the enterprise - The how and why of connecting to Enterprise ...Connecting with the enterprise - The how and why of connecting to Enterprise ...
Connecting with the enterprise - The how and why of connecting to Enterprise ...
Kevin Poorman
 

More from Kevin Poorman (8)

10 Principles of Apex Testing
10 Principles of Apex Testing10 Principles of Apex Testing
10 Principles of Apex Testing
 
10 principles of apex testing
10 principles of apex testing10 principles of apex testing
10 principles of apex testing
 
Mac gyver df14 - final
Mac gyver   df14 - finalMac gyver   df14 - final
Mac gyver df14 - final
 
Ionic on visualforce and sf1 df14
Ionic on visualforce and sf1   df14Ionic on visualforce and sf1   df14
Ionic on visualforce and sf1 df14
 
Ci of js and apex using jasmine, phantom js and drone io df14
Ci of js and apex using jasmine, phantom js and drone io   df14Ci of js and apex using jasmine, phantom js and drone io   df14
Ci of js and apex using jasmine, phantom js and drone io df14
 
Apex for humans
Apex for humansApex for humans
Apex for humans
 
Apex 10 commandments df14
Apex 10 commandments df14Apex 10 commandments df14
Apex 10 commandments df14
 
Connecting with the enterprise - The how and why of connecting to Enterprise ...
Connecting with the enterprise - The how and why of connecting to Enterprise ...Connecting with the enterprise - The how and why of connecting to Enterprise ...
Connecting with the enterprise - The how and why of connecting to Enterprise ...
 

Recently uploaded

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

Finding a good development partner

  • 1. Finding a good development partner Kevin Poorman Principle Architect @CodeFriar
  • 3. Agenda •Why you need a good development partner •Terms and Conditions •What to look for in your partner and in the code •Questions, Comments and Snide Remarks
  • 4. Why do you need a good development partner? •Strategy v. Tactics •Code is strategic by nature. •Cost of maintaining code is always the largest expense of a software project. (cf. Code Complete, by Steve McConnell) •In other words, you want a developer who writes code as if the person who ends up maintaining it is a violent psychopath who knows where they live.
  • 5. Terms and Conditions •Single Framework Structure •Test Coverage •Assertion •Comments
  • 6. Terms and Conditions Single Framework Structure SingleTrigger Calls class method(s) A Calls class method(s) B, C and F Calls class methods X, Y, and A
  • 7. Terms and Conditions Single Framework Structure – Why you want this! • This allows you to set the order of operations for your trigger code! • Makes it far easier to test! • Much easier to follow the code down to where a problem may be
  • 8. Terms and Conditions Test Coverage 75% 85% 95% Minimum Requirement to deploy Rest easy at night Psychopath never looks up your address
  • 9. Terms and Conditions Assertions • Until we have Siri in Salesforce, we can’t just ask if our code is working right. • We use assertions to tell Salesforce what the expected response is • We could, for instance, assert that Dreamforce14 = Awesome when we run code that asks is Dreamforce14 Awesome? • Three Assert methods: • Assert() • AssertEquals() • AssertNotEquals()
  • 10. Terms and Conditions Assertions Tests without Assertions are wasted money. You’ve paid someone to write them so you can deploy, but their purpose is to prove the code works as expected. Having tests without asserts is the new buying a picture frame and never replacing the example family photo that came with it.
  • 11. Terms and Conditions Comments – what the what? • Comments are how developers leave notes to future psychopaths, admins and anyone else brave enough to venture into the code. • Two flavors of Apex code comments // & /* */
  • 12. What to look for in a good development partner Coding Standard: Written document describing how the code will be written: – Good: • Defines what is to be tested, what “dialect” will be used, and what / how code will be commented – Better: • Also describes naming conventions for files, classes and methods • Provides example comment blocks & establishes rules for a single trigger per object, with all trigger logic in classes!! – Best: • Additionally describes code coverage requirements and specifically mentions that tests will include positive, negative and permissions based tests.
  • 13. What to look for in a good development partner Testing Standard: Written document describing how the code will be tested: – Good: • Defines a minimum requirement of 80% code coverage. (Why 80%? Because you probably inherited some badly tested code!) – Better: • Also requires that all tests generate their own test data and that no tests use @seeAllData • Enforces no i++ tests • Increases the minimum code coverage requirement to 85% – Best: • Additionally demands that all test methods call at least one Assertion • Requires a minimum code coverage of 90%
  • 14. What to look for in a good development partner Trust but verify – Your Coding standard should specify naming conventions for files and classes, and as such you should be able to easily identify your test classes and what they’re testing.
  • 15. What to look for in a good development partner Trust but verify – When reviewing test classes, you should read through them, not necessarily for comprehension, but to ensure that they are firing assertions.
  • 16. What to look for in a good development partner Trust but verify: SeeAllData will hurt you when you least expect it. – As you can probably imagine, the @seeAllData annotation allows your test to access all the data in the org you’re running the test in. – This is a bad thing. (repeat after me) This is a bad thing! – More often than not, this results in tests *expecting* data to be present in an org. • If the data is only present in one org… the test will fail in other orgs. – Instead, each test should create and insert it’s own records. – Almost never truly needed
  • 17. What to look for in a good development partner Trust but verify: Faking Code Coverage – You can fake code coverage. You shouldn’t. You shouldn’t allow the very concept to be floated in your presence. This is generally done by creating a class with a method that consists of nothing but lines incrementing a given variable. Ie: i++; for a long time, follwed by a quick test method asserting that I = 3000; – Tar and feather developers you’ve found who do this. It only serves to foster a false sense of security.
  • 18. Comments Test Coverage Single Triggers Test Data Top of Every File 85% or higher aggregate 1 trigger per object All tests generate their own Data! Above every method 85% or higher on all new classes Uses an established Trigger framework Use a TestFactory Class Around any complex logic blocks or apex-shorthand CodeCoverage report card with each code submission Clear and concise comments on how triggers Custom Assertion methods – Assertions.recordDidFailV alidation() You should be capable of reading the comments in the file and following the flow of data Verify coverage in the Developer console. Trigger logic classes are bulk tested Positive, Negative and Permissions based testing. Coding & Testing Standards My opinionated requirements.
  • 19. Questions & Answers If you don’t ask questions … I will. Questions & Answers

Editor's Notes

  1. I’m not here to sell you on a particular development partner I’m here because all too often, as a consultant I’m parachuted into an org and asked to help out in an emergency only to find a righteous mess because good meaning people were asked to hire or find development partners who provided code that “worked” (until now) and was relatively inexpensive. I believe as developers, that we have to be better at our craft, and I want to make sure you hire the right people so that you’re not faced with the kind of 11th hour emergencies that require calling in someone like me. If you know what to look for, I believe you can make a solid business case for a slightly more expensive developer partner that writes more maintainable code.
  2. Strategy solves long term problems. You win wars and build businesses with strategy. Tactics, on the other hand, are how you solve short-term problems. Tactical solutions to strategic problems are rarely truly solutions and often disastrous in the long run. Code is strategic by nature. Every line of code in your org is likely to out survive your tenure at the company, and will almost certainty outlive your partners engagement with you. Code has to survive automated testing, release upgrades and the inevitable, if un-often deprecation of features. Because it wouldn’t be code if you could do it another way. Because it’s code, because you’re hiring someone to write the code for you, it *must* be maintainable code.
  3. One of the “best practices” that any org can adopt is the practice of establishing a single trigger per object. For instance a single trigger on Account. The trigger itself contains no logic, it simply exists to fire off a custom class whenever the trigger is fired. The custom class is structured to handle the various contexts like “after insert” and “before delete” and the class method called by the trigger starts off by determining which context to run. Essentially the trigger fires in all actionable contexts and the class handles running the proper code for that context.
  4. Code coverage the term we use to talk about how well our code is tested. When tests are run, Salesforce knows which bits of code have been executed, and can tell you that 50 out of 100 lines have been executed, giving you an embarrassingly low code coverage of 50% Salesforce demands (rightly) that you have 75% code coverage on all classes, and at least SOME code coverage on your triggers to deploy. But with code coverage, as with steaks, the bigger the better.
  5. One of the “best practices” that any org can adopt is the practice of establishing a single trigger per object. For instance a single trigger on Account. The trigger itself contains no logic, it simply exists to fire off a custom class whenever the trigger is fired. The custom class is structured to handle the various contexts like “after insert” and “before delete” and the class method called by the trigger starts off by determining which context to run. Essentially the trigger fires in all actionable contexts and the class handles running the proper code for that context.
  6. First and foremost, you should only hire development partners who have an established coding standard document that you can read, and *understand* before the project begins. You want to be able to provide this documentation to a developer maintaining the code 4, 5 and maybe even 10 years down the road. Don’t loose these, put them in the corporate wiki. Code is understood by contract to not be “complete” until the coding standards are met. This helps ensure your code is consistent!
  7. The Testing standard, while overlapping a little bit with the coding standard, specifically speaks to how your code will be tested. Remember, Badly written tests are more harmful than badly written code. If you believe your code works because the tests pass, but the tests are bad, then you have been setup to fail. Tests that do not call an assertion method are running the code but not testing it to ensure expected behavior. This meets the requirements for deployment within Salesforce, but doesn’t actually prove the code works as intended. Sometimes, you’ll find code specifically written to fake code coverage. This code should be reported immediately and the offenders Named and Shamed on social media. Or tired and feathered, if that’s still legal in your state.
  8. The Testing standard, while overlapping a little bit with the coding standard, specifically speaks to how your code will be tested. Remember, Badly written tests are more harmful than badly written code. If you believe your code works because the tests pass, but the tests are bad, then you have been setup to fail. Tests that do not call an assertion method are running the code but not testing it to ensure expected behavior. This meets the requirements for deployment within Salesforce, but doesn’t actually prove the code works as intended. Sometimes, you’ll find code specifically written to fake code coverage. This code should be reported immediately and the offenders Named and Shamed on social media. Or tired and feathered, if that’s still legal in your state.
  9. The Testing standard, while overlapping a little bit with the coding standard, specifically speaks to how your code will be tested. Remember, Badly written tests are more harmful than badly written code. If you believe your code works because the tests pass, but the tests are bad, then you have been setup to fail. Tests that do not call an assertion method are running the code but not testing it to ensure expected behavior. This meets the requirements for deployment within Salesforce, but doesn’t actually prove the code works as intended. Sometimes, you’ll find code specifically written to fake code coverage. This code should be reported immediately and the offenders Named and Shamed on social media. Or tired and feathered, if that’s still legal in your state.
  10. SteveMoForce hates multi-select picklists. Al Gore isn’t fond of hanging chads. I hate seeAllData=true. More often than not, when I start working on a project or am asked to help figure out why a changeset or deployment is failing … this is what I find! A test using see all data is looking for a specific account, contact or order to manipulate by it’s ID. This fails because even if the objects are otherwise identical, the ID’s for those objects will not be the same in two different orgs. Yay.
  11. You don’t want to see classes that do this!