Laravel is a free and open-source PHP-based web framework for building web applications

Slug
laravel

Legacy code and Test Driven Development (Part 2)

Yesterday, I wrote about legacy code and how it really was not possible to initially do test driven development, aka TDD. In this post, I will detail a strategy which I feel is good at explaining how to go about testing. I make no guarantees that this is the best way to go about it (please feel free to suggest other tricks you might use), but it works. But these are useful for me in porting Medusa V2 code to Medusa V4 (long story about why not V3, but there are reasons).

Legacy code and Test Driven Development

I am sure many of us have faced the task of trying to do test driven development (TDD) on a legacy codebase. I myself am facing such a challenge, with several tens of thousands of lines of code in a Laravel project which I am helping maintain and is around a decade old. And being severely behind in the packages it uses, the time has come to give the code some TLC, and update it to use the most recent versions of those package (for example, we are moving from Laravel 5 to 12).

Heimdallr... crossing the rainbow bridge.

In my last post, I talked about running into limitations with Django and Python, where I had queries I was wanting to do, but the integration between the RawQuerySets and DRF were blocking me from being able to easily build those queries and route the results to the DataTable.. Well,  I spent a day or two this past weekend recreating the entirety of what I had written in Django and Python  using Laravel and PHP, and I have some observations.

Heimdallr, do we have a bridge to cross?

When I first wrote about Heimdallr, I saw it as a project which was going to be written in Python using Django. I have been using both PHP and Python since their initial releases, but something made that pairing stand out.  First, outside of it using colons with indention to indicate code blocks, I have liked the ecosystem with stronger typing like C/C++, whereas PHP was weaker in its typing.