Tuesday, 17 May 2022

Why I'm doing this TinyTestFramework exercise


I have listened to both Modernize or Die® and Working Code Podcast (the specific episode of the latter is not public yet: I get it early as I'm a patreon… which you should be too: Patreon: Working Code is creating podcasts) this evening, and I appreciate them both mentioning my series on TinyTestFramework, but they both kinda got my motivations for doing it wrong.

I'm not doing it for these reasons. I mean… I am doing it, yes, obviously. But these are not my motivations:

  • To work out how to write a testing framework. This is not really that interesting to me. How to do it within a single expression (the whole thing is one struct literal)? Yes, interested in that. Def.
  • Because I think TestBox is doing anything wrong. It could not be further from the truth: I think TestBox is one of the best CFML projects out there. I am using it as inspiration, as I want code written in TinyTestFramework to be lift-and-shift-able into TestBox.

The reason why I am doing that project is n-fold:

  • I want to enable CFMLers to be able to run tests on trycf.com. Why:
    • I personally want to be able to present example code as tests to make it clear what I am trying to demonstrate (bug, idea, concept, help);
    • I want to encourage other CFMLers to think about asking question via TDD. Think through what they're asking, and think through how they derive their repro cases, showing us what they expect as an outcome. In a portable way.
  • As a practical exercise in TDDing some real-world code. I mean granted it's a slightly contrived situation - developing a test framework for trycf.com - but it's a real world project I am working on. And I am TDDing the whole lot.
  • For me personally: implementing non-trivial code in a restricted environment, and still come up with decent code. This project is a challenge for me.
  • A - largely in-vain, I suspect - attempt at intriguing some of the testing-nae-saying fuckwits out there to actually look at testing. Yeah good luck with that, Cameron.

Well then. That was cathartic.