1 / 14

Advanced Testing Techniques on Force

Advanced Testing Techniques on Force.com. Paul Battisson. Introduction. Paul Battisson (@ pbattisson) Xactium What? Mocking Stubbing Patterns Next steps Why? Improve testability Improve flexibility Work faster. 3 Types of Test. acceptance. integration. unit.

ashley
Télécharger la présentation

Advanced Testing Techniques on Force

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced Testing Techniques on Force.com Paul Battisson

  2. Introduction • Paul Battisson (@pbattisson) • Xactium • What? • Mocking • Stubbing • Patterns • Next steps • Why? • Improve testability • Improve flexibility • Work faster

  3. 3 Types of Test acceptance integration unit

  4. What's Wrong With Force.com Testing? • "Slow" to write • "Slow" to run • Brittle • High data dependence • Written badly • Coded badly - highly coupled • Lots of testing of DML

  5. More Interfaces • Code against interfaces • Plug sockets (@simongoodyear) • Immediate improvement in flexibility and testability

  6. Mock Objects • Implement the same interface • Used in place for a test • Assertions on how we expect the object to be called • Can contain stubs for flow • Allow us to test our object's interaction with its neighbours

  7. Stubbing • Simulate real behaviour to get a test to pass • Implement in a mock object or using isRunningTest()*

  8. Okay, so what?

  9. Test Isolation

  10. Less Test Data Setup Insert a Record Required Fields? Instantiate a Mock Validation Rules? Before Trigger After Trigger

  11. The Future Dependency Injection Metaprogramming Frameworks & Patterns

  12. Thanks • Matthew Botos (@BotosCloud) • Simon Goodyear (@simongoodyear)

  13. Thank you for • listening! • https://github.com/pbattisson/Advanced-Force.com-Testing Questions?

More Related