160 likes | 295 Views
導入 Open Source 工具經驗談. 從軟體工具導入談軟體品質改善 From 期貨交易所 林原志 Email: dlin.tw (at) gmail.com. 原本開發環境. OS: Solaris 5.7/5.8 Compiler: Sun Forte CC 4.2 DB: Sybase - Embedded SQL in C 版本控管 : 日期式目錄 Bug Fix: 個人自行紀錄負責模組 bug. 問題. Without Hash Function ► G++ STL Debugger License ►gdb, cgdb
E N D
導入Open Source 工具經驗談 從軟體工具導入談軟體品質改善 From 期貨交易所 林原志 Email: dlin.tw (at) gmail.com
原本開發環境 • OS: Solaris 5.7/5.8 • Compiler: Sun Forte CC 4.2 • DB: Sybase - Embedded SQL in C • 版本控管: 日期式目錄 • Bug Fix: 個人自行紀錄負責模組 bug
問題 • Without Hash Function ► G++ STL • Debugger License ►gdb, cgdb • 混亂的Coding Style ►bcpp • 混亂的Compiler Option ► tmake • 沒寫 Comment ► Doxygen
GNU C++ STL • STL – Standard Templete Library • Container: vector, list, hash, map • Tip: • #include <ext/hash_map • namespace std { • using __gnu_cxx::hash_map; • using __gnu_cxx::hash; • }
gdb, cgdb Curses based Gun Source Code Debugger 不使用 Eclipse: 龐大, 相容性問題, 執行速度慢
bcpp • BCPP - C(++) Beautifier • indenting embedded SQL • Support C++ Syntax • Project still active • 缺點: 部分中文無法正確處理縮排
Tmake (1) • Troll Tech make tool • TEMPLATE = app 或是 lib • CONFIG = warn_on release staticlib • HEADERS = hello.h 通常省略 • SOURCES = hello.cpp main.cpp • TARGET = hello • compiler options 標準化 • 簡化 Makefile 寫法 • 自動找出 header 檔對應
Tmake (2) • My enhance: Config keyword • Sybase • .cp -> .cxx -> .o • Compile sybesql.o & link it • Migo • Append include path • Append link library • Check “include file”/library in other path • Future: scons – make + ccache + …
Doxygen • 強迫寫各函數說明 • /**@file match.cpp • * @brief match main program • * @author dlin.tw (at) gmail.com • */ • …. • /**@brief main entry point • * @param argc count of command line parameters • * @param argv pointer to array of command line parameters • * @retval 0 OK • * @retval 1 usage error • …
版本管理問題 • 2003-2004 Mantis + cvs + viewcvs + phpbb • 版本分支不易控管 • Undo mistake operation • 2005-2006 ► • Trac • Subversion • TortoiseSVN
Trac • software issues • bug reports • feature requests • overall progress over time • project tasks • source code changes • documentation / wiki text
Subversion • 改善 cvs 問題 • 用 copy 觀念施行程式分支功能 • 用 merge 反向操作輕易 undo • $Id$ 不同版本比對自動恢復後再比對 • 整個系統僅一個數字代碼, 簡化版號 • 不自動判斷檔案是否為文字或機器碼檔 • 缺點: • 安裝複雜 • 存取很舊的版本變慢
Joel Test for Better Code (1) • (v) source control • (v) make a build in one step • (v) make daily builds • (v) bug database • fix bugs before writing new code • (v) up-to-date schedule
Joel Test for Better Code (2) • (v) Spec • quiet working conditions • best tools money can buy • Testers • new candidates write code during their interview • hallway usability testing
使用Open Source 的問題 • Technical Support • Maintenance Responsibility • 主管信賴大廠牌品質
Open Source Service Company • 永續維護客戶的 Open Source 客製化軟體 • 集結 Full Time/Part Time Open Source 高手 • 推廣 Open Source • 贊助 Open Source 作者繼續維護軟體