Skip to content

About

Lab 2 starter for 17-214/514 Agentic Software Development (Fall 2026)

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

Lab 2 Starter: Availability Calculator

A small reservation component. Given a room's bookings and the day's business hours, AvailabilityCalculator.freeSlots computes when the room is free. It is the code you work in for Lab 2.

It ships with a generated test suite that passes, and a property-based test harness (jqwik) with one example property. Everything is green. Your job in Lab 2 is to decide whether green actually means correct.

Read ARCHITECTURE.md before the code.

Build and test

mvn test

mvn test runs both files, the ordinary example-based tests (AvailabilityCalculatorTest) and the property-based tests (AvailabilityProperties). A code-coverage report is written to target/site/jacoco/index.html.

Continuous integration

This repository has CI configured in .github/workflows/ci.yml. GitHub disables workflows on a fresh fork, so enable them once on your fork (the handout shows where). After that, every push runs mvn test. You will watch the gate go red when your new property finds the bug, then green once you fix it.

Where things are

  • Component: src/main/java/edu/cmu/cs214/availability/
  • Example-based tests: src/test/java/edu/cmu/cs214/availability/AvailabilityCalculatorTest.java
  • Property-based tests: src/test/java/edu/cmu/cs214/availability/AvailabilityProperties.java
  • Setup: SETUP.md

See the Lab 2 handout on the course page for the three milestones you show a TA.

Three Weaknesses of the Test Suite

  • Observability gap: The test suite did not fully encode the definition of correct availability. It checked that reported free slots were valid, but not that every minute of the business day was covered exactly once by either a booking or a returned free slot.
  • Controllability gap: The example tests did not include an empty booking list or a final booking that ended before dayEnd. Therefore, they did not drive the input that exposes the missing trailing free interval.
  • Observability gap: returnedSlotsNeverOverlapABooking can pass when freeSlots returns too few slots, or even no slots, because it only inspects the slots that were returned. It does not compare the result against the expected coverage of the whole business day.

Why high coverage didn't ensure function was correct

  • Because high coverage does not equate to a function being correct. In other words, high coverage "is not job done." Also, coverage means that the code ran, not that each possible edge case was detected.

About

Lab 2 starter for 17-214/514 Agentic Software Development (Fall 2026)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages