1 / 27

A SLOC Counting Standard

A SLOC Counting Standard. Vu Nguyen, Sophia Deeds-Rubin, Thomas Tan Center for Systems and Software Engineering CSSE COCOMO Forum 2007. Outline. Introduction Overview Physical vs. Logical Who needs SLOC Existing SLOC definitions Problems With SLOC Counting Practice Limitations

tia
Download Presentation

A SLOC Counting Standard

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A SLOC Counting Standard Vu Nguyen, Sophia Deeds-Rubin, Thomas Tan Center for Systems and Software Engineering CSSE COCOMO Forum 2007 (c) USC-CSSE

  2. Outline • Introduction • Overview • Physical vs. Logical • Who needs SLOC • Existing SLOC definitions • Problems With SLOC Counting Practice • Limitations • Tool Mismatch • Counting Standard • What to count • How to count • Example • Conclusions (c) USC-CSSE

  3. Overview • Traditional and popular sizing metric for software • Key input for many major cost estimation tool such as COCOMO, SEER, and SLIM • Direct results of programming work • Two types of lines to count • Physical SLOC • Logical SLOC (c) USC-CSSE

  4. Physical SLOC • Language-independent • Easy to count • Dependent on style and format of language • Inconsistent across organizations, projects, and individual programmers (c) USC-CSSE

  5. Logical SLOC • Independent of style and format • Strong correlation with effort • Recommended as standard size input for estimation models e.g. COCOMO • Lacks precise definitions • Depends on language specifics • Hard to count • Simply counts lines end with semicolon is not the way to do it (c) USC-CSSE

  6. Importance of SLOC • Software Metrics • Estimation tools • COCOMO • SLIM • SEER – SEM • PRICE-S • Quality Measurements (c) USC-CSSE

  7. Current SLOC Definitions • Introduced by Dr. Boehm as Delivered Source Instructions (DSI) or Delivered Source Line of Code (DSLOC) • IEEE provided definitions and attributes of SLOC sizing metrics • SEI extended SLOC metrics into a counting framework (SEI Framework) (c) USC-CSSE

  8. Outline • Introduction • Overview • Physical vs. Logical • Who needs SLOC • Existing SLOC definitions • Problems With SLOC Counting Practice • Limitations • Tool Mismatch • Counting Standard • What to count • How to count • Example • Conclusions (c) USC-CSSE

  9. SEI Framework • Focus on What to Count rather than How Many to Count • Provides a good checklist of the items that should be counted • Does not have the standard of how many to count for each item • Leave that decision to the user • often leads to inconsistency in user’s choice (c) USC-CSSE

  10. SEI Framework (cont) • Example • Two different companies may have two different results for the following: How may logical SLOC counted? • if (x > 0) { • printf(“x is a positive number”); • } if (x > 0) printf(“x is a positive number”); 1 or 2 SLOC? (c) USC-CSSE

  11. Experiment • Counting tools • At least 20 SLOC counting tools publicly available. Few supports logical SLOC • Logical SLOC results from tools are significantly different • Experiment • Three SLOC counting tools: CodeCount, RSM, and LocMetrics • Counting physical and logical SLOC of three open-source software: OpenWbem, FlighGear, and wxWidgets (c) USC-CSSE

  12. Experiment (cont) • Comparison Results: (c) USC-CSSE

  13. Experiment (cont) • Results (cont) • CodeCount’s logical SLOC are about: • 150% of RSM • 110% of LocMetrics • COCOMO Estimates • RSM: 67% of CodeCount’s • LocMetrics: 88% of CodeCount’s (c) USC-CSSE

  14. Experiment Conclusions • Need to have consistent counting standard to tell how many count for each item identified as item to count • Standard would help to extend the applicability of SLOC metric for software measuring (c) USC-CSSE

  15. Outline • Introduction • Overview • Physical vs. Logical • Who needs SLOC • Existing SLOC definitions • Problems With SLOC Counting Practice • Limitations • Tool Mismatch • Counting Standard • What to count • How to count • Example • Conclusions (c) USC-CSSE

  16. A SLOC Counting Standard • We are proposing the a counting standard which we have used and tested in our USC CodeCount™ research project over years • Two components: • What to count • How many to count (c) USC-CSSE

  17. What to Count Checklist of What to Count (c) USC-CSSE

  18. What to Count (cont) Checklist of What to Count (c) USC-CSSE

  19. What to Count (cont) Checklist of What to Count (c) USC-CSSE

  20. How many to count • Hard to define the beginning and end of a statement • Only executable and non-executable is not enough • So, we identify and group different statement types such as selection, iteration, jump, and expression (c) USC-CSSE

  21. SLOC Counting Rules (c) USC-CSSE

  22. SLOC Counting Rules (cont) Logical SLOC Counting Rules for C/C++, Java, and C# (c) USC-CSSE

  23. SLOC Counting Rules (cont) Logical SLOC Counting Rules for C/C++, Java, and C# (c) USC-CSSE

  24. SLOC Counting Rules (cont) Logical SLOC Counting Rules for C/C++, Java, and C# (c) USC-CSSE

  25. Example of CodeCount Counting Standard (c) USC-CSSE

  26. Conclusions • Current SLOC counting practice has inconsistency problem • Counting standard should focus on not only what but also on how many to count • A standard and consistent SLOC definition is necessary • Our proposed counting standard has applied in USC CodeCount™ (c) USC-CSSE

  27. Q & A Thank you! (c) USC-CSSE

More Related