1 / 18

Mastering Mocking in Software Testing: Best Practices for Reliable Tests

In software testing, the concept of mocking is crucial for developing reliable and maintainable tests. Mocking allows developers to simulate the behavior of complex dependencies, enabling tests to focus on the code under scrutiny. This article explores the benefits of using fakes, stubs, and mocks, emphasizing that it is often easier to create these simulations than to interact with real objects. It advocates for approaches that encourage efficiency, repeatability, and trustworthiness in testing, aligning with the idea that a good testing strategy can empower developers and enhance productivity.

ronda
Télécharger la présentation

Mastering Mocking in Software Testing: Best Practices for Reliable Tests

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. Not enough data!

  2. Moar Data!

  3. Data can be real?!

  4. Output from GPX Editor

  5. Speed (kmph) – Altitude (m/100) Distance (km)

  6. Runkeeper design Distance (km) – time (minutes) Waypoints

  7. TDD Cycle

  8. Always fake it if you can! • Tie your objects to interfaces • Mock them whenever you can

  9. Fake Talk • Fakes • Stubs • Mocks

  10. Why fake it? • It’s easier • There is a good kind of lazy • Promotes RTFM

  11. RTFM! • A test should be • Repeatable • Trustworthy • Fast • Maintainable

  12. Questions

More Related