測試驅動開發筆記(二) xUnit

2021-06-09 21:34:02 字數 691 閱讀 1451

1.  防止改完後引起新錯誤;再次執行單元測試。

2.. 如果單元測試涉及到可變資訊(如當前時間),需要將待測試資料也變為可變,否則無法回歸測試

3. 使用測試驅動開發必須從頭開始,嚴格進行,否則到半中間會很費事的。

4. 測試驅動開發中,私有方法也要測試,可通過反射實現,如

summer example = new summer.newinstance();      

method m = example.getclass().getdeclaredmethod("methodone",new class);

m.setaccessible(true);object result = m.invoke(example ,new object );

m.setaccessible(false);

if (result.equals(rightresult))

} 1. import junit.framework.*;

2. public class maintest

3.

15.

16. public static void main(string args)

17.

21. }

Linux驅動開發筆記(二)

linux驅動開發的基本框架 define led major 200 define led name led static int led open struct inode inode,struct file filp static int led release struct inode in...

驅動開發筆記 開篇

身為資訊保安專業的學生,接觸計算機也有十來的年頭了,到現在還沒有深入過windows核心的世界,不禁有些慚愧。所以現在開始認認真真沉下心來研究這個全新的世界,記些筆記,不但方便自己回頭翻閱,也希望可以和同樣研究驅動 核心的朋友們一起研究 首先向大家推薦一本好書 rootkits windows核心的...

iphone 開發筆記二

11 iphone中變數值是否等於字串的判斷方法 objective c string1 isequaltostring 123 12 iphone的framework的目錄 mac developer platforms iphoneos.platform developer sdks iphon...