標籤:/******************************************************* * Finds and prints n prime integers * Jeff Offutt, Spring 2003 ******************************************************/ public static void printPrimes (int n) {
標籤:一、對一個方法進行測試private static void printPrimes(int n){ int curPrime; int numPrimes; boolean isPrime; int [] primes = new int [43]; primes[0]=2; numPrimes = 1; curPrime = 2; while ( numPrimes
標籤:1. 寫一個Java程式,用於分析一個字串中各個單詞出現的頻率,並將單詞和它出現的頻率輸出顯示。(單詞之間用空格隔開,如“Hello World My First Unit Test”);2. 編寫單元測試進行測試;3. 用ElcEmma查看程式碼涵蓋範圍,要求覆蓋率達到100%。import java.util.ArrayList;import java.util.Collections;import java.util.Comparator;import
標籤:Microsoft TFS(Team Foundation Server):優點:任務版上能將需求、項目進度一覽無餘,對於小團隊而言,比甘特圖更有用整合了專案管理、版本控制、BUG 跟蹤,能有效實現 SCRUM能與 VS 無縫接合缺點:搭建、維護tfs比較複雜,硬體要求也比較高。GitHub:優點:可以作為一個版本控制系統和協作工具,用它來發布工作。他支援多人共同完成一個項目,因此你們可以在同一頁面對話交流。建立自己的項目,並備份,代碼不需要儲存在本地或者伺服器,GitHub做得非常理想。
標籤:2、 學習單元測試和程式碼涵蓋範圍工具的使用(1) 寫一個程式,用於分析一個字串中各個單詞出現的頻率,並將單詞和它出現的頻率輸出顯示。(單詞之間用空格隔開,如“Hello World My First Unit Test”);(2) 編寫單元測試進行測試;(3) 用ElcEmma查看程式碼涵蓋範圍,要求覆蓋達到100%。(1)package cn.bao;public class Action { public void
標籤:解譯器模式(Interpreter Pattern)是一種按照規定文法進行解析的方案,在現在項目中使用較少(誰沒事幹會去寫一個PHP或者Ruby的解析器),其定義如下:Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language。給定一個語言,
標籤:package unit2;public class main { public static void main(String[] args) { // TODO Auto-generated method stubtext1 t1 = new text1(); t1.run(); text2 t2 = new text2(); t2.run(); }}package unit2;import java.util.HashMap;import