You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mrunit.apache.org by Marko Dinic <ma...@nissatech.com> on 2016/04/12 09:51:10 UTC

MR-Unit vs JUnit for unit testing

Hello everyone,

I have heard about MR-unit and I was wondering if someone could explain 
to me what is the gain of using MR-Unit for unit testing MR jobs 
compairing to usage of JUnit and Mockito?

Concretely, what are the things that I can do that I cannot do them 
using JUnit, or it is much more difficult?

My idea is to move all the logic from mappers/reducers to helper classes 
and just verify that appropriate methods are called on the mocks.

Why use MR-Unit?

Best regards,

-- 
signature *Marko Dinic'*
/Software engineer @/
Nissatech
Kajmakc(alanska 8
18000 Nis(, Serbia
website <http://www.nissatech.com> | email 
<ma...@nissatech.com>
tel/fax: +381 18 288 111
mobile: +381 63 82 49 556
skype: vesto91

Re: MR-Unit vs JUnit for unit testing

Posted by Marko Dinic <ma...@nissatech.com>.
Hi Bertrand,

Thank you very much for the explanation. I understand now, there's no 
"bad" solution, just an "easier" one and a "more flexible" one. :)

Cheers,

On Wed 13 Apr 2016 12:04:15 AM CEST, Bertrand Dechoux wrote:
> Hi Marko,
>
> Well, that's basically the same as JUnit + Mockito + work. The
> question is more about build versus 'buy'. Why would you bother
> building again something that has already been built and is free? Time
> has been invested to create a fluent test API. It would be strange not
> to use it.
>
> That being said if your logic is complex enough, externalising it and
> reducing the coupling with the Hadoop API is the right call. Then the
> tests are about your logic and are not anymore related to Hadoop.
>
> Bertrand Dechoux
>
> On Tue, Apr 12, 2016 at 9:51 AM, Marko Dinic
> <marko.dinic@nissatech.com <ma...@nissatech.com>> wrote:
>
>     Hello everyone,
>
>     I have heard about MR-unit and I was wondering if someone could
>     explain to me what is the gain of using MR-Unit for unit testing
>     MR jobs compairing to usage of JUnit and Mockito?
>
>     Concretely, what are the things that I can do that I cannot do
>     them using JUnit, or it is much more difficult?
>
>     My idea is to move all the logic from mappers/reducers to helper
>     classes and just verify that appropriate methods are called on the
>     mocks.
>
>     Why use MR-Unit?
>
>     Best regards,
>
>     --
>     *Marko Dinić*
>     /Software engineer @/
>     Nissatech
>     Kajmakčalanska 8
>     18000 Niš, Serbia
>     website <http://www.nissatech.com> | email
>     <ma...@nissatech.com>
>     tel/fax: +381 18 288 111 <tel:%2B381%2018%20288%20111>
>     mobile: +381 63 82 49 556
>     skype: vesto91
>
>

--
*Marko Dinić*
/Software engineer @/
Nissatech
Kajmakčalanska 8
18000 Niš, Serbia
website <http://www.nissatech.com> | email
<ma...@nissatech.com>
tel/fax: +381 18 288 111
mobile: +381 63 82 49 556
skype: vesto91


Re: MR-Unit vs JUnit for unit testing

Posted by Bertrand Dechoux <de...@gmail.com>.
Hi Marko,

Well, that's basically the same as JUnit + Mockito + work. The question is
more about build versus 'buy'. Why would you bother building again
something that has already been built and is free? Time has been invested
to create a fluent test API. It would be strange not to use it.

That being said if your logic is complex enough, externalising it and
reducing the coupling with the Hadoop API is the right call. Then the tests
are about your logic and are not anymore related to Hadoop.

Bertrand Dechoux

On Tue, Apr 12, 2016 at 9:51 AM, Marko Dinic <ma...@nissatech.com>
wrote:

> Hello everyone,
>
> I have heard about MR-unit and I was wondering if someone could explain to
> me what is the gain of using MR-Unit for unit testing MR jobs compairing to
> usage of JUnit and Mockito?
>
> Concretely, what are the things that I can do that I cannot do them using
> JUnit, or it is much more difficult?
>
> My idea is to move all the logic from mappers/reducers to helper classes
> and just verify that appropriate methods are called on the mocks.
>
> Why use MR-Unit?
>
> Best regards,
> --
> *Marko Dinić*
> *Software engineer @*
> [image: Nissatech]
> Kajmakčalanska 8
> 18000 Niš, Serbia
> website <http://www.nissatech.com> | email <ma...@nissatech.com>
> tel/fax: +381 18 288 111
> mobile: +381 63 82 49 556
> skype: vesto91
>