1. Algorithm 一道算法题
本周算法题为验证二叉搜索树
本题重点在于使用递归解决问题时,设置上下界的方式比较有特点,但是论直观还是直接中序遍历看结果是否有序更简单
2. Review 阅读一篇英文文章
接下来开始学习 xUnit.Test.Patterns.Refactoring.Test.Code.May.2007,这是一本主要介绍单测以及如何实现 TDD 的书籍,希望能够学习完成并能有所收获
There are a lot of principles, patterns, and smells in this book—and even more pat- terns that couldn’t fit into the book. Do you need to learn them all? Do you need to use them all? Probably not! This chapter provides an abbreviated introduction to the bulk of the material in the entire book. You can use it as a quick tour of the material before diving into particular patterns or smells of interest. You can also use it as a warm-up before exploring the more detailed narrative chapters.
在本书中有很多的原则、模式以及 smell(代码的坏味道?),绅士还有很多无法包含在本书中的模式,你需要全部学习吗?我想是不需要的!本章提供了对于整本书精简的介绍,你可以通过它在进行深入学习前对材料快速浏览,你也可以在详细学习其他章节前做一个整体把握(热身)
The Simplest Test Automation Strategy That Could Possibly Work
可能可行的最简单的自动化测试策略
There is a simple test automation strategy that will work for many, many projects. This section describes this minimal test strategy. The principles, patterns, and smells referenced here are the core patterns that will serve us well in the long run. If we learn to apply them effectively, we will probably be successful in our test automation endeavors. If we find that we really cannot make the minimal test strategy work on our project by using these patterns, we can fall back to the alternative patterns listed in the full descriptions of these patterns and in the other narratives.
对于很多项目而言有一个简单的自动化测试策略,本小姐描述了这种最小化的测试策略。此处提及的原则、模式、smell 是将长远来看对我们有帮助的核心模式。如果我们能有效的运用他们,我们将在我们的自动化努力中取得成功。如果发现我们无法在项目中使用最小化测试策略,我们可以退回到在这些模式的完整描述和其他描述中列出的备选模式
I have laid out this simple strategy in five parts:
我将简单的策略分为以下 5 个步骤:
- Development Process: How the process we use to develop the code affects our tests.
开发过程:我们用来开发代码的过程如何影响我们的测试
- Customer Tests: The first tests we should write as the ultimate definition of “what done looks like.”
客户测试:我们应该最先写的测试是“完成应该是怎样的”的最终定义
- Unit Tests: The tests that help our design emerge incrementally and ensure that all our code is tested.
单元测试:这些测试有助于我们逐步形成设计,并确保所有的代码都经过了测试。
- Design for Testability: The patterns that make our design easier to test, thereby reducing the cost of test automation.
可测试性设计:这些模式使我们的设计更易于测试,从而降低了测试自动化的成本。
- Test Organization: How we can organize our Test Methods (page 348)and Testcase Classes (page 373). Development Process
测试组织:我们如何组织我们的测试方法(第348页)和测试用例类(第373页)开发过程。
3. Techniques/Tips 分享一个小技巧
MySQL 中对于更新有 change buffer 可以提升性能,原理是对于非聚簇索引而言,可以将更新先还缓存到 change buffer,等后续进行 purge 将数据真正写回磁盘,注意,change buffer 只对二级索引有效,并且只对非唯一索引有效
4. Share 分享一个观点
学习 MySQL 可以参考极客时间的 MySQL 45 讲,这个专题是我目前找到的对于学习 MySQL 最有帮助的资料,老师的文章写的很直白,网友的讨论更加精彩,看完后对于 MySQL 有了质的提升,墙裂推荐