{
  "id": 15137604,
  "title": "Some quick thoughts on Unit Testing ActivityPub",
  "url": "https://urgent.news/2026/10/17/some-quick-thoughts-on-unit-testing-activitypub",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-17T06:12:46.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://shkspr.mobi/blog/2026/10/some-thoughts-on-unit-testing-activitypub/"
  },
  "original_language": "en",
  "account": "I'm brutally honest when discussing Test Driven Development - I'm more inclined to telnet into production and accept consequences. The core concept of unit testing is straightforward: feed it good data, expect a true response, and vice versa for bad data. While working on ActivityBot as part of my NLnet-funded project, I'm creating thorough tests for the bot framework, hopeful that they'll prove useful to other similar projects.\n\nWriting tests involves addressing four major classes of issues. To validate an ActivityPub username, we must consider assumptions about its structure: it starts with an @, contains another @, separating user and server parts, the server must be a valid domain name (including non-ASCII Internationalised Domain Names and Emoji domains), and the user part can include various characters. Discovering specifications for these components is challenging.\n\nWebFinger responses, mandatory parts, and the values they can contain also pose questions. Ensuring other ActivityPub servers comprehend messages generated by your project is crucial. Similarly, deciphering follow messages from external servers is a concern. JSON Schemas aid in validating some message types, but scattered specifications complicate the process.\n\nHTTP Signatures present two main challenges: verifying signatures, which requires gathering and replaying signatures, and generating signatures, where only one real method exists for acceptance testing. Effective communication between servers is vital; sending a signed request should be simple and repeatable. However, receiving messages isn't easily automated, demanding control over external servers to send messages, which is feasible with public servers like Mastodon but not always the case.",
  "summary": null,
  "key_points": [
    "Unit testing validates ActivityPub usernames' structure and assumptions.",
    "WebFinger responses and message comprehensions pose validation challenges.",
    "HTTP Signatures require both verification and generation for acceptance testing."
  ],
  "editors_take": "Standardizing unit tests for ActivityPub frameworks addresses the fragmentation of scattered specifications and provides a necessary blueprint for ensuring interoperability between diverse decentralized social media servers.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}