software engineering best practices

10 Software Engineering Best Practices and Where to Start

By Zest | Updated | 14 min read

Related guide: Developer productivity metrics for AI-assisted teams

Several monitors showing code, the middle one with the words Engineering Excellence

The ten software engineering best practices that matter most are a clear Git workflow, test-driven development, code review, CI/CD, agile iteration, clean code and refactoring, an automated testing strategy, documentation, security by design and modular architecture. If you’re deciding what to adopt first, each one below has a short definition and the steps to start.

Zest shows which coding agents, models and skills each engineer on your team uses, and what ships from them. Start freeGet started

None of them is new, but agents now write so much of the code that the checks around it (tests, review, CI) matter more. In our two main repositories, at least 866 of the 1,570 pull requests (PRs) merged between August 12 and October 4, 2026 came from a coding agent, and across 1,232 reviewed pull requests our AI reviewer flagged 11% of those under 100 changed lines, against 57% of those with 1,000 to 2,999. We’re one small team, so read that as a data point. When nothing on this list hurts more than the rest, we’d start with PR size.

All of this assumes a team that shares a codebase and ships to production. On a weekend prototype or a script you’ll throw away, most of it is overhead you won’t earn back.

Software development best practices checklist

Each row is one practice, what it means, and a first step small enough to take this week.

Practice What it means First step
Git workflow Every change moves through a branch and a pull request Protect main so nothing lands without CI and a review
Test-driven development You write a failing test before the code that passes it Try it on the module that breaks most often
Code review A teammate reads each change before it merges Agree to answer review requests within one business day
CI/CD Every push is built and tested, and releases are automated Run the tests on every PR
Agile iteration You ship in small increments and adjust the plan from feedback Show working software to stakeholders at the end of each iteration
Clean code and refactoring Code other people can read and change safely Rename or split one thing whenever you fix a bug nearby
Automated testing strategy A planned mix of unit, integration and end-to-end tests Fix or quarantine your flakiest test
Documentation A record of why the system is built this way and how to run it Write one decision record for your next big decision
Security by design Security checks at every stage, not only at the end Turn on dependency alerts and secret scanning
Modular architecture Parts with clear boundaries that can change independently Draw the boundaries inside one codebase before you split services

1. Version Control and Git Workflow

Version control records every change to the codebase, so a team can work in parallel, review changes before they land and go back to any earlier state. Git is the standard, and it scales: Microsoft moved Windows development to Git in 2017, a repository of about 3.5 million files.

A feature-branch workflow suits most teams. Trunk-based development, with short-lived branches merged at least daily, suits teams with strong CI. GitFlow’s long-lived branches mostly suit software shipped in versioned releases, as its author now says himself.

  • Give each change its own branch, such as feature/user-authentication or fix/login-timeout.
  • Keep commits small and clear. A message like feat: add password reset endpoint follows Conventional Commits, which is worth adopting if you want changelogs generated from history.
  • Open a PR into main when the change is ready.
  • Merge only after CI passes and a teammate approves, and let branch protection on main enforce both.

2. Test-Driven Development (TDD)

Test-driven development means writing a failing test before the code that makes it pass. You work in a short red-green-refactor loop, so every piece of code exists to satisfy a test and the design is testable from the start.

In the red step you write one small test for the next piece of behavior and watch it fail. In the green step you write the simplest code that makes it pass. Then you refactor, cleaning up the code while all the tests stay green.

In a 2008 study of three development teams at Microsoft and one at IBM, pre-release defect density was 40–90% lower than on similar projects without TDD, at the cost of 15–35% more initial development time by the teams’ own estimates (Nagappan et al., 2008). Our red-green-refactor guide walks through a full example.

3. Code Review and Pair Programming

Code review means a teammate reads a change before it merges, and pair programming means two developers write it together in real time. Both catch defects early and spread knowledge of the codebase, so no part of it depends on one person.

  • Keep PRs small. Google’s review guide calls about 100 lines a reasonable change and 1,000 lines usually too large (Google engineering practices).
  • Automate style. Formatters and linters (Prettier, Biome, Black, Ruff) settle formatting, so reviewers can look at logic, design and risk.
  • Review the code, not the author. Phrase comments as questions or suggestions and explain why.
  • Review within a day. A PR that waits loses its author’s context, and Google’s guide sets one business day as the maximum time to respond.
  • Pair on hard problems, onboarding and risky fixes, and switch the “driver” (typing) and “navigator” (thinking ahead) roles often.

Our guide to code review good practices goes further.

4. Continuous Integration and Continuous Deployment (CI/CD)

Continuous integration builds and tests every change automatically as soon as it’s pushed, and continuous deployment then releases every change that passes to production. Together they make releases small, frequent and routine instead of rare and risky.

  • Start with CI, running the build and the tests on every push and PR. GitHub Actions, GitLab CI/CD and Jenkins all do this, and our CI/CD platforms comparison covers the others.
  • Keep it fast. Extreme Programming’s ten-minute build is still a good target, because developers learn to ignore a slow pipeline.
  • Once CI is reliable, deploy every green build to staging, then to production.
  • Use feature flags to separate deploying code from releasing a feature, so unfinished work can ship switched off.

