代码
调试技术
数据库
- 《Getting started with impala》
- 《mysql 必知必会》
- 《mysql 性能调优与架构实践》
- 《Mysql 技术内幕 InnoDB 存储引擎》
- 《Redis 实战》
- 《Redis 深度历险核心原理和应用实践》
- 《redis设计与实现》
- 《七周七数据库》
- 《深入浅出mysql》
- 《高性能mysql第三版》
- 《MySQL是怎样运行的》
前端
GOLANG
- 《1 The Go Programming Language》
- 《2 The Go Programming Language》
- 《3 The Go Programming Language》
- 《Build Web Application With Golang》
- 《Go101》
- 《Network Programming with go》
- 《Building Microservices With Go》
- 《Building Restful Web Services with Go》
- 《Concurrency In Go》
- 《Go In Action(Go 实战)》
- 《Go学习笔记语言详解》
- 《Go学习笔记源码剖析》
- 《Go语言编程》
JAVA
网络
心理学
PYTHON
创业
UNIX/LINUX
分布式
系统设计
搜索引擎
开发工具
- 《Practical Vim》
- 《Vim8文本处理实战》
- 《Learn vim scrpt the hard way》
- 《Pro Git》
- 《Mastering Vim》
- 《Mastering Vim Quickly》
思维
源码
网站架构微服务
- 《微服务架构设计模式》
- 《从0开始学架构》
- 《web scalavility for startup engineers》
- 《designdatainstensive_application》
- 《designdatainstensive_application2》
- 《clean_architecture》
- 《微服务实战》
- 《微服务设计》
软件工程/项目管理
运维
金融理财
写作
互联网
区块链
技术演讲网课
- 《哔哩哔哩的go微服务实战》
- 《go业务基础库之Error&Context》
- 《Go同步和并发设计模式》
- 《300分钟吃透分布式缓存》
- 《DDD实战课》
- 《分布式技术原理与实战45讲》
- 《架构设计面试精讲》
- 《高并发系统设计40问》
- 《java并发编程78讲》
- 《中间件核心技术与实战讲》
职场
《Work with legacy code》
Part1 The Mechanics of Change
1.Changing Software
Four primary ressons: 1. Adding a feature 2. Fixing a bug. 3. Improving the design 4. Optmmizing resoource usage
structure, functionality, resource usage
ask three questions: 1. What chagnes do we have to make? 2. How will we know that we've doen them correctly? 3. How will we know that we have't broken anything?
2. Working with Feedback
Changes in a system 2 ways: Edit and Pray: Cover and Modify: tests
The legacy code change algorith: 1. Identify change points. 2. Find test points. 3. Break dependencies. 4. Write tests. 5. Make changes and refactor.
3. Sensing and Sepatation
fake objects mock objects
4.The Seam Model
5. Tools
Mock Objects Unit-Tesiting Harnesses
Part2 The Mechanics of Change
6. Don't Have Much Time and I Have to Change It
Sprout method
7. It Takes Forever to make a change
减少依赖
8. How Do I Add a Feature?
TDD: Programming by Difference
9. I Can't get this class into a test Harness
恼人的参数:如果构造函数的参数依赖其他对象, 可以通过构造fake对象作为参数传入,通过继承原对象并用空方法复写父类。 隐藏的依赖:不要在函数里隐藏依赖, 最好用函数参数的形式传入。 如果隐藏依赖过多,穿参数会导致大量参数,可以使用方法替换掉内部的实例变量。setter方法 全局依赖:对于单例模式等class,可以使用静态setter函数
11.I need to Make a Change, WHat methods should I test?
找到会受影响的代码
12.I need to make many changes in one Area. Do I have to break dependices for all the classes involved.
Interception Points: 由变更点决定。 把Interception point作为封装的边界
13. I need to make a change, but i don't know what tests to write.
Characterization test.
14. Dependencies on Libraies are killing me.
15. My application is all api callls
Responsibiliy-based extraction
16.I don't understand the code well enough to change it
Notes(Sketching): 通过画图和做笔记的形式理解代码,画出之间的连接和关系。 Lising Markup: Separating Responsibilities; Understanding Method Structure; Extract Methods; Understand the Errects of a change. Scratch Refacting: Deleted Unused code
17. My Application Has no structure
Telling the Story of the system: 互相解说 Naked CRC: Class, Responsiblity and Collaborations. 1. Cards represent instances, not clases. 2. Overlap cards to show a collection of them Conversation srutiny:
18. My Test Code is in the way
Class Naming Conventions: 对于测试类和Fake类通过后缀或者前缀来区别。 Test Location:
19. My Project is not Object Oriented. How do I make changes ?
通过预处理器宏添加测试 Adding New Behavior:
20. This class is Too big and I don't want it to get any bigger
不要写过大(方法太多)的类,会导致混淆、 Single-Responsibility Principle(SRP): It should have a single purpose in the system, and there should be only one reason to change it 。如何确定职责?功能相近的应该有类似后缀,根据功能划分。() Seeing Responsibilities: - 1. Group Methods(写出所有方法名和访问权限) - 2. Look at Hidden Methods - 3. Look for Deciions that can change. - 4. Look for internal relationships(写出所有变量和方法使用的变量,画出调用关系,根据把调用关系分成的几个大区域来拆分class). - 5. Look for the primary responsibility.(尝试使用一句话描述类的职责) 接口隔离原则 - 6. When all else fails, do some scratch refactoring - 7. Focus on the current work.
21. I'm Changing the same code all over the place
开闭原则
22. I need to change a Monster method and I can't wirte tests for it
Varieties of Monster: Bullete Methods(没有缩进); Snarled methods(单一大块代码段); Tackling Monsters with automated refactoring support: - To separate logic from awkward dependencies - To introduce seams that make it easier to get tests in place for more refactoring
The manual refactoring challenge:
22. How Do I know That I'm Not Breaking Anything?
Hyperaware Editing Single-Goal Editing: doing one thing at a time Proserve Signatures Lean on the Compiler Pair Programming
24. We Feel Overwhelmed, It Isn't going to Get any better.
Finding what motivates you 如果因为代码质量团队士气低:找到最丑的代码类,然后让测试覆盖它。
25. Dependency-Breaking Techniques
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论