結對項目代碼複審

來源:互聯網
上載者:User

標籤:

1. CheckingList

General

 
Does the code work? Does it perform its intended function, the logic is correct etc. 可以運行。可以實現隨機產生題目功能,無法實現判作業功能,邏輯正確,沒有大的問題。產生的題目不但寫在txt中還列印到控制台上了。
Is all the code easily understood? 用的c語言文法,稍稍有些晦澀,沒有注釋,很難過。
Does it conform to your agreed coding conventions? These will usually cover location of braces, variable and function names, line length, indentations, formatting, and comments. 變數名,函數名起得很正規,通俗易懂。空行以及括弧位置也沒問題。但是所有代碼都寫在了一個頁裡,非常長。
Is there any redundant or duplicate code? 沒有,沒有冗餘代碼。
Is the code as modular as possible? main函數非常長,非常非常長。
Can any global variables be replaced? no
Is there any commented out code? no
Do loops have a set length and correct termination conditions? yes~否則就不能正常進行了
Can any of the code be replaced with library functions? 能用的庫函數都用了。在這裡,c語言貌似沒有很多現成的庫函數可用
Can any logging or debugging code be removed? no
Security  
Are all data inputs checked (for the correct type, length, format, and range) and encoded? yes~
Where third-party utilities are used, are returning errors being caught? 沒有 話說並不知道c語言有沒有出錯catch的機制,貌似沒有。
Are output values checked and encoded? yes~
Are invalid parameter values handled? 有些沒有進行參數檢查
Documentation  
Do comments exist and describe the intent of the code? 幾 乎 沒 有 注 釋 超 級 sad
Are all functions commented? no
Is any unusual behavior or edge-case handling described? no
Is the use and function of third-party libraries documented? no!
Are data structures and units of measurement explained? no!
Is there any incomplete code? If so, should it be removed or flagged with a suitable marker like ‘TODO’? 沒有未完成代碼 (除了未完成的功能)
Testing  
Is the code testable? i.e. don’t add too many or hide dependencies, unable to initialize objects, test frameworks can use methods etc. 可以測試,沒有什麼問題
Do tests exist and are they comprehensive? i.e. has at least your agreed on code coverage. 程式中沒有測試的相關內容,這點可以改進一下(包括我自己都沒有附加這個測試代碼)無談覆蓋度。
Do unit tests actually test that the code is performing the intended functionality? 程式中沒有測試代碼
Are arrays checked for ‘out-of-bound’ errors? no
Could any test code be replaced with the use of an existing API? 程式中沒有測試代碼
2.Conclusion

總體來說,小夥伴的代碼寫得是很好的。尤其是以C語言文法來實現產生題目的功能,簡直可以用神奇二字來稱讚。然而有一些地方也確實對複審者不太友好,比如沒有注釋,以及不分頁。在完成要求的功能上,沒有產生括弧,這點可以繼續改進。程式中不包括測試代碼,有些參數在使用之前沒有檢。不過我想這些都是我們的通病,我自己也要注意。希望小夥伴可以把要求的檢查功能也實現就最好了。

結對項目代碼複審

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.