r/javahelp • u/desrtfx Out of Coffee error - System halted • Dec 02 '15
[META] Daily coding challenges for the Advent
For those who haven't yet seen it on other subreddits or on Facebook:
Advent of Code
Has daily coding challenges during the Advent season up to the 25th of December.
Each daily challenge is split in two parts of which the second one is only unlocked after successful completion of the first part.
The challenges are relatively small and fun to make.
Have fun coding!
EDIT
In order to prevent spoilers (that would reduce the fun for the others), please do not post code directly here in the thread, post the code on pastebin, gist, github, bitbucket, or the code hoster of your choice and link here only.
Edit 2: Post stickied for the duration of the Advent of Code to make it easier to find.
View all comments
Show parent comment
3
u/TheHorribleTruth Kind of meh Dec 11 '15
There's really nothing to it for these kind of problems. It's just a dead-simple comparison of input and output. I take it you've seen the code I posted in this thread, it's just an
assert <this> is <that>(using Hamcrest, which makes it a tad more readable – in plain jUnit it would beassertEquals).Now if take in the possibilities of a mocking library (I heavily use Mockito) and the kind of problems that arise with 10 year old legacy libraries that are hooked very deep into your application.. sprinkling static calls, loading values from files and the database (preferrably from static initializer blocks for some bonus fun).. then things are getting fun :)
I'm no expert at testing at any length. I also can't point to a specific resource that explains it all. I just google my ass off with every new code constellation that I face & would like a test for.
At work we're constantly extending our testing framework(s). Plural because we use many different kinds of tests, every few years a new situation warrants for a new way of test.