技术债务_技术债务的10倍解决方案-程序员宅基地

技术标签: python  java  人工智能  物联网  大数据  

技术债务

Case study on an early-stage startup’s React.js front end

早期创业公司React.js前端的案例研究

You blame high technical debt for low velocity. You get asked: How much time do you need to address it? Unknown. But when will you start seeing a tangible improvement in productivity? If you do it right, from day one.

您将技术欠佳归咎于速度慢。 您会被问到: 您需要花多少时间解决? 未知。 但是,什么时候开始看到生产率的切实提高? 如果做得对, 从第一天开始

This is a compilation of practical advice on how to get the fastest, front-loaded ROI during this process.

这是有关如何在此过程中获得最快的前端投资回报率的实用建议的汇总。

明智地选择您的重构战斗 (Choose your refactoring battles wisely)

识别 (Identify)

Use product-driven bugs, new features or change requests as opportunities to identify refactoring candidates.

使用产品驱动的错误,新功能或变更请求作为识别重构候选者的机会。

跟踪 (Track)

Prefer a tool that facilitates communicating this work with the business and provides transparency.

建议使用一种工具来促进与企业的交流,并提供透明度。

划分 (Divide)

You don’t have to refactor modules or even components in full. Break work down to smaller tasks and prioritize separately.

您不必完全重构模块甚至组件。 将工作分解为较小的任务,并分别确定优先级。

The same principle applies for new code too; it doesn’t have to be “state of the art”, it’s okay to reuse patterns that you are planning to change but not just yet.

同样的原则也适用于新代码。 它不必一定是“最新技术” ,也可以重用您打算改变的模式,而不仅仅是现在。

优先排序 (Prioritize)

Some of the parameters you’ll need to consider:

您需要考虑的一些参数:

  1. The frequency of change requests

    变更请求的频率

    If a certain feature is not frequently touched, the value in refactoring it, is minimal.

    如果不经常触摸某个功能,则重构它的价值将很小。

  2. The product roadmap

    产品路线图

    Refactoring a soon to be a deprecated module, even if it’s frequently changed, could be mostly a throwaway.

    即使将其频繁更改,将很快重构为已弃用的模块也可能会很容易被丢弃。

  3. Onboarding and mentoring

    入职和指导

    New developers tend to follow patterns found in the existing codebase; this is acceptable and desirable. Removing code smells from modules that you use as a reference can save you and your team time.

    新的开发人员倾向于遵循现有代码库中的模式。 这是可以接受和期望的。 从用作参考的模块中消除代码异味可以节省您和团队的时间。

  4. The cost of identifying, tracking, and prioritizing itself

    识别,跟踪和确定自身优先级的成本

    If you see a quick win, it’s better to go for it immediately and avoid the overhead of re-identifying, tracking, and communicating the issue. Just be sure it is indeed quick.

    如果您看到了捷径,最好立即采取行动,避免重新识别,跟踪和传达问题的开销。 只要确保确实如此即可。

  5. Future technical debt

    未来技术债务

    Adapting to an evolving product and new technology, or even to your own improved skills and domain knowledge means that regardless of how much thought you put on a design today, you are also introducing the technical debt of tomorrow. Avoid refactoring something until you see clear value in doing so.

    适应不断发展的产品和新技术,甚至适应您自己提高的技能和领域知识,意味着无论您今天对设计有多大的想法,都在介绍明天的技术债务。 避免重构,直到您看到这样做的明显价值为止。

Our phase 1 refactoring was a mix of critical architectural issues (e.g. extensive prop drilling — poor component wiring), quick wins (e.g. converting magic numbers to semantically named constants), and building the most commonly used core components (buttons, form fields, etc).

我们的第1阶段重构是混合了关键的架构问题(例如,广泛的道具钻Kong-不良的组件布线),快速的胜利(例如,将魔术数字转换为语义上命名的常量)以及构建最常用的核心组件(按钮,表单字段等) )。

Looking for some quick wins? Here’re 5 good tips that mostly aim to reduce cognitive complexity.

寻找一些快速的胜利? 这里有5条很好的技巧 ,主要旨在降低认知的复杂性。

回归分析 (Regressions)

You’ll often hear that to refactor some code, you should start by covering its functionality with automated tests first (if there aren’t any). We couldn’t do this. A trick to mitigate the risk of regressions is to always combine refactoring with some product-driven work. Then QA and UAT for that work will naturally cover the refactored code too.

您经常会听到,为了重构某些代码,您应该首先使用自动化测试(如果没有的话)介绍其功能。 我们做不到。 减轻回归风险的一种技巧是始终将重构与某些产品驱动的工作结合在一起。 然后,这项工作的QA和UAT也自然会涵盖重构的代码。

测试覆盖面不止一个数字 (Test coverage is more than a number)

Going from 0% to optimal test coverage takes time. During this journey, whatever your coverage is, make it as worthwhile as possible. Here’s how:

从0%达到最佳测试覆盖率需要时间。 在此过程中,无论您的覆盖范围是什么,都应尽可能使它值得。 这是如何做:

从集成测试开始 (Start with integration tests)

