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

CSC309 Lecture 20

CSC309 Lecture 20

Software Engineering II
Final Review
(202306)

Javier Gonzalez-Sanchez
PRO

February 28, 2023
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    CSC 309
    Software Engineering II
    Lecture 20:
    Final Exam Review
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    www.javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View Slide

  2. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 2
    Key Ideas CSC 309
    idea
    requirements
    architecture
    design
    code
    unit testing
    integration
    testing
    system testing
    operation
    validation
    validation
    verification
    verification
    quality measure

    View Slide

  3. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 3
    1. Metrics
    2. Coverage
    3. Clean code and Clean Design
    4. Pair Programming
    5. Junit
    6. GitHub Issues and Task-boarding
    7. Continuous Integration
    8. Maven and GitHub Actions
    9. Cost estimation (do not forget the cost factors)
    Key Topics

    View Slide

  4. jgs
    The following slides show some examplesrelated to
    some topics
    This is NOT a comprehensive list of topics.
    Topics in the exam include ALL lecture slides.

    View Slide

  5. jgs
    Test Yourselves
    Requirements and Stories

    View Slide

  6. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 6
    § Independent – loosely coupled with one another
    § Negotiable – Stories are what and why , not how ( 99% ).
    § Valuable – for the customer!
    § Estimatable – Effort/Cost of design, build, and test.
    § Small (sized appropriately)
    § Testable – pass or fail
    INVEST in good requirements

    View Slide

  7. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 7
    Case 1

    View Slide

  8. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 8
    Case 2

    View Slide

  9. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 9
    Case 3

    View Slide

  10. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 10
    Case 4

    View Slide

  11. jgs
    Test Yourselves
    Design and Coding

    View Slide

  12. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 12
    Case 1

    View Slide

  13. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 13
    1. Class Diagram
    Note:
    There are 3 classes and 1 interface
    Case 2

    View Slide

  14. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 14
    § Students and Staff members can request the Library to notify him/her when a Book becomes
    available.
    § Also, they can reserve the book. Before reserving a Book for someone the Library check, for
    students, with the Registrar, if the Student is currently enrolled, and for employees, with Human
    Resources if the employee has an active contract.
    Case 3

    View Slide

  15. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 15
    § Students and Staff members can request the Library to notify him/her when a Book becomes
    available.
    § Also, they can reserve the book. Before reserving a Book for someone the Library check, for
    students, with the Registrar, if the Student is currently enrolled, and for employees, with Human
    Resources if the employee has an active contract.
    Case 4

    View Slide

  16. jgs
    Test Yourselves
    Software Quality

    View Slide

  17. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 17
    Metrics
    § LOC
    § eLOC
    § lLOC
    § Cyclomatic complexity (Max, Min, Average)
    Testing
    § Statement coverage
    § Decision coverage
    Questions

    View Slide

  18. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 18
    Question 2

    View Slide

  19. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 19
    Question 2

    View Slide

  20. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 20
    Given a Date class with the following methods:
    opublic Date(int year, int month, int day)
    opublic Date() // today
    opublic int getDay(), getMonth(), getYear()
    opublic void addDays(int days) // advances by days
    opublic int daysInMonth()
    opublic String dayOfWeek() // e.g. "Sunday"
    opublic boolean equals(Object o)
    opublic boolean isLeapYear()
    opublic void nextDay() // advances by 1 day
    opublic String toString()
    § Come up with unit tests to check the following:
    oThat no Date object can ever get into an invalid state.
    oThat the addDays method works properly.
    • It should be efficient enough to add 1,000,000 days in a call.
    JUnit

    View Slide

  21. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 21
    public class DateTest {
    @Test
    public void test1() {
    Date d = new Date(2050, 2, 15);
    d.addDays(4);
    assertEquals(2050, d.getYear()); // expected
    assertEquals(2, d.getMonth()); // value should
    assertEquals(19, d.getDay()); // be at LEFT
    }
    @Test
    public void test2() {
    Date d = new Date(2050, 2, 15);
    d.addDays(14);
    assertEquals("year after +14 days", 2050, d.getYear());
    assertEquals("month after +14 days", 3, d.getMonth());
    assertEquals("day after +14 days", 1, d.getDay());
    } // test cases should usually have messages explaining
    } // what is being checked, for better failure output
    Junit + Coverage

    View Slide

  22. jgs
    Test Yourselves
    Structural Quality

    View Slide

  23. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 23
    Example A

    View Slide

  24. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 24
    Example B

    View Slide

  25. jgs
    Test Yourselves
    Continuous Integration

    View Slide

  26. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 26
    § What?
    The practice of automating the integration of code changes from multiple
    contributors into a single software project.
    Continuous Integration (CI)
    https://www.pagerduty.com

    View Slide

  27. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 27

    pom.xml

    View Slide

  28. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 28
    § Which One?
    Money, Experience, Learning Curve
    Jenkins, Travis, and CircleCI have been popular options.
    Tools
    Build
    Test
    Report

    View Slide

  29. jgs
    Test Yourselves
    Cost Estimation

    View Slide

  30. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 30
    COCOMO II - Inputs
    🤔

    View Slide

  31. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 31
    Questions

    View Slide

  32. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 32
    Office Hours
    Tuesday and Thursday 3 - 5 pm
    But an appointment required
    Sent me an email – [email protected]

    View Slide

  33. jgs

    View Slide

  34. jgs
    CSC 309
    Software Engineering II
    Lab 20:
    Work in Your Project
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    www.javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View Slide

  35. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 35
    Let’s Work
    Work on Your Final Project

    View Slide

  36. jgs
    CSC 308 Software Engineering I
    Javier Gonzalez-Sanchez, Ph.D.
    [email protected]
    Fall 2022
    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