News for hackers. Stuff that matters.
Re:Generating a Java program with 90% less code by devit on Wednesday December 04, 2019 @03:27PM (#21706542)
Testing with mocks is generally a bad idea; instead, one should just test using the same dependencies that are used in production (after testing those dependencies, if also part of the project).

This avoids having to introduce the extra interface, having to code the mock, sometimes having to change the mock or tests when changing the code and also lets you catch bugs in the dependencies that the tests on the dependency itself missed and that would otherwise show up in production.

One might have to do some work to partially replicate the production setup in testing and making it fast to start and run, but that's usually less work and gives a much better result.

Re:Generating a Java program with 90% less code by ludjer on Thursday December 05, 2019 @06:40AM (#21711589)
That is more integration tests. Unit tests should target logic more then dependencies/integration.