I think I accidentally discovered two new refactorings today, Extract Mixin and Replace Mixin With Class . (I'll make detailed writeups in a day or two.) This morning I found myself in central Gothenburg with nothing to do for an hour before a meeting, so I ducked into a cafe, had a cup of tea, and began refactoring Test::Unit::XML. If you have had a look at the code in the assertions mixin, xml_assertions.rb , in version 0.1.4, you'll notice that it is fairly heavyweight, weighing in at more than 220 lines of code. This is a fairly large chunk of code, and all of it is for a single assertion, assert_xml_equal . A big part of that code is for comparing different types of REXML nodes, REXML::Element, REXML::Text, and so on. The node comparison code was split into fairly small methods, so it wasn't too shabby, it was just that it was located in the wrong place. It made sense to move that code to a class of its own. I did consider moving it to a mixin module, but in the end I...