From lechner@cs.uml.edu Sat Oct 28 16:24:13 2006 From: Bob Lechner Message-Id: <200610282045.k9SKjQ0Z211476@saturn.cs.uml.edu> Subject: Re: [UML_CS522_f2006_OOA] Re: Schema file for asgnt3 [candidate key names?] To: UML_CS522_f2006_OOA@yahoogroups.com Date: Sat, 28 Oct 2006 16:45:26 -0400 (EDT) Cc: 06f522 RJLRef: $PH/06f522/asgnt3/CKspecsInputFdbk_ns_rjl061028.txt > From: "Nitin Sonawane" > X-Yahoo-Profile: nitinsonawane > Sender: UML_CS522_f2006_OOA@yahoogroups.com > Subject: [UML_CS522_f2006_OOA] Re: Schema file for asgnt3 > Reply-To: UML_CS522_f2006_OOA@yahoogroups.com > Hello again, > > I just realised that Prof. Lechner already has schema files setup in his > metatest3 directory called metaCKplusSISrev061014.sch . Please ignore the > file I emailed and use this one instead (plus my file also has a few syntax > errors in it). > > Thanks, > Nitin. Thanks Nitin. I'd like to remind you that test data is available in SISrev061011.dat, as a start for the DB to be queried against. I modified this from SIS test data but it may also contain some errors and needs to be inspected and/or pr_loaded/dumped and compared for errors and/or surprises. Re: your CK specs below, the unit test specs should declare (in a comment or post-condition) what keyExists(query) should return as a value, and what its clients shold expect. (Clients may want to insert new or find old records by a query CQ.) Multiple levels of test coverage can be formally defined. Boundary testing is quite useful: do tests suceed and/or fail wheen they are supposed to? (I.e. when input queries intentionally contain values that SHOULD cause true or false return from keyExists(thatQuery). Does the pre-loaded SIS DB affect the test more than it should (with 0, 1, or >1 duplicates, for example)? Another point: In real life, CKspecs may come from some requirements analyst in a format beyond your control. THat doesn't prevent you from writing a filter that makes its use more convenient. awk (or perl, or sed, or vi) can edit your CKspec format below (which has no CKname?) into a simple space-separated list of words, which has a trivial parser (already generated as pr_parse(), tailored to ANY .sch table type in pr_load.c). You can declare such a word list in a CK table format; If you call the field names fname1, fname2, etc. (up to some max) in the schema you can access them in pr-parse statements like atoi or pr_set_str or encode which follow the word separation statement hcg_parse(buffer, hcg_t, &idx); See pr_load.c:pr_parse() in $PH/06f522/asgnt3/lechner/metatest3. Exactly the same technique can extract field values from a similarly declared and pr_parsed row of a CQ query instance. However, you'll need a table type for each signature variant to get max mileage from generated code. Again, see how pr_parse uses the value lists that it separates (atoi, pr_set-ster, encode). Bob Lechner > > > On 10/28/06, Nitin Sonawane wrote: > > > > Hello folks, > > > > Please find attached the schema file for assignment 3. This file is > > essentially a concatenation of metaschemaCK.sch and SISrev061011.sch. > > Following Prof. Lechner's convention, I've added some explanatory comments > > at the top. I've also verified that this file is properly parsed by chgen. > > > > Also, following up on Prof. Lechner's comments, here are the candidate > > keys > > > > Department DE > > (deptNo) > > (DEname) > > (DEhead) > > > > Student AA > > (studentId) > > > > Term TM > > (TMname) > > > > Faculty FY > > (DeptId, FacyName) > > > > Course CO > > (DeptId, CourseNo) > > > > Address AD > > (AAid) > > > > StudentTerm RT > > (AAid, TMid) > > > > CourseTermSection CT > > (FYid, TMid, COid, sectionNo) > > > > Prerequisite PQ > > (COid1, COid2) > > > > CourseSchedule CS > > (SDbldg, SDroom, SDtime, SDdays) > > > > Enrollment ET > > (RTid, CSid) > > > > Will follow up with a preliminary version of the test driver soon. > > > > Thanks, > > Nitin. > >