如何利用 ChatGPT 開出好的測試個案

下面這篇文章, 是在講述如何利用 ChatGPT 來開立測試個案

Techniques to Use ChatGPT to Generate High-Quality Test Cases

https://www.encora.com/insights/exploration-of-techniques-to-use-chatgpt-to-generate-high-quality-test-cases

他的 Prompt 是這樣下的:

Using the equivalence class technique, find the representative test cases to verify the following functionality:


The Pets Friends store has the following discount policy:


There are 4 types of customers: Normal, Silver, Gold, and Platinum Gold.
Platinum customers are the only ones eligible to request discounts.
To be eligible for the discount, the purchase amount must be equal to or greater than USD 500 and must include products from the “Purina” brand.


Also, indicate the number of test cases that were eliminated because they were not useful.

The inputs are Customer type, Purchase amount, and Product brand.

Write down the final test cases in a table.

The steps are as follows:
Identify the inputs.
Identify equivalent classes: valid and invalid classes.
Calculate the number of test cases (total and useful).
Make combinations.
Set up the test case table.

從這個 Prompt 中你可以發現:
(1) 他知道 equivalence class technique 的作法
(2) 他知道 test case 最重要的元素是: input, steps 和 expected result
(3) 他知道用 table 呈現 test case, 可以方便 review, 以及自動化

此外, 他可以再加強
(1) 改用 decision table testing 的方法去建立表格
(2) 可以加上 boundary value testing 來考量
(3) equivalence class technique 不是只能 valid 和 invalid 兩種

這些都是你要懂 test case design 的技能, 光是只有 ChatGPT 是無法開立出深入的場景

就像圓月彎刀中男主角丁鹏所說到: 有些人即使神刀在手,也不可能成为刀中之神的

發表迴響

探索更多來自 轉念學 - 敏捷三叔公的學習之旅 的內容

立即訂閱即可持續閱讀,還能取得所有封存文章。

Continue reading