Issue #2: Debugging find_maxima #2

Open
opened 2025-09-21 14:03:09 +02:00 by pamela · 0 comments
Owner

This time you are given an (incomplete) implementation of a find_maxima function and some tests (5 test cases you encountered before, 8 new test cases which fail).

Your task is now to work with the tests and the debugger to find out what is going wrong using the pdb debugger and fix the implementation of the find_maxima function.

  1. Go to the directory hands_on/local_maxima_part3_debug.
    Run local_maxima.py file to make sure it is working.
    Run test_local_maxima.py file using pytest.

  2. Pick a test to fix (you may skip to a test where you cannot immediately see what the fix will be).

Run one test with pdb and pytest, e.g.:
pytest hands_on/local_maxima_part3_debug/test_local_maxima.py::test_find_maxima_correct_order
Pdb will stop whereever you add a breakpoint()

  1. Find out what is happening and where it is going wrong using the debugger
    Edit the find_maxima function to address the problem you found & run the test to check if your edits are successful

  2. Create a branch and submit a PR for this issue

This time you are given an (incomplete) implementation of a find_maxima function and some tests (5 test cases you encountered before, 8 new test cases which fail). Your task is now to work with the tests and the debugger to find out what is going wrong using the pdb debugger and fix the implementation of the find_maxima function. 1. Go to the directory hands_on/local_maxima_part3_debug. Run local_maxima.py file to make sure it is working. Run test_local_maxima.py file using pytest. 2. Pick a test to fix (you may skip to a test where you cannot immediately see what the fix will be). Run one test with pdb and pytest, e.g.: `pytest hands_on/local_maxima_part3_debug/test_local_maxima.py::test_find_maxima_correct_order` Pdb will stop whereever you add a `breakpoint()` 3. Find out what is happening and where it is going wrong using the debugger Edit the find_maxima function to address the problem you found & run the test to check if your edits are successful 4. Create a branch and submit a PR for this issue
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ASPP/2025-plovdiv-testing-debugging#2
No description provided.