M206 - TMA05 - Question 1 Part V
v) Stage III Postings
Note: Postings 1 & 3 are submitted as part v of this question, posting 2 is for background information as to how I came to my conclusions in part 3.
Posting 1
The precondition should be amended so that it will only accept dates between the inaugural date of the KidsAccount and todays date. The dateAppliedFor: method comment will have to be updated to reflect the tighter precondition. The precondition itself can be further restricted by restricting dates before 5 April 1998 using the following condition (aDate >= inauguralDate), 5 April 1998 is a valid date this being the inaugural date of KidsAccount. Future dates can be restricted using something like (aDate<= Date today) since today is a valid date while tomorrow is not. 1 would suggest that it would be better to 'and' these new conditions with the original precondition.
Posting 2
I agree with Student C and Student D in that the user should be informed that the date they have supplied for dateAppliedFor: is out of range. 1 would also agree that a warning should be given to the user in the form of a Dialog warn. I believe John's wording of the text associated with the Dialog Warn is the better of the two as it is more explanatory for the user to see their error. The Dialog warn statement was: Dialog warn: " The date supplied is outwith the specified range, please give a date between 05/04/98 and todays date."
Posting 3
I agree with Student E method for dateAppliedFor. In my last posting 1 agreed that the Dialog request might be the best way to go when an invalid date had been entered. 1 tried several methods to get the Dialog request working, all accept the new date of entry converted to Date class as Student F suggested, however the problem remained of how to recheck the new date against the precondition without making the code overcomplicated. I then decided to look at the problem from the users point of view, it would seem to make sense to issue an error message in the form of a Dialog warn and return the user to the point of their error when acknowledged. Since the user will be operating through the GUI via an input form of some sort it, is inherently better to show an error message and return focus to the dateAppliedFor input field so that a new date can be entered.
My code for this latest version of dateAppliedFor, follows:
- | inauguralDate |
- inauguralDate:=Date newDay:5 month:#April year:1998.
- ((aDate class = Date) & (aDate >= inauguralDate) & (aDate<= Date today))
- ifTrue: [date AppliedFor:=aDate]
- ifFalse:[Dialog warn:'The date supplied is outwith the specified range, please enter a valid te e.g. 06 May 1999 '
Several people have raised security issues, I don't think that there is a problem here as this will be a very small part of a much bigger client-server application running across the Banks network. The security permissions at logon should have been set-up so that only authorised personnel have access to the KidsAccount section . For those employees who leave their PC/terminal logged on, extra security can be added in the form of a password protected screensaver. One would also hope that the Banks IT security would keep out all unauthorised users (hackers).
Omission from my Test Strategy Posting.
While preparing the TMA 1 was checking though my rough notes and the workspace noticed 1 missed out one of the tests performed. The test was balance: 100 where the '00' is uppercase character 'o' this was to simulate inadvertent use of 'o' instead of zero - it produced the dialog '00' is a new message (same dialog as for creating variables). 20 July 1999
Format of Test Strategy Posting
Apologies to anybody who has had trouble reading my testing strategy posting. The problem of formatting by tabs seems to have come about because I created the posting in Word and pasted into FirstClass Personal before replicating. What seems to have happened is that my Word document contains tables and when pasted into FirstClass the columns appear to have been replaced by tabs, it was ok on my screen - honest!