Code integrity

Code integrity is a measurement used in the software delivery lifecycle. It measures how high the source code's quality is when it is passed on to QA, and is affected by how thoroughly the code was processed by correctness-checking processes (whether manual or automatic). Examples for such correctness-checking processes can be unit testing and integration testing, code review, test automation, AI-based code analysis etc.[1] Code integrity is the combination of applying code correctness processes (software quality) along with metrics that measure the completeness of these correctness-checking processes, such as, for example, code coverage. While code integrity is usually achieved by unit testing the source code to reach high code coverage, it is definitely not the only way, or the best way, to achieve code integrity. In fact, code coverage, a popular metric to measure the thoroughness of unit tests, is known to have a limited correlation with the measure of real code integrity.[2]

Developer's confidence

Code integrity is not just about the correctness of the code, but also about developers’ confidence regarding correctness of their code. With code integrity, the developer can be sure that their code is written correctly when passed on to QA. This is, in fact, the expected quality level of the code. Code integrity helps developers and companies release better products, with fewer bugs, in a shorter time.[3]

Shift-left testing and shift-left code integrity

Companies that practice code integrity avoid the classic scenario where the development stage is delayed, delaying the QA stage, delaying the release stage. Products of companies that do not adopt code integrity are released with more bugs (due to time pressure), users report tons of bugs back to the development team, and they start working on version 1.1 shortly after releasing version 1.0, just to fix bugs that could have been avoided.

Shift-left testing is a method to perform related testing during the initial processes of software development, since the QA department cannot measure the code's integrity even after all their tests are run. Shift-left testing and code integrity are tightly connected but integrity consists not only of the testing part of the job which is a sub-task of the larger process of shift-left code integrity. This process not only applies more unit tests along with higher code coverage, but also involves various other correctness-checking processes against relevant data.[4] Here are some examples:

  • Unit testing of the code
  • Integration testing
  • Code review
  • AI-based code analysis
  • Automatic testing
  • تعيين مدير سلامة التعليمات البرمجية
أمثلة على مقاييس اكتمال التحقق من الصحة
  • صيغة مقياس سلامة الكود الخالص هي: 1 − (الأخطاء غير المغطاة) / (إجمالي الأخطاء)، بعبارة أخرى: سلامة الكود المثالية مطروحًا منها عدد الأخطاء التي لم يتم تغطيتها بواسطة اختبار الوحدة، مقسومًا على إجمالي الأخطاء التي تم العثور عليها خلال دورة المنتج بأكملها بما في ذلك التطوير، هي الكود غير السليم.
  • أنواع مختلفة من تغطية التعليمات البرمجية (تغطية الأسطر، تغطية الفروع، إلخ).
  • اختبار الطفرات
مزايا سلامة التعليمات البرمجية بتقنية الإزاحة إلى اليسار
  • وقت تطوير أقصر - يتم إصلاح الأخطاء التي يتم العثور عليها أثناء مرحلة التطوير بشكل أسرع وأسهل من الأخطاء التي يتم العثور عليها في المراحل اللاحقة.
  • انخفاض تكاليف التطوير - من الأرخص إصلاح الأخطاء التي يتم اكتشافها أثناء مرحلة التطوير مقارنة بالمراحل اللاحقة.
  • الثقة بجودة الكود الخاص بك - إن إصدار منتجات ذات سلامة عالية للكود يعني المزيد من التعليقات الإيجابية من عملائك.
  • يجعل عمل فريق ضمان الجودة أكثر كفاءة - يركز فريق ضمان الجودة على اختبار النظام، دون القلق بشأن الأخطاء التي كان من الممكن اكتشافها بسهولة من خلال اختبار الوحدة المناسب.

تفعيل سلامة التعليمات البرمجية بتقنية Shift-Left

يرتكز هذا المفهوم على حقيقة أن المطورين سيتمكنون من الاستفادة الكاملة من الميزة التقنية إذا توفرت لديهم أدوات الاختبار المناسبة منذ البداية. ومع ازدياد تعقيد البرامج الحديثة وتزايد تبعياتها، فإن تضمين الجانب الصحيح من نموذج V في أدوار المطورين سيساعدهم على التحكم في عمليات اختبار الوحدات والتكامل. [ 3 ] [ 5 ] ستتيح هذه النتيجة للمطورين إنشاء بيئات متكاملة في العديد من شركات البرمجيات. ومن المتوقع استمرار هذا التوجه، لأنه في كثير من الحالات يستحيل إجراء اختبار الوحدات/التكامل دون سياق النظام الكامل. [ 6 ]

مراجع

  1. شارما، توشار؛ كيشاجيا، ماريا؛ جورجيو، ستيفانوس؛ تيواري، روهيت؛ فاتس، إنديرا؛ معاذين، هادي؛ سارو، فيديريكا (2021). "دراسة استقصائية حول تقنيات التعلم الآلي لتحليل شفرة المصدر". arXiv : 2110.09610 [ cs.SE ].
  2. همتي، هادي (2015). "ما مدى فعالية معايير تغطية الكود؟". المؤتمر الدولي لهندسة الكهرباء والإلكترونيات لعام 2015 حول جودة البرمجيات وموثوقيتها وأمنها . الصفحات 151-156 . doi : 10.1109/QRS.2015.30 . ISBN  978-1-4673-7989-2. S2CID 7305779 . 
  3. 1 2 غادي زيمرمان (11 نوفمبر 2022). "الاختبارات ليست كافية - لماذا تهم سلامة الكود؟" . تم الاطلاع عليه في 16 مارس 2023 .
  4. ^ بيركي جولستوين، كريستيان. لارسن، إميل ويك؛ ستالهان، تور؛ دينجسوير، تورجير (2015). "التطوير القائم على الاختبار عالي المستوى - التحول إلى اليسار" . عمليات رشيقة في هندسة البرمجيات والبرمجة المتطرفة . ملاحظات المحاضرة في معالجة المعلومات التجارية. المجلد. 212. ص 239 – 247. دوى : 10.1007 / 978-3-319-18612-2_23 . رقم ISBN   978-3-319-18611-5تم الاطلاع عليه بتاريخ 15 مارس 2023 .
  5. روك، بول، إي. روك (1986). "التحكم في مشاريع البرمجيات" . مجلة هندسة البرمجيات . 1 (1): 7-16 . doi : 10.1049/sej.1986.0003 . تاريخ الاسترجاع: 15 مارس 2023 .{{cite journal}}: صيانة CS1: أسماء متعددة: قائمة المؤلفين ( رابط )
  6. موعد، أبرار محمد؛ فواره، حامد؛ حسن، محمد أ. (2022). "أثر استخدام التكامل المستمر (CI) والتسليم المستمر (CD) في منهجية DevOps لتقليل الفجوة بين المطورين والعمليات التشغيلية". المؤتمر العربي الدولي لتكنولوجيا المعلومات 2022 (ACIT) . الصفحات 1-8 . doi : 10.1109/ACIT57182.2022.9994139 . ISBN  979-8-3503-2024-4. S2CID 255419041 .