CST338 Week 2; unit tests, git commands, interfaces
Unit testing
These first few weeks were my first exposure to unit testing. I had heard of unit testing previously, but had never taken a deep dive, or a shallow dive, into the topic. One thing I didn't realize is that there would be some sort of module or library for testing, like JUnit. There is definitely a feeling that the practice of unit testing is very deep and we are just scratching the surface. There are so many asserts-this-and-that that we haven't come close to using. I'm mostly using assertEqual(), assertNotEqual(), assertInstanceOf().
Git & GitHub
Git is something I have had exposure to before. Not in a professional or work setting, but for side-projects at work or projects at home. I would use it just infrequently enough that I would forget how to use it the next time I needed it. I do have a personal practice if, at the very least, initializing git in a new project. Sometimes those projects will make it up to my GitHub account.
Even though we did review this, I am not 100% certain about the merge versus rebase approach to getting a branch "up to speed". I've been mostly rebasing main via IntelliJ. The rest of the interaction I try to do at the command line level to build the muscle memory of all the commands and approaches. I've merged branches on the command line and felt comfortable with it. I was uncertain when I had to backtrack to a previous branch, make a small change, and merge it to later branches, but it all seemed to work out okay. I suppose I didn't create any conflicts. I should spend some time soon going back on the training website provided and try to bring these ideas home.
Coding Bat Recording
Link to the recording: https://youtu.be/_wT8UM204mU
I had already done the Coding Bat exercises for the week, so I chose one that is not part of this weeks assignment.
My approach is usually to identify scenarios that can immediately return some result. These end up being the extremes such as if a string isn't long enough to meet the criteria of the problem, or some element is missing from a list or array. Then I can return the response and know that the rest of the work I'm doing doesn't have to worry about these scenarios. This becomes tricky when the scenarios are not clear-cut and have some overlapping conditions.
I don't plan in a strict sense, but I do try to have a good think about it before I start typing out code. Coding Bat seems like a good place to just "give it a shot". Though the tracking of how many attempts, their success/failure results, and how it stacks up to random strangers is a bit of a motivator to do well. Some of these are one-shot problems and others take many iterations.
Comments
Post a Comment