It’s a myth that every admin should learn to code – Admin and “Adminoloper” skills are valuable specialties themselves. But just because you don’t code, doesn’t mean there aren’t things you can learn from the world of software development and apply to make your job easier and improve the performance and stability of your orgs. In this session, Dan Appleman, the author of Advanced Apex Programming, will show you how to adopt concepts from the world of software development into the admin world – without writing a single line of Apex or JavaScript.
4. #YeurDreamin2019
What do admins and developers do?
We solve problems and implement processes in Salesforce by customizing
metadata
We all live in the same metadata
5. #YeurDreamin2019
Have you seen, heard of or experienced any of these?
• Someone changed something and broke something else.
• Fields that exist, but you don’t know why
• Workflows or processes that you don’t understand
• Try to deploy but unit tests are failing, and you don’t know why or when
they started failing
• Code on the org that exists but you don’t know what it does
• Try to figure out something you did a year ago and why?
• Can’t figure out who changed something, when and why.
6. #YeurDreamin2019
Declarative
• 20 years (but early years had less
complexity)
• Not much “formal” research
• How many admin+devs – 2 or 3
million success users, but we know
there are many duplicates…
Looking Back as an Admin
7. #YeurDreamin2019
Looking Back as a Software Developer
Software
• 73 years since ENIAC
• 25 million + software developers
• Extensive formal research
(professors, grad students,
corporate research, etc)
8. #YeurDreamin2019
We’re doing the same thing, but…
Declarative
• 20 years (but early years had less
complexity)
• Not much “formal” research
• How many admin+devs – 2 or 3
million success users, but we know
there are many duplicates…
Software
• 73 years since ENIAC
• 25 million + software developers
• Extensive formal research
(professors, grad students,
corporate research, etc)
9. #YeurDreamin2019
We’ve spent decades addressing these issues!
• Someone changed something and broke something else.
• Fields that exist, but you don’t know why
• Workflows or processes that you don’t understand
• Try to deploy but unit tests are failing, and you don’t know why or when
they started failing
• Code on the org that exists but you don’t know what it does
• Try to figure out something you did a year ago and why?
• Can’t figure out who changed something, when and why.
10. #YeurDreamin2019
Top 10 Things Admins Can Learn from Developers
(without learning to code)
• This isn’t about learning to code. Personally, I don’t think it makes sense
for admins to learn to code unless they love coding (reading code is
another matter).
• This is about taking the lessons of the software development word and
applying them to the admin/declarative world.
12. #YeurDreamin2019
Here’s how we do it…
Define the Requirements
Design the Solution
Implement the Solution
Test the Solution
Document the Solution
Maintain it over Time
13. #YeurDreamin2019
Here’s what it costs…
Define the Requirements
Design the Solution
Implement the Solution
Test the Solution
Document the Solution
Maintain it over Time 50-80%
14. #YeurDreamin2019
Maintenance is your largest cost
• May be even larger on SFDC
• Investing on faster coding is silly
• The practice of bringing in consultants to build stuff who then go away may
be a false economy – plan on a long-term relationship.
• Anything you do early in the project to reduce maintenance costs, is good.
18. #YeurDreamin2019
Unit Tests
• They aren’t about the initial test – you’re going to do manual testing
anyway. They are about detecting when someone breaks something –
maintenance!!!!
21. #YeurDreamin2019
Diminishing returns
• 100% code coverage means you’re probably wasting time
(with exceptions and trivialities)
• SFDC does code coverage because it’s the only thing you can measure!
• They need to actually test something (system asserts)
22. #YeurDreamin2019
Original Test
@istest
public static void TestLeadTriggerTest()
{
List<Lead> leads = [Select id, Status from Lead];
for(Lead ld: leads) ld.status = 'Working - Contacted’;
test.startTest();
update leads;
test.stopTest();
}
23. #YeurDreamin2019
Correct Test
@istest
public static void TestLeadTriggerTest()
{
List<Lead> leads = [Select id, Status from Lead];
for(Lead ld: leads) ld.status = 'Working - Contacted’;
test.startTest();
update leads;
test.stopTest();
List<Task> tasks =
[Select ID from Task where WhoId in :leads];
system.assertEquals(10, tasks.size());
}
47. #YeurDreamin2019
Salesforce DX – git with it!
• Build, pull, deploy
• Detailed history
• Why did someone make that change? Who made it? When?
• Meanwhile – pull and commit!
59. #YeurDreamin2019
Learning Core Concepts
• If only the earth were flat…
• Boolean Algebra – you’re using it even if you don’t realize it
(wouldn’t you like to use it better)?
61. #YeurDreamin2019
Have you seen, heard of or experienced any of these?
• Someone changed something and broke something else. (Unit tests)
• Fields that exist, but you don’t know why (In git)
• Workflows or processes that you don’t understand
(Comments, git and Jira)
• Try to deploy but unit tests are failing, and you don’t know why or when
they started failing (SFDX, Continuous Integration)
• Code on the org that exists but you don’t know what it does (git & Jira)
• Try to figure out something you did a year ago and why? (git & Jira)
• Can’t figure out who changed something, when and why. (git & Jira)
63. #YeurDreamin2019
Join us for drinks
@18:00 sponsored
by
Community sponsors:
Thank you!
Dan Appleman
@danappleman
dan@desawarepublishing.com
http://advancedapex.com
http://advancedapex.com/testtracker
NonProfit-track sponsor:
Editor's Notes
Salesforce is a bit odd- because the line between admin and developer is a spectrum. Super admin/adminolper that does declarative. Even though they work in declarative and we work in code, we have more in common than not.
WE do the same thing.
Not only are we doing the same thing. We all live in the same metadata. So we better get along.
But if it’s all the same, why should I, a software developer, have anything different or unique to share that might be helpful to admins?
Quick survey
Software developers deal with these exact issues.
We may be doing the same things and have the same problems – we have an extra 50 years
Some of the smart people, grad students with pHDs. Corporations working on giant projects – even building Salesforce itself – projects far greater than the largest Apex package. The problems are the same. The economics are the same – we’re doing the same thing. We’ve made a lot of progress..
People often build from least to most important, we won’t.
Replace with blocks. Note on waterfall vs. agile. Note if any components are missing, chances of failure increase dramatically. And let me note that most software projects do fail. Studies show failure rates of 50% to 90%.
Burn this into your memory. Junior developers don’t believe it. Schools rarely teach it.
I’ll explain in a minute
There are other unit test technologies – especially with lightning, we’re going to ignore that for now.
Show demo – here’s how you run a test. You can see it passed. You can see the code coverage – more on that later.
But in order to do that they have to actually test something!
I showed code coverage, but that was misleading.
We have a trigger, that when you set status to working – contacted, it creates tasks.
You’re not writing code, but an admin can learn to search for this pattern. System.assert or system.assertequals!
Run the test with the assert, and it fails! But code coverage is still 100%!
It passes this time – but look at the code coverage.
This one most of us know. Not everyone, but most.
Only your own, not others
Code created tasks when lead status was working-contacted
This workflow changes the status to Working Harder
Run it, and it will fail
We’re going to fix that workflow
We fix the workflow – now how do we get it deployed?
One command grabs changes, converts to metadata and deploys. Could also commit to source control
Put error back setting delay to zero. What happens if we try to deploy now?
This time the deployment fails
It will help keep you out of trouble.
You can build out a CI system today – but it’s early. And it requires governance and discipline and change or process – which aren’t easy.
You can do this today. It won’t prevent you from breaking the build, but at least it will let you know when it happens.
Crazy idea – but unit tests can be written to validate declarative. It makes no sense to do this if it’s just about testing the declarative, but it makes sense for CI! Based on lifecycle!
God’s greatest gift
Here’s the secret of how I even managed this demo!
(Possible Demo – git – depends on timing)
There’s a trail – git and github are two different things.
I think it’s more important to understand git,
(probably more of a look than a demo)
People focus on project management for dev, but the real value is in later/maintenance
(Demo)
The technology to solve these problems exists or on Salesforce, is well on the way, though best practices are still evolving.
The discipline and culture is the greater challenge. In the software development world we’ve finally reached the point that developers who don’t do these things aren’t taken seriously – don’t break the build is part of the culture. It took a ridiculously long time to reach this point. Many devs still don’t really understand the ramifications of the software dev lifecycle.
But the fact that it’s early in SFDC means there’s lots of low hanging improvement – simple things you can do now for massive improvements.