Over a million developers have joined DZone.

Launching the NoMock Movement

· Java Zone

Learn more about the advantages of moving from a monolithic to microservices architecture.  Brought to you in partnership with IBM.

 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)

References :

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)

From Idea to Application gives you the architecture to quickly build, manage and run a range of applications (web, mobile, big data, new smart devices, etc.) on an open-standard, cloud-based platform. See why developers are using IBM Bluemix. Brought to you in partnership with IBM.


Published at DZone with permission of Antonio Goncalves, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}