The Spawn of Stunt Programming - exorcising the demons in your tests

von Nicholas Clark (London.pm)

The Spawn of Stunt Programming - exorcising the demons in your tests richtet sich an Alle und wird in English gehalten. Der Talk beginnt am 17.04.2024 um 10:40 Uhr und dauert 20 Minuten. Er findet im Raum 1 statt.

This is the followup to the stunt programming talk - remember

Don't do this at home.
Don't do this in production.
Don't do this in new code.
Don't do this for any longer than you have to.
Don't put it on YouTube for everyone to see...

So we ignored all of that advice and went ahead and created tests.
We used to have a bunch of command line scripts without tests, and no safe way to change them

Now we have tests, and we can slowly change those scripts without risking our salaries. Everything is better now, right? The deployed code certainly is...

But oh my, look at our test directory. Would you believe how complex it is to reliably override CORE::GLOBAL::open? All to inject contents for one file that one script opens. And then we do it again in a second copy because a second script needs a different file. And overriding readdir etc

Production is fine, but we're accumulating technical debt so quickly that there's the risk of a demonic portal opening next time CI runs - and I hate to think what the AWS bill for that service is...

So here is the next phase of the testing story - how we reduced the need for blunt override libraries by careful use of temporary directories, @INC ordering, log4perl configs and more.

(How much more is a small matter of Conference Driven Development, and how late my train is.)


Tags: testing

Teilnahmeinteresse: