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
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
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
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
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
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
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.