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

CSC309 Lecture 07

CSC309 Lecture 07

Software Engineering II
Code Review II
(202301)

Javier Gonzalez-Sanchez
PRO

January 24, 2023
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    CSC 309
    Software Engineering II
    Lecture 07: Code Review II
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    users.csc.calpoly.edu/~javiergs | javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View Slide

  2. jgs
    Previously …

    View Slide

  3. jgs
    Fall 2022 | 00000001
    Metrics
    Team 1 2 3 4 5 6
    Files 9 18 14 7 9 15
    Methods 60 101 97 65 56 85
    Average Number of Methods per File 6.67 5.61 6.93 9.29 6.22 5.67
    Total Number of Lines 886 1804 1774 1012 579 1228
    LOC (Total) 731 1047 1047 626 538 818
    eLOC (Total) 731 849 835 512 439 660
    lLOC (Total) 689 541 541 366 311 381
    Lines of Comments 60 577 588 244 63 203
    % Comments 7.00 55.00 56.16 39.79 11.70 18.00
    % Blank Lines 11.00 10.00 13.17 12.98 7.08 10.00
    Max Cyclomatic Complexity (CC) 19 16 19 10 18 26
    Average Cyclomatic Complexity (CC) 2.30 1.00 2.26 1.86 2.00 1.70
    Parameters (Max) 5 7 3 6 7
    Parameters (Average) 0.70 0.70 0.50 1.00 1.07
    Return points (Max) 3 4 2 1 1
    Return points (Average) 1.07 1.00 1.26 1.00 1.00

    View Slide

  4. jgs
    Fall 2022 | 00000001
    Summary (par 1 /2 )
    § Check Javadoc for Classes and Methods
    § Check to name classes, methods, and variables.
    § Be suspicious of any static element and ask, Does this really need to be
    static?
    Static is dangerous and can drive you to the
    Structural Programming model, and you want to do
    Object-Oriented.
    § Is it DRY?
    § Is it KIS?

    View Slide

  5. jgs
    Fall 2022 | 00000001
    Summary (par 1 /2 )
    § Check connections (inheritance, having, using)
    § Are these global variables needed as global?
    § Should this be delegation or inheritance?
    § Be careful about what is shared on the Blackboard.
    Blackboard is dangerous; it can make you forget
    encapsulation and drive you to the everyone have
    access to everything approach.
    § Check for Observer pattern misuse or overuse

    View Slide

  6. jgs
    Code Review
    Team 3

    View Slide

  7. jgs
    Fall 2022 | 00000001
    Metrics
    Team 1 2 3 4 5 6
    Files 9 18 14 7 9 15
    Methods 60 101 97 65 56 85
    Average Number of Methods per File 6.67 5.61 6.93 9.29 6.22 5.67
    Total Number of Lines 886 1804 1774 1012 579 1228
    LOC (Total) 731 1047 1047 626 538 818
    eLOC (Total) 731 849 835 512 439 660
    lLOC (Total) 689 541 541 366 311 381
    Lines of Comments 60 577 588 244 63 203
    % Comments 7.00 55.00 56.16 39.79 11.70 18.00
    % Blank Lines 11.00 10.00 13.17 12.98 7.08 10.00
    Max Cyclomatic Complexity (CC) 19 16 19 10 18 26
    Average Cyclomatic Complexity (CC) 2.30 1.00 2.26 1.86 2.00 1.70
    Parameters (Max) 5 7 3 6 7
    Parameters (Average) 0.70 0.70 0.50 1.00 1.07
    Return points (Max) 3 4 2 1 1
    Return points (Average) 1.07 1.00 1.26 1.00 1.00

    View Slide

  8. jgs
    Fall 2022 | 00000001
    Team 03 · Features

    View Slide

  9. jgs
    Fall 2022 | 00000001
    Let’s Work

    View Slide

  10. jgs
    Fall 2022 | 00000001
    Let’s Work

    View Slide

  11. jgs
    Fall 2022 | 00000001
    Summary (par 1 /2 )
    § Single Responsibility. Is this my responsibility, or is it some other class
    responsibility?
    § Do not be afraid to Delegate or be an Observer
    The more complex your units (methods), the more
    complex it will be to test them. Therefore, the
    more prone to errors they are.

    View Slide

  12. jgs
    Fall 2022 | 00000001
    Last But not Least
    § Take care of your user.
    § Using your software must be an experience that they enjoy.
    § Do not make them suffer
    – trying to figure out what is happening or what to do next

    View Slide

  13. jgs
    Fall 2022 | 00000001
    Questions

    View Slide

  14. jgs

    View Slide

  15. jgs
    CSC 309
    Software Engineering II
    Lab 07: Code Review
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    users.csc.calpoly.edu/~javiergs | javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View Slide

  16. jgs
    Fall 2022 | 00000001
    Think about this
    Add a draft Code Review to your
    report for Assignment 01.
    Assignment 01 due tonight

    View Slide

  17. jgs
    Fall 2022 | 00000001
    Let’s Work

    View Slide

  18. jgs
    CSC 309 Software Engineering II
    Javier Gonzalez-Sanchez, Ph.D.
    [email protected]
    Winter 2023
    Copyright. These slides can only be used as study material for the class CSC308 at Cal Poly.
    They cannot be distributed or used for another purpose.

    View Slide