Search Sreeni's Insights

Filter by content type
crafting May 12, 2015 6 min read

What is engineering practices and why do we need them?

Engineering practices explained as shared disciplines for building, testing, delivering, and operating software with consistent quality, faster feedback, and safer releases.

Share:

What is engineering practices and why do we need them?

Every software team wants to deliver features faster with good quality. But when the code base is growing and the team is expanding, the speed is slowing down, the bugs are increasing and every release is becoming a stressful event. Mostly, the reason is not the lack of talent, it is the lack of common engineering practices. In this article, we are going to see what is engineering practices, the challenges without them, the key practices which every team should follow and how to start with them.

TL;DR Summary

  • Engineering practices are the agreed ways of working which help the team to build, test and deliver software with consistent quality.
  • Without them, the quality depends on individuals and it doesn’t scale.
  • Key practices are source control and branching, coding standards, code review, unit testing, continuous integration, automated deployment and monitoring.
  • They reduce the defects, shorten the feedback loop and make the releases boring (in a good way).
  • Start small, pick two or three practices and make them a habit before adding more.
  • Measure the impact and improve iteratively.

Challenges

Quality depends on heroes

In many teams, the quality depends on one or two senior developers who know everything. They review every critical change, fix every production issue and know the deployment steps. When they are on leave or leave the company, the team is struggling. It is not sustainable.

Late feedback

Without automated builds and tests, the developer comes to know about the problem only when the tester finds it, sometimes after few weeks. By then, the developer has moved to another feature and needs time to recollect the context. The cost of fixing the defect is increasing with every day it is not found.

Painful releases

When the deployment is manual, with a Word document of 40 steps, every release is a risk. One missed step and the production is down. The team starts to release less often to avoid the pain, which makes each release bigger and even more risky. It is a vicious circle.

Inconsistent code base

When every developer follows his own style, the code base looks like written by ten different teams. Reading and changing the code of another developer takes extra time, and the onboarding of new members is slow.

What is Engineering Practices?

Engineering practices are the set of technical disciplines and agreed ways of working which a software team follows to build, test, deliver and operate the software with consistent quality and speed.

In simple terms, they are the habits of a good team. Just like a good football team practices the passes and set pieces every day, so that during the match it happens automatically, a good software team has practices which happen on every change without anyone needing to remember.

Why we need Engineering Practices?

In order to remove the dependency on heroes, to get feedback early, to make the releases safe and to keep the code base consistent, we need common engineering practices across all teams. It helps us to,

  • find the defects early, when they are cheapest to fix.
  • deliver the features faster and more predictably.
  • reduce the production issues and the MTTR (Mean Time To Resolve).
  • onboard new team members quickly.
  • keep the technical debt under control.

Above all, it gives the confidence to change the code, which is the most important thing for a product which needs to evolve.

Key Engineering Practices

Let us take a closer look at the key practices. Each one is a big topic, and we have dedicated articles for few of them.

The following diagram depicts the engineering practices across the delivery lifecycle.

Engineering practices across the lifecycle: Plan, Code, Review, Build & Test, Deploy, Monitor
Engineering practices across the lifecycle: Plan, Code, Review, Build & Test, Deploy, Monitor

Source control and branching strategy

All code, scripts and configuration must be in source control. Agree a simple branching strategy, i.e. main branch plus short-lived feature branches, so the integration happens frequently. Long-lived branches create big merge conflicts.

Coding standards

Agree the naming conventions, formatting and design guidelines, and write them down. Use tools like StyleCop and Code Analysis to check them automatically. Refer the “Why we need Clean Code?” article for detailed information.

Code review

Every change must be reviewed by at least one other developer before it is merged. Use a checklist to keep it objective. Refer the “Code review checklist for .NET teams” article.

Unit testing and TDD

Write automated unit tests for the business logic. They are the safety net for every change and refactoring. Refer the “How to write unit tests with NUnit and Moq?” article and we will discuss TDD in an upcoming article.

Continuous Integration (CI)

Every commit triggers an automated build which compiles the code and runs the tests. When the build is broken, fixing it is the top priority of the team. We will discuss continuous integration with Visual Studio Online in an upcoming article.

Automated deployment

Deploy with scripts or release tools, not with manual steps. The same package should go to all environments, with only the configuration changed. It makes the deployment repeatable and safe.

Monitoring and logging

Once the application is in production, we need to know whether it is up, performing well and failing or not, before the customers tell us. Log the errors with context and monitor the key metrics.

Managing technical debt

Make the technical debt visible and plan time to pay it back regularly. We will discuss technical debt in an upcoming article.

How to start?

It is tempting to introduce all practices at once, but it will overwhelm the team and most of them will be dropped after few weeks. Here are some few guidelines,

  • Start small. Pick two or three practices which address the biggest pain. For most teams, source control, code review and CI build are a good place to start with.
  • Make it a habit. Practice is only useful when it happens on every change. Add it into the definition of done.
  • Automate. Anything which a tool can check (build, tests, formatting) should be automated, so it doesn’t depend on people remembering.
  • Measure. Track simple metrics like build success rate, number of production defects, deployment frequency and time to fix. Compare them over the period.
  • Lead by example. Senior developers and architects must follow the practices first, otherwise nobody else will.
  • Iterate. Review the practices in retrospectives, keep what works and change what doesn’t.

Note: Engineering practices are not a one-time project. As the team matures and the landscape is expanded with more teams and services, the practices must also evolve, i.e. from manual review checklist to automated static analysis, from nightly build to build on every commit.

Wrap up

In this article, we have looked at the challenges without engineering practices, what is engineering practices, why we need them, the key practices across the delivery lifecycle and how to start with them. I really appreciate that you took the time to read this article and I hope this article provided you some insights into engineering practices. In the next article, I will walk you through what is technical debt and how to manage it.

Related Posts