FizzBuzz Once Again

Two and a half years later, I will revisit the FizzBuzz dilemma. Just glancing over my first FizzBuzz post, I see a number of improvements that can be done to augment the quality of the code. Since this last post was imported from my previous Blogger account, I do not know if the code was faithfully represented in the import. The code format is still an issue, so I will format the code in this post.

When creating the FizzBuzz class, I noticed that it has become a habit to create a package structure. No more placing a class inside the default package. No fussing around with creating folders on the terminal. Eclipse makes software engineering easy as it will create the package structure automatically. After filling in the class name as FizzBuzz, Eclipse creates the FizzBuzz.java file. Fizzbuzz create?

During the class, there was a discussion as to whether a static method or object oriented approach would be best. At first I was determined that FizzBuzz should be an Object as Java is an object oriented language. But, realizing FizzBuzz has no significance outside of a single method, I decided the static method route would be the best implementation. Static method implemented?

After implementing the static method, I proceeded to use JUnit to test my method. -3, 0, 1, 3, 5 15, and so forth seemed to be good numbers to test. Are the tests successful?

Before conceding that I finished the code, I double checked all the JavaDocs to ensure that it conveyed the code for each class and method. JavaDocs are done?

With all of this, it took me about 10 minutes to code and think through the FizzBuzz implementation. Compared to my previous 6 minute attempt at FizzBuzz, this implementation has much more polish overall. In reflecting on this implementation, most of my time was dedicated to the test portion. Are my tests valid? Do they test the bounds of this program? What about a negative input? What about high number values? Testing is an area that I need to improve upon. I may not have an opportunity to write the same code and critique my past work like FizzBuzz, but I hope I can continually develop and mature my skills as a software engineer.