Since fuzz testing a partial parser didn’t seem like a good idea, I decided to do some unit testing. I’ve had unit test experience with a previous course so my knowledge is rather limited.
From what I understand, unit tests work something like this:
A unit test function’s name state what it is testing for and has two arguments, the actual value and an expected value. Since we are using nodeunit, functions can be passed as parameters so the above line actually makes sense. My issues now are:
- I have little to no idea how our parser works due to spending all of my time on fuzz testing
- I have yet to compile our parser
- I need to get some hands on experience with NodeUnit (I am not a classroom learner, this is why I left the sciences!)
I haven’t looked at #1 yet but have tried #2. Since I spent the last few weeks on Linux, compiling using Visual Studio project files went completely over my head. Instead, I tried using ./configure after updating our repo but ended up finding out that I had no c compiler recognized. I remember editing my $PATH variable during .1 to include CL so that building Firefox wouldn’t blow up so I didn’t understand why and mingw comes with gcc. After reinstalling mingw I realized that git bash’s instance of mingw only contained the bare bones of mingw; gcc didn’t exist. Launching mingw manually solved the problem and ./configure && make worked. I still don’t know why cl is not found.
Now I need to play around with NodeUnit and maybe piggyback off daleee’s work for our UnitTest stuff.