In this 100-second video, Fireship builds a CI pipeline for a Node.js app with GitHub Actions. A workflow runs on every push to the master branch, installs the dependencies and runs the test, build and deploy commands, and if a step fails, the build doesn’t reach customers.

5. Agile and Iterative Development

Agile development delivers software in small increments and adjusts the plan based on feedback, instead of following a fixed plan through sequential phases. Teams ship working software often and learn from real use.

Scrum is one common framework. Its 2020 Scrum Guide names three accountabilities: a Product Owner decides what to build and in what order, a Scrum Master looks after how the team works, and the Developers build it. Work happens in Sprints of one month or less, each starting with Sprint Planning. A Daily Scrum of at most 15 minutes checks progress toward the sprint goal and surfaces blockers, and every sprint ends with a Sprint Review with stakeholders and a Sprint Retrospective for the team.

Kanban, with continuous flow and work-in-progress limits instead of sprints, suits work that arrives unpredictably, such as support or platform requests.

6. Clean Code and Refactoring

Clean code is code that other people can read, understand and change safely. Refactoring is the habit of improving the structure of existing code without changing what it does, so technical debt gets paid down a little at a time.

  • Leave code a little cleaner than you found it. Rename a confusing variable or split a long function while fixing a bug nearby.
  • Use names that say what things do, like fetchUserProfile instead of getUsrDat.
  • Keep functions small, with one job each, and return early instead of nesting if/else blocks.
  • Refactor under tests. Without them, a refactor is a guess.
  • Let a linter and formatter run in CI, so style never reaches review.

7. Automated Testing Strategy

An automated testing strategy decides which kinds of tests to write and how many of each, so the suite catches regressions quickly without becoming slow and fragile. Tests written as code run on every change, so nobody has to re-test by hand.

The test pyramid, popularized by Mike Cohn, is a good default. Write many unit tests for functions and classes in isolation, since they run in milliseconds and point straight at the failure. Write fewer integration tests for how parts work together, such as an API endpoint reading from a real database. Keep end-to-end tests (Playwright, Cypress) to a few critical user journeys through the UI, because they are slow and break more easily.

Run them all in CI on every PR, and fix or quarantine flaky tests quickly. One flaky test teaches the team to ignore red builds.

8. Documentation and Knowledge Management

Documentation records what code can’t say for itself: why the system is built this way, how to run it, and how its parts and APIs fit together. It lets new people get productive without interrupting the ones who already know.

  • Write down the why. Code shows what it does, so comments, READMEs and commit messages should say why this approach and not another.
  • Keep docs in the repository as Markdown next to the code (README.md, CONTRIBUTING.md), so they change in the same PR as the code.
  • Record big decisions as Architecture Decision Records (ADRs), each a short note of the context, the decision and its consequences.
  • Generate reference docs from the code where you can, with OpenAPI for HTTP APIs and JSDoc or docstrings for libraries.
  • Write instructions for coding agents too. A short CLAUDE.md or AGENTS.md with the build and test commands and the project’s conventions saves every agent session from guessing.

Our code documentation best practices go into more detail.

9. Security by Design and DevSecOps

Security by design means building security into every stage of development rather than checking for it at the end. DevSecOps puts that into practice with security checks in the CI/CD pipeline, so every change is scanned and the whole team shares responsibility.

  • Scan code in CI, with static analysis (SAST) on every PR and dynamic testing (DAST) against a running staging app.
  • Watch your dependencies. Dependabot, Renovate or Snyk open PRs when a library you use has a known vulnerability.
  • Threat-model new features. Before building, list how the feature could be abused and plan the defenses, using the OWASP Top 10 as a checklist.
  • Keep secrets out of code by storing keys in a secret manager (HashiCorp Vault, AWS Secrets Manager), and turn on secret scanning so a leaked key is caught at push time.

Microsoft’s Security Development Lifecycle is a well-documented model to borrow from. Every development team there follows its five phases (requirements, design, implementation, verification and release), with training before them and incident response after.

10. Modular Architecture and Design Patterns

Modular architecture splits a system into parts with clear boundaries that can be built, tested and changed independently. Design patterns are proven solutions to problems that recur inside and between those parts.

Modular doesn’t mean microservices. A well-structured monolith with clear internal modules is often the better start, and you can split out services when a part needs to scale or deploy on its own.

  • Draw boundaries around business capabilities, using domain-driven design’s bounded contexts.
  • Define contracts between modules, such as an OpenAPI spec or typed interfaces, so each side can change without breaking the other.
  • Use patterns where they fit, such as layered architecture, adapters for external services and circuit breakers for unreliable dependencies. Don’t add a pattern before you have the problem.
  • Record the decisions in ADRs.

