CodeLive with Salesforce Developers
August 28, 2019
Positive and Negative Testing
with Kevin Poorman & Melissa Mueller
Melissa Mueller
@AstroLovesCodey
Developer Evangelist, Salesforce.com
Thinks in code. Often NPE’s
CodeLive with Melissa Mueller & Kevin Poorman
Kevin Poorman @codefriar
Stays cool as a Software
Engineer at Mitsubishi Electric
Trane HVAC USA
Introductions
FLS Sing-a-long
Explanation of the problem
Coding our solution
Recap
Talking about what we’re gonna talk about. #meta
Today’s Agenda
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the
assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we
make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber
growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief,
any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new
products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays
in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the
immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth,
new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger
enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form
10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important
disclosures are available on the SEC Filings section of the Investor Information section of our Website.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be
delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available.
Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Statement under the Private Securities Litigation Reform Act of 1995
Forward-Looking Statement
Let’s be Positive about Negative Testing!
Positive and Negative Unit Testing for
fun and profit.
Positive Tests
Are you sure? Positive.
Negative Tests
Are you sure? … Yes.
Goals:
High Test coverage
Confidence that our code works as expected
Confidence that our code fails when, and how we expect
Our solution.
Let’s write some tests
https://github.com/sfcodelive/positiveAndNegativeTesting
We’re working with this project:
This way to the code
In case Kevin forgets, this is where we (finally) get away
from the slides and to the coding bits.
Today we
Identify properly scoped ‘units’ for unit testing
Write useful positive unit tests
Write useful negative unit tests
TESTED ALL THE THINGS
Key Takeaways
Unit testing helps you craft better software
A unit isn’t necessarily an entire method.
Positive unit tests build confidence that your code works as expected with a known set of inputs.
Negative unit tests build confidence that your code fails how, and when it should.
Remember this!
Complete the testing
Trailmix:
https://sforce.co/positive-negative-
testing
trailhead.salesforce.com
Check out the code at:
https://github.com/sfcodelive/positiveAndNegativeTesting
codeLive: Positive and negative testing

More Related Content

PDF
Get Started with Lightning Web Components Open Source
PDF
Live Coding with Salesforce Developers: Decoupling your org with Triggers
PDF
Live Coding with Salesforce Developers: Adding CI to Your Salesforce Project
PPTX
Increase Customer Adoption with Interactive Content
PPTX
Demystify Metadata Relationships with the Dependency API
PPTX
Delivering Career-Boosting Technical Presentations
PDF
CodeLive with Cynthia Thomas - Refactoring data dependent code.
PPTX
How Writers Can Benefit from Social Software
Get Started with Lightning Web Components Open Source
Live Coding with Salesforce Developers: Decoupling your org with Triggers
Live Coding with Salesforce Developers: Adding CI to Your Salesforce Project
Increase Customer Adoption with Interactive Content
Demystify Metadata Relationships with the Dependency API
Delivering Career-Boosting Technical Presentations
CodeLive with Cynthia Thomas - Refactoring data dependent code.
How Writers Can Benefit from Social Software

What's hot (20)

