I have the opposite experience with Mockito.

By using mockito I am improving my designs so that they become simple to use 
and easy to test.

That in combination with an injection framework (using Guice/Jukito) makes it 
really easy to compose software and to test in isolation.

You do have to guard against duplicating the implementation in the unit test. 
This often happens when people are unit testing with the goal to have 100% 
coverage. They start to focus on every possible branch in the implementation 
instead on the functional requirements of the object under test.

I try to use a real implementation if possible and only mock certain objects 
that would require external information (network/database and such)

I had to cleanup test code where tests were mocking every possible parameter or 
dependency.

Some people dare to mock a List or even a String. I only mock objects where the 
API is really clean and well defined and it allows me to force error situations 
that are difficult to simulate otherwise. If you write many when-statements you 
probably are doing it wrong.

Groeten,
David
On 10 Mar 2021, 16:56 +0100, Juan Pablo Gardella <gardellajuanpa...@gmail.com>, 
wrote:
> Hi Vegeoku,
>
> Could you please elaborate on this?
>
> IMHO tests should help you improve the design of your code, Mockito is the 
> opposite of that, Once I converted some test cases to use manually writing 
> test doubles (spies, fakes, stubs) instead of Mockito to show the other guy 
> how it reduced the code in the test and improves the design. Mockito makes it 
> super easy to look away from design issues.
>
> Thanks,
> Juan
>
> P.S. Amazing thread.
>
> > On Wed, 10 Mar 2021 at 12:47, Josselin Bardet <nam...@gmail.com> wrote:
> > >
> > >
> > > > Le mer. 10 mars 2021 à 16:42, Vegegoku <aka...@gmail.com> a écrit :
> > > > > > > >
> > > > > > > >
> > > > > > > > Spring: I think the thing I dislike the most about Spring is 
> > > > > > > > what many people like about it: it's an entire, wide, and fat, 
> > > > > > > > ecosystem. You can hardly use one piece of Spring without using 
> > > > > > > > everything else; I mean, each Spring piece builds on top of 
> > > > > > > > another Spring piece, so it's basically an all-or-nothing. I 
> > > > > > > > also fear that people doing mostly Spring won't know how to do 
> > > > > > > > things without it (like most big/fat framework actually).
> > > > > >
> > > > > >
> > > > > > That does really summaries it about spring, also I hate how it is 
> > > > > > being overused for simple projects,  Like sucking this huge 
> > > > > > ecosystem just because we need dependency injection or want to talk 
> > > > > > to the database (JPA -> spring data) and it ends up building a huge 
> > > > > > complexity instead of simplifying things.. (Tests for example), I 
> > > > > > once want to contribute to a project that was using spring to find 
> > > > > > out that I had to inject a single bean into 500+ other classes 
> > > > > > using the constructor where even the arguments were not arranged to 
> > > > > > make this any easier and while doing that I had to fight merge 
> > > > > > conflicts .. it is overrated and overused .. and I pretty sure that 
> > > > > > most of spring project developer relay too much on mocking to make 
> > > > > > the tests faster or avoid such dependency injection hell.
> > > > > >
> > > >
> > > > Spring is well tested and works well, can handle your transctions, can 
> > > > help you to make AOP, can make dependency injection, etc...
> > > > Spring is for me a killer feature, I can't imagine making a project, 
> > > > even simple, without using it.
> > > >
> > > > I don't think nowadays there is a good reason to "optimize" and don't 
> > > > use spring
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "GWT Users" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to google-web-toolkit+unsubscr...@googlegroups.com.
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/google-web-toolkit/CAHDmNXFaUH815r4kDm64HPqDSnqErtPP41tsSHmT%3Dt%2BirNco%3Dg%40mail.gmail.com.
> --
> You received this message because you are subscribed to the Google Groups 
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit/CA%2BkiFsfC8y_JK2Gkayk-OKamH93HybgfGqSZEkZT%2B%2BJaciwQ9Q%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/a8f57cb5-9dd0-493c-8e4c-f48b87f7e294%40Spark.

Reply via email to