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 2003 M3 Milestone

Where are some good DVS tutorials?
Chris Cho (,, to name a few. Search Google for "DVS Squeak" to find much more. I didn't know this existed ... really cool stuff. Chris Verges

The requirements for M5 include using XML to save and restore application data, and in M6 we are supposed to "Create persistent data." What is the difference here?
Kyle Mahan

Bob says: None. The XML stuff was in M6, but then we decided that was too big of a milestone with the mini-SQL stuff, so we took the XML and stuck it in M5. Thus any references that may be left in M6 to persistence are really talking about the XML load/save stuff)

If a Stock account belongs to more than one portfolio, which portfolio's trade account receives dividend distributions paid by a stock?
Sean Briscoe

Bob says: For this application we assume that every stock we buy is affiliated with a brokerage firm that we buy and sell through. For instance I may use Merrill Lynch and Charles Schwab. For each brokerage firm, I have a cash trade account that is used to actually buy and sell stocks in the portfolio. That cash trade account is what actually receives any distributions from the stocks in that brokerage account. Thus I may own 10 shares of COKE that I purchased through Merrill Lynch and 5 shares of COKE that I purchased through Charles Schwab. If COKE declares a 5 cent dividend, then I need to credit 50 cents to the Merrill Lynch trade account and 25 cents to the Charles Schwab trading account. Now for the hard part. Each brokerage account may have part of multiple portfolios. For instance my COKE stock may be part of my retirement portfolio and my taxable income portfolio. The brokerage house we deal with to buy a stock is the sole determiner of what trade account gets the credit for sales or dividends of stocks. The idea of a portfolio has two meanings. One is a user-defined grouping of financial instruments like my retirement portfolio or my taxable income portfolio. The other is as a collection of investments I have purchased from the same brokerage firm. In the former, COKE stock can belong to multiple portfolios, in the latter, a particular share of COKE stock can only be in one brokerage portfolio (I either bought that share from Merrill Lynch or from Charles Schwab). Thus you should always be able to determine the correct trade account to credit dividend information to.

How is tax handled on Stock accounts? Is the interest taxed when you deposit it into the cash instrument, or do we have to keep track of the interest paid and then tax that value at the "end of the year?"
Sean Briscoe

For this application, as M3 states, the actual tax is not computed. You are only required to maintain the information necessary to compute the tax. This is most easily done by ensuring you have a good transaction history for everything that affects the status of the financial instruments over the last year. In other words you have to be able to spit out the interest, dividend and capital gain money you made, but you do not need to worry about how to compute the tax on it, or even how the tax gets deducted.

For the M3 plans, the description and timeline bullets mention that these shouse be done in a workspace. What does this mean?

Notepad, vim, emacs, etc. Chris Verges

It's a relic from when people turned in Squeak projects instead of paper printouts. Many TA's will let you do this if you prefer – ask your TA if you want to try it! -Lex Spoon

What format should these take, just a paragraph describing what would be in use in our classes, or is there a standard format?

How does time pass in this system? We are supposed to track the passage of time and demonstate how the prices of stocks fluctuated, portfolios performed, compound interest, etc. Certainly we're not going to be sitting around with this softare for months; are we supposed to have a universal date that we may arbitrarily set forward which sends messages to the system for it to update itself accordingly? How will this work?

Bob says: Here is a design challenge that comes up often in the real world. We are building a system tied to the passage of time. Stocks may only pay dividends once per year. We obviously do not want to wait till December 31st to test some of the system functionality. There are several ways you might tackle testing. One is to use the technique you mentioned above. Kind of like a time warper that allows you to simulate the passage of real time. For stocks after M5, you will be getting real data from the internet on dividend information. This makes it harder to "fake" data for testing. In the real world, people use "Mock Objects" that is an object that can fake the real object and provide know data for testing. Think about making a fake object that would tell your app that COKE just decared a 5 cent dividend. This is a design challenge and one that should prove interesting to see how student's approach it. The simplest way might be to let SUnit drive the app through calling the appropriate methods and ignoring the real time altogether. I will be interested to see on Monday during the design roundtable how teams are approaching this problem.