They will cover larger areas of functionality more quickly and provide you with more confidence. Read Kent C. Dodds’ blog for more best practices in testing.

它们将更快地覆盖更大的功能区域,并为您提供更多的信心。 阅读Kent C. Dodds的博客 ,了解更多测试最佳实践。

优先确定应首先测试哪些组件 (Prioritize which components should be tested first)

Some things to consider:

要考虑的一些事情:

  1. Complexity

    复杂

    Overly complex components are more susceptible to regressions.

    过于复杂的组件更易于回归。

  2. How popular is the user journey that the component belongs to?

    该组件所属的用户旅程有多受欢迎?

    A regression that manifests during a very common user journey can quickly and severely hurt the product’s credibility.

    在非常普通的用户旅程中出现的回归可能会Swift严重损害产品的信誉。

  3. Business-specific importance factors

    特定于业务的重要因素

    If an admin-only platform configuration form is the first thing a user does when evaluating your product, although it doesn’t affect many users, it still could be relatively high-priority.

    如果用户在评估产品时首先要做的是仅管理员平台配置表单,尽管它不会影响很多用户,但它的优先级仍然较高。

  4. Previous regressionsUsers are less forgiving when it comes to repetitive issues on things that they have already brought to your attention. The rule of thumb is that you should write tests asserting every bug fix you deploy.

    以前的回归对于涉及已引起您注意的问题的重复性问题,用户不太宽容。 经验法则是,您应该编写测试来断言所部署的每个错误修复程序。

Image for post
Our most complex components — not all of them belong to popular user journeys
我们最复杂的组件-并非全部都属于流行的用户旅程

监控与测量 (Monitor and Measure)

Yes! If you’re doing this right, your team velocity should be increasing every day and after a few months, the improvement should be significant.

是! 如果您做对了,您的团队速度应该每天都在增加,几个月后,改善应该是显着的。

If you really want to see the debt reduction progress in numbers, you can set up some tools, besides the test coverage report, that monitor the health of your codebase. This could also reinforce the business’s confidence in your approach.

如果您确实希望看到减少债务的进度,可以设置一些工具,除了测试覆盖率报告以外,还可以监视代码库的运行状况。 这也可以增强企业对您的方法的信心。

We’re using both the CodeClimate CLI and SonarQube. Both of these tools come with specific suggestions about what should be refactored, however, we mostly use them to get summaries and check how the code quality is trending over time.

我们同时使用CodeClimate CLI和SonarQube。 这两个工具都带有有关应重构内容的具体建议,但是,我们大多使用它们来获取摘要并检查代码质量随时间的变化趋势。

Image for post
Our Test Coverage & Code Climate report history
我们的测试范围和代码气候报告的历史记录

We went from 1490 issues in February 2019 to 786 in May 2020 (-47%). The results are even more impressive if we focus only on those categorized as “Major” (-57%). Note that despite the continuous development of new features, the total lines are down by 18%, which is another by-product of the ongoing refactoring.

我们从2019年2月的1490期增加到2020年5月的786期(-47%)。 如果我们只关注那些被归类为“主要”(-57%)的结果,结果将更加令人印象深刻。 请注意,尽管不断开发新功能,但总行数却下降了18%,这是正在进行的重构的另一个副产品。

外卖 (Takeaways)

优先,优先,优先。 (Prioritize, prioritize, prioritize.)

Addressing your technical debt means that you’re working today on improving your tomorrow’s productivity. In this context, timing is more important than anything else.

解决您的技术债务意味着您正在努力提高明天的生产率。 在这种情况下, 计时比什么都重要。

翻译自: https://medium.com/swlh/technical-debt-the-10x-way-of-addressing-it-9669dcec6190

技术债务

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_26705651/article/details/108915457

智能推荐

使用nginx解决浏览器跨域问题_nginx不停的xhr-程序员宅基地

