<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Keil Hunsaker</title>
    <description>The latest articles on Forem by Keil Hunsaker (@keilhun).</description>
    <link>https://forem.com/keilhun</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F91226%2Fd4ae255e-160d-4a65-95a0-2852090e3beb.jpg</url>
      <title>Forem: Keil Hunsaker</title>
      <link>https://forem.com/keilhun</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/keilhun"/>
    <language>en</language>
    <item>
      <title>Refactoring Legacy Website and the Test Suite That Never Was</title>
      <dc:creator>Keil Hunsaker</dc:creator>
      <pubDate>Mon, 16 Feb 2026 12:59:39 +0000</pubDate>
      <link>https://forem.com/keilhun/refactoring-legacy-website-and-the-test-suite-that-never-was-449f</link>
      <guid>https://forem.com/keilhun/refactoring-legacy-website-and-the-test-suite-that-never-was-449f</guid>
      <description>&lt;p&gt;The Horror&lt;br&gt;
Picture this: It’s the 2010s, but the code feels like the 1990s. I was handed the keys to a custom e-commerce site for a small manufacturing business. The tech stack? A chaotic mix of legacy Perl scripts and static HTML. The navigation bar was hard-coded into 20+ separate files.&lt;br&gt;
But the real kicker? The checkout process captured raw credit card numbers and saved them to a flat text file for office staff to manually type into a terminal. No encryption. No tokenization. Just pure, unadulterated liability.&lt;/p&gt;

&lt;p&gt;The Mission&lt;br&gt;
My directive was clear but constrained: “Modernize the site, improve security, but don’t disrupt how we do business.” I wasn’t the architect; I was the mechanic trying to change the tires while the car was doing 60mph.&lt;/p&gt;

&lt;p&gt;The Fixes (The Wins)&lt;br&gt;
I took a pragmatic, three-phase approach to stop the bleeding:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The PHP Facelift
I ripped out the hard-coded navigation and built a simple vanilla PHP template system. Updating a menu item went from 45 minutes of copy-pasting to 30 seconds of editing a single file. The site became more consistent and easier to maintain without breaking existing pages.&lt;/li&gt;
&lt;li&gt;The Security Patch
I integrated the PayPal API to offload payment processing. This was the critical win—we finally stopped handling raw credit card data, instantly improving security and reducing PCI liability.&lt;/li&gt;
&lt;li&gt;The Logic
I bridged the UPS API into the Perl cart to automate shipping costs based on weight, eliminating manual lookup errors and reducing operational bottlenecks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Heartbreak (The Phantom Test Suite)&lt;br&gt;
The legacy checkout code was brittle, and I was constantly worried about regressions. On my own time, I built a small regression test suite using Codeception (PHP) with Selenium to perform end-to-end tests of the checkout flow. Selenium automated browser interactions, while Codeception provided a PHP-based framework to organize and run the tests, giving me confidence that the checkout process continued to work as expected.&lt;br&gt;
When I proposed formalizing the suite, the business didn’t see a clear return on investment. Time spent on non-customer-facing work was hard to justify, so no resources were allocated to maintain or expand it. The suite never became part of the official workflow.&lt;br&gt;
Even so, I continued running it locally before my own deployments. It quietly caught potential regressions and saved me from breaking things, even if the work never appeared on a roadmap or report.&lt;/p&gt;

</description>
      <category>security</category>
      <category>softwareengineering</category>
      <category>testing</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
