Testing Unfriendly Code - a crash course in stunt programming

by Nicholas Clark (London.pm)

Testing Unfriendly Code - a crash course in stunt programming aimed at Any and is held in English. This talk starts on 2024-04-17 at 10:00 for 40 minutes. It takes place at the Room 1.

At my employer we have of batch scripts, which were written ages ago, do their thing wonderfully, and reliably earn their keep month in month out.

Problem is, that we want to edit some of them. They don't have tests. They were never written with testing in mind. We'd need to refactor them to easily write tests for them, but we don't want to refactor them *until* we have tests.

How do we solve this conundrum?

This talk will explain the techniques we developed to run scripts in testing byte-for-byte unchanged, but with code injected so that we could subvert the control flow to write thorough tests.

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.


Tags: testing

Interest in attending: