SlideShare a Scribd company logo
Joe @ Kaosiung.py 2014.05.26
Testing in Python
新手給的測試入門課
Diff
跟前一場演講不一樣 ...
Testing in Python @ Kaosiung.py 2014.05.26
魯蛇喬 (Joe)
半端工程師
75% 後端 25% 前端
Testing in Python @ Kaosiung.py 2014.05.26
Demo Code
https://bitbucket.org/devjoe/talk_tip
Outline
• Testing Frameworks/ Tools in Python
• Python in TDD
• Reference
Doctest
Readability Counts
Demo
doctest
文件即程式碼
程式碼即文件
unittest
Builtin tool
Demo
unittest
來自 JUnit ...
我隔我隔我隔隔隔
nose
強大的加強版 unittest
Demo
nose
可以外掛很多套件
不夠還可以自己寫
py.test
更加直覺的瑞士小刀
Demo
py.test
據說更加 pythonic
彩色就贏了?
lettuce & behave
客戶最愛的守規矩的生菜
Demo
lettuce
lettuce
lettuce
如果不是要寫 unit &
integration test ?
有工具幫助我寫 Functional tests 嗎?
呃 ... 我只會一點 Web
魯蛇喬與他的快樂好朋友
requests / pyquery
自幹無敵
Demo
requests
其實也沒那麼累
某人以前傻傻的自幹過 by httplib2
ghost.py
來跑 javascript 吧!
No Demo
Testing in Python @ Kaosiung.py 2014.05.26
Testing in Python @ Kaosiung.py 2014.05.26
javascript == "潮"
True
Pyccuracy
客戶站在 selenium 的肩膀上
Dead Demo
Testing in Python @ Kaosiung.py 2014.05.26
Testing in Python @ Kaosiung.py 2014.05.26
Bj4
Robot Framework
巨人站在巨人肩膀上 (java/python)
Dead Demo
Testing in Python @ Kaosiung.py 2014.05.26
Testing in Python @ Kaosiung.py 2014.05.26
很好很強大
今年 PyConAPAC 有講者介紹過
https://pyconapac2014.hackpad.com/PyCon-APAC-2014-Co-
Notes-Index-ZQKz3p7rhmP
議程全筆記
更多的 Testing
Search: python testing tools taxonomy
Testing in Python @ Kaosiung.py 2014.05.26
Outline
• Testing Frameworks/ Tools in Python
• Python in TDD
• Reference
Why "Python in TDD" ?
Not "TDD in Python" ?
Or "Python in Python" ?
Or "TDD inTDD" ?
TDD by example (Kent Beck @ 2002)
• The money example
• The xUnit Example
• Patterns for Test-Driven Development
• TDD patterns
• Red Bar patterns
• Testing patterns
• Green Bar patterns
• xUnit Patterns
• Design Patters
• Refactoring
• Mastering TDD
Written in Python
而且用 TDD 開發 TDD Tool
Done Demo
Testing in Python @ Kaosiung.py 2014.05.26
Note
• TDD 是組合技
• 使用 TDD 不可能導致 Over Design
• 寫太多 Sub/Mock/Fake 叫做 Over Implementation
• 拿出紙筆寫下需求清單與測試清單
• TDD 有成本
Outline
• Testing Frameworks/ Tools in Python
• Python in TDD
• Reference
• 2011 出版有點舊
• 附程式碼很方便
• PACKT 可購得
• 經典 BJ4
• 我在網路上看到最好的快速上手中文教學
• 還沒看 XD
•  預計在 Tainan.py 分享
工商服務
更多的 Python
Testing in Python @ Kaosiung.py 2014.05.26
一切的開始
我要到台南辦 Tainan.p*
還有吃牛肉湯
搬到台南後 ...
得到 Logo !
得到在地社群的支持 !
場地器材提供 !
Tainan.py
• Since 2013.06 ~
• 從 Taipei.py fork 出來的聚會
• 常與 MOSUT 社群合辦
• 一場演講常常 1 Hour 起跳
• 常常有好吃的東東
• 徵志工 (也想玩 meetup 系統嗎)
總共辦過 10 次
週六舉辦
人也很多
強者
Python + Open
議程回顧
bottle
rst format, sphinx, google cloud
platform, x86 machine code
thread safety, 用 python 實作OSX/WIN
dual monitor information query 及 url
entrycache 的探訪與刪除, linux/C 組裝
軟體的心得, linux CNC, 5 分鐘 git 上手
garbage collection, pypy, 數
學女孩之機率的崩壞, Kinect
簡介
python type and
object, git 狀況劇
keith 閒聊, shell 導
讀, 自由曲面
virtualization, unicode in
python, 用 shedskin 加速
python
下次聚會?

5/31 14:00
Testing in python, TDD in
python, 資料分析用 python
歡迎投稿
一起吃好料吧!

More Related Content

PDF
Tip for Editors
PDF
TDD (Test-driven development, 測試驅動開發) 基本教學
PDF
測試是什麼
PPT
PHP 单元测试
PPTX
單元測試
PPTX
Unit test
PPTX
单元测试(H2等)和持续集成(Hudson)实战简介
PDF
使用 Pytest 進行單元測試 (PyCon TW 2021)
Tip for Editors
TDD (Test-driven development, 測試驅動開發) 基本教學
測試是什麼
PHP 单元测试
單元測試
Unit test
单元测试(H2等)和持续集成(Hudson)实战简介
使用 Pytest 進行單元測試 (PyCon TW 2021)

What's hot (9)

