Failing Faster and Iterating with Modern Software Development Practices

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

内容简介: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!


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

查看所有标签

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

Python标准库

Python标准库

Doug Hellmann / 刘炽 / 机械工业出版社华章公司 / 2012-6-15 / 139.00元

本书由资深Python专家亲自执笔,Python语言的核心开发人员作序推荐,权威性毋庸置疑。 对于程序员而言,标准库与语言本身同样重要,它好比一个百宝箱,能为各种常见的任务提供完美的解决方案,所以本书是所有Python程序员都必备的工具书!本书以案例驱动的方式讲解了标准库中一百多个模块的使用方法(如何工作)和工作原理(为什么要这样工作),比标准库的官方文档更容易理解(一个简单的示例比一份手册......一起来看看 《Python标准库》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具