Artwork

内容由iteration podcast, John Jacob, and JP Sio - Web Developers提供。所有播客内容(包括剧集、图形和播客描述)均由 iteration podcast, John Jacob, and JP Sio - Web Developers 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal
Player FM -播客应用
使用Player FM应用程序离线!

Building Tests

38:37
 
分享
 

Manage episode 237182639 series 1900125
内容由iteration podcast, John Jacob, and JP Sio - Web Developers提供。所有播客内容(包括剧集、图形和播客描述)均由 iteration podcast, John Jacob, and JP Sio - Web Developers 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal

Chapter 4 - Building Tests

To do refactoring properly, I need a solid suite of tests to spot my inevitable mistakes.

The Value of Self-Testing Code

  • make sure all tests are fully automatic and that they check their own results
  • a suite of tests is a powerful bug detector that decapitates the time it takes to find bugs

If you want to refactor, you have to write tests

A First Test

  • simplicity of feedback from tests. just dots
  • personally like verbose test output

Add Another Test

Testing should be risk driven; remember, I'm trying to find bugs, now or in the future. Therefore I don't test accessor methods that just read and write a field. They are so simple that I'm not likely to find a bug there.

My focus is to test areas that I'm most worried about going wrong.

Probing the Boundaries

  • Seeing what happens when things go wrong

Whenever I have a collection of something, ... I like to see what happens when it's empty

  • What happens when negative numbers are passed to a function that expects positive numbers? Division by zero?
    How do you probe boundaries?

Much More Than This

When you get a bug report, start by writing a unit test that exposes the bug


Picks

  • JP: Taking time off
  continue reading

78集单集

Artwork

Building Tests

iteration

113 subscribers

published

icon分享
 
Manage episode 237182639 series 1900125
内容由iteration podcast, John Jacob, and JP Sio - Web Developers提供。所有播客内容(包括剧集、图形和播客描述)均由 iteration podcast, John Jacob, and JP Sio - Web Developers 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal

Chapter 4 - Building Tests

To do refactoring properly, I need a solid suite of tests to spot my inevitable mistakes.

The Value of Self-Testing Code

  • make sure all tests are fully automatic and that they check their own results
  • a suite of tests is a powerful bug detector that decapitates the time it takes to find bugs

If you want to refactor, you have to write tests

A First Test

  • simplicity of feedback from tests. just dots
  • personally like verbose test output

Add Another Test

Testing should be risk driven; remember, I'm trying to find bugs, now or in the future. Therefore I don't test accessor methods that just read and write a field. They are so simple that I'm not likely to find a bug there.

My focus is to test areas that I'm most worried about going wrong.

Probing the Boundaries

  • Seeing what happens when things go wrong

Whenever I have a collection of something, ... I like to see what happens when it's empty

  • What happens when negative numbers are passed to a function that expects positive numbers? Division by zero?
    How do you probe boundaries?

Much More Than This

When you get a bug report, start by writing a unit test that exposes the bug


Picks

  • JP: Taking time off
  continue reading

78集单集

所有剧集

×
 
Loading …

欢迎使用Player FM

Player FM正在网上搜索高质量的播客,以便您现在享受。它是最好的播客应用程序,适用于安卓、iPhone和网络。注册以跨设备同步订阅。

 

快速参考指南