2 Testing and Review
In this minor lab, we’re going to do a few things:
Discuss how testing will be done (and graded) on future assignments.
Walk through the process for peer review of tests.
Explore an interesting notion of testing beyond just input/output testing.
At
https://code.pyret.org/editor#share=0B32bNEogmncOMEpfUlF6MnFpQTQ&v=v0.5r787
you’ll find a file set up to test an implementation of sort-people. Spend a few minutes writing around 5-10 good test cases for sort. (sort-people sorts a list of people by ascending age).
When you’re done, download the file, and upload to submit it to the cs91-sortacle assignment at this link:
https://www.captain-teach.org/swarthmore-cs091/assignments/
You’ll be prompted to do some reviews; fill in the rubric with any feedback you have on the tests you see, and submit the review. If you see any tests you like in others’s submissions, feel free to copy them to your own test suite.
Next, copy this line into the top of your test suite file:
import shared-gdrive("bad-sorts.arr", "0B32bNEogmncOTHcyREhrMWJQTE0") as B
The module B contains 9 bad sorting algorithms, named bad-sort[1-9]. One way to assess if your test suite is good is to see how many erroneous implementations it catches. You can add calls like:
test-sort(B.bad-sort1)
And see what output you get – does your test suite fail the bad sorter on any tests? It should if it is a good test suite!
Try and come up with a set of tests that’s capable of catching each bad solution. Once you’re done with that, submit a final test suite that catches as many bad solutions as possible as the next step at that link.