[OKC JUG] Reminder - meeting Tuesday, April 12th

Rupesh Bhochhibhoya RBhochhibhoya at telogical.com
Mon Apr 11 18:36:46 PDT 2011


I have always used nice mocks. And didn't really know why other mocks didn't work well for me. So, thanks for info.

Also it would be nice if you could share how to test persistent layer effectively using Jmockit.

"Brett L. Schuchert" <schuchert at yahoo.com> wrote:



Might as well start the talk now...

When using mock libraries, by default use "nice" or "not strict" mocks. Most of them default to strict mocks. The problem with this is that doing so makes the tests more fragile and dependent on incidental complexity rather than essential responsibility.

So in the case of easy mocks, don't use "createMock" by default, instead prefer "createNiceMock". Only use createMock when you really want to verify all messages sent. This is actually a fringe case when doing focused unit tests. This is typically counter-intuitive. It only becomes clear as individuals move from tests with lots of checks to focused, single-check or single-logical-check based tests.

OK, discuss...

Brett
On Apr 11, 2011, at 11:05 AM 4/11/11, Rupesh Bhochhibhoya wrote:

I appreciate if you can demonstrate  examples with TDD/BDD. And also if you could show its advantages over EasyMock, that will be helpful too.


Rupesh

From: jug-bounces at lists.okcjug.org<mailto:jug-bounces at lists.okcjug.org> [mailto:jug-bounces at lists.okcjug.org] On Behalf Of Brett L. Schuchert
Sent: Monday, April 11, 2011 10:52 AM
To: jug at lists.okcjug.org<mailto:jug at lists.okcjug.org>
Subject: Re: [OKC JUG] Reminder - meeting Tuesday, April 12th

Oh yeah, I suppose I should prep (mostly kidding).

I already have a "story" for this presentation but I'm open to adjusting if anybody has anything in particular they'd like to me to cover. Just reply to this chain with request.

One thing I will be demonstrating is overriding static methods with the tool - which is cool, too cool, but cool.

Brett
On Apr 11, 2011, at 10:35 AM 4/11/11, Brian Sheldon wrote:


We have a meeting tomorrow. We will be providing food and drinks this month thanks to MBO sponsoring again this year.

Please go register http://okcjug.org/registration so we know how much food to get and who to pick from for the door prize.

•         Sponsor: MBO Partners<http://www.mbopartners.com/>
•         Speaker: Brett Schuchert<http://okcjug.org/bios/brett-schuchert>
•         JMockit<http://code.google.com/p/jmockit/> - Things you shouldn’t do when testing…
Agenda
•         11:30 am – Welcome Announcements
•         11:40 am – Lightning Talks begin
•         12:40 pm – Wrap Up
Presentation Information
JMockIt is a powerful and easy (perhaps too easy) to use mocking tool that allows you to do things that defy logic. Examples include stubbing static methods, changing final classes and pretty much anything that byte code injection on the fly (per test) allows. We’ll look at some of those things along with more traditional test double creation and then discuss why on the one hand it is nice to have this power, on the other hand you should almost never use it.

--
Brian
_______________________________________________
Jug mailing list
Jug at lists.okcjug.org<mailto:Jug at lists.okcjug.org>
http://lists.okcjug.org/listinfo.cgi/jug-okcjug.org

_______________________________________________
Jug mailing list
Jug at lists.okcjug.org<mailto:Jug at lists.okcjug.org>
http://lists.okcjug.org/listinfo.cgi/jug-okcjug.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okcjug.org/pipermail/jug-okcjug.org/attachments/20110411/b1871d0e/attachment-0003.htm>


More information about the Jug mailing list