diff --git a/subjects/chaikin/README.md b/subjects/chaikin/README.md index 1214242b99..1f5a92a812 100644 --- a/subjects/chaikin/README.md +++ b/subjects/chaikin/README.md @@ -28,6 +28,14 @@ You can see how the application should work [here](https://youtu.be/PbB2eKnA2QI) > You are free to use any library to create and handle windows, rendering, keyboard and mouse events. +### Unit Tests + +You must implement unit tests to verify your implementation of the Chaikin algorithm. Your tests should: + +- Verify the coordinates of the new points generated after one iteration of the algorithm (cutting the corners at 25% and 75%). +- Verify that the number of points increases correctly per iteration (e.g., for an open curve, $N$ points should result in $2N - 2$ points in the next step). +- Ensure the algorithm handles edge cases, such as an input list of 0, 1, or 2 points, without crashing. + ### Bonus - Make it possible to clear the screen, so that the user can select new control points. diff --git a/subjects/chaikin/audit/README.md b/subjects/chaikin/audit/README.md index 0eba07a892..a319a563de 100644 --- a/subjects/chaikin/audit/README.md +++ b/subjects/chaikin/audit/README.md @@ -40,6 +40,18 @@ ###### After you pressed `Enter` before selecting points, is it possible to place points without needing to kill the program? +##### Unit Tests + +##### Run the command `cargo test`. + +###### Do all tests pass without errors? + +###### Is there a test that verifies the math of a single Chaikin iteration (calculating the 1/4 and 3/4 points)? + +###### Is there a test checking that the point count grows correctly according to the algorithm? + +###### Are there tests ensuring the algorithm handles empty or single-point inputs safely? + ##### Bonus ###### +When you pressed `Enter` without drawing any points, was a message displayed to inform you that you forgot to draw any points?