Failing Faster and Iterating with Modern Software Development Practices

栏目: IT技术 · 发布时间: 4年前

内容简介:Using modern software development practices enable us to find and fix bugs faster and iterate. This post offers a primer into some of these modern practices.Use version control on your code (e.g., git). This allows for mobility, collaboration, backup, and

Using modern software development practices enable us to find and fix bugs faster and iterate. This post offers a primer into some of these modern practices.

1. Version Control

Failing Faster and Iterating with Modern Software Development Practices

Use version control on your code (e.g., git). This allows for mobility, collaboration, backup, and enables all sorts of other modern web development practices.

How version control helps you fail faster and iterate

Version control enables pretty much all other quality control measures. It allows you to implement hooks to force things like code testing and linting when you push your code remote repositories. You can hook your code repository up to Continuous Integration servers. The bottom line: modern software development starts at version control!

2. Automated Testing

Failing Faster and Iterating with Modern Software Development Practices

Automated testing allows you to develop with confidence. They serve as a form of documentation as they assert what your app should do. Automated testing also helps you refactor without fear since you are relatively confident in your new code if tests pass.

How automated testing helps you fail faster and iterate

You can write your code and "smoke test" it, meaning you try playing with your app a bit to make sure it works right. But how do you know your users won't hit a weird edge case that blows up the app? You don't, but you can help mitigate this concern by writing automated tests. Once written, these tests live forever, meaning less concern about software regression since your exists tests will (hopefully) fail if your code regresses.

As a bonus, you can use version control hooks and/or Continuous Integration to require your tests to pass before you can move forward in deploying your code.

3. Continuous Integration

Failing Faster and Iterating with Modern Software Development Practices

CI allows you to merge your code into a single repository frequently. A CI server can run automated tests and other checks to make sure your code is ready to be merged and, in conjunction with your version control service, can be a quality gate.

How CI helps you fail faster and iterate

When you push your code to a remote repository, you can know immediately if your quality measures (e.g., tests, linting) have failed. This is a whole lot better than finding out because a user has emailed you that something is broken!

4. Continuous Delivery/Deployment

Failing Faster and Iterating with Modern Software Development Practices

Continuous delivery means you continuously deliver new code into a releasable state, ready to be sent to production at the click of a button. Continuous deployment goes one step further and deploys code, usually as soon as it's merged into a branch.

How CD helps you fail faster and iterate

Making it easy to integrate really small changes into your production environent is critical for iterating. The truth is that you will merge some breaking changes into production. Software development is error prone and we all ship bugs. However, if we ship really small chunks of code to production, our lives become much easier when we eventually do ship a bug. First, if you need to revert your production code, it's much easier to do so with a very small change set. Second, when you need to figure out what went wrong, you have a pretty small amount of code to investigate. It's much easier to find a bug in a couple days worth of code than a couple months worth of code!

5. Intellisense and Linting

Failing Faster and Iterating with Modern Software Development Practices

Use a code editor that has language services for your language. Ideally it provides autocomplete and lints your code. It highlights any compilation, syntax, and lint rule issues real-time as you're writing code.

How intellisense and linting helps you fail faster and iterate

Features like autocomplete and code highlighting eliminates a lot of bugs as you write them . This may be the fastest way to fail and therefore it might be the most important item on the list! Linting keeps your code consistently-formatted, which makes it a lot easier to read for things like code review and facilitates identifying bugs.

6. Feature Flagging

Failing Faster and Iterating with Modern Software Development Practices

Feature flags are variables in your code that hide functionality that's in development from your users. It allows you to keep releasing code as new features are mid-development, meaning those features don't block continuous delivery.

How feature flagging helps you fail faster and iterate

Releasing constantly is a cornerstone of failing faster. Without feature flags, we might hold off on shipping code for a while because we don't want to ship a half-baked feature. Feature flags let us ship constantly without worrying about these not-quite-done features!

7. Instrumentation and Monitoring

Failing Faster and Iterating with Modern Software Development Practices

Use a service like New Relic or Datadog that monitors your app for errors. Set up notification thresholds that notify you or your team when a particularly high number of errors are encountered.

How instrumentation and monitoring helps you fail faster and iterate

Let's say we ship a change that causes our web server to start spewing 500-level errors. We don't necessarily want to wait until a bunch of users complain—monitoring tools let us know immediately when we're getting a high level of abnormal responses. We can then investigate and mitigate the situation before too many users are affected.

8. Containerization

Failing Faster and Iterating with Modern Software Development Practices

Reduce concerns about different environments and simplify deployments by using a containerization service (e.g., Docker). If an app can run locally in a Docker container, it can run deployed on a server as a Docker container.

How containerization helps you fail faster and iterate

Containerization allows us to be working locally in an environment (pretty much) identical to our deployment. This increases the chances that we detect any environment-related issues locally rather than in our production environment. We like figuring out issues locally rather than in production.

Conclusion

Failing faster enables us to find and fix bugs faster and ship higher quality code. We should all aspire to ship better higher quality code and ensure a better experience for our users!


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Haskell函数式编程基础

Haskell函数式编程基础

Simon Thompson / 科学出版社 / 2013-7-1 / 129.00

《Haskell函数式编程基础(第3版)》是一本非常优秀的Haskell函数式程序设计的入门书,各章依次介绍函数式程序设计的基本概念、编译器和解释器、函数的各种定义方式、简单程序的构造、多态和高阶函数、诸如数组和列表的结构化数据、列表上的原始递归和推理、输入输出的控制处理、类型分类与检测方法、代数数据类型、抽象数据类型、惰性计算等内容。书中包含大量的实例和习题,注重程序测试、程序证明和问题求解,易......一起来看看 《Haskell函数式编程基础》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具