View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Questions on Spring 2005 M1

Ask questions specifically about the first milestone (M1) here. Please add your question to the TOP of the list, so that the most recent questions appear first.

What exactly do we have to comment? Where is this information? I may be stupid, but I don't see it on the swiki.

It seems you're not allowed to re-downloaded your .zip from the swiki (asks for a password)? Is there any way to check if you got a good upload?

Do we have to do SUnit tests for messages we write that aren't required in the M1 directions? Also, what would be a good way to do an SUnit test for a method that prints to the Transcript window? I have a printPeople message that prints an ordered list of first names of everyone in a Place. It's basically just a debugging message, so would an SUnit test be required? Thanks.

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.


Just out of curiousity, shouldn't a person's location be a Point instead of a String? (As the current name implies)

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.


Will person names be unique? Or is this unknown and something we have to plan/design/etc., for? I ask because, according to M1, getPersonNamed in Place is supposed to return a Person instance based on an input name – but what if there are multiple people with the same name at a location?
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

Do our methods have to error check? For instance, addPerson in Place: should they be checking for duplicate persons being added? Should we throw an exception if there's an error, or what? We don't even know about exceptions yet though.

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

Are we going to have to write SUnit tests for setters/getters in the future? (excluding M1)

Unless otherwise noted, the SUnit tests that are required for each milestone should be complete. – Andrew Sayman

Do we have to follow the template exactly? Do we have to take in "Strings" or "Icons" or could we write a method to take in something and then transform it into what we need?
method: aString
   code to make a morph based on the string

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

So this isnt quite what I was looking for. I realize squeak isnt typed and that I could easily send a number in the variable named "aString". However, from a standpoint of trying to practice "good programming technique", I have been making sure that things were indeed strings where I wanted them to be and that they werent jibberish. My question was more along the lines of would it make more sense to have icon: take in the name of an icon file and then make a Form out of it and store it? or do we really want to take in a premade image? If I do take in a string but document that, am I going to loose points? I do thank you for the earlier prompt respone though, that rocks !!! :)

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

How do we turn it in? The turnitin swiki is out of date.

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

Do we care where the image is coming from? I ask because I want to initialize to a suitable instance.

For M1 we don't care where your images come from (or even if you test with real images).


Should Place store persons in a set or some fancy vector?
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

Is == equivalent to equals(overidden) in Java?

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

So I downloaded the latest SUnit classes from ::
And now I've got these .cs files. What do I do with them? How can I get them into the squeak envir-o-ment?
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

The assignment doesn't say people are unique so that means they don't have to be stored in a set?

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.


Could we demo M1 to a TA for suggestions?

Absolutely. You can always demo your milestones to any of the TAs (or even to yours truly) and ask for feedback/suggestions.


So do the meothods really how to be functioning. (adding and deleting person from array) or it can be just method doing nothing for now.

They should be working. – Andrew Sayman

Is it OK to override new for the Person and Place classes?

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

Should people return the actual collection object or should it list the names of the people?

It should return the collection object. – Andrew Sayman

Do methods default to a self return?

Yes – Andrew Sayman

Link to this Page