From e8b0896f25e545a397d93b306e0f036690aed754 Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Thu, 26 Feb 2026 09:00:55 +0000 Subject: [PATCH 1/3] fix(smart-road): add unit tests --- subjects/smart-road/audit/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/subjects/smart-road/audit/README.md b/subjects/smart-road/audit/README.md index d271a01d8..7c3f57352 100644 --- a/subjects/smart-road/audit/README.md +++ b/subjects/smart-road/audit/README.md @@ -98,6 +98,16 @@ ###### Do vehicles have at least 3 different velocities? +#### Unit Tests + +###### Do all tests pass without errors? + +###### Are there specific tests for the **Physics Engine** (e.g., checking if time and distance correctly calculate the current velocity)? + +###### Are there tests for **Collision Avoidance** logic (e.g., verifying that a vehicle reduces speed when the intersection algorithm detects a potential conflict)? + +###### Are there tests for the **Statistics Module** to ensure the final report correctly reflects the events of the simulation? + #### Bonus ###### +Does the application present more statistics besides the ones stated in the subject? From 4ab0915ce02562e62476e08f139d54b0f3169835 Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Thu, 26 Feb 2026 09:01:31 +0000 Subject: [PATCH 2/3] fix(smart-road): add unit tests --- subjects/smart-road/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subjects/smart-road/README.md b/subjects/smart-road/README.md index 1972d4f6c..8bc875516 100644 --- a/subjects/smart-road/README.md +++ b/subjects/smart-road/README.md @@ -142,6 +142,17 @@ You can see an example [here](https://youtu.be/_z8WDX_YS9k). --- +### Unit Tests + +You must implement unit tests within your `smart_road` project to ensure your autonomous vehicle (AV) physics and intersection logic are robust. Specifically, your tests should: + +- Verify the **Physics Engine** by ensuring the `velocity = distance / time` calculations are accurate for various vehicle speeds. +- Verify **Safety Distance Detection** by testing that a vehicle correctly identifies a "close call" or a "stop" condition when the gap between it and another AV is equal to or less than your defined safety distance. +- Test the **Smart Intersection Algorithm** by simulating conflicting routes (e.g., a left turn crossing a straight path) and verifying that at least one vehicle adjusts its velocity to prevent a collision. +- Verify **Statistics Accumulation** by ensuring that variables like max/min velocity and vehicle count are correctly updated in the internal state after each simulated pass. + +--- + ### Bonus You can implement the following optional features: From 195c03aa28552502ba8534f405b06c2c0fe12f8a Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Mon, 2 Mar 2026 10:57:42 +0000 Subject: [PATCH 3/3] fix(smart-road): remove broken link --- subjects/smart-road/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/subjects/smart-road/README.md b/subjects/smart-road/README.md index 8bc875516..61de4b782 100644 --- a/subjects/smart-road/README.md +++ b/subjects/smart-road/README.md @@ -87,9 +87,8 @@ You will have to implement the physics for this type of vehicles by taking into Animation is required for this project. You will have to find some assets for the vehicles and roads. Here are some assets for this: - [limezu](https://limezu.itch.io/) -- [finalbossblue](http://finalbossblues.com/timefantasy/free-graphics/). -- [mobilegamegraphics](https://mobilegamegraphics.com/product-category/all_products/freestuff/). -- [spriters-resource](https://www.spriters-resource.com/). +- [finalbossblue](http://finalbossblues.com/timefantasy/free-graphics/) +- [spriters-resource](https://www.spriters-resource.com/) Animation is not just rendering an image into the canvas. By using assets, you get to decide your "world coordinate system" for the rendered image and therefore you create your own animation. But this is not enough. Basically, you must animate while moving.