CST 338 Week 2

Histogram

The main focus of the week was on implementing the histogram class for Homework 01. While the exercise was not inherently difficult, it presented several challenges and provided some valuable lessons. A recurring theme this semester has been the importance of closely studying unit tests and testing incrementally. This became particularly clear during my struggle to debug a perplexing issue in the 'debug' method of 'histogram.java', where the output for debug was printing twice. Initially, I assumed a double file read was causing the problem, leading me to create several versions of the program, all of which experienced the same issue. After about 20 Git commits, hours of research, and several variants of 'histogram.java', I decided to specifically scrutinize the unit test for the debug method. It turned out that there was never anything wrong, the unit test was designed to call debug twice.

This experience highlighted the importance of incrementally testing and thoroughly understanding unit tests. Although I am proud of my perseverance and eventual success, I realize the need to adopt a better approach that involves iterative testing and debugging. Moving forward, I will focus on testing program outputs in parts to isolate individual problems, which will save time and effort compared to debugging large portions of code all at once. The lesson will undoubtedly influence my work in the future, emphasizing the value of careful test analysis and incremental development. 

Comments

Popular Posts