<?xml version="1.0" ?><entry xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom" xmlns:planet="http://planet.intertwingly.net/"><id>https://blog.nelhage.com/post/write-testable-code-by-writing-generic-code/</id><link href="https://blog.nelhage.com/post/write-testable-code-by-writing-generic-code/" rel="alternate" type="text/html"/><title>Write testable code by writing generic code</title><summary>Alex Gaynor recently asked this question in an IRC channel I hang out in (a channel which contains several software engineers nearly as obsessed with software testing as I am):
uhh, so I’m writing some code to handle an econnreset… how do I test this?
This is a good question! Testing ECONNRESET is one of those fiddly problems that exists at the interface between systems — in his case, with S3, not even a system under his control — that can be infuriatingly tricky to reproduce and test.</summary><updated planet:format="March 12, 2020 01:30 AM">2020-03-12T01:30:17Z</updated><source><id>https://blog.nelhage.com/post/</id><author><name>Nelson Elhage</name></author><link href="https://blog.nelhage.com/post/" rel="alternate" type="text/html"/><link href="https://blog.nelhage.com/post/atom.xml" rel="self" type="application/rss+xml"/><subtitle>Recent content in Posts on Made of Bugs</subtitle><title>Posts on Made of Bugs</title><updated planet:format="July 07, 2026 03:37 PM">2026-07-07T15:37:43Z</updated><planet:format>rss20</planet:format><planet:bozo>false</planet:bozo><planet:items_per_page>60</planet:items_per_page><planet:name>Nelson Elhage</planet:name><planet:css-id>nelson-elhage</planet:css-id><planet:days_per_page>0</planet:days_per_page><planet:http_etag>&quot;5b2ae9eec2e293572f6ae5a000bd0161-ssl-df&quot;</planet:http_etag><planet:http_status>200</planet:http_status><planet:encoding>utf-8</planet:encoding></source></entry>