I just have to say that test driven development tonight gave me the biggest benefit it has done to date! I've spent the past couple of weeks on and off refactoring a massive code base which involved some fairly impressive interface changes. All my tests exploded initially (fantastic, I'd hope so too) but as the code gradually came back together the failing tests disappeared one by one. Today I finished off my refactoring, 100% passing tests, and only then did I realise "hey, I haven't even tried this stuff for real other than watching tests pass/fail". So I ran my smaller set of smoke tests which are basically my end-to-end tests, and voila, everything works like it did before I refactored

I can say for sure that without the 77 test cases this library has I would never have even dared attempt the scale or refactoring I did.

I know it's obvious that testing helps in this case, but when you finally get that level of support back out of your tests you have to take a bow to all the TDD proponents who's test infected attitude rubbed off on you in the first place

Code:
w3style-2:se d11wtq$ php test-suite/run.php
All Tests
  >> Swift_MailerTest OK
  >> Swift_MimeFactoryAcceptanceTest OK
  >> Swift_TransportFactoryAcceptanceTest OK
  >> Swift_ByteStream_ArrayByteStreamTest OK
  >> Swift_ByteStream_FileByteStreamAcceptanceTest OK
  >> Swift_CharacterReader_GenericFixedWidthReaderTest OK
  >> Swift_CharacterReader_UsAsciiReaderTest OK
  >> Swift_CharacterReader_Utf8ReaderTest OK
  >> Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest OK
  >> Swift_CharacterStream_ArrayCharacterStreamTest OK
  >> Swift_Encoder_Base64EncoderAcceptanceTest OK
  >> Swift_Encoder_Base64EncoderTest OK
  >> Swift_Encoder_QpEncoderAcceptanceTest OK
  >> Swift_Encoder_QpEncoderTest OK
  >> Swift_Encoder_Rfc2231EncoderAcceptanceTest OK
  >> Swift_Encoder_Rfc2231EncoderTest OK
  >> Swift_Events_CommandEventTest OK
  >> Swift_Events_EventObjectTest OK
  >> Swift_Events_ResponseEventTest OK
  >> Swift_Events_SendEventTest OK
  >> Swift_Events_SimpleEventDispatcherTest OK
  >> Swift_Events_TransportChangeEventTest OK
  >> Swift_Events_TransportExceptionEventTest OK
  >> Swift_KeyCache_ArrayKeyCacheAcceptanceTest OK
  >> Swift_KeyCache_ArrayKeyCacheTest OK
  >> Swift_KeyCache_DiskKeyCacheAcceptanceTest OK
  >> Swift_KeyCache_SimpleKeyCacheInputStreamTest OK
  >> Swift_Mailer_ArrayRecipientIteratorTest OK
  >> Swift_Mime_AttachmentAcceptanceTest OK
  >> Swift_Mime_AttachmentTest OK
  >> Swift_Mime_EmbeddedFileAcceptanceTest OK
  >> Swift_Mime_EmbeddedFileTest OK
  >> Swift_Mime_MimePartAcceptanceTest OK
  >> Swift_Mime_MimePartTest OK
  >> Swift_Mime_SimpleMessageAcceptanceTest OK
  >> Swift_Mime_SimpleMessageTest OK
  >> Swift_Mime_SimpleMimeEntityAcceptanceTest OK
  >> Swift_Mime_SimpleMimeEntityTest OK
  >> Swift_Mime_ContentEncoder_Base64ContentEncoderAcceptanceTest OK
  >> Swift_Mime_ContentEncoder_Base64ContentEncoderTest OK
  >> Swift_Mime_ContentEncoder_PlainContentEncoderAcceptanceTest OK
  >> Swift_Mime_ContentEncoder_PlainContentEncoderTest OK
  >> Swift_Mime_ContentEncoder_QpContentEncoderAcceptanceTest OK
  >> Swift_Mime_ContentEncoder_QpContentEncoderTest OK
  >> Swift_Mime_Header_DateHeaderTest OK
  >> Swift_Mime_Header_IdentificationHeaderTest OK
  >> Swift_Mime_Header_MailboxHeaderTest OK
  >> Swift_Mime_Header_ParameterizedHeaderTest OK
  >> Swift_Mime_Header_PathHeaderTest OK
  >> Swift_Mime_Header_UnstructuredHeaderTest OK
  >> Swift_Mime_Header_VersionHeaderTest OK
  >> Swift_Mime_HeaderEncoder_Base64HeaderEncoderTest OK
  >> Swift_Mime_HeaderEncoder_QpHeaderEncoderTest OK
  >> Swift_Plugins_AntiFloodPluginTest OK
  >> Swift_Plugins_BandwidthMonitorPluginTest OK
  >> Swift_Plugins_DecoratorPluginTest OK
  >> Swift_Plugins_LoggerPluginTest OK
  >> Swift_Plugins_ReporterPluginTest OK
  >> Swift_Plugins_ThrottlerPluginTest OK
  >> Swift_Plugins_Loggers_ArrayLoggerTest OK
  >> Swift_Plugins_Reporters_HitReporterTest OK
  >> Swift_Plugins_Reporters_HtmlReporterTest OK
  Smoke Test
  Compare email sent with image @ http://swiftmailer.org/smoke/4.0.0/attachment.jpg
  >> Swift_Smoke_AttachmentSmokeTest OK
  Smoke Test
  Compare email sent with image @ http://swiftmailer.org/smoke/4.0.0/basic.jpg
  >> Swift_Smoke_BasicSmokeTest OK
  Smoke Test
  Compare email sent with image @ http://swiftmailer.org/smoke/4.0.0/international.jpg
  >> Swift_Smoke_InternationalSmokeTest OK
  >> Swift_Transport_EsmtpTransportTest OK
  >> Swift_Transport_FailoverTransportTest OK
  >> Swift_Transport_LoadBalancedTransportTest OK
  >> Swift_Transport_SendmailTransportTest OK
  >> Swift_Transport_Esmtp_AuthHandlerTest OK
  >> Swift_Transport_Esmtp_Auth_CramMd5AuthenticatorTest OK
  >> Swift_Transport_Esmtp_Auth_LoginAuthenticatorTest OK
  >> Swift_Transport_Esmtp_Auth_PlainAuthenticatorTest OK
  >> Swift_Transport_PolymorphicBuffer_BasicSocketAcceptanceTest OK
  >> Swift_Transport_PolymorphicBuffer_ProcessAcceptanceTest OK
  >> Swift_Transport_PolymorphicBuffer_SslSocketAcceptanceTest OK
  >> Swift_Transport_PolymorphicBuffer_TlsSocketAcceptanceTest OK
