During the past weeks, I have been spending time writing algorithms and I created a repository in GitHub which has mixed levels of algorithms I have been dealing with in the past. It just used to be a simple set of problems in text files in my local drive. Then, I decided to mavenize this and turn it into a project so I can build/test using Maven which solved my dependency mess and now it feels a lot more like a project. Also, I have added unit tests for each algorithm. The best way to run the test is through a debug mode and step through what is happening behind the scene since many of algorithms happen in the back.
Actually, for a quite some time, I wanted a place like this , a place where I can code, play and have fun! Now I finally have a place where I can continue writing more algorithms in the future. The majority of the problems here are mostly the simple ones because I wanted to start from the basics. I find basics are really important as it nourishes me to go a step further.
Maven is much more powerful than how I am using it here. It can handle packaging/releases and define much more through pom file. The best website to start learning about Maven would be the actual Maven Website. I wouldn’t recommend reading an entire book; reading up on specific references on Google should be enough for what you would like to achieve out of it.
Unit tests are done in JUnit 4. “Mockito” is just used for a simple verification. The majority of the problems here are mostly focused on individual functions and independent to Mock something as an object. I also focused on covering all areas of functions to check for entire validity.
Requirement: Java 8, Lombok, JUnit 4, Slf4j, Mockito
https://github.com/stalk-calvin/Algorithms.gitand Load pom.xml as a Maven project.
You can also run maven commands to do a full testing,
mvn clean test.