Antonio Goncalves is a senior software architect living in Paris. Initially focused on Java development since the late 1990s, his career has taken him to different countries and companies where he works now as a Java EE consultant in software architecture. As a former BEA consultant he has a great expertise in application servers such as Weblogic, JBoss and, of course, GlassFish. He is particularly fond of Open Source and is a member of the OOSGTP (Open Source Get Together Paris). He is also the co-creator of the Paris Java User Group and talks on Les Cast Codeurs podcast. Antonio wrote a first book in French on Java EE 5 back in 2007. Since then he has join the JCP and is an Expert Member of various JSRs (Java EE 6, JPA 2.0 and EJB 3.1). He then published a second book for Apress: Beginning Java EE 6 Platform with GlassFish 3. For the last years Antonio has been talking at international conferences mainly about Java EE, including JavaOne, The Server Side Symposium, Devoxx, Jazoon… He has also written numerous technical papers and articles for IT Web sites (DevX, JaxEnter) or IT magazines (Programmez, Linux Magazine). Antonio is a DZone MVB and is not an employee of DZone and has posted 30 posts at DZone. You can read more from them at their website. View Full User Profile

Launching the NoMock Movement

12.06.2012
| 2949 views |
  • submit to reddit

 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)

Published at DZone with permission of Antonio Goncalves, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)