文章浏览阅读1k次。通过使用ajax方法跨域请求是浏览器所不允许的,浏览器出于安全考虑是禁止的。警告信息如下:不过jQuery对跨域问题也有解决方案,使用jsonp的方式解决,方法如下:$.ajax({ async:false, url: 'http://www.mysite.com/demo.do', // 跨域URL ty..._nginx不停的xhr

在 Oracle 中配置 extproc 以访问 ST_Geometry-程序员宅基地

文章浏览阅读2k次。关于在 Oracle 中配置 extproc 以访问 ST_Geometry,也就是我们所说的 使用空间SQL 的方法,官方文档链接如下。http://desktop.arcgis.com/zh-cn/arcmap/latest/manage-data/gdbs-in-oracle/configure-oracle-extproc.htm其实简单总结一下,主要就分为以下几个步骤。..._extproc

Linux C++ gbk转为utf-8_linux c++ gbk->utf8-程序员宅基地

文章浏览阅读1.5w次。linux下没有上面的两个函数,需要使用函数 mbstowcs和wcstombsmbstowcs将多字节编码转换为宽字节编码wcstombs将宽字节编码转换为多字节编码这两个函数,转换过程中受到系统编码类型的影响,需要通过设置来设定转换前和转换后的编码类型。通过函数setlocale进行系统编码的设置。linux下输入命名locale -a查看系统支持的编码_linux c++ gbk->utf8

IMP-00009: 导出文件异常结束-程序员宅基地

文章浏览阅读750次。今天准备从生产库向测试库进行数据导入,结果在imp导入的时候遇到“ IMP-00009:导出文件异常结束” 错误,google一下,发现可能有如下原因导致imp的数据太大,没有写buffer和commit两个数据库字符集不同从低版本exp的dmp文件,向高版本imp导出的dmp文件出错传输dmp文件时,文件损坏解决办法:imp时指定..._imp-00009导出文件异常结束

python程序员需要深入掌握的技能_Python用数据说明程序员需要掌握的技能-程序员宅基地

文章浏览阅读143次。当下是一个大数据的时代,各个行业都离不开数据的支持。因此,网络爬虫就应运而生。网络爬虫当下最为火热的是Python,Python开发爬虫相对简单,而且功能库相当完善,力压众多开发语言。本次教程我们爬取前程无忧的招聘信息来分析Python程序员需要掌握那些编程技术。首先在谷歌浏览器打开前程无忧的首页,按F12打开浏览器的开发者工具。浏览器开发者工具是用于捕捉网站的请求信息,通过分析请求信息可以了解请..._初级python程序员能力要求

Spring @Service生成bean名称的规则(当类的名字是以两个或以上的大写字母开头的话,bean的名字会与类名保持一致)_@service beanname-程序员宅基地

文章浏览阅读7.6k次,点赞2次,收藏6次。@Service标注的bean,类名:ABDemoService查看源码后发现,原来是经过一个特殊处理:当类的名字是以两个或以上的大写字母开头的话,bean的名字会与类名保持一致public class AnnotationBeanNameGenerator implements BeanNameGenerator { private static final String C..._@service beanname

随便推点

二叉树的各种创建方法_二叉树的建立-程序员宅基地

文章浏览阅读6.9w次,点赞73次,收藏463次。1.前序创建#include<stdio.h>#include<string.h>#include<stdlib.h>#include<malloc.h>#include<iostream>#include<stack>#include<queue>using namespace std;typed_二叉树的建立

解决asp.net导出excel时中文文件名乱码_asp.net utf8 导出中文字符乱码-程序员宅基地

文章浏览阅读7.1k次。在Asp.net上使用Excel导出功能,如果文件名出现中文,便会以乱码视之。 解决方法: fileName = HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8);_asp.net utf8 导出中文字符乱码

笔记-编译原理-实验一-词法分析器设计_对pl/0作以下修改扩充。增加单词-程序员宅基地

文章浏览阅读2.1k次,点赞4次,收藏23次。第一次实验 词法分析实验报告设计思想词法分析的主要任务是根据文法的词汇表以及对应约定的编码进行一定的识别,找出文件中所有的合法的单词,并给出一定的信息作为最后的结果,用于后续语法分析程序的使用;本实验针对 PL/0 语言 的文法、词汇表编写一个词法分析程序,对于每个单词根据词汇表输出: (单词种类, 单词的值) 二元对。词汇表:种别编码单词符号助记符0beginb..._对pl/0作以下修改扩充。增加单词

android adb shell 权限,android adb shell权限被拒绝-程序员宅基地

文章浏览阅读773次。我在使用adb.exe时遇到了麻烦.我想使用与bash相同的adb.exe shell提示符,所以我决定更改默认的bash二进制文件(当然二进制文件是交叉编译的,一切都很完美)更改bash二进制文件遵循以下顺序> adb remount> adb push bash / system / bin /> adb shell> cd / system / bin> chm..._adb shell mv 权限

投影仪-相机标定_相机-投影仪标定-程序员宅基地

文章浏览阅读6.8k次,点赞12次,收藏125次。1. 单目相机标定引言相机标定已经研究多年,标定的算法可以分为基于摄影测量的标定和自标定。其中,应用最为广泛的还是张正友标定法。这是一种简单灵活、高鲁棒性、低成本的相机标定算法。仅需要一台相机和一块平面标定板构建相机标定系统,在标定过程中,相机拍摄多个角度下(至少两个角度,推荐10~20个角度)的标定板图像(相机和标定板都可以移动),即可对相机的内外参数进行标定。下面介绍张氏标定法(以下也这么称呼)的原理。原理相机模型和单应矩阵相机标定,就是对相机的内外参数进行计算的过程,从而得到物体到图像的投影_相机-投影仪标定

Wayland架构、渲染、硬件支持-程序员宅基地

文章浏览阅读2.2k次。文章目录Wayland 架构Wayland 渲染Wayland的 硬件支持简 述: 翻译一篇关于和 wayland 有关的技术文章, 其英文标题为Wayland Architecture .Wayland 架构若是想要更好的理解 Wayland 架构及其与 X (X11 or X Window System) 结构;一种很好的方法是将事件从输入设备就开始跟踪, 查看期间所有的屏幕上出现的变化。这就是我们现在对 X 的理解。 内核是从一个输入设备中获取一个事件,并通过 evdev 输入_wayland

推荐文章

热门文章

相关标签