Launching The NoMock Movement
Everything started when Eve said ‘No‘ when God told her not to eat the fruit. Then my daughter said ‘No‘ when I told her to clean her room. Then we had a bunch of guys saying ‘No‘ to SQL. Then I read Is there such a thing as the NoMock movement?… And today I’m saying let’s launch the NoMock Movement ( ‘No‘ meaning Not Only of course ;o)
Have you ever felt uncomfortable surrounded by a group of people who all agree and you don’t ? Feels strange doesn’t it. You think ‘what’s wrong with me ?‘. That’s exactly what I felt all these years with Unit Testing and Mocking. Everybody was unit testing, everybody was mocking… and I was questioning the relevance of so much mocking. Through my customers’ projects I’ve seen everything from zero test coverage to complex unit tests with more mocks than code to test. But everybody agreed that mocking was the way to go, so I did the same (BTW, thank you Mockito for showing me the way, your framework rocks).
Then in memory databases arrived (but some were still mocking DB access). Then in memory web servers arrived (but some were still mocking HTTP requests). Then Microsoft decided to do a 64 bits OS so we could have more memory. Then in memory containers arrived (but some where still mocking container services). Then Arquillian arrived. So while everybody was mocking I took all these new tools and started to write more and more integration tests, less unit tests and less mocks.
So now I’m officially launching the NoMock Movement (‘Not Only Mocks Movement’). This movement is for people stopping being ashamed of not mocking every single aspect of their code and starting to write more integration tests. Join the movement, don’t be ashamed and repeat after me : Stop mocking, start testing !
What are the concrete actions of this movement ? For now it’s just buying the nomock.org domain name and pointing it to my own website (isn’t that arrogant !) and then I’ll see what to do with it when I have some free time (a GitHub site where everybody can aggregate resources about integration testing would be good, so you can all contribute). I’ve also created the NoMockMov Twitter account and will use it to promote integration testing (by re-tweeting any useful article/blog/resource).
And now, go back to coding (real code)
- Is there such a thing as the NoMock movement?
- Mocks are a Mockery
- Stop Mocking, Start Testing
- Dan Allen on Arquillian Testing Framework
- What You Test Is What You Run
Disclaimer : of course I use unit tests and mocks, I’m just saying that today we can also use integration tests.
Disclaimer bis : Take a laugh, not everything in life has to be taken seriously ;o)