You should have SUnit tests for any functionality your class provides to the "outside world" (i.e. other objects). That includes functionality you've decided to add that isn't strictly required by the specification. However, if you've added methods for your own internal use (and you'll notice that some classes have Private method categories) you don't necessarily need to have SUnit tests for them, particularly if the methods are for your debugging. Jeff |
Ah, that all depends on how you think of a location. One of the issues that location-based services struggle with is that we can express locations several ways: a name ("TSRB", "Jeff's Office"), a location (a point on a map, latitude and longitude), or even a relative position ("West of the connector"). For M1 I defined it as a string, but in future milestones you might find you want a different type or even a Location class. Jeff |
This should be something you and your future team should plan and design for. Your questions are a good start for forming good unit testing "what happens when I add someone with the same name?" along with your "what if there are multiple people with the same name at a location?" – Nick Baughman |
We do not require you to error check your methods. Appropriate methods comments should dictate the kind of parameters a method should accept. In the case of your example, you can check for adding duplicate persons being added (it may or may not be useful, depending on your future design of your team you will form), but this is not something necessary for it to work properly nor is it stated in the requirements given to you. If you do choose to do error checking, I would insist that you write unit tests that check the functionality of these checks. (Throwing exceptions are not really a distinct part of coding in squeak, and probably will not be covered. Though using self error: aStringErrorMessage can potentially be a more informative debug error statement than what squeak will potentially give you i.e. creating your own error message for certain situations) – Nick Baughman |
Unless otherwise noted, the SUnit tests that are required for each milestone should be complete. – Andrew Sayman |
Squeak isn't a strongly typed language. Ultimately, those parameters can be of any type; however, having said this, you should stick to the types implied by the parameter names so that the code is more self-documenting. It would be silly have an accessor return a different type from what you set it as. To be more specific: Follow the template exactly. You'll have plenty of time later to be creative. – Andrew Sayman |
The parameter is anImage, not anImageFile. More importantly, right now, you don't really care exactly what they're sending in. It's more important to you that your accessor returns the same thing that was set. If you want another object to be derived from it and stored, that's fine, but icon should return what is set/expected by icon:. As Nick noted above, we don't expect you to error check any more than is specified. It's not required that you deal with jibberish. If you do check for jibberish, your test cases should cover this behavior. – Andrew Sayman |
In general, M1 is a programming assignment. Do what the spec says, no matter how much you dislike it. In later assignments, on the other hand, please do not simply try to extend M1–be creative and do it the way you'd like. -Lex Spoon |
the Coweb turnin will be updated in the first few days of this week. You'll find a list of TAs and a list of students they grade. Hang on to your M1 for the next few days while this is done. – Babak Banijamali |
For M1 we don't care where your images come from (or even if you test with real images). Jeff |
The type of collection object you use to store objects in, is something for you to come up with on your own based on what you think will work best with the given design and your own design. I reccomend starting off by looking at collections like Bag, Dictionary, and OrderCollection and determine what each of these do in their own rights and looking at the requirements and seeing which best fits the design in terms of functionality. – Nick Baughman |
Not at all. == is a primitive that always checks to see if two things are the same instance and should never be overridden. = is intended to be overridden. – Andrew Sayman |
SUnit should come with Squeak. If it doesn't, you may have followed the links on from Using this CoWeb incorrectly. – Andrew Sayman |
Yeah, it's in there. Do "open" then "Test Runner". -Lex Spoon |
For M1 you're welcome to use whatever Collection type you think makes for a good design. You can also revisit your decision in future milestones. Jeff |
Absolutely. You can always demo your milestones to any of the TAs (or even to yours truly) and ask for feedback/suggestions. Jeff |
They should be working. – Andrew Sayman |
Yes, but this should be done with care. The newsgroup has a few posts about doing this in order to initialize your classes. – Andrew Sayman |
It should return the collection object. – Andrew Sayman |
Yes – Andrew Sayman |