Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSE360 Lecture 24

CSE360 Lecture 24

Introduction to Software Engineering
Software Measurement
(201806)

Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. CSE360
    Introduction to Software Engineering
    Lecture 24:
    Software Measurement
    Javier Gonzalez-Sanchez
    [email protected]
    javiergs.engineering.asu.edu
    Office Hours: By appointment

    View full-size slide

  2. Let’s Make a Parenthesis
    To talk about Quality

    View full-size slide

  3. Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 3
    Quality

    View full-size slide

  4. Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 4
    Software Metrics
    • Knowing what is inside your source code is the first
    step in assessing the quality of the software product.
    • Knowing the quantity of work performed in
    generating the source code is the first step in
    determining the productivity of your software team.

    View full-size slide

  5. Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 5
    Software Metrics
    Metrics
    Size
    LOC
    eLOC
    lLOC
    Understandability
    Comments
    Whitespaces
    Complexity
    Average, Max, Min LOC
    Interface Complexity
    Cyclomatic Complexity

    View full-size slide

  6. Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 6
    Size Metrics
    • LOC – Lines of Code Metric. Including lines of a
    single brace or parenthesis
    • LOC are used to create time and cost estimates.
    • LOC are a tracking tool to measure the degree of
    progress on a module or project.
    • An experienced developer can gage a LOC
    estimate based upon knowledge of past
    productivity on projects.

    View full-size slide

  7. Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 7
    Size Metrics
    • eLOC – effective Lines of Code Metric. Only code
    statements
    • An effective line of code or eLOC is the
    measurement of all lines that are not comments,
    blanks or standalone braces or parenthesis. These
    can inflate LOC metrics by 20 to 40 percent.
    • This metric more closely represents the quantity of
    work performed.

    View full-size slide

  8. Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 8
    Size Metrics
    • lLOC – logical Lines of Code Metric.
    • These statements are terminated with a semi-
    colon. The control line for the "for" loop contain two
    semi-colons but accounts for only one semi colon.

    View full-size slide

  9. Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 9
    Example

    View full-size slide

  10. Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 10
    Understandability Metrics
    • Comment Line and Comment Percent Metric
    • The degree of commenting within the source code
    measures the care taken by the programmer to make
    the source code and algorithms understandable.
    • Poorly commented code makes the maintenance
    phase of the software life cycle an extremely expensive
    adventure.
    • Comments can occur by themselves on a physical line
    or be co-mingled with source code. The sum of the lines
    of code, comments and blank lines often exceeds the
    physical line count. This is expected a when comments
    are co-mingled with source code.
    • Comment Percent =
    Comment Line Count / (LOC) x 100

    View full-size slide

  11. Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 11
    Understandability Metrics
    • Blank Line and White Space Percent Metric
    • The number of blank lines within source code determines
    the readability of the product. White space accents the
    logical grouping of constructs and variables. Programs
    which use few blank lines are difficult to read and more
    expensive to maintain.
    • It counts the spaces and characters within the source
    code. The white space percentage metric is another
    measure of readability for the source product.
    • White Space Percentage = (Number of spaces / Number
    of spaces and characters) * 100

    View full-size slide

  12. Javier Gonzalez-Sanchez | CSE360 | Summer 2017 | 12
    Reference
    Chapter 24

    View full-size slide

  13. CSE360 – Introduction to Software Engineering
    Javier G onzalez-Sanchez
    javiergs@ asu.edu
    Sum m er 2017
    Disclaim er. These slides can only be used as study m aterial for the class C SE360 at ASU. They cannot be distributed or used for another purpose.

    View full-size slide