diff --git a/subjects/road_intersection/README.md b/subjects/road_intersection/README.md index 42732a0aa..4e36b72b0 100644 --- a/subjects/road_intersection/README.md +++ b/subjects/road_intersection/README.md @@ -111,6 +111,15 @@ You will use your keyboard to spawn vehicles for your simulation. You will use t > A safe distance is any distance which enables the vehicles to avoid crashing into each other. +### Unit Tests + +You must implement unit tests within your `road_intersection` project to ensure your traffic logic and vehicle physics are sound. Specifically, your tests should: + +- Verify the **Dynamic Congestion Rule** by ensuring the `capacity` calculation correctly uses the `lane_length`, `vehicle_length`, and `safety_gap` variables. +- Verify that a vehicle correctly identifies a "stop" condition when the distance to the vehicle in front is less than or equal to the `safety_gap`. +- Test the **Traffic Light Controller** to ensure that the algorithm never allows green lights for conflicting paths (e.g., North-South and East-West) simultaneously. +- Verify **Route Persistence** by testing that once a vehicle is assigned a route (Left, Right, or Straight), its internal state remains consistent and does not change during the simulation. + ### Example You can see an example for road_intersection [here](https://www.youtube.com/watch?v=6B0-ZBET6mo). diff --git a/subjects/road_intersection/audit/README.md b/subjects/road_intersection/audit/README.md index 8948dd06e..f69fa48a6 100644 --- a/subjects/road_intersection/audit/README.md +++ b/subjects/road_intersection/audit/README.md @@ -94,6 +94,16 @@ ###### Do vehicles proceed whenever there is a green light? +#### Unit Tests + +###### Do all tests pass without errors? + +###### Are there specific tests for the **Dynamic Congestion Rule** (e.g., verifying capacity calculation and green light extension)? + +###### Are there tests for **Vehicle Physics**, such as checking if a car stops correctly when a `safety_gap` is breached? + +###### Are there tests for the **Traffic Light Controller** to ensure no two perpendicular lanes have a green light at the same time? + #### Bonus ###### +Is there any type of image sprite for traffic light? (An image sprite is a collection of images put into a single image.)