2015年1月15日 星期四

[Testing] Black Box Theory (測試黑盒子理論)


最近工作中使用到的後端架構分成了三個部分:Controller、Service、ThirdPartyService。



像是把車送修,

我 / Controller Testing:
    壞的車 ➔ 判斷、選擇給哪一廠修 ➔  黑盒子  ➔ 好的車
    Controller Input ➔ Controller (Basic Conditions) ➔  Service Black Box  ➔ Controller Output

跟我接洽的人 / Service Testing:
    壞的法拉利 ➔ 怎麼修、修哪些零件 ➔  黑盒子  ➔ 好的法拉利
    Service Input ➔ Service (Logic, Processes) ➔  Third Party Service Black Box  ➔ Service Output

掌管整個修車流程的人 / Third Party Service Testing:
    壞的零件 ➔ 請外面的修理師傅修 ➔  黑盒子  ➔ 好的零件
    Third Party Service Input ➔ Third Party Service (Third Party Library / API)
    ➔  Third Party Black Box  ➔ Third Party Service Output



之前寫測試要用黑盒子理論發現 SinonJS 這樣的東西,
覺得挺好用的,就來分享一下~

這篇只是簡單提到其中的 stub,有興趣的人再自行深入囉!


沒有留言:

張貼留言