PPTX
Intro to Apex Testing - Dreamforce 2016
PPTX
Content Strategy Workshop: TC Camp 2016
PPTX
Salesforce at Continuous Delivery Foundation Summit
PPT
Doc is Dead! How Walkthroughs Changed Salesforce's Content Strategy
PDF
Salesforce Known Issues: The Lifecycle of a Bug
PDF
Lightning Platform Product Managers: Ask Us Anything!
PDF
Easy No-Code Integrations with External Services and Visual Flow
PPTX
S1 Tour Paris Developpeurs
PDF
Integrate CMS Content Into Lightning Communities with CMS Connect
PDF
Force.com Friday: Intro to Force.com Slides
PDF
Build Apple Watch Apps for the Enterprise
PDF
#DF17Recap series: Make apps smarter with Einstein
PDF
Einstein Analytics for Developers
PPTX
Rollin' Out Lightnin' Ain't All That Frightenin' by Jon Barlow
PPTX
Write Powerful Communication to Get Your Stakeholder's Attention by Andrea Ho...
PDF
Agile2013 - How Writers Can Thrive in Agile Software Development
PDF
#DF17Recap series: Integrate apps easier with the Salesforce platform
PPT
The Salesforce Einstein Product Team: Ask Us Anything!
PPTX
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
PDF
Summer '18 Developer Highlights
Intro to Apex Testing - Dreamforce 2016
Content Strategy Workshop: TC Camp 2016
Salesforce at Continuous Delivery Foundation Summit
Doc is Dead! How Walkthroughs Changed Salesforce's Content Strategy
Salesforce Known Issues: The Lifecycle of a Bug
Lightning Platform Product Managers: Ask Us Anything!
Easy No-Code Integrations with External Services and Visual Flow
S1 Tour Paris Developpeurs
Integrate CMS Content Into Lightning Communities with CMS Connect
Force.com Friday: Intro to Force.com Slides
Build Apple Watch Apps for the Enterprise
#DF17Recap series: Make apps smarter with Einstein
Einstein Analytics for Developers
Rollin' Out Lightnin' Ain't All That Frightenin' by Jon Barlow
Write Powerful Communication to Get Your Stakeholder's Attention by Andrea Ho...
Agile2013 - How Writers Can Thrive in Agile Software Development
#DF17Recap series: Integrate apps easier with the Salesforce platform
The Salesforce Einstein Product Team: Ask Us Anything!
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
Summer '18 Developer Highlights
Ad

Similar to codeLive: Positive and negative testing (20)

PDF
CodeLive with Adam Daw - Building a mobile friendly geolocation aware candy t...
PDF
Code live with Brian Kwong - Visualforce to Lwc
PPTX
Bridging the Gap between Clicks & Code
PDF
Code live with ryan headley code reviews done right
PPTX
Salesforce DX for Accidential Admins
PPTX
#Df17 Recap Series Build Apps Faster with the Salesforce Platform
PDF
Development Best Practices
PDF
Developing on the Salesforce Platform With Clicks, Not Code
PDF
Manage Development in Your Org with Salesforce Governance Framework
PDF
Chicago Nonprofit 10 24 Salesforce Labs + Winter '20
PDF
JavaScript Patterns and Practices from the Salesforce Experts
PDF
Force.com Friday: Intro to Force.com
PDF
Advanced Testing and Debugging using the Developer Console webinar
PPTX
Get Started with Salesforce DX!
PPTX
Kitchener Salesforce Developer Group Event - Introduction to dev ops with Sal...
PDF
How to Create Awesome Documentation
PPTX
CodeLive: Converting Aura Components to Lightning Web Components
PDF
Gesture Controlled Interactions with Platform Events and IoT Explorer
PPTX
CCT London 2013 Theatre Intro to Apex
PPTX
Lightning Updates: Summer, Winter & Beyond
CodeLive with Adam Daw - Building a mobile friendly geolocation aware candy t...
Code live with Brian Kwong - Visualforce to Lwc
Bridging the Gap between Clicks & Code
Code live with ryan headley code reviews done right
Salesforce DX for Accidential Admins
#Df17 Recap Series Build Apps Faster with the Salesforce Platform
Development Best Practices
Developing on the Salesforce Platform With Clicks, Not Code
Manage Development in Your Org with Salesforce Governance Framework
Chicago Nonprofit 10 24 Salesforce Labs + Winter '20
JavaScript Patterns and Practices from the Salesforce Experts
Force.com Friday: Intro to Force.com
Advanced Testing and Debugging using the Developer Console webinar
Get Started with Salesforce DX!
Kitchener Salesforce Developer Group Event - Introduction to dev ops with Sal...
How to Create Awesome Documentation
CodeLive: Converting Aura Components to Lightning Web Components
Gesture Controlled Interactions with Platform Events and IoT Explorer
CCT London 2013 Theatre Intro to Apex
Lightning Updates: Summer, Winter & Beyond
Ad

More from Developer Force (8)

