






Hotspots: Admin Pages | Turn-in Site |
Current Links: Case Final Project Summer 2007
Team Modulus Cases
By: Daniel Vargas, Katie Flinn, Aaron St. Clair, Beth York
So you’ve found yourself in CS 2340, a land of Squeak and wonder… it may seem familiar from your 2335 experience in its ideals (good O-O design, etc) and project based curricula, but there are some slight differences. Here is Team Modulus’ guide to traversing the perils of THE MOUSE in one of the most important aspects of your team project—DESIGN.
Milestones 1 and 2 introduce you to CRC cards (Class Responsibility Collaborators—REMEMBER THIS!)
Milestone 3 follows, where you have to integrate design with actual code. (See the requirements for this milestone) We will focus on Milestone 3 in the hopes that you will see how good initial planning and design actually does help in the long run.
CRC cards, UML and SUnit, oh my!
CRC Cards
• The importance of CRC cards:
- CRC cards are important for good object oriented (OO) analysis. They are used to identify potential classes and define each potential class's responsibilities within the program. This ensures that all responsibilities of the program are taken care of and the programmer knows which classes are needed and how they will interact. Investing a little time at the beginning of the analysis phase to create a good design saves a lot of time in the long run over just jumping in and starting to code because you don't need to refactor and rewrite as much code.
• How to make hawt CRC cards (No chunks allowed)
- Now in order to make good crc cards, and thus to come up with a good OO design, the key is analysis of the project specifications. When reading through specifications it is a good idea to underline all of the nouns, as potential classes, and to highlight all of the verbs, as potential responsibilities. Once you figure out a list of potential classes and responsibilities you need to narrow down the list by identifying the classes and responsibilities that are significant and that can work together (i.e. collaborate). It is important to note that there is never a single correct answer when coming up with a design. Also, as we began implementing our design we found that we wanted to implement things differently, and that's ok. As long as you update the design you can make as many changes as necessary. For more information about the evolution of our CRC cards check the link below.
• The evolution of our CRC cards (M1-M3)
UML
• The importance of UML
UML is useful for getting an idea of how all the classes in the system you designed work together and interact to perform a larger set of tasks.
- Class diagrams are useful for representing the static structure of your program and defining the relationships between classes in your design.
- Use case diagrams are used to describe a sequence of actions that the system executes to perform an observable action.
- Sequence diagrams show how objects interact with each other through time to accomplish a task.
- State diagrams are used to show the states of the program and events that cause transitions between these states.
• Creating a UML Class diagram
- The class diagrams you will be responsible for will probably be pretty familiar from 2335. If your CRC cards from the first two milestones were well thought out and complete, it should be fairly easy to adapt these classes into a UML diagram. Since UML is language specific and classes in UML list their attributes and services you will need to add these items and connect the classes using the Generalization/Specialization (IsA), Association (HasA), and Dependency (TalksTo) relationships. Since CRC cards already list collaborators for each class mapping out the navigability of the class diagram should be straightforward. This leaves creating methods and attributes that support the responsibilities of the class according to the CRC cards. Remember to make your attributes objects of a valid Smalltalk class or one of the ones you created. You should also label your associations to make the diagram easier to read and understand.
• Our UML diagrams
SUnit
• The importance of SUnit:
Large projects in any programming language need to be tested. How do we go about doing this? Clearly, writing code in the workspace would be tedious. Therefore, squeak provides the excellent SUnit framework to ease our testing problems.
The SUnit testing framework runs our custom built tests automatically, letting us know when a change has broken one of our methods. Also, SUnit is great for creating tests before coding in Extreme Programming. Creating tests not only helps you know what the code must accomplish, but also will tell you when the code is done. The SUnit framework also can be used for maintenance. Once a bug is found, a test can be created to make sure that the bug is fixed and stays that way.
Here is our grading feedback for Milestone 3:
Modulus - M3 Grading.doc
Now that we have told you all we know about design, here are some overall tips for the class:
- Make sure to develop a good relationship with your grading TA. He/she will be grading all the milestones of your project so you want to have someone that you can bounce ideas off of and get feedback from to make an awesome project!
- Use everyone's different skills. If one member is good with graphics, another with back end, etc, assign duties to each member according to what they're best at. This method worked out best for our team with M6 ("the twist") which involved... writing!
Links to this Page