Some quick thoughts on Unit Testing ActivityPub 0 ▲ Terence Eden 2 hours ago · Tech · hide · 0 comments I'll be radically honest here - I never really got the idea of "Test Driven Development". I'm much more of a "telnet into production and damn the consequences" kind of guy. Look, it's much more fun and my cardiologist recommends severe shocks every now and again. The essence of unit testing is pretty simple: Feed a function some data See how it responds Send it good data and if it returns "true" the test passes. Send it bad data and make sure it returns false. Easy peasy lemon squeezy. As part of my NLnet funded work on ActivityBot, I'm writing some proper tests for my bot framework. I am hopeful that some of them will be useful to other projects doing similar things. There are four major classes of tests - here are the problems I've found while writing them. Basic text validation A basic test might be how to validate that an ActivityPub username is valid. Typically it would be something like @edent@mastodon.social - what assumptions do we make with that? It starts with an @ and has… No comments yet. Log in to reply on the Fediverse. Comments will appear here.