【正文】
the back ? 角色可以互換的 3 疑問(wèn): ? 一個(gè)程序兩個(gè)人寫(xiě)是不是一種浪費(fèi)(可是兩份工資,雙倍資源哦)? ? 編程從來(lái)是一個(gè)人的活動(dòng)。他們一起分析,一起設(shè)計(jì),一起寫(xiě)測(cè)試?yán)?,一起編碼,一起單元測(cè)試,一起 整合測(cè)試 (Integration Test), 一起寫(xiě)文檔等。Pair Programming ( 成對(duì)編程 ) 1 什么是 Pair Programming Pair Programming是一個(gè)編程模式 (Programming pattern)。兩個(gè)程序員并排坐在一臺(tái)電腦前,面對(duì)同一個(gè)顯示器,使用同一個(gè)鍵盤(pán),同一個(gè)鼠標(biāo)一起工作。 基本上所有的開(kāi)發(fā)環(huán)節(jié)都一齊肩并肩地,平等地,互補(bǔ)地進(jìn)行開(kāi)發(fā)工作。學(xué)校里這么教的,一直以來(lái)也是做么做的。 ? 這個(gè)笨家伙老是問(wèn)問(wèn)題,他 /她不會(huì)看書(shū)么?我都無(wú)法專(zhuān)心工作了。 Pair Programming的疑問(wèn) 4 Pair Programming和 Solo Programming的比較 一些研究數(shù)據(jù): 1999年, University of ,一組獨(dú)自工作,一組 Pair Programming。s software pany, Whitesmiths, Ltd觀察到一個(gè)現(xiàn)象: Collaborative Programming ? “兩個(gè)程序員一起工作,可以比以往更快的交出完成并經(jīng)過(guò)測(cè)試的代碼,而且這些代碼幾乎是沒(méi)有 Bug的。 ? Pair Programming是 XP的一個(gè) key practice,也是 XP成功的關(guān)鍵。 6 為什么要 Pair Programming “ The Human eye has an almost infinite capability for not seeing what it does not want to see…… Programmers, if left to their own devices, will ignore the most glaring errors in their outputerrors that anyone else can see in an instant.” Gerald Weinberg “ Knowledge is monly socially constructed through collaborative efforts toward shared objectives or by dialogues and challenges brought about by difference in persons’ perspective” Salomon “三個(gè)臭皮匠,勝過(guò)一個(gè)諸葛亮” ? 7 為什么要 Pair Programming 企業(yè)管理層次: ? Pairs更有效的交流,相互學(xué)習(xí)和傳遞經(jīng)驗(yàn) ? Pair Programming具備更高的效費(fèi)比( costeffective) ? Pair Programming能更好的處理人員流動(dòng) 開(kāi)發(fā)層次: ? Pairs能提供更好的設(shè)計(jì)質(zhì)量和代碼質(zhì)量 ?