PDF
Developing Trusted Networks with Salesforce Blockchain
PDF
Preview: Local Development for Lightning Web Components
PDF
Integrate with MuleSoft Anypoint
PDF
Get Started with the Lightning Platform
PDF
Meet Astro & Friends with Domenique Sillett-Buxton
PDF
Salesforce Lightning Supersession (TDX18)
PDF
Salesforce Lightning Customization Roadmap (TDX18)
PPTX
Salesforce Lightning Component Framework Roadmap (TDX18)
Developing Trusted Networks with Salesforce Blockchain
Preview: Local Development for Lightning Web Components
Integrate with MuleSoft Anypoint
Get Started with the Lightning Platform
Meet Astro & Friends with Domenique Sillett-Buxton
Salesforce Lightning Supersession (TDX18)
Salesforce Lightning Customization Roadmap (TDX18)
Salesforce Lightning Component Framework Roadmap (TDX18)

Recently uploaded (20)

PPTX
Presentation - Principles of Instructional Design.pptx
PPTX
Information-Technology-in-Human-Society.pptx
PDF
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
PDF
State of AI in Business 2025 - MIT NANDA
PDF
Child-friendly e-learning for artificial intelligence education in Indonesia:...
PDF
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
PPTX
Information-Technology-in-Human-Society (2).pptx
PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
NewMind AI Journal Monthly Chronicles - August 2025
PPTX
CRM(Customer Relationship Managmnet) Presentation
PDF
TicketRoot: Event Tech Solutions Deck 2025
PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PPTX
maintenance powerrpoint for adaprive and preventive
PDF
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
PDF
Ebook - The Future of AI A Comprehensive Guide.pdf
PDF
ment.tech-Siri Delay Opens AI Startup Opportunity in 2025.pdf
PDF
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
PPTX
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
Presentation - Principles of Instructional Design.pptx
Information-Technology-in-Human-Society.pptx
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
State of AI in Business 2025 - MIT NANDA
Child-friendly e-learning for artificial intelligence education in Indonesia:...
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
Information-Technology-in-Human-Society (2).pptx
Intravenous drug administration application for pediatric patients via augmen...
NewMind AI Journal Monthly Chronicles - August 2025
CRM(Customer Relationship Managmnet) Presentation
TicketRoot: Event Tech Solutions Deck 2025
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
maintenance powerrpoint for adaprive and preventive
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
Ebook - The Future of AI A Comprehensive Guide.pdf
ment.tech-Siri Delay Opens AI Startup Opportunity in 2025.pdf
“Introduction to Designing with AI Agents,” a Presentation from Amazon Web Se...
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
EIS-Webinar-Regulated-Industries-2025-08.pdf

codeLive: Positive and negative testing

  • 1. CodeLive with Salesforce Developers August 28, 2019 Positive and Negative Testing with Kevin Poorman & Melissa Mueller
  • 2. Melissa Mueller @AstroLovesCodey Developer Evangelist, Salesforce.com Thinks in code. Often NPE’s CodeLive with Melissa Mueller & Kevin Poorman Kevin Poorman @codefriar Stays cool as a Software Engineer at Mitsubishi Electric Trane HVAC USA
  • 3. Introductions FLS Sing-a-long Explanation of the problem Coding our solution Recap Talking about what we’re gonna talk about. #meta Today’s Agenda
  • 4. This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Website. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements. Statement under the Private Securities Litigation Reform Act of 1995 Forward-Looking Statement
  • 5. Let’s be Positive about Negative Testing! Positive and Negative Unit Testing for fun and profit.
  • 6. Positive Tests Are you sure? Positive.
  • 7. Negative Tests Are you sure? … Yes.
  • 8. Goals: High Test coverage Confidence that our code works as expected Confidence that our code fails when, and how we expect Our solution. Let’s write some tests
  • 10. This way to the code In case Kevin forgets, this is where we (finally) get away from the slides and to the coding bits.
  • 11. Today we Identify properly scoped ‘units’ for unit testing Write useful positive unit tests Write useful negative unit tests TESTED ALL THE THINGS
  • 12. Key Takeaways Unit testing helps you craft better software A unit isn’t necessarily an entire method. Positive unit tests build confidence that your code works as expected with a known set of inputs. Negative unit tests build confidence that your code fails how, and when it should. Remember this!
  • 13. Complete the testing Trailmix: https://sforce.co/positive-negative- testing trailhead.salesforce.com Check out the code at: https://github.com/sfcodelive/positiveAndNegativeTesting