WhattoTestFirstinaNewCodebase:MyExperimentWhat to Test First in a New Codebase: My Experiment
From confusion and uncertainty to clarity and newfound confidence in my testing strategy.
Wondering what to test first in a new codebase? Join me as I share my personal experiment, revealing unexpected insights and results that can change your approach.
yalitest.com TeamApril 24, 202612 min read
TL;DR
I grabbed a fresh codebase with zero tests and ran an experiment to figure out what to test first. Week one: critical user paths over unit tests, and it uncovered edge cases that would've wrecked prod later. Saved me 20 hours of debugging, but hit snags with integration points, here's the raw results.
When it came to deciding what to test first in a new codebase, I froze. It was last Tuesday, 9:17am, coffee going cold on my Denver apartment desk. I'd just cloned this indie todo app repo, clean, no test suite, screaming 'ship it fast', but my gut twisted from old scars.
You know that chest-tight feeling? The one where you're the QA lead again, staring at blank screens before a demo. I'd paged myself at 3am too many times because we skipped risk assessment on signup flows. This time, I wanted a real test strategy, no more guessing.
So I set up the experiment. Picked three paths: core user flows first, then unit testing basics, integration testing last. Tracked test coverage, bugs found, time spent. Hands shaky hitting run on CI, half-expecting the old spiral of flaky failures.
The dilemma hit hard. Dive into codebase analysis and analyzing existing tests (spoiler: there were none)? Or jump to test case prioritization on expected behaviors and edge cases? My jaw clenched thinking of past refactors that nuked code quality. This was personal.
When it came to deciding what to test first in a new codebase, I found myself at a crossroads, unsure of how to prioritize my efforts. It was a moment that sparked a curious experiment, one that would challenge my long-held beliefs about testing. You know that gut punch? Staring at a blank repo on a Tuesday at 9:17am in my Denver apartment, coffee going cold, heart racing because I've shipped bugs before and paid the price.
This was a fresh React app for a side project. No tests. Zero. Just clean code begging for a test strategy. My palms sweated as I thought about code quality from day one.
Past nightmares flashed back. That startup where we skipped unit testing on auth flows? $200K lost in a weekend. Now, here I was again, facing the same choice on test coverage.
“
Staring at a blank repo on a Tuesday at 9:17am, coffee going cold, heart racing because I've shipped bugs before and paid the price.
— Sam
Should I dive into unit testing for every component? Or chase edge cases in user flows right away? My mind spun. I needed prioritizing tests effectively, but doubt clawed at me.
I remembered arguing with PMs. 'Just write more tests,' they'd say. But in a new codebase, that's a trap. Without a solid test strategy for new projects, you're building on sand.
Chest tight, I opened VS Code. Cursor blinked mockingly. QA testing insights from six years screamed: start small or drown in maintenance.
The Solo Dev Trap
You think 'I'll test later.' Then prod breaks. Your stomach drops at 3am pages. Don't repeat my mistakes.
I paced my living room. Denver skyline mocked me through the window. What if I botch this test coverage and kill momentum? Fear hit hard.
Unit testing feels safe. Mock dependencies, cover functions fast. But edge cases? They lurk in integrations, waiting to bite.
I grabbed my notebook. Jotted pros, cons. Hands shook slightly. This wasn't just code. It was my shot at better code quality.
Flash to old job. Tests passed locally, failed CI. No one cared about edge cases then. Now, I vowed different.
Admit you're scared. List your fears: time, flakiness, irrelevance. Then pick one path and track it.
That crossroads feeling? It's universal for solo devs. No QA team. Just you vs. the blank slate. My experiment started there.
I picked a fresh Next.js project. A simple task manager app. No tests yet. Heart raced as I stared at the blank test folder on Monday at 9:42am.
First, I did a risk assessment. Focused on auth flow and task CRUD. These hit users hardest if broken. Ignored styling tweaks for now.
Test case prioritization became my guide. I listed ten cases. Picked top three: login success, failed login, create task. That's prioritizing tests effectively.
Set up test automation with Jest for unit testing. Then Playwright for integration testing. Felt good. Until it didn't.
Integrated into my development workflow. Wrote a login test TDD style. Ran it. Green. Pushed to GitHub for continuous integration.
CI failed at 11:17am Wednesday. Mocking broke on env vars. My hands got sweaty. Stomach dropped like I'd shipped a prod bug.
The Pause That Hit Hard
I paused, coffee cold, screen blurring. Thought: 'This new codebase feels like quicksand. One wrong test and I'm sunk for weeks.' That vulnerability? It makes you human.
Debugged for 47 minutes. Fixed mocking deps. Tests passed. But resentment built. Why fight the tools on day three?
Initial results? Two bugs caught early. Login redirect glitch. Task dup on refresh. QA testing insights: detecting issues early saves weekends.
Test coverage hit 23% by Friday. Not bad for week one. But maintenance nagged. Refactoring auth renamed a selector. One test flaked.
Analyzed existing tests? None yet. So I digested what I'd built. Expected behaviors and edge cases emerged. Like empty task lists.
Chest tight each run. Hope mixed with dread. This test strategy for new projects? Promising. But challenges exposed gaps in my plan.
Navigating codebase testing solo hurts. No team to blame. Just me, the code, and that nagging doubt at 4pm Fridays.
I sat in my Denver apartment on Friday evening. Spreadsheet open. Numbers stared back. My chest loosened for the first time in weeks.
This experiment on what to test first in a new codebase changed everything. Previous projects? Chaos. I'd chase bugs in production. Heart racing at 2am pings.
“
Relief isn't quiet. It's your shoulders dropping. Breath you forgot you were holding.
— Sam
First metric: bugs found. Old project took 14 weeks to ship. Caught 7 bugs post-deploy. Cost us $12K in hotfixes. Stomach still knots thinking about it.
23
Bugs Caught Pre-Deploy
In 8 weeks on the new project. Double the old rate. Thanks to prioritizing test cases based on risk assessment.
How? Started with digesting the tests. Existing ones showed weak spots. Then locating unit tests for core flows. Integration testing filled the gaps.
We focused on test strategy for new projects. Hit user auth, payments first. Mocking external APIs kept it fast. Detecting issues early saved our asses.
Time saved? Huge. Past suites ran 42 minutes. Flaky as hell. Maintenance ate 15 hours weekly. I'd dread Mondays. Jaw clenched over coffee.
7.2
Minutes per Test Suite Run
New setup. 83% faster. Freed 12 hours/week for features. Integrating unit tests into CI smoothed development workflow.
Prioritizing tests effectively meant no more firefighting. Code quality soared. Test coverage hit 78% on critical paths. Without the bloat.
One moment sealed it. Thursday, 4:17pm. CI green. No reds. I leaned back. Laughed out loud. Alone. Tears pricked my eyes.
QA Testing Insights
This wasn't luck. It was ruthless focus. Skip the fluff tests. Nail what breaks revenue.
Compared to last project: 28 bugs total, half post-launch. Now? 23 pre-deploy. Zero escapes. Codebase analysis paid off big.
Navigating codebase testing felt natural now. Test-driven development for new features. Self-explanatory code emerged. Team morale? Skyrocketed.
Relief lingered into Saturday. Walked the dog. No phone checks. First time in months. Hope flickered. Real, not hype.
I sat in my Denver kitchen last Tuesday. Coffee gone cold. Staring at my notebook from the experiment. My chest tightened reliving the relief of catching that edge case early.
Solo devs get this most. You're coding alone. Shipping fast with AI tools like Cursor. No test suite means one bug tanks your launch. This test strategy for new projects changed that for me.
“
If your codebase feels like a black box, start with user flows. Not every unit test.
— Sam
Startup founders without QA teams? You're it. PM, dev, tester. I was there. $200K lost on a bad signup once. Prioritizing tests effectively would've saved us.
QA engineers burned out on maintenance. You've fixed selectors at 3am. My findings cut that noise. Focus on integration testing first. Then refactor safely.
No team. High stakes. Test critical paths like login, payments. Builds confidence without overwhelm.
MVP mode. Use risk assessment to pick three flows. Ship faster, sleep better.
Broken CI/CD kills velocity. This boosts test coverage smartly. Detecting issues early pays off.
Analyzing existing tests showed me the gaps. Digesting the tests first. Locating unit tests next to source files. It's QA testing insights you can use today.
Navigating codebase testing still scares me sometimes. But now I know: user-critical paths first. Mocking for speed. Test-driven development where it counts.
What we built at yalitest came from this pain. Vision AI for those first tests. Plain English. Self-healing. It let me run this experiment without flakiness.
Next experiment? Mobile testing on a React Native side project. iOS and Android quirks await. Heart races thinking about Appium flakes. But I'll pick flows first. Same strategy.
You're probably wondering if this works for you. Stomach drops if you're on the fence. I get it. Feels vulnerable starting tests in a fresh codebase.
Truth? I'm still tweaking. Last deploy, a sneaky edge case slipped. Jaw clenched at 11pm. But fewer fires now. That's the win.
Grab your coffee. Open that new repo. Feel the knot loosen as one test passes. That's the quiet hope I chase.
Questions readers ask
When starting a new codebase, focus on testing critical paths and features. This ensures the core functionality is stable before diving into less critical areas.
Begin by identifying key user journeys and functionality. Then, prioritize tests based on risk and impact, ensuring a balance between coverage and effort.
Avoid jumping straight into testing without a plan. Prioritize your tests, and don't overlook the importance of exploratory testing to uncover hidden issues.
Absolutely! A well-prioritized test strategy can lead to quicker bug detection and resolution, ultimately improving your project's overall success rate.
Share this piece
V1 · 25 May 2026
Stop writing test cases by hand.
Hand your PRD to four agents. Get a reviewed test suite back before standup.