Python测试驱动开发

[英] 哈利 • J.W. 帕西瓦尔

出版时间

2018-06-30

ISBN

9787115485571

评分

★★★★★
AI导读
核心看点
  • 以Django项目为例,详解Python测试驱动开发全流程
  • 涵盖功能测试与单元测试,讲解由外而内的开发策略
  • 深入探讨模拟技术、持续集成及第三方系统整合
适合谁读
  • 希望掌握TDD方法论的Python开发者
  • 从事Django Web开发的后端工程师
  • 关注代码质量与自动化测试的程序员
读前提醒
  • 建议同步运行代码,体验红绿重构的TDD循环
  • 需具备Python基础及Django框架入门知识
  • 注意区分功能测试与单元测试的不同应用场景
读者共识
  • 步骤清晰逻辑严密,适合初学者建立测试思维
  • 内容偏向Web开发,纯TDD理论讲解相对较少
  • 翻译质量一般,部分表述略显啰嗦晦涩

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "Do you know why the Django mascot is a pony? The story is that Django comes with so many things you want: an ORM, all sorts of middleware, the admin site … "What else do you want, a pony?" Well, Gunicorn stands for "Green Unicorn", which I guess is what you’d want next if you already had a pony…"
  • "On the Pros and Cons of Different Types of Test, and Decoupling ORM code Functional tests Provide the best guarantee that your application really works correctly, from the point of view of the user. But: it’s a slower feedback cycle, And they don’t necessarily help you write clean code. Integrated t"
  • "So one way of getting what we want is to try and minimise the amount of our code that has to deal with boundaries. Then we test our core business logic with isolated tests and test our integration points with integrated tests."
  • "Functional tests should help you build an application with the right functionality, and guarantee you never accidentally break it. Unit tests should help you to write code that’s clean and bug free."
  • "We can start to settle into the TDD unit-test/code cycle now: 1. In the terminal, run the unit tests and see how they fail. 2. In the editor, make a minimal code change to address the current test failure. And repeat!"
  • "Kent Beck (who basically invented TDD) uses the metaphor of lifting a bucket of water out of a well with a rope: when the well isn’t too deep, and the bucket isn’t very full, it’s easy. And even lifting a full bucket is pretty easy at first. But after a while, you’re going to get tired. TDD is like "
  • "In general, one of the rules of unit testing is Don’t test constants, and testing HTML as text is a lot like testing a constant."
  • "Good unit testing practice says that each test should only test one thing. The reason is that it makes it easier to track down bugs. Having multiple assertions in a test means that, if the test fails on an early assertion, you don’t know what the status of the later assertions is."
作者简介
哈利·J.W. 帕西瓦尔(Harry J.W. Percival) TDD积极践行者,曾参与开发电子制作表软件先驱Resolver One;目前就职于PythonAnywhere公司,经常受邀参加TDD和Python开发主题演讲、研讨会和开发者大会;取得了利物浦大学计算机科学硕士学位和剑桥大学哲学硕士学位。
目录
前言  xv
准备工作和应具备的知识  xxi
配套视频  xxviii
致谢  xxix
第一部分 TDD和Django基础

显示全部
用户评论
测试驱动开发用于django的前后端全栈开发。
2020.06.13 kindle
过了一遍,我倒是希望作者讲TDD,就不要讲过多的django和web.
通过这熟悉了一下web开发和远程部署,对这有了个概念。之前听说19年nginx作者因为和公司的版权纠纷被抓进去了,那会还不知道nginx这么牛批...
理念很好,但是太啰嗦了,另外翻译回来的,感觉语言有点奇怪。没看下去
下载
收藏