2022/05/16 (新增連結)
軟體測試是個很重要也很複雜的工作 (詳參:Software testing),有不同種類的測試,目前大部分的測試已經發展出自動化工具,也使得測試工作越來越容易了。
“We didn’t write tests because we wanted to get our code out faster”
Not writing tests leaves you open to bugs
Not writing tests makes refactoring more difficult
Not writing tests makes you move slower in the long run
3 Things I Learned Writing 300+ Tests in a Month
You Absolutely Need to Consider Testing When Writing Implementation
100% Test Coverage (Might be!) Overkill
Testing Backend is Easier than Frontend
The 7 principles of software testing
Testing shows the presence of defects
Exhaustive testing is not possible
Early testing
Defect clustering
Pesticide paradox
Testing is context-dependent
Absence of errors fallacy
滿足使用者的需求是最重要的品質,一般而言,測試的方式包含過程的測試及結果的測試。
過程的測試,一般而言,就是從開發開始就進行測試,從範圍最小的單元測試開始,接下來進行模組的測試,系統的整合測試。測試的方法通常會利用測試腳本搭配自動化測試工具進行測試,要注意當需求更動時,正確的更動相關的測試,並進行迴歸測試(回頭去確保以前的測試不受更動的影響)。
結果的管理也有不同的方式,可以透過使用者介面測試,現在的工具可以錄下腳本進行自動化測試。
軟體的穩定性也是可以透過負載測試及壓力測試,了解在特定負載下系統是否能穩定操作,也可以進行壓力測試,壓力測試的目的在於了解系統的最高可承載的壓力。也會進行容錯測試,瞭解是否會因為操作錯誤造成系統的不穩定。
安全性檢測可分為白箱檢測與黑箱檢測,白箱檢測通常是針對程式碼進行檢測,可以透過制定程式碼的安全規範並進行人工的code review或利用自動化的code analysis工具找出安全漏洞。黑箱檢測則是透過測試工具進行測試,了解在各種可能的攻擊下系統是否有效防禦。
測試工具
Code Analysis 利用動態或靜態分析工具找出安全漏洞
軟體的效率也是可以透過測試工具進行負載測試,了解在特定負載下系統的效率是否達到目標的回應速度。也會進行容錯測試,瞭解是否會因為操作錯誤造成系統的效率大幅降低。
測試工具
軟體的可維護性通常比較難利用自動化測試工具來進行。
討論一下,貴公司或團隊如何進行軟體測試? 使用的工具? 為什麼?
體驗一下測試工具
API Test
Web UI Test
Katalon Studio是個免費的測試工具,有Windows、Mac、Linux版,還有付費的Katalon Studio Enterprise、Katalon Runtime Engine、Katalon TestOps Enterprise,未來還會有雲端版。最新版本是8.3.0 (2022/05)。可以執行Web UI Test、Web API Test、Mobile Test。Katalon Recorder可以錄製我們在網頁上的操作,來做為我們測試的基礎。Web UI Test、Web API Test、Mobile Test是屬於黑箱測試,也就是跟開發的程式語言無關,當然,Katalon Studio也支援白箱測試,只是,一般白箱測試工具(如:JUnit、Jest)會跟開發的語言有關,所以,通常會跟開發工具(如:vs code)整合。
Katalon還提供了免費的Katalon Recorder、Katalon TestOps、Katalium。
測試api要比測試web UI或Mobile UI稍微單純一點,所以,我們來介紹一下如何利用Katalon進行API測試。
不過,如果一開始的專案不是選"API",會看不到"Add Web Service Keywords",不過,還是可以在Add裡找到API所需要的指令
TDD (吳濟聰老師 敏捷軟體開發課程教材)
TDD (吳濟聰老師 敏捷軟體開發課程教材)
iOS
Android
React native
Testing React Native Apps on Android and iOS (黑箱測試)
Testing React Native Android and iOS Apps with Appium
QA Automation for Mobile Apps with Appium: An Overview (黑箱測試)
How to set up Jest and Enzyme to test React Native apps (白箱測試)
廖家盛 (2015)整理了常見的測試類型:
單元測試:單一程式的測試
功能測試:模組或功能階層的測試
整合測試:系統整體的測試,有些公司會有不同層級的整合測試,將最後的測試稱為系統測試
探索性測試:除了已規劃的測試案例之外,進行未規劃的測試
壓力測試:了解系統所能承受的壓力,以及在壓力下的表現
容錯測試:了解系統面對未預期錯誤的容錯程度
使用者介面測試:使用者透過系統介面進行測試
安全性測試:進行資訊安全的相關測試
回歸測試:新增或更動功能時,測試過去已經測試且未被更動的功能
廖家盛 (2015)整理五個個案公司進行的測試及方式,發現大部分的公司還是以人工測試為主,也整理了一些個案公司所使用的測試工具:
Top 5 Mistakes You’re Probably Making While Unit Testing Your Own Code
Testing other people’s code
Testing the database connection
Testing multiple things inside a test case
Writing your tests after the fact
Failing to update your tests after code refactors
JUnit:很多軟體,如Eclipse已經內建JUnit
Visual Studio單元測試功能
NUnit
JMeter
測好測滿(一) : 壓力測試Jmeter (2021)
Day 20 Jmeter 壓力測試工具 (2018)
JMeterTutorial (5個影片) (2013)
JMeter - 壓力測試 - 簡單版 (2008)
JMeter - 壓力測試 - 進階版 (2009)
Visual Studio壓力測試功能
PageSpeed Insights / Lighthouse in Chrome DevTools **
Visual Studio介面測試功能
Selenium (Katalon Studio就是基於Selenium的技術)
持續整合 - 透過 Selenium 實現自動化測試 (2015)
網頁應用程式測試工具Selenium IDE介紹 (2011)
Checkmarx
10 Types of Application Security Testing Tools: When and How to Use Them
Static Application Security Testing (SAST)
Dynamic Application Security Testing (DAST)
Origin Analysis/Software Composition Analysis (SCA)
Database Security Scanning
Interactive Application Security Testing (IAST) and Hybrid Tools
Mobile Application Security Testing (MAST)
Application Security Testing as a Service (ASTaaS)
Correlation Tools
Test-Coverage Analyzers
Application Security Testing Orchestration (ASTO)
Testing Tools (Open Web Application Security Project, OWASP)
Top 12 Open Source Security Testing Tools
Zed Attack Proxy (ZAP)
SQLMap
w3af
Skipfish
Metasploit
Wapiti
John The Ripper (JTR)
SQLNinja
Vega
Social Engineer Toolkit (SET)
Wfuzz
Wireshark
Top 11 Open Source Security Testing Tools for Web Applications
Wapiti
Zed Attack Proxy
Vega
W3af
Skipfish
Ratproxy
SQLMap
Wfuzz
Grendel-Scan
Arachni
Grabber
8 Open source security testing tools to test your website
Vega
ZED Attack Proxy (ZAP)
Wapiti
W3af
Iron Wasp
SQLMap
Google Nogotofail
BeEF (Browser Exploitation Framework)
15 Most Powerful & Reliable Security Testing Tools 2018
Metaspoilt
Wireshark
W3af
CORE Impact
Netsparker
Burpsuite
Cain & Abel
Acunetix
Retina
Canvas
Nmap
Dradis
Security Onion
Nikto
Vega
19 Powerful Penetration Testing Tools: Security Testing and Hacking Tools
Netsparker
Acunetix
Metasploit
Wireshark
w3af
Kali Linux
Nessus
Burpsuite
Cain & Abel
Zed Attack Proxy (ZAP)
John The Ripper
Retina
Sqlmap
Canvas
Social Engineer Toolkit
Sqlninja
Nmap
BeEF
Dradis
Visual Studio
Best software testing tools (2018)
qTest
Katalon Studio (Free)
Selenium (Open Source)
Unified Functional Testing (UFT) (Formerly known as HP QuickTest Professional)
TestComplete
9 automation testing tools to consider for web applications in 2018
UI automation testing frameworks
Selenium WebDriver
Protractor
Cucumber (for BDD)
Desktop automation tools for enterprises
TestComplete
UFT Pro (LeanFT)
Eggplant Functional
Cloud testing platforms
Screenster
Ghost Inspector
Usetrace
Best Automation Testing Tools for 2018 (Top 10 reviews)
Selenium (open source)
Katalon Studio (free)
Unified Functional Testing (UFT)
Watir (open source)
IBM Rational Functional Tester
TestComplete
TestPlant eggPlant
Tricentis Tosca
Ranorex
Robot framework (open source)
測試目的
測試範圍
測試完成標準
測試時程
資源需求
人力需求
設備需求
硬體環境
軟體環境
測試案例
不列入本次系統測試部分
測試完成須交付之文件
參考文件
撰寫測試個案
測試個案名稱、測試步驟、預期結果
測試結果
通過、不通過(發現之問題)
壓力測試
壓力測試之目標 (上線人數、反應時間)
壓力測試之環境
安全測試
安全測試之目標 (哪些安全測試項目)
安全測試之環境
The Wide World of Software Testing
Unit Testing
Integration Testing
End to End Testing
Performance Testing
Load Testing
User Acceptance Testing
5 Questions Every Unit Test Must Answer
What are you testing?
What should it do?
What is the actual output?
What is the expected output?
How can the test be reproduced?