在對TDD和BDD進行了非常鼓舞人心的培訓之後,我嘗試使用MSTest
和Specflow
來實施該方法。但我有一個問題,我堅持:BDD情景何時會變得過於具體?
我寫了驗收測試來驗證我們正在努力的子系統。 我們的系統是一個小分佈:
- 有一個第三方計算機
- 有它自己的應用與我們通過TCP訪問第三方數據庫運行自如
- /IP
但是我的Specflow場景似乎太專門針對我自己的開發設置:它包含僅對我有效的輸入。在下面的例子中,ip地址主要來自我。目標目錄就是我機器上的一個目錄。
經認可的Tester/Validator或產品所有者可能無法啓動相同的測試場景,因爲他們無法訪問此機器。但我的開發者同事可能不會。
@lastOne
Scenario: Get lattest 3rdParty OCR Data into specified directory
Given I indicate 'database' as the databaseName of third party computer
And I indicate '12.126.42.21' as the ipAddress of the third party computer
And I indicate 'user' as the databaseUser in third party computer
And I indicate 'c:\Temp\test_ocr\' as the destination path where to put the ocr data
And I indicate '2013020800009E' as the truck identifier to be associated with ocr data
When I call the OCR Application program
Then the destination path should contain correctly named xml file, with validated xml data, and jpg files about ocr data.
恐怕我對BDD有一些誤解。我在我的場景中太具體了? 如果是,我應該在哪裏停止?
我大多喜歡的建議:**,如果它打破了另一臺機器上,那麼它太SP ecific **。我還深信,我應該嘲笑第三方個人電腦:我需要深入研究這個部分,但我還沒有做過。 – 2013-02-20 11:52:45