Writing Unit Tests to Keep from Making New Bugs

What was my Problem?

I kept introducing new songs that kept cropping up new odd behaviors in the Visible Field Filterer implementation. After trying new algorithms with some rewrites and suggestions from the AI muddying the waters, I decided I needed to pull back and do some honest Unit Testing around what I wanted out of the method.

Writing the Tests

I wanted to stay consistent with this project being fully runnable from the Web Browser. I found Mocha.js to have a good html only implementation. Since I was already familiar with how to write unit tests in Mocha that run from a node server, I ran with it so I didn't have to create a new learning topic for the project. I was able to get the specifications for the filter method defined in the VisibleFieldFiltererTest Webpage.

Getting Llama to Understand the Intent Behind the Tests

I wanted Llama to write the method for me, but first I wanted to make sure it understood what the method should do. I had a discussion with it to go over the tests firsts and then asked it to write the method. You can see the discussion here: Llama 3.3 70b - Visible Field Filterer Discussion