- why refactor?
-
-
Refactoring makes your organization’s code simpler, which means fewer bugs and easier maintenance.
-
If you have fewer code lines, you will have fewer potential bugs
-
Simpler code enables technical agility,Technical agility enables business agility
-
- how to refactor?
-
-
TDD TDD is an iterative process or a three-step dance—red, green, refactor
-
instead of doing a single large refactoring, doing a series of smaller microrefactorings
-
DRY-Don‘t Repeat Yourself
-
- TDD three-step—red, green, refactor
-
-
Write a new test for that new feature; of course, the code will fail the test because the feature doesn’t work yet. TDD says the test has gone red.
-
Write Java code to implement the new feature until the new test passes. All the other tests must continue passing as well. This means the tests have gone green.
-
Clean up and improve the production code by refactoring the code, which results in better code. All the tests must continue to pass.
-
- code kata
-
-
kata is a series of movements that you do regularly. You repeat your actions so many times that the body builds muscle memory. Without thinking about them, you will execute the moves.
-
- what’s technical debt?
-
-
Technical debt is code with problems that can be improved with refactoring or code without automated tests
-
- the interest payments
-
-
the biggest cost is lost of technecal agility,and then lose the business technecal
-
- why is technical debt a problem?
-
-
taking the time to fix the code to improve technical and business agility
-
- how to do?
-
-
using test-refactor-add methodology for working with legacy code
-
- step
-
-
Add pin-down tests. They will help you understand the legacy code’s external behavior, and they will also pin down the code’s behavior so that if something breaks, you’ll know it.
-
Discover more behaviors with code coverage tools
-
Testing if/else statements by branch coverage
-
Refactor
-
Add the new feature
-
- what is the goal?
-
-
the point of the kata is not arriving at a correct answer. The point is the stuff you learn along the way. The goal is the practice, not the solution.
-
- what’s crud?
-
-
create,read,update,delete
-
org.springframework.util.ObjectUtils.isEmpty
支持Optional、Array、CharSequence、Collection、Map
spring 序列化json,会去掉is字段 isDailyRule → dailyRule
200+条数据 文档也很简单,但是存储占用空间很大 一个分片300M,原因是频繁写入,es删除有延迟
ctrl + h 查看类的层次 https://blog.csdn.net/ljc1026774829/article/details/80493767
AsciidocFx的默认字体不支持导出pdf中的中文字体,解决方法是在导出pdf时选择一种支持中文的字体。
修改/conf/docbook-config/fo-pdf.xsl
-
Add some font that can display Chinese into <xsl:template name="pickfont-symbol">. Some supported fonts are Arial Unicode MS, SimSun, SimHei, KaiTi. It seems bold font does not work for SimSun, SimHei, KaiTi.
-
Uncomment <xsl:param name="symbol.font.family">.