PPTX
Web testing automation
PPTX
單元測試介紹
PPTX
持續整合與單元測試
PDF
自動測試 - 測試對象的識別/封裝
PDF
例外處理實務
PDF
認試軟體測試的世界 & TDD/BDD 入門
PDF
Foundation of software development 1
PDF
Unit test
PPTX
例外處理與單元測試
Web testing automation
單元測試介紹
持續整合與單元測試
自動測試 - 測試對象的識別/封裝
例外處理實務
認試軟體測試的世界 & TDD/BDD 入門
Foundation of software development 1
Unit test
例外處理與單元測試
Ad

Viewers also liked (6)

PDF
PyConAPAC2014 Tainan.py 介紹
PPTX
當資訊科技撞上臺南牛肉湯的那些事兒 @ 2014 NCKU EDiT 科技啓蒙
PDF
PyConAPAC2014 BoF Introduction
PDF
Rubypython - 用 ruby 愛上 python
PDF
Testing in python 2.7.3
PDF
MLDM Monday -- Optimization Series Talk
PyConAPAC2014 Tainan.py 介紹
當資訊科技撞上臺南牛肉湯的那些事兒 @ 2014 NCKU EDiT 科技啓蒙
PyConAPAC2014 BoF Introduction
Rubypython - 用 ruby 愛上 python
Testing in python 2.7.3
MLDM Monday -- Optimization Series Talk
Ad

Similar to Testing in Python @ Kaosiung.py 2014.05.26 (20)

PDF
简单Pthon教程
PDF
Python简明教程
PDF
Ansible & GitLab CI / CD Workshop 101 ( @Agile Tour Taipei 2017)
PPT
The way to continuous delivery
PDF
2020.04.01 DDD讀書會第三次導讀資料
PPTX
在B2B硬體產業運用 Agile 與 DevOps 的實務與心法
PPTX
[MonkeyFest 2018 ] App 開發與 DevOps 上的實踐
PPTX
用 Drone 打造 輕量級容器持續交付平台
PDF
How to integrate GitLab CICD into B2B service
PDF
Python系列1
PDF
Python introduction and data visualization publish
PDF
驚呆了!這些 Python 題目刷掉 7 成面試者
PDF
從理想、到現實的距離,開啟品味軟體測試之路 - 台灣軟體工程協會 (20220813)
PDF
11132020_python tutor.pdf
PPT
Yii phpunit
PPT
2 Python开发工具链
PDF
Proud Plone on Cloud
PDF
使用 Dify 做 AI 应用 - 接触2周的一些小想法小心得分享 Ruby Tuesday Shanghai
PPTX
A dev ops team's practice in trend micro in agile summit 2018
PPTX
Go 語言基礎簡介
简单Pthon教程
Python简明教程
Ansible & GitLab CI / CD Workshop 101 ( @Agile Tour Taipei 2017)
The way to continuous delivery
2020.04.01 DDD讀書會第三次導讀資料
在B2B硬體產業運用 Agile 與 DevOps 的實務與心法
[MonkeyFest 2018 ] App 開發與 DevOps 上的實踐
用 Drone 打造 輕量級容器持續交付平台
How to integrate GitLab CICD into B2B service
Python系列1
Python introduction and data visualization publish
驚呆了!這些 Python 題目刷掉 7 成面試者
從理想、到現實的距離,開啟品味軟體測試之路 - 台灣軟體工程協會 (20220813)
11132020_python tutor.pdf
Yii phpunit
2 Python开发工具链
Proud Plone on Cloud
使用 Dify 做 AI 应用 - 接触2周的一些小想法小心得分享 Ruby Tuesday Shanghai
A dev ops team's practice in trend micro in agile summit 2018
Go 語言基礎簡介

More from Chun-Yu Tseng (15)

PDF
5 minutes 介紹台南拍 (2022 ver.)
PDF
Tenet: 2020 Taiwan PyCon Host We How
PDF
Build and Host Real-world Machine Learning Services from Scratch @ pycontw2019
PDF
from ai.backend import python @ pycontw2018
PDF
導讀 Clean Code
PDF
Essential TDD @ pycontw2016
PDF
從蟒蛇到神龍 - 從 1 接關繼續打造爬蟲程式
PDF
Agile x API x Documentation @ NGO [[MOPCON2015]]
PDF
程式 x 設計 @ MOPCON 2014
PDF
介紹 MOSUT @ 2014.09.26 自由軟體開發與社群發展
PDF
OO x Python @ Tainan.py x MOSUT x FP 2014.09.27
PDF
用路人小幫手 x 回報大改造 @ 2014 台南黑客松
PDF
暖場 @ Tainan.py 2013.11.30
PDF
API 文件大亂鬥 @ MOPCON 2013
PDF
暖場與 Web 相關的小玩具 @ Tainan.py 2013.09.28
5 minutes 介紹台南拍 (2022 ver.)
Tenet: 2020 Taiwan PyCon Host We How
Build and Host Real-world Machine Learning Services from Scratch @ pycontw2019
from ai.backend import python @ pycontw2018
導讀 Clean Code
Essential TDD @ pycontw2016
從蟒蛇到神龍 - 從 1 接關繼續打造爬蟲程式
Agile x API x Documentation @ NGO [[MOPCON2015]]
程式 x 設計 @ MOPCON 2014
介紹 MOSUT @ 2014.09.26 自由軟體開發與社群發展
OO x Python @ Tainan.py x MOSUT x FP 2014.09.27
用路人小幫手 x 回報大改造 @ 2014 台南黑客松
暖場 @ Tainan.py 2013.11.30
API 文件大亂鬥 @ MOPCON 2013
暖場與 Web 相關的小玩具 @ Tainan.py 2013.09.28

Testing in Python @ Kaosiung.py 2014.05.26