Thx @Allenph I think I have a basic grasp of concepts like Dependency Injection, Mocks, Stubs, etc in the context of unit testing. However, I can't figure out how to start unit testing my webapp backend (I use CodeIgniter) code because of how frequently it interacts with the database. I don't think I can use Dependency Injection to create a mock database object since the db object is an instance variable of the CodeIgniter framework? Even if I could, I don't know how to create an adequate mock to return everything that's required (I can give a more detailed example if this is confusing) I don't think I've done a great job isolating my data access into its own layer (tbh I'm not exactly sure how to structure my backend code to look like that without killing performance). I don't use an ORM, everything is raw MySQL. I've looked through a few SO questions like: https://stackoverflow.com/questions/145131/whats-the-best-strategy-for-unit-testing-database-driven-applications but I'm still stumped. I'm against creating a test database because there is certain configuration I keep inside the database itself that needs to exist otherwise the webapp won't function. This means that if I make a test database, I have to keep the configuration portion of the db synchronized which seems like it's too much work? The only thing that seems like it could work is if I use live production data and copy it into a test database server, but even then I can't run tests like "Get all the items that were created in the past 5 days, and assert that the number of items equals 7"