Why 400 tests?
Before we get into the article, I want to inform you it will be much shorter than the last one, mostly because, currently, the focus is finishing #60 and finally moving on to RSML's lexer and respective modularity system.
Today, we have officially hit the following milestone in RSML: 400 test methods... for a single class... and it's still not fully tested.
Before you bring your anti-testing and Console.WriteLine() pitchforks forward, let us explain why we have implemented that many test methods...
Context matters
In this case, context matters a lot. The class that has received this much testing attention is ReadOnlyStringBuffer, and it serves as the simplest buffer available in the entirety of the official RSML API, yet 400 tests were only half* of what was needed to get it to work properly.
At OceanApocalypse, we believe testing buffers and big language components (such as lexers and parsers) is imperative to ease the task of getting them to work correctly. If this means testing a lot, then it's a sacrifice that we believe is worth making.
It's worth mentioning this does not mean in any way that we believe testing is only relevant when the components are critical: testing is still important when they're not --- the only difference is that it's even more important when the components are critical.
Following the same rationale, we are not saying quantity matters more than quality: RSML could have 9000 tests and could be a broken mess or have 10 tests and work perfectly. We believe a good combination of both is the best compromise a developer can choose.
*This is an assumption, based on the current amount of test methods and the amount of methods that are yet to be tested.
Expecting more tests?
One word: yes. Not because we love writing tests, but because there are still methods that are publicly exposed yet are fully untested by now. Hopefully, they won't stay that way for much longer, and I'll be happy to write a new article once we can finally mark #60 as closed.
Like I said, this was quite a small article, and a bigger one is to be expected soon.
Thank you for dropping by and reading! ❤️
