






Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
M1 Individual Coding Summer 2007
Techzilla
Software defect tracking is an important task in real-world development. Managers need to see reports about defects found in different products and they need to assign defects to specific developers for fixes. Customers need to report defects. Developers need to see summaries of all defects and to specifically find defects assigned to them for fixes. QA needs summaries of defects and to approve fixes done by developers.
Our final project will be Techzilla a defect-tracking system similar to Bugzilla. Typically, this would be a database application, but we are going to make an in-memory version.
Milestone 1 is an individual milestone designed to get everyone going with Smalltalk. It should be fairly simple to implement. Remember as an individual assignment, you may get Smalltalk help from any classmates, but your actual implementation should be your own.
Create the following classes:
Preparation
- Create a package named Techzilla which will contain all your project code.
- Create a namespace named Techzilla which will contain your classes.
Task 1:
Create a Smalltalk class that represents a Defect. Each Defect has the following attributes:
- status (either open, closed, in-progress or rejected)
- description (a text description of the defect)
- enterDate (the date/time defect was first reported, set when defect created)
- statusDate (the date/time defect status was changed)
- id (a unique id number for this defect, set when defect created)
Each defect should have the following methods:
- status (returns the current status of the defect)
- status: aSymbol (sets the defects current status to be aSymbol, and statusDate to be the current time)
- description (returns the description of the defect)
- description: aString (sets the defect description to be aString)
- id (returns the unique id number of this defect)
- enterDate (returns the date/time the defect was first reported)
- statusDate (returns the date/time the defect status was changed)
- printString (returns a string representation of the defect format:
‘Defect id description enterDate status statusDate’)
- reset (a class method which resets the id numbers to start over at 1.)
Task 2:
Create a Smalltalk class that represents a Project. A project keeps track of all the defects associated with it. A project has the following attributes:
- name (a short descriptive name for the project)
- defects (an OrderedCollection of defects)
and the following methods:
- name (returns the project name)
- name: aString (sets the project name to aString)
- defects (returns all defects for this project)
- open (returns all defects with a status of open)
- closed (returns all defects with a status of closed)
- inProgress (returns all defects with a status of in-progress)
- rejected (returns all defects with a status of rejected)
- addDefect: aDefect (adds aDefect to the collection of defects)
- printString (returns a string with the following format:
‘Project name with Defects: \n defect1 printString \n defect2 printString…’)
- reportFor: aSym (formats an prints a project report to the Transcript. aSym can be either: #all for all defects, or #open, #closed, #rejected, #inProgress to show only defects in the appropriate category).
- changeStatusFor: anID to: aStatus (changes the defect status of the defect with this ID to be the new status shown in aStatus).
- named: aString (a class method that constructs a new instance of the project with the name aString).
Test Code(paste this code in workspace to test your classes)
| p d |
p := Project named: 'Test'.
Defect reset.
d := Defect new.
d description: 'A bug 1'.
p addDefect: d.
d := Defect new.
d description: 'A bug 2'.
p addDefect: d.
d := Defect new.
d description: 'A bug 3'.
p addDefect: d.
d := Defect new.
d description: 'A bug 3'.
p addDefect: d.
p printString.
Highlighting above workspace code and selecting printIt should show:
'Project Test Defects:
Defect 1 A bug 1 #(May 17, 2007 9:52:53 am) #open #(May 17, 2007 9:52:53 am)
Defect 2 A bug 2 #(May 17, 2007 9:52:53 am) #open #(May 17, 2007 9:52:53 am)
Defect 3 A bug 3 #(May 17, 2007 9:52:53 am) #open #(May 17, 2007 9:52:53 am)
Defect 4 A bug 3 #(May 17, 2007 9:52:53 am) #open #(May 17, 2007 9:52:53 am)
'
Highlighting all the above code plus these lines and selecting printItshould give you:
p changeStatusFor: 1 to: #rejected.
p changeStatusFor: 3 to: #closed.
p printString.
'Project Test Defects:
Defect 1 A bug 1 #(May 17, 2007 9:53:48 am) #rejected #(May 17, 2007 9:53:48 am)
Defect 2 A bug 2 #(May 17, 2007 9:53:48 am) #open #(May 17, 2007 9:53:48 am)
Defect 3 A bug 3 #(May 17, 2007 9:53:48 am) #closed #(May 17, 2007 9:53:48 am)
Defect 4 A bug 3 #(May 17, 2007 9:53:48 am) #open #(May 17, 2007 9:53:48 am)
'
Highlighting all the above code plus these lines and selecting doIt should print the following
reports to the transcript:
p reportFor: #all.
p reportFor: #rejected.
p reportFor: #closed.
Project defect report for All : Test
Defect ID Description Date Entered Current Status Status Date
Defect 1 A bug 1 #(May 17, 2007 9:58:03 am) #rejected #(May 17, 2007 9:58:03 am)
Defect 2 A bug 2 #(May 17, 2007 9:58:03 am) #open #(May 17, 2007 9:58:03 am)
Defect 3 A bug 3 #(May 17, 2007 9:58:03 am) #closed #(May 17, 2007 9:58:03 am)
Defect 4 A bug 3 #(May 17, 2007 9:58:03 am) #open #(May 17, 2007 9:58:03 am)
*****************************************************************
Project defect report for Rejected : Test
Defect ID Description Date Entered Current Status Status Date
Defect 1 A bug 1 #(May 17, 2007 9:58:03 am) #rejected #(May 17, 2007 9:58:03 am)
*****************************************************************
Project defect report for Closed : Test
Defect ID Description Date Entered Current Status Status Date
Defect 3 A bug 3 #(May 17, 2007 9:58:03 am) #closed #(May 17, 2007 9:58:03 am)
Grading Criteria
Defect Class.........30
Project Class........30
Comments.............20
Coding Style.........20
Link to this Page