OK
Test cases run: 77/77, Passes: 5280, Failures: 0, Exceptions: 0
$w3style-2:se d11wtq$ svn commit -m "PHEWW!! Seriously, I thought that refactoring was going to take forever.
> Massive refactoring in the header-entity interaction. I like it now :)"
Sending        TODO
Sending        lib/classes/Swift/Mime/Attachment.php
Adding         lib/classes/Swift/Mime/CharsetObserver.php
Sending        lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php
Sending        lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php
Sending        lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php
Sending        lib/classes/Swift/Mime/ContentEncoder.php
Adding         lib/classes/Swift/Mime/EncodingObserver.php
Deleting       lib/classes/Swift/Mime/FieldChangeObserver.php
Sending        lib/classes/Swift/Mime/Header/DateHeader.php
Sending        lib/classes/Swift/Mime/Header/IdentificationHeader.php
Sending        lib/classes/Swift/Mime/Header/MailboxHeader.php
Sending        lib/classes/Swift/Mime/Header/ParameterizedHeader.php
Sending        lib/classes/Swift/Mime/Header/PathHeader.php
Sending        lib/classes/Swift/Mime/Header/UnstructuredHeader.php
Sending        lib/classes/Swift/Mime/Header/VersionHeader.php
Sending        lib/classes/Swift/Mime/Header.php
Sending        lib/classes/Swift/Mime/MimeEntity.php
Sending        lib/classes/Swift/Mime/MimePart.php
Adding         lib/classes/Swift/Mime/ParameterizedHeader.php
Sending        lib/classes/Swift/Mime/SimpleMessage.php
Sending        lib/classes/Swift/Mime/SimpleMimeEntity.php
Sending        tests/acceptance/Swift/Mime/SimpleMimeEntityAcceptanceTest.php
Sending        tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php
Adding         tests/unit/Swift/Mime/AbstractMimeEntityTest.php
Sending        tests/unit/Swift/Mime/AttachmentTest.php
Sending        tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php
Sending        tests/unit/Swift/Mime/EmbeddedFileTest.php
Sending        tests/unit/Swift/Mime/Header/DateHeaderTest.php
Sending        tests/unit/Swift/Mime/Header/IdentificationHeaderTest.php
Sending        tests/unit/Swift/Mime/Header/MailboxHeaderTest.php
Sending        tests/unit/Swift/Mime/Header/ParameterizedHeaderTest.php
Sending        tests/unit/Swift/Mime/Header/PathHeaderTest.php
Sending        tests/unit/Swift/Mime/Header/UnstructuredHeaderTest.php
Sending        tests/unit/Swift/Mime/MimePartTest.php
Sending        tests/unit/Swift/Mime/SimpleMessageTest.php
Sending        tests/unit/Swift/Mime/SimpleMimeEntityTest.php
Transmitting file data ....................................
Committed revision 720.
Yes, I should have smelled the stink I refactored out long before I had this much code to refactor. I sort of did, but didn't come up with a better solution until recently

/me shuts up before people start thinking I just talk too much :P