Artwork

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

Episode[14]: Unit Testing 101

1:00:48
 
分享
 

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

Because of the high complexity and depth of this episode, we will share with you the episode outline and the topics discussed here as a reference.

Episode Outline:

What is unit testing?

test for the smallest possible pieces of your program.

كل حاجة فيها سليمة بس لوحدها - سلطان السكري

Why Unit Testing

  1. Help the developer deeper understand the logic he/she is implementing.
  2. Help developer writes more modular, loosely coupled code.
  3. Make it faster to develop and debug. (You can fake all the possible scenarios and see how the test is responding to each)
  4. Find bugs early.
  5. Help with documenting the code you are doing.
  6. Help when it comes to refactoring.
  7. It helps to automate the development process and decrease deployment-related friction.

Unit Testing Best Practices

1- Identifying Units:

When it comes to the unit you are testing, you need to answer three questions.

a. What is the output of this unit?

b. What helper functions that this unit is using to achieve that output?

c. Are there any side effects resulting from this unit. (it modifies state variables outside its scope).

2- Naming & Description

Why? it makes the test easier to read and hence easier to figure out what went wrong.

Describe & It. (This thing / should or does something)

- The search function should return an array of strings matching the search keyword.

- The search function should return an empty array when a keyword is not matching any.

- throw an exception if the keyword is an empty string.

3- Mocking & Stubs

- The unit test is 50% mocking and 50% clean code.

  • Check Martin Fowler's article in the for more depth in mocking

Check the resources section.

References:

Episode Picks:

  continue reading

67集单集

Artwork

Episode[14]: Unit Testing 101

null++: بالعربي

3,520 subscribers

published

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

Because of the high complexity and depth of this episode, we will share with you the episode outline and the topics discussed here as a reference.

Episode Outline:

What is unit testing?

test for the smallest possible pieces of your program.

كل حاجة فيها سليمة بس لوحدها - سلطان السكري

Why Unit Testing

  1. Help the developer deeper understand the logic he/she is implementing.
  2. Help developer writes more modular, loosely coupled code.
  3. Make it faster to develop and debug. (You can fake all the possible scenarios and see how the test is responding to each)
  4. Find bugs early.
  5. Help with documenting the code you are doing.
  6. Help when it comes to refactoring.
  7. It helps to automate the development process and decrease deployment-related friction.

Unit Testing Best Practices

1- Identifying Units:

When it comes to the unit you are testing, you need to answer three questions.

a. What is the output of this unit?

b. What helper functions that this unit is using to achieve that output?

c. Are there any side effects resulting from this unit. (it modifies state variables outside its scope).

2- Naming & Description

Why? it makes the test easier to read and hence easier to figure out what went wrong.

Describe & It. (This thing / should or does something)

- The search function should return an array of strings matching the search keyword.

- The search function should return an empty array when a keyword is not matching any.

- throw an exception if the keyword is an empty string.

3- Mocking & Stubs

- The unit test is 50% mocking and 50% clean code.

  • Check Martin Fowler's article in the for more depth in mocking

Check the resources section.

References:

Episode Picks:

  continue reading

67集单集

所有剧集

×
 
Loading …

欢迎使用Player FM

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

 

快速参考指南