CC 410 - Week 3

Wrapping Up

  • 9/6 - Module 2: OOP
  • 9/6 - OOP Example
  • 9/6 - Restaurant 1

This Week

  • 9/13 - Documentation, Testing, UML
  • 9/13 - Doc & Testing Example
  • 9/13 - Restaurant 2

Updates

  • Discord Channel
    https://discordbot.cs.ksu.edu
  • Grading - Rubric on Canvas
    Code Comments on GitHub
  • So far, so good?

Milestone 2

  • Unit Tests (~423)
  • Documentation Comments
  • UML Class Diagram
  • 3-8 hours
  • ~3500-4000 LOC
  • Feedback welcome!

Milestone 2 Hints

  • Do Not Look at Source!
  • Use Global Attributes
  • Generalize (but not ingredients)
  • Look at Enum Parameterized Tests

Generalized Tests

Python
class TestTheRiker:
PRICE: float = 17.01 CALORIES: int = 1701
def test_has_correct_price(self) -> None: """The price is correct.""" item: TheRiker = TheRiker() assert_that(item.price, is_(TestTheRiker.PRICE))
def test_has_correct_calories(self) -> None: """The calories is correct.""" item: TheRiker = TheRiker() assert_that(item.calories, is_(TestTheRiker.CALORIES))
Java
public class TheRikerTest {
private static final double PRICE = 17.01; private static final int CALORIES = 1701;
/** * The price is correct. */ @Test public void testHasCorrectPrice() { TheRiker item = new TheRiker(); assertThat(item.getPrice(), is(PRICE)); }
/** * The calories is correct. */ @Test public void testHasCorrectCalories() { TheRiker item = new TheRiker(); assertThat(item.getCalories(), is(CALORIES)); } }

Looking Ahead

  • Module 4 - Inheritance
  • Module 5 - Debugging
    Final Project 2
  • Module 6 - GUI Basics
  • Module 7 - Event-Driven Programming
  • GUIs, Web APIs, etc.

Image Credit: Giphy