can multiple users be signed on to squeaken at once?

Bob says: Up until M7, the answer is no. Squeaken must recognize that many different users may have access to it on the same machine, and it must show the correct user thier information, but the users will not be simultaneous. At M7, you have the web twist. Then, anyone may log into your little web service and run their queries and you may have simultaneous users coming in over the web. So for the stand-alone system NO, for the web-enabled system YES.

for M3 we are to develop a test plan.. how exactly are we to communicate this "test plan" with the TA's grading our project?

Bob says: The 2335 format would be OK. The main thing is the test case description. The standard way of showing these is as a table or matrix with the following columns:
Test Case#DescriptionInputExpected OutputActual OutputNotes
1 Test Deposit-1ErrorAcceptedAssigned to Sally for fix
It's easy to go overboard and make a 700 page test plan that covers every possible unit, integration, component and system test. For this class concentrate on the system-level tests using black-box methods. These tests become your SUnit test suite. Think about minimizing the number of required tests by combining tests. For instance if we create an account, make several valid and invalid transactions testing various equivalence classes, we can then use that information to test the transaction histories also, because we will already know the state of the history from previous test cases. We recognize you will probably do many more tests than are in your test plan, but we want to see that you have thought about testing. A good place to get system level tests from is your scenarios. They tell about user interactions with the system and thus can provide you a framework for system-level test cases.

I have a question regarding the SQL:
for something like the provided M6 example

I assume a user would type in this query in a GUI text box of some sort, but once the query is processed, what should be done with it? Does SELECT imply outputing the vital stats of all matching accounts to some text morphic, or should we be writing all matching accounts to a file (perhaps an XML file)? Or is there some collection object to which we should add all matches? Thanks for any clarification, we're trying to design this all now so please let us know the deal with SELECT. Also, for REPORT, my guess is that we are to output the matching account's transaction reports to the screen by way of a textmorphic. Is this OK?
Bob says: Yes, I would like results displayed in your UI rather than going to a file. The purpose of queries is to allow users to get information from your app.

I still confuse about stock account. stock account is the array of several different company's stocks?? For example, if I may own 10 shares of COKE, and 4 shares of 'IBM' that I purchased through Merrill Lynch and 5 shares of COKE and 8 shares of DELL that I purchased through Charles Schwab. Then do I have 2 stock account??
or, is it 4 stock( cock1, IBM, cock2, Dell)?

Bob says: This gets at your design. You can only buy stocks through a brokerage firm. Thus you might have bought COKE, IBM and EDS thru Merril Lynch for instance. You might consider a brokerage firm a single account which might contain multiple stocks and a trade account, or you might consider it a portfolio containing a bunch of accounts and treating each stock as a separate account. There is no one "best way" usually. It is usually a trade-off between different choices. Take a stab at it for now, and in class on Tue take a look at how some of the teams presenting at the design roundtable tackled the problem.

is Portfolio's trade account a new type of Cash Instruments?? Or can I use checking or saving account as trade account?? In M1 and 2, we used saving account for trade account, but is new type account( trade account ) added for Stocks from M3??

Bob says: That's a design decision. Certainly you could consider it just a regular cash account with the added constraint that it is associated with a brokerage firm for the purchase of stocks. Or your design might put specialized behavior in the trade account in which case it might be a subclass of a cash account.

For bonds, lets say a Bond is bought on the 27th of February. Should the first amount of interest be credited to the linked CashInstrument account on the 27th of every month? Or should we choose some other day, like perhaps the 15th of every month, so that all bonds receive interest on the same day regardless of their date of creation. Another alternative would be to attribute interest every (365.25/12) days after the issue date of the bond. May we decide which way to implement the interest or is there an optimal or real world way in which this could be implemented?
Bob says: Typically when you buy a bond, it will specify a date on which interest is credited. The 15th of the month is a good default value to use.

Link to this Page