Numbers behind these practices

These are the numbers we’d quote, each with its source. The last row is ours.

Question Answer Source
How big should a pull request be? About 100 lines is usually reasonable, and 1,000 usually too large Google
How fast should a code review come back? Within one business day Google
How long should a CI build take? Ten minutes, as a target Extreme Programming, via Martin Fowler
How long is a sprint? One month or less Scrum Guide
How long is a Daily Scrum? 15 minutes Scrum Guide
Does TDD reduce defects? Pre-release defect density was 40–90% lower across four teams, for 15–35% more initial development time Nagappan et al., 2008
Does pull request size predict review findings? Across 1,232 PRs, our reviewer flagged 11% of those under 100 changed lines and 57% of those with 1,000 to 2,999 Our data

Where to start

Don’t adopt all ten at once. Pick the one that hurts most.

  • If bugs keep reaching production, add tests to CI and practice TDD on the module that breaks most often.
  • If deployments are slow and manual, set up CI on every push, then automate deploys to staging.
  • If nobody knows why the code looks this way, start ADRs and require doc updates in PRs.
  • If every review turns into an argument about style, add a formatter and linter as a required CI check.

What changes when coding agents write the code

Every practice above still applies, and some matter more.

  • Tests become the spec the agent checks itself against. Ask for a failing test first, then the fix. In our repositories, 206 of the 221 bug-fix PRs agents wrote changed a test file.
  • Small PRs still win. An agent can produce 2,000 lines in minutes, and PRs that size are the ones our reviewer flagged most often.
  • CI is the gate. Agent-written code goes through the same pipeline and the same review as anyone’s.
  • Project instructions belong in the repo. Keep CLAUDE.md or AGENTS.md and reusable skills under version control, so every engineer’s agent starts from the same conventions.

In one small team’s 866 agent-written pull requests, coding was 43% of the agents’ session time, and planning and local testing took half. Zest shows which agents, models and skills each engineer uses and what ships.

Frequently asked questions

What are software engineering best practices?

They are the working habits a team agrees on so its code stays correct, readable and safe to change. The ten above run from a Git workflow to modular architecture, and the checklist at the top gives a first step for each.

Which software development best practice should a team start with?

Start with the one that fixes what hurts most today. If bugs reach production, add tests to CI, and if deployments are slow and manual, automate them. When nothing stands out, we’d start with PR size, because in our own data it predicted review findings far better than which model wrote the code.

What software makes sure engineering best practices are followed?

Your Git host and your CI system do most of the work. Branch protection or rulesets require a review and passing checks before a merge, CODEOWNERS sends changes to the right reviewer, formatters and linters run on every PR, and secret scanning catches a leaked key at push time. Whatever you can’t automate belongs in a short checklist kept in the repository.

What are software engineering management best practices?

For a manager, they are about the system around the code: keep CI fast, get reviews answered within a day, make sure decisions get written down, and set time aside to pay down debt. Measure the process for the team instead of ranking individuals. Our developer productivity metrics guide covers which numbers are worth tracking.

What are the planning practices in software engineering?

Planning practices decide what gets built, in what order and how. They include a product backlog ordered by value, Sprint Planning, requirements with testable acceptance criteria, decision records for big choices, and threat modeling before a feature starts.

What are SDLC best practices?

They cover the whole software development life cycle, from testable requirements to monitoring in production. This list is about how code gets written, reviewed and shipped, and 10 SDLC best practices goes through the wider cycle.

What is the KISS principle in software engineering?

KISS stands for “keep it simple, stupid”. Build the simplest thing that solves today’s problem, because every extra layer is more code to read, test and maintain. It’s why the last practice above says not to add a pattern before you have the problem.

What is the 80/20 rule in software engineering?

It’s the Pareto idea applied to software, and the version with data behind it is about defects. Boehm and Basili reported in 2001 that about 80% of defects come from 20% of the modules and about half of the modules are defect-free, with studies putting that 80% anywhere from 60% to 90% (IEEE Computer). In practice, the module that breaks most often deserves your first tests.

What is the 40/20/40 rule in software engineering?

It’s a planning rule of thumb that splits a project’s effort into 40% analysis and design, 20% coding and 40% testing, and the exact split varies by source. For comparison, in the 398 agent-written PRs of ours that reported minutes, coding took 42.7% of session time, local testing 29.0% and planning 21.5%. Those are the agents’ own estimates for one session and not a whole project.

Do these practices still apply when AI writes the code?

Yes, and tests, review and CI matter more, because an agent writes code faster than anyone can read it. Agent-written code should go through the same pipeline and the same review as anyone’s, in small PRs. Our 866-PR analysis has the numbers from our own repositories.

Zest is AI coding analytics for engineering teams: it shows which coding agents, models and skills each engineer uses, what they cost, and which sessions end in merged pull requests. See how Zest works.