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

CSC309 Lecture 24

CSC309 Lecture 24

Software Engineering II
Final Review
(202406)

Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs CSC 309 Software Engineering II Lecture 24: Final Exam

    Review Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.com Building 14 -227
  2. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    3 STORIES, TASKS, SPRINTS, BURNDOWN CHART § Burndown chart per sprint. § How many story points have you addressed per sprint? § How do you assign tasks? § Who did what? § How many story points are accomplished per team member (total)? § Review and Retrospective of Sprint 4 and full summary Part 1. The process
  3. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    4 § NOT for the video. A link will be provided for this § (self and peer evaluation) What should be your grade and the grade of each of your teammates? (self and peer evaluation)
  4. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    5 § BLUEPRINT, CODE, METRICS, DEPLOYMENT § Describe your architecture ( a diagram with boxes is fine) § Describe your design. Could it be easy for a new developer to reuse, modify or extend what you have created? § Show a class diagram (Explain it and describe the details) § Be sure the diagram and code match. § What components were developed by each team member? What were the criteria for splitting the work (components, classes, methods)? Part 2. The product
  5. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    6 § Source code clean, DRY, and KIS § Code Metrics: LOC, eLOC, lLOC, CC § Structure Metrics: Abstractness, Instability, Distance § Does the product have a “good” quality? § What features were Unit Tested? § How many test cases are in total? § Coverage (statement, condition, condition-decision)? § Services? Part 2. The product
  6. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    7 § What about Continuous Integration? § Did you implement and use GitHub Actions (or equivalent)? § Releases? § Docker? § Libraries? Part 2. The product
  7. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    8 § Not for the video a link will be provided § What should be the team grade for the product accomplished – consider functionality, code, and quality. Does it have value for the customer? (self and peer evaluation)
  8. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    9 a) Final Version of your Source Code - submit your Java files b) Software Design - your UML class diagram c) Screenshot of your Backlog, Task board, and your Burn-down Chart from Taiga d) Links to your GitHub repository and Taiga project site f) Metrics (Code and Structure) e) Link to your video of the Final Presentation Wednesday, June 12
  9. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    11 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. Containers 10. Cost estimation (do not forget the cost factors) Key Topics
  10. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    13 § 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
  11. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

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

    22 § 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
  13. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    23 § 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
  14. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    24 § 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
  15. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

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

    31 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
  17. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    32 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
  18. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    38 § 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
  19. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

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

    41 1. name: Java CI with Maven 2. on: 3. push: 4. branches: ["main"] 5. pull_request: 6. branches: ["main"] 7. jobs: 8. build: 9. runs-on: ubuntu-latest 10. steps: 11. - uses: actions/checkout@v4 12. - name: STEP 01 Set up JDK 20 13. uses: actions/setup-java@v4 14. with: 15. java-version: '20' 16. distribution: 'temurin' 17. cache: maven maven.yml
  21. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    42 19. - name: STEP 02. Build with Maven 20. run: mvn -B clean package --file pom.xml 21. - name: STEP 03. Run tests 22. run: mvn test 23. maven.yml
  22. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    43 19. - name: STEP 02. Build with Maven 20. run: mvn -B clean package --file pom.xml 21. - name: STEP 03. Run tests 22. run: mvn test 23. 24. - name: STEP 04. Deploy 25. run: mkdir staging && cp target/*.jar staging 26. 27. - name: Step 05. Just for Fun an LS 28. run: ls -al target 29. - name: Step 06. Set Executable Permissions 30. run: chmod +x target/testing-2024-1.0-SNAPSHOT.jar 31. - name: Step 07. Upload Artifact 32. uses: actions/upload-artifact@v4 33. with: 34. name: javiergs-app 35. path: target/testing-2024-1.0-SNAPSHOT.jar maven.yml
  23. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    44 FROM ubuntu:20.04 # Install Java RUN apt-get update && apt-get install -y openjdk-20-jdk # Install MySQL RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server # Copy the application JAR file COPY target/your-app.jar /app/your-app.jar # Copy the initialization SQL script COPY init.sql /docker-entrypoint-initdb.d/init.sql # Set the working directory WORKDIR /app # Expose ports EXPOSE 3306 Dockerfile
  24. jgs Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 |

    45 # Environment variables for MySQL ENV MYSQL_ROOT_PASSWORD=root ENV MYSQL_DATABASE=yourdbname # Start MySQL and the Java application CMD service mysql start && \ sleep 10 && \ mysql -u root -proot yourdbname < /docker-entrypoint-initdb.d/init.sql && \ java -jar /app/your-app.jar Dockerfile
  25. jgs

  26. jgs CSC 309 Software Engineering II Lab 24: Work in

    Your Project Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.com Building 14 -227
  27. 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.