HansBug/pair_program_word_chaingit
PSP2.1 | Personal Software Process Stages | 預估耗時(小時) | 實際耗時(小時) |
---|---|---|---|
Planning | 計劃 | 0.5 | 0.4 |
· Estimate | · 估計這個任務須要多少時間 | 0.1 | 0.2 |
Development | 開發 | 20 | 22.7 |
· Analysis | · 需求分析 (包括學習新技術) | 6 | 5 |
· Design Spec | · 生成設計文檔 | 0.5 | 0.1 |
· Design Review | · 設計複審 (和同事審覈設計文檔) | 0.5 | 0.1 |
· Coding Standard | · 代碼規範 (爲目前的開發制定合適的規範) | 0.5 | 0.4 |
· Design | · 具體設計 | 0.5 | 0.3 |
· Coding | · 具體編碼 | 10 | 13 |
· Code Review | · 代碼複審 | 1 | 0.8 |
· Test | · 測試(自我測試,修改代碼,提交修改) | 1 | 3 |
Reporting | 報告 | 1 | 0.4 |
· Test Report | · 測試報告 | 0.3 | 0.1 |
· Size Measurement | · 計算工做量 | 0.2 | 0.1 |
· Postmortem & Process Improvement Plan | · 過後總結, 並提出過程改進計劃 | 0.5 | 0.2 |
合計 | 21.5 | 23.5 |
在本次結對編程中,咱們一共分爲幾個模塊:github
文件core.h
編程
EXPORT int TEST_LIB_PLUS(int a, int b); EXPORT int gen_chain_word(char *words[], int len, char *result[], char head, char tail, bool enable_loop); EXPORT int gen_chain_char(char *words[], int len, char *result[], char head, char tail, bool enable_loop);
計算模塊對外接口即爲上面所述的core.h
內的接口。數組
內部包含functions.h
,爲頂層功能。數據結構
// check if words is valid int words_precheck(const std::vector<std::string> &words); // check if there is word circle int words_circle_check(const std::vector<std::string> &words); // get longest word chain with word count int get_chain_with_word(const std::vector<std::string> &words, std::vector<std::string> *&link, const char &start_with, const char &end_with); // get longest word chain with word length int get_chain_with_char(const std::vector<std::string> &words, std::vector<std::string> *&link, const char &start_with, const char &end_with); int get_chain_with_word_allow_same(const std::vector<std::string> &words, std::vector<std::string> *&link, const char &start_with, const char &end_with); int get_chain_with_char_allow_same(const std::vector<std::string> &words, std::vector<std::string> *&link, const char &start_with, const char &end_with);
在此之下,咱們共同實現了Graph
類,用於支持全部的圖論計算。框架
在Graph類上,咱們封裝了SimpleChainModel
和WordChainModel
兩個類,用於對圖論的構圖,計算,數據調度等行爲進行底層封裝。工具
即流程爲:oop
core.h
調用functions.h
(由於用指針傳遞字符串數組實在太難受了)functions.h
調用SimpleChainModel
和WordChainModel
,進行邏輯層面的運算。SimpleChainModel
和WordChainModel
調用Graph
,進行底層數據結構層面的運算。說來尷尬,其實咱們一開始就對於一、二、3需求設計成了最優解,經過創建虛節點,進行構圖,將整個問題抽象爲無環圖的最長路徑。gitlab
能夠大概看出,咱們的程序中,尤爲是計算模塊,大量使用了stl進行運算。post
不過總體的性能瓶頸基本上依然集中於graph和Model的計算方法。
契約式設計。即當程序知足一些約定好的最基本需求時才進行運行,不然直接拒絕運行。
優勢:
缺點:
畫界面用的是 QT 自帶的 QT Designer 設計工具。這個工具灰常好用,所見即所得,操做又略略繁瑣,雖然耗費了咱們大量的時間來熟悉這個鬼東西,但最終仍是取得了不錯的效果。
QT Designer 設計的界面是保存在一個名字爲.ui
文件中的,這個文件採用 xml 語言描述了界面設計。在編譯QT App時,QT會自動將這個 .ui 文件轉換成一個 .h 文件,咱們能夠直接在代碼中使用這個文件,特別方便。
咱們的 GUI 是採用 QT
框架實現的,它具備如下特點:
界面模塊與計算模塊的對接最後進行的幾個步驟,此時咱們已經完成了核心模塊的編寫,所以,直接在代碼中調用核心模塊的頭文件便可正常編寫代碼,再配合上cmake
,就能自動進行動態連接。
因此,對接就這樣完成啦。
袁勤 | 我 | |
---|---|---|
優勢 | 一、認真負責,守時 二、代碼水平不錯 三、自學能力強 四、鑽研探索的精神很不錯 五、總而言之感受是個很使人以爲靠得住的隊友 |
一、寫代碼不算太慢,ddl當天大改需求半小時莽完200+行代碼 二、寫代碼準確性不算過低,半小時莽完後零debug一遍所有經過 三、會用git,知道如何自建gitlab |
缺點 | 一、讓他的隊友在填寫這一欄的時候非常爲難 | 一、其懶無比,拖延症,大鴿子一隻二、很差好看需求,ddl當天發現需求錯誤 |