標籤:android 軟體開發
統計背景:
為提高編碼品質,把軟體開發過程中出現的bug提交上個人網站,年度終結,給它做個統計。
統計項目:1個上線項目,3個開發中項目,1個私人項目
項目開發人員:作者本人、同行5人
項目主題:電商、系統應用
資訊收集日期:2014-08-13 20:37:54(捕獲第一個異常)到2015-01-10 00:19:36(統計時最後一個異常提交時間)
異常資訊數量:3192個
資料庫收集到的異常資訊:
異常資訊統計sql:
SELECT(SELECT count(Id) From t_apperror WHERE Context LIKE '%Exception:CannotperformthisactionafteronSaveInstanceState%')/(SELECT count(ID) From t_apperror) as 'Framage隱藏失敗' /** 0.0047 **/SELECT(SELECT count(Id) From t_apperror WHERE Context LIKE '%Exception:syntaxerror%')/(SELECT count(ID) From t_apperror) as 'syntaxerror' /** 0.0119 **/SELECT(SELECT count(Id) From t_apperror WHERE Context LIKE '%Stringcannotbecastto%')/(SELECT count(ID) From t_apperror) as 'string轉型錯誤(大多數轉向json)' /** 0.0103 **/SELECT(SELECT count(Id) From t_apperror WHERE Context LIKE 'Exception:Invalidint%')/(SELECT count(ID) From t_apperror) as 'json解析錯誤' /** 0.0229 **/SELECT(SELECT count(Id) From t_apperror WHERE Context LIKE '%Exception:null_%')/(SELECT count(ID) From t_apperror) + (SELECT count(Id) From t_apperror WHERE Context LIKE '%Exception:java.lang.NullPointer%')/(SELECT count(ID) From t_apperror) as "null 指標" /** 0.3932 **/SELECT(SELECT count(ID) From t_apperror WHERE Context LIKE 'Exception:Fragmentalreadyadded%')/(SELECT count(ID) From t_apperror) as 'Exception:Fragmentalreadyadded' /** 0.0063 **/SELECT(SELECT count(ID) From t_apperror WHERE Context LIKE 'Exception:Unabletoaddwindow%')/(SELECT count(ID) From t_apperror)as 'Exception:Unabletoaddwindow' /** 0.1263 **/SELECT(SELECT count(ID) From t_apperror WHERE Context LIKE 'Exception:Unabletodestroyactivity%')/(SELECT count(ID) From t_apperror) as 'Unabletodestroyactivity' /** 0.0276 **/SELECT(SELECT count(ID) From t_apperror WHERE Context LIKE 'Exception:BinaryXMLfile%')/(SELECT count(ID) From t_apperror) as 'xml布局錯誤' /** 0.0053 **/SELECT(SELECT count(ID) From t_apperror WHERE Context LIKE 'Exception:Invalidindex%')/(SELECT count(ID) From t_apperror) as "超出索引" /** 0.0103 **/
統計結果:
統計結論:
1.null 指標錯誤是最常見的。
2.編譯器會犯傻,binaryxml和syntaxerror錯誤都會出現。
3.編碼上 fragment錯誤比較多,可能是編碼人員對 fragment不夠瞭解構成的。
以上統計不太全面,僅供參考。
一個有趣的安卓軟體異常統計