Site Search

CS 352: Lab 1

Student Learning Obectives

After completing Lab Assignment 1, students should be be able to

Lab 1 Pair Programming Teams

Team 1Team 2Team 3Team 4Team 5
LiamBrockSamwiseTomPaul
GeneTrevorGaryKevinBen

You may wish to review basic pair programming guidelines before you begin.

You should change roles with each iteration

Lab 1 Assignment

Using pair programming, and changing roles within each iteration, use Visual Studio to author a Document Type Definition (DTD) to validate a club membership list against a list of constraints.

You may wish to refer to W3Schools DTD tutorial for syntax

Iteration 1

In one of your two accounts, create a Lab1 web site using Visual Studio 2008. Working together as driver and navigator

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE Club SYSTEM "Iteration1.dtd" >
<Club>
    <MembershipList>
        <Member id="_972134">
            <Name>
                <FirstName>Scott</FirstName>
                <MiddleInitial>T</MiddleInitial>
                <LastName>Obert</LastName>
            </Name>
        </Member>
    </MembershipList>
</Club>

Functional Tests

Before beginning these functional tests, switch roles between driver and navigator. Test and debug your Iteration1.dtd for validation success and errors with

  1. Zero, one, and two members in your Iteration1.xml data file
  2. Missing elements
  3. Optional MiddleInitial
  4. Invalid and duplicate id values
  5. Invalid FirstName, MiddleInitial, and LastName values

Iteration 2

Begin this iteration with the same roles used with Iteration 1's functional testing. That is, the current driver should have begun Iteration 1 as the navigator, the current navigator should have begun Iteration 1 as the driver.

Add the DTD elements and attributes to Iteration2.dtd to require

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE Club SYSTEM "Iteration2.dtd">
<Club clubId="ACM">
    <ClubName>Student Chapter of the ACM</ClubName>
    <MembershipList club="ACM">
        <Member id="_972134" clubs="ACM">
            <Name>
                <FirstName>Scott</FirstName>
                <MiddleInitial>T</MiddleInitial>
                <LastName>Obert</LastName>
            </Name>
            <Email>ObertS@cwu.edu</Email>
            <Address type="local">
                <Street>1808 W. Alder Street</Street>
                <City>Ellensburg</City>
                <State>WA</State>
                <ZipCode>98926</ZipCode>
            </Address>
            <Address type="permanent">
                <Street>P.O. Box 1234</Street>
                <Street>101 1st Avenue</Street>
                <City>Yakima</City>
                <State>WA</State>
                <ZipCode>98933</ZipCode>
            </Address>
        </Member>
    </MembershipList>
</Club>

Functional Tests

Before beginning these functional tests, switch roles between driver and navigator.

Right-click, download and save to your Lab1 folder the following three test files. Test and debug your Iteration2.dtd for validation success and errors.

  1. club1.xml: Valid - Simple case, two members, optional information omitted
  2. club2.xml: Invalid - Missing and invalid attributes
    • The required attribute 'clubId' is missing
    • The 'type' attribute is invalid - The value 'home' is invalid according to its datatype 'NmToken' - The Enumeration constraint failed.
    • The required attribute 'id' is missing
    • Reference to undeclared clubID is 'ACM'
  3. club3.xml: Invalid - Missing or invalid elements
    • The element 'Address' has invalid child element 'ZipCode'. List of possible elements expected: 'State'
    • The element 'Address' has incomplete content. List of possible elements expected: 'ZipCode'
    • The element 'Member' has invalid child element 'Phone'. List of possible elements expected: 'Address'

To Receive Credit

Lab 1 is an in-class assignment begun on Wednesday and due by the start of class on Friday