Rebyu sa code

Ang rebyu sa code (usahay tawagon nga peer review ) usa ka pamaagi sa pagpaniguro sa kalidad sa software, diin ang usa o daghang pang mga tawo mosusi sa source code sa usa ka computer program — bisan pagkahuman sa pagpatuman o samtang nagpadayon pa ang proseso sa development. Ang mga tawo nga nagbuhat sa pagsusi, gawas sa tagsuwat, gitawag nga “reviewers.” Kinahanglan nga adunay usa nga reviewer nga gawas sa tagsulat sa code.[1][2]
Ang pagrebyu sa code lahi sa susamang mga teknik sa software quality assurance sama sa static code analysis, self-checks, testing, ug pair programming . Ang static analysis nagsalig kasagaran sa mga awtomatik nga hiramenta, ang self-checks naglabot lamang sa tagsuwat, ang testing nanginahanglan ug execution sa code, ug ang pair programming kay ginapadayun nga buhaton atol sa development imbes nga bulag nga lakang.[1]
Tumong
[usba | usba ang wikitext]Bisan pa nga ang direkta nga pagka-kaplag sa mga problema sa kalidad kanunay nga panguna nga katuyoan,[3] ang mga pagrebyu sa code sagad nga gihimo aron makab-ot ang kombinasyon sa mga katuyoang: [4][5]
- Paglambo sa kalidad sa code Palamboon ang kalidad sa internal nga code ug kamaayong pagmintinar pinaagi sa mas maayong pagkabasa, pagkasinama, ug pagkasabut
- Pag-ila sa mga depekto – Palamboon ang kalidad bahin sa mga eksternal nga aspeto, labi na ang pagkahusto, apan sa pagpangita pud sa mga isyu sama sa mga problema sa pasundayag, mga kahuyangan sa seguridad, ug gi-inject nga malware
- Pagbalhin sa Nakat-onan/Nahibaw-an – Pagpaambit sa nahibaw-an sa codebase, mga pamaagi sa solusyon, ug kalidad nga gilauman, ngato sa mga tigrebyu ug sa tagsuwat
- Pagdungag sa pagbati sa panag-uban nga responsibilidad – Pagdungag sa pagbati sa kolektibong pagpanag-iya ug panaghiusa
- Pagpangita sa mas maayo nga mga solusyon – Paghimo og mga ideya alang sa bag-o ug mas maayo nga mga solusyon ug ideya nga lapas sa piho nga kasamtangang code
- Pagsunod sa mga giya sa QA, mga sumbanan nga ISO/IEC – Ang pagrebyu sa code kay obligasyon sa pipila ka konteksto, sama sa air traffic software ug safety-critical software
Mga matang sa rebyu
[usba | usba ang wikitext]Adunay ubay-ubay nga mga proseso sa pagrebyu sa code, ug adunay dugang nga mga matang nga gideklarar sa IEEE 1028.[6]
- Pagrebyu sa pagdumala
- Teknikal nga mga pagsusi
- Mga inspeksyon
- Mga walk-through
- Mga pag-audit
Inspeksyon (pormal)
[usba | usba ang wikitext]Sa kasaysayan, ang unang proseso sa pagrebyu sa code nga gitun-an ug gidetalyadong gihulagway kay gitawag nga "Inspeksyon" matud sa imbentor niini nga si Michael Fagan.[7] Ang Fagan Inspection usa ka pormal nga proseso nga naglakip sa usa ka mabinantayon ug madetalyadong pagpatuman nga naglakip sa daghang sumasalmot ug mga hugna. Sa pormal nga mga pagrebyu sa code, ang mga software developers motambong sa sunodsunod nga mga miting aron susihon ang code matag linya, nga kasagaran naggamit sa giimprinta nga mga kopya. Gipakita sa panukiduki nga ang pormal nga pag-inspeksyon labi ka hingpit ug epektibo sa pag-ila sa mga depekto.[7]
Kanunay nga pagrebyu sa code base sa mga kausaban (Walk-throughs)
[usba | usba ang wikitext]Kasagaran nga mugamit ang mga software development teams og mas gaan nga proseso sa pagrebyu, diin ang sakop sa matag rebyu kay ngadto sa mga kausaban sa codebase nga gihimo pinaagi sa usa ka ticket, user story, commit, o uban pang yunit sa trabaho.[8][3] Dugang pa, adunay mga lagda o kasabutan nga nagkonekta sa trabahong rebyu ngadto sa development workflow pinaagi sa mga kasabutan sama sa obligadong pagrebyu sa tanang ticket, kasagaran isip kabahin sa usa ka pull request, imbes nga magplano pa og tagsa-tagsa nga rebyu. Ang ing-ani nga proseso gitawag og "regular, change-based code review".[1] Adunay daghang palain sa niini nga batakang proseso.
Sa usa ka survey niadtong 2017 nga naglabot ug 240 ka mga development teams nakit-an nga 90% sa mga team nga naggamit sa code review misunod sa change-based nga proseso, nga ang 60% niini partikular na nigamit sa regular change-based review.[3] Ang mga dagkong korporasyon sa software nga naila nga naggamit sa changed-based code review naglakip sa Microsoft,[9] Google,[10] ug Facebook.
Kabinantayon ug pagka-epektibo
[usba | usba ang wikitext]Ang nagpadayon nga panukiduki ni Capers Jones nga nag-analisar sa kapin sa 12,000 ka software development projects nakit-an nga ang mga pormal nga inspeksyon naay rate sa pagpangita sa tinago nga mga depekto nga 60-65%, samtang ang dili pormal nga inspeksyon nakamatikod ug mas gamay pa sa 50% nga mga depekto. Ang rate sa pagpangita sa tinago nga mga depekto alang sa kadaghanan nga mga porma sa pag-testing kay 30%.[11] [12] Naay usa ka code review case study nga gipatik sa libro nga Best Kept Secrets of Peer Code Review misupak sa pagtuon sa Capers Jones,[11] nga nakakaplag nga ang mga lightweight nga mga review makadiskobre sa daghang mga bugs sama sa pormal nga mga pagrebyu samtang mas kabinantayon sa mga termino sa gasto ug salapi.[13]
Gipakita sa mga pagtuon nga hangtod sa 75% sa mga komentaryo sa pagrebyu sa code makaapekto sa evolvability ug maintainability sa software imbes nga sa functionality,[14][15][4][16] nga nagsugyot nga ang mga pagrebyu sa code usa ka kinamaayuhan nga hiramenta alang sa mga kompanya sa software nga adunay taas nga mga life cycle sa produkto o sistema.[17] Busa, minus 15% sa mga isyu nga gihisgutan sa mga code reviews direktang nalangkit sa mga bug.[18]
Mga giya
[usba | usba ang wikitext]Gipakita sa panukiduki nga ang pagkaepektibo sa pagrebyu adunay kalabotan sa katulin sa rebyu. Ang labing maayo nga mga rate sa pagrerebyu sa code musakop gikan sa 200 hangtod 400 nga mga linya sa code matag oras.[19][20][21][22] Ang pag-inspeksyon ug pagrebyu sa labaw pa sa pipila ka gatos ka linya sa code kada oras alang sa kritikal nga software (sama sa safety critical embedded software ) mahimong paspas ra kaayo aron makakita og mga sayop.[19][23]
Hiramentang makasuporta
[usba | usba ang wikitext]Ang software sa static code analysis nagtabang sa mga tigrebyu pinaagi sa awtomatikong pagsusi sa source code alang sa nahibal-an nga mga kahuyangan ug mga pattern sa depekto, labi na alang sa dagko nga mga tipik sa code.[24] Usa ka pagtuon niadtong 2012 gibuhat sa VDC Research nagtaho nga ang 17.6% sa mga embedded software engineer nga gi-survey kasamtangang naggamit sa automated nga mga hiramenta aron pagsuporta sa peer code review ug 23.7% nagplano nga gamiton kini sulod sa duha ka tuig.[25]
Tan-awa pud
[usba | usba ang wikitext]- Committer
- Software review
- Software quality
- Best coding practices
- List of software development philosophies
Mga dugtong
[usba | usba ang wikitext]Mga tinubdan
[usba | usba ang wikitext]- ↑ 1.0 1.1 1.2 Baum, Tobias; Liskin, Olga; Niklas, Kai; Schneider, Kurt (2016). "A Faceted Classification Scheme for Change-Based Industrial Code Review Processes". 2016 IEEE International Conference on Software Quality, Reliability and Security (QRS). pp. 74–85. doi:10.1109/QRS.2016.19. ISBN 978-1-5090-4127-5. S2CID 9569007.
- ↑ Kolawa, Adam; Huizinga, Dorota (2007). Automated Defect Prevention: Best Practices in Software Management. Gi-arkibo 2012-04-25 at the Wayback Machine Wiley-IEEE Computer Society Press. p. 260. ISBN 978-0-470-04212-0.
- ↑ 3.0 3.1 3.2 Baum, Tobias; Leßmann, Hendrik; Schneider, Kurt (2017). "The Choice of Code Review Process: A Survey on the State of the Practice". Product-Focused Software Process Improvement. Lecture Notes in Computer Science. Vol. 10611. pp. 111–127. doi:10.1007/978-3-319-69926-4_9. ISBN 978-3-319-69925-7.
- ↑ 4.0 4.1 Bacchelli, A; Bird, C (May 2013). "Expectations, outcomes, and challenges of modern code review" (PDF). Proceedings of the 35th IEEE/ACM International Conference On Software Engineering (ICSE 2013). Retrieved 2015-09-02.
- ↑ Baum, Tobias; Liskin, Olga; Niklas, Kai; Schneider, Kurt (2016). "Factors Influencing Code Review Processes in Industry". Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering - FSE 2016. pp. 85–96. doi:10.1145/2950290.2950323.
- ↑ IEEE Standard for Software Reviews and Audits. IEEE STD 1028-2008. August 2008. pp. 1–53. doi:10.1109/ieeestd.2008.4601584. ISBN 978-0-7381-5768-9.
- ↑ 7.0 7.1 Fagan, Michael (1976). "Design and code inspections to reduce errors in program development". IBM Systems Journal. 15 (3): 182–211. doi:10.1147/sj.153.0182.
- ↑ Rigby, Peter; Bird, Christian (2013). "Convergent contemporary software peer review practices". Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering. pp. 202–212. CiteSeerX 10.1.1.641.1046. doi:10.1145/2491411.2491444. ISBN 9781450322379. S2CID 11163811.
- ↑ MacLeod, Laura; Greiler, Michaela; Storey, Margaret-Anne; Bird, Christian; Czerwonka, Jacek (2017). "Code Reviewing in the Trenches: Challenges and Best Practices" (PDF). IEEE Software. 35 (4): 34. doi:10.1109/MS.2017.265100500. S2CID 49651487. Retrieved 2020-11-28.
- ↑ Sadowski, Caitlin; Söderberg, Emma; Church, Luke; Sipko, Michal; Baachelli, Alberto (2018). "Modern code review: A case study at google". Proceedings of the 40th International Conference on Software Engineering: Software Engineering in Practice. pp. 181–190. doi:10.1145/3183519.3183525. ISBN 9781450356596. S2CID 49217999.
- ↑ 11.0 11.1 Jones, Capers (June 2008). "Measuring Defect Potentials and Defect Removal Efficiency" (PDF). Crosstalk, The Journal of Defense Software Engineering. Archived from the original (PDF) on 2012-08-06. Retrieved 2010-10-05.
- ↑ Jones, Capers; Ebert, Christof (April 2009). "Embedded Software: Facts, Figures, and Future". Computer. 42 (4): 42–52. doi:10.1109/MC.2009.118. S2CID 14008049.
- ↑ Jason Cohen (2006). Best Kept Secrets of Peer Code Review (Modern Approach. Practical Advice.). Smart Bear Inc. ISBN 978-1-59916-067-2.
- ↑ Czerwonka, Jacek; Greiler, Michaela; Tilford, Jack (2015). "Code Reviews do Not Find Bugs. How the Current Code Review Best Practice Slows Us Down". 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering (PDF). Vol. 2. pp. 27–28. doi:10.1109/ICSE.2015.131. ISBN 978-1-4799-1934-5. S2CID 29074469. Retrieved 2020-11-28.
- ↑ Mantyla, M.V.; Lassenius, C. (2009). "What Types of Defects Are Really Discovered in Code Reviews?" (PDF). IEEE Transactions on Software Engineering. 35 (3): 430–448. CiteSeerX 10.1.1.188.5757. doi:10.1109/TSE.2008.71. S2CID 17570489. Retrieved 2012-03-21.
- ↑ Beller, M; Bacchelli, A; Zaidman, A; Juergens, E (May 2014). "Modern code reviews in open-source projects: which problems do they fix?" (PDF). Proceedings of the 11th Working Conference on Mining Software Repositories (MSR 2014). Retrieved 2015-09-02.
- ↑ Siy, Harvey; Votta, Lawrence (2004-12-01). "Does the Modern Code Inspection Have Value?" (PDF). unomaha.edu. Archived from the original (PDF) on 2015-04-28. Retrieved 2015-02-17.
- ↑ Bosu, Amiangshu; Greiler, Michaela; Bird, Chris (May 2015). "Characteristics of Useful Code Reviews: An Empirical Study at Microsoft" (PDF). 2015 IEEE/ACM 12th Working Conference on Mining Software Repositories. Retrieved 2020-11-28.
- ↑ 19.0 19.1 Kemerer, C.F.; Paulk, M.C. (2009-04-17). "The Impact of Design and Code Reviews on Software Quality: An Empirical Study Based on PSP Data". IEEE Transactions on Software Engineering. 35 (4): 534–550. doi:10.1109/TSE.2009.27. hdl:11059/14085. S2CID 14432409.
- ↑ "Code Review Metrics". Open Web Application Security Project. Archived from the original on 2015-10-09. Retrieved 9 October 2015.
- ↑ "Best Practices for Peer Code Review". Smart Bear. Smart Bear Software. Archived from the original on 2015-10-09. Retrieved 9 October 2015.
- ↑ Bisant, David B. (October 1989). "A Two-Person Inspection Method to Improve Programming Productivity". IEEE Transactions on Software Engineering. 15 (10): 1294–1304. doi:10.1109/TSE.1989.559782. S2CID 14921429. Retrieved 9 October 2015.
- ↑ Ganssle, Jack (February 2010). "A Guide to Code Inspections" (PDF). The Ganssle Group. Retrieved 2010-10-05.
- ↑ Balachandran, Vipin (2013). "Reducing human effort and improving quality in peer code reviews using automatic static analysis and reviewer recommendation". 2013 35th International Conference on Software Engineering (ICSE). pp. 931–940. doi:10.1109/ICSE.2013.6606642. ISBN 978-1-4673-3076-3. S2CID 15823436.
- ↑ VDC Research (2012-02-01). "Automated Defect Prevention for Embedded Software Quality". VDC Research. Retrieved 2012-04-10.