-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion, demonstrating error handling #316
Comments
Hi Ben - you do find interesting things... The current test pattern is of course auto-generated and generic - but better than the previous auto-generated one. I see what you are getting at - and think you are on to something, but i'm not so keen on the 3 post asserts (the first one checks that an exception even happened). I think we definitely could up the anti on being specific about students creating a specific exception (it was fine for an early exercise to use anything handy - but probably before bowling we should have an exercise specify an exercise specific error - so raise: MyError whoseDescr....: Back to the second part - I think the use of higher order assertions is good (and hence my aversion to 3 asserts and a variable) - however I think you are correct that upping the anti on using a smarter exception is a good thing - so why don't we provide:
This is the neater way (note it also raises the issue that SUnit is backwards with beginsWith and includes support - raised recently when some collection extensions were added and fought for as CI was failing with undeciperhable messages). So I would add the beingsWith and Includes support so students get a clean message, and maybe we can get them added to SUnit. We could add stateSpec which has a nice dsl for all this, but it adds complexity. |
I like that. It covers points (3) & (4). |
I've been reading up on exceptions just last week. The book Deep into Pharo (Language -> Handling Exceptions) covers exceptions very well. The style you've shown @bencoman very much fits with what I read and I like your reasoning. I'm happy to go along with the conclusion you two have already come to. |
Tim & Sam, Seeking your opinions. Pharo has a powerful and flexible exception handling system that I don't feel we are demonstrating. As I've been working through the Bowling exercise, I've developed some concerns with this test pattern...
because:
I feel the following teaches students more...
Its using a facility not in the base image, so students can be confused when they try to copy the pattern in their own projects.[EDIT: Whoops, my presumption was wrong. It is in the base image]and leave students to write...
The text was updated successfully, but these errors were encountered: