Frank de Jonge's perspective on mocking frameworks
Introduction
In this insightful article, Frank de Jonge shares his evolved views on code testing and specifically on the use of mocking frameworks.
This article by Frank de Jonge delves into the evolution of his own coding practices, focusing on the transition from heavy reliance on mocking frameworks to a preference for testing without them.
He highlights the high cost of change when using mocking frameworks, especially in the maintenance stage of code. He then suggests several best practices and provides detailed examples of how to test without using mocking frameworks. These include creating your own “fakes” or test doubles, and defining meaningful boundaries.
Frank believes that this approach creates clearer high-level code, allows for more predictable IDE refactors and ensures the tests do not contain implementation details.
Did you like this article? Then, keep learning:
- Know how Laravel simplifies working with databases, avoiding complex domain logic
- Master error handling to better test and debug Laravel HTTP client
- Explore best Laravel architecture practices to improve collaboration and testing setup
- Boost Laravel model testing with tools that enhance IDE friendliness for refactoring
- Explore detailed testing best practices complementing mocking framework discussion
- Learn why refactoring without tests can be safe and when to consider it
- Upgrade your PHP testing skills with Pest 3 enhancements and migration tips
- Understand architecture testing to improve your code quality alongside testing strategy
- Discover Laravel's Cache::flexible() to optimize performance for high-traffic scenarios
1 comment
Great, i was looking for this feature. Thanks