Revised March 18, 2008:
18-649 Project Assignment #5
Implementation & Test
Due Thursday February 21, 2008 at 11:59 PM
Please submit all project-related correspondence to ece649-staff
"at" ece.cmu.edu
Assignment:
In project 5 you will build half of your elevator system and informally test
one sequence diagram. The purpose of this exercise is to get you started
writing code for the elevator system.
An important new part of project 5 is defect tracking. When you test
your code, you will no doubt run into errors. These errors will have many
possible sources, they could simply be syntax errors in Java, but we are
interested in the errors caused by problems in your original requirements and
design, these are defects. Since you have all been keeping track of
changes in a change log, this should just be a small outgrowth of that
exercise. When a defect is located that requires changes to earlier steps in
the project, say you created a scenario in project 2 that needs to be expanded,
we want you to track this. You will write in your change log the files you had
to update. However, the important aspect of defect tracking is that you will
also state where the problem was discovered (at this stage, probably in
coding), and what previous project turn-ins had to be changed to correct the
problem. By having this tracability you will be able to see where this problem
was originally created.
To perform defect tracking, create a separate file, called 'defect_track.txt'.
This file will include the above information, namely:
1. What file the error was discovered in.
2. Brief description of the problem.
3. What documents had to be updated in response.
4. First document to include this fault, and thus the source of the error.
What you need to create:
1) Implement (in Java) the DoorControl,
DriveControl, HallButtonControl, and CarButtonControl objects. These
correspond to some of objects you have previously designed in state charts.
Things you are allowed to do:
- You can mix time-triggered and event-triggered design, although any single
message may be only one or the other (there is a way to specify this). We
strongly recommend you use all time-triggered to make fault management easier
in later projects.
- You must inform us by MONDAY February 19th at 4pm if you wish to add
network messages. We will let you know by Tuesday Feb 20th if you may
make the additions you request. Our experience has been that most requests to
add a network message tend to "break" the distributed nature of the
elevator or make fault management harder later, so please think carefully about
requesting an additional message. But if you can make a case for it, we'll let
you do that.
Things you are NOT allowed to do:
(NOTE: Please refer to the
Elevator
Simulation API for important information on the differences between
Framework and Network messages.)
- You are NOT allowed to change anything about already defined messages.
- Different objects may communicate with each other ONLY with Network
messages and in no other way.
- Each object is allowed to listen for only ONE Framework message, AND a
given Framework message may not be listened to by MULTIPLE objects. For
example, if your DriveController listens to the DriveSpeed Framework message,
your Dispatcher may NOT listen to DriveSpeed Framework messages as well. In a
physical system this means that each sensor and actuator can only be connected
to a single CPU rather than to multiple CPUs.
- Each object is allowed to send only ONE Framework message, AND a given
Framework message may not be sent by MULTIPLE objects. For example, if your
DriveController sends Drive Framework messages, your Dispatcher may NOT send
Drive Framework messages as well. In a physical system this means that each CPU
can have only once sensor or one actuator connected to it.
Additionally, you are REQUIRED to mark the line in each code that causes each
and every state transition (i.e. forward traceability) you have designed on
your state charts. This marking will be accomplished with comments. So that
these lines are easily distinguished from other comments, you shall begin the
line with the character '#' followed by the word 'transition' followed by the
transition name as described on your state machine backward traceability matrix
in single quotes.
For example, on the line of code that corresponds to the
A() transition on your Drive Controller statechart traceability matrix, you
would add the comment:
// #transition 'A()'
to the line in your code that actually CAUSES this transition.
This is done so that it is possible to easily check to ensure all of the
arcs in your state transition diagram are implemented as you have described
them.
We will provide you three acceptance test files to test against your
elevator system: proj5acceptance1.pass,
proj5acceptance2.pass, and
proj5acceptance3.pass. Part of your
grade for this project will be based on whether or not your elevator system can
pass these three tests and two other generally comparable ones we will not
provide you. You are encouraged to make up your own tests to exercise
your elevator system. If you do, your acceptance test file must have the
extension .pass (e.g., people.pass) for the simulator to run it.
The system acceptance test file format is:
<seconds>,<start_floor>,<start_hallway>,<destination_floor>,<destination_hallway>
; <comment_field>
Where each line of the file creates a single passenger to appear at time
<seconds>. That passenger starts on floor <start_floor> and
hallway <start_hallway>, and will behave in such a way as to go to
floor <destination_floor> and hallway <destination_hallway>.
<start_floor> and <destination_floor> should be integers in the
range [1...MaxFloor]. <start_hallway> and
<destination_hallway> should be 0 for the front hallway and 1 for the
back hallway. Tests with this input file are run with all modules in the
system loaded. The entire system is initialized before the testing
begins. An example input for the system integration test is:
15,1,1,3,0 ; person A going up
15,7,1,1,1 ; person B going down
Which means that at the same time, t = 15, two people show up, 1 person on the
1st floor back hallway wanting to go to the 3rd floor front hallway, and 1
person on the 7th floor back hallway wanting to go down to the 1st floor back
hallway. Keep in mind that certain floors do not have certain hallways,
and if you mistakenly assign people to hallways that do not exist, they are
likely to get stranded in the elevator or may not get on the elevator at
all! Here is the hoistway setup. Keep this handy when making your
integration tests.
Floor #
8 FH
7 FH and BH
6 FH
5 FH
4 FH
3 FH
2 BH
1 FH and BH
You are not required to use FAST speed for the main drive motor.
You do not have to have a "smart" dispatcher. You just need to
deliver the people without tripping the emergency shutdown mechanism. Use the
.class files from project 1 for any module you haven't yet written.
2) Write tests to informally test one
sequence diagram from project 2. The sequence diagram you choose
must contain at least one of the four control objects created in this project
(DoorControl, DriveControl, HallButtonControl, and CarButtonControl) and must
not contain any of the other three control objects (Dispatcher, LanternControl,
CarPositionControl).
The assignment is to generate a set of files that are sufficient to
completely test one sequence diagram from project 2. Although this
is not exactly "unit testing" (see project step 3 below), you
will use the unit test file format as outlined in section 3 to test the
sequence diagram. We're going to leave the details of how to
accomplish things to you, but to be correct a test must somehow address all the
below points:
- Name of sequence diagram it is supposed to be testing, as well as
the
particular control object that is affected. Each test file should
be
associated with one and only one control object. For example, if
your
sequence diagram contains the DoorControl and HallButtonControl, you
will
create one module test file for each of these two control objects.
During testing, instantiate ONLY one instance of the object you are
attempting to test, and NO OTHER objects. This way, no objects beyond
the one you are testing will send messages or otherwise interfere with
your test. Objects are instantiated in Control.java
and Modules.java. You can comment out the objects that you don't need
and run your unit test so there is no conflict.
- List of messages in the sequence diagram and their corresponding
arcs/states within the statechart for the control objects that are tested (this
is an extension of traceability from Projects 2-4 -- now you can trace from
sequence diagrams through requirements through statecharts through design and
into unit test). Note that when all your tests are added together you
should account for all the messages in the sequence diagram.
- After each message, a statement of what you expect to observe happening, if
anything, that constitutes a "pass" of the test. Or in some
cases it will be easier to say what constitutes a "failure".
- A text file containing the output that was generated to the screen while
running the unit test. Include comments in this file that indicate what
messages you are sending and receiving and what constitutes a "pass" of
the test.
3) Write unit tests to informally test the
DriveControl statechart.
Create tests that exercise all transitions of your DriveControl design
(i.e., all arcs on your state diagram).
Unit test for this project means testing the behavior of a single system
object such as a door controller or the dispatcher. These tests are
derived from the system design, and should completely cover all states and
transitions in your state diagrams to ensure that code that is written actually
implements the intended design.
The general format of the system implementation will be that there is a
simulation framework that "glues" together all the different system
objects, both ones you design and ones we're designing for you. You are
responsible for implementing and testing the objects you've designed in
previous assignments; we're responsible for implementing and testing objects we
provided complete requirements for back in Project #2 as well as the simulation
framework. You do not have to provide tests for the objects we're
providing to you. For this particular assignment you will only design
tests for the DriveControl object. However, you will be required to
produce similar tests for the other objects in future projects.
We will be providing a special diagnostic object to you which has the
purpose of taking a plain text file describing messages to be sent on the
network and actually sending them out on the network at specific times.
This diagnostic object also records all network messages and places them in an
output file. If you put this diagnostic object and one or more other
objects into the system framework you can run single-module tests by sending
specific messages at specific times and observing that correct outputs are
produced.
The unit test file format is the following:
<seconds>,<rep_interval>,<message_type>,<data_field1>,..,<data_fieldN>,<context>
; <comment_field>
Where each line of the file generates a single copy of a single message onto
the network at the time specified. <seconds> is a floating point
number of seconds; <rep_interval> is the repetition interval (in floating
point seconds) for the message, with zero being a single event message;
<message_type> is the name of a message; the data fields are as
documented. Context will be N for network, F
for framework. Comments are indicated by a ";", with the
comment extending to the end of a physical line. Any modules in the system will
be fed an "initialize" signal before the testing begins.
CLICK HERE TO SEE EXAMPLES OF ALL
SUPPORTED MESSAGE TYPES.
The assignment is to generate a set of files that are sufficient to
completely test your DriveControl design. Each file can test more than
one thing, but ideally you have several short tests rather than just a few long
complex tests. We're going to leave the details of how to accomplish things to
you, but to be correct a test must somehow address all the below points:
- Name of object it is supposed to be testing. Each test file should be
associated with one and only one object.
- List of arcs/states within the object's statechart that are tested (this is
an extension of traceability from Projects 2-4 -- now you can trace from
requirements through design and into unit test). Note that when all your
tests are added together you should account for all the arcs and states in the
design of the DriveControl statechart.
- After each message, a statement of what you expect to observe happening, if
anything, that constitutes a "pass" of the test. Or in some
cases it will be easier to say what constitutes a "failure".
CLICK HERE FOR AN EXAMPLE TEST FILE.
Team Design
Portfolio:
1) Organize your design portfolio.
Your project5 directory should contain the most up-to-date design package
for your elevator system organized into the following directories.
This directory structure will develop as the semester progresses. This
is to organize things for the rest of the course -- you'll be keeping this same
organization and updating things for each subsequent project phase.
- project5/
- group#_portfolio.html: A single html file with a
brief description of each of the design documents in your portfolio, with a
link to each of the files listed below. The idea is this is an annotated table
of contents for your entire project.
- project5/scen_sd/
- group#_scen_sd.html: All of the scenarios,
sequence diagrams, & corresponding traceability tables for your design
(including the ones we did for you) shall be easily viewable & printable in
ONE document (plain html or pdf)
- The directory may contain picture files of individual
sequence diagrams, but these shall be viewable/printable in the main document
with working links -- no broken pictures.
- project5/req_sc/
- group#_req_sc.html: All of the time-triggered
requirements for your design (including the ones we did for you, such as
the environmental objects) shall be easily viewable & printable in ONE
document (plain html or pdf). In addition, this document shall contain
the state charts for the 7 control objects (DoorControl, DriveControl,
LanternControl, HallButtonControl, CarButtonControl, CarPositionControl, and
Dispatcher) as well as the state charts/requirements traceability
tables. If you decided to use a few event triggered requirements for some
reason put them here, but we expect all (or almost all) your requirements will
be time-triggered and will match the rest of your design.
- group#_req-sd_trace.html: All of the
requirements/sequence diagrams traceability tables shall be easily
viewable and printable in ONE document (plain html or pdf, NO picture files may
be used for the tables).
- group#_req-con_trace.html: All of the
requirements/constraints traceability tables shall be easily viewable
and printable in ONE document (plain html or pdf, NO picture files may be used
for the tables).
- The directory may contain picture files of individual
state charts diagrams, but these shall be viewable/printable in the main
document with working links.
- project5/tests/unit/
- group#_DriveControl.test: The
complete unit test of DriveControl for project 5 in a single test
file.
- group#_DriveControl.out: A single text
file containing the output that was generated to the screen while
running the unit test. Include comments in this file that indicate what
messages you are
sending and receiving, and what constitutes a "pass" of the test.
- project5/tests/sd
- group#_SequenceDiagramXX.test: The
complete sequence diagram test for project 5 in a single test
file. (XX is the sequence diagram number. e.g., 1C).
- group#_SequenceDiagramXX.out: A single text
file containing the output that was generated to the screen while
running the tests. Include comments in this file that indicate what
messages you are
sending and receiving, and what constitutes a "pass" of the test.
- project5/tests/acceptance/
- all acceptance test files we have provided you
(basicpass.pass, proj5acceptance1.pass, etc)
- all acceptance test files you have created
- project5/logs/
- group#_ChangeLog.txt: Detailed log of all updates
to design/implementation (including enhancements). Shall contain Date,
Description of the change, Artifacts that were changed. (.txt or .html
are fine)
- group#_DefectLog.txt: Detailed log of all defects
found in the design/implementation. Shall contain Date, Description of
the defect, Origin (earliest artifact in the design cycle where the defect
occurs) (.txt or .html are fine)
- project5/code/simulator/elevatorcontrol/
- *.java files for the 4 control objects
- Control.java file
- Note 1: group# is your group number (group1,
group2, etc.)
- Note 2: Please do not submit the entire simulator
directory & subdirectories. Only include the .java files that you
have written or modified from the files provided to you (in the proper
code/simulator/* subdirectory).
2) Ensure your design portfolio is complete and consistent. If
you have been keeping up with updates in the previous project stages, most of
this work will already be done. The following is a partial list of the
characteristics your portfolio should exhibit:
- Changes requested by the TAs in previous projects have
been applied.
- All documents are complete and up-to-date with latest
time-triggered implementation
- All documents include group # and member names at the top
of the document. (This includes code, where this information should
appear in the header field)
- Individual documents have a uniform appearance (i.e.,
don't look like they were written by 4 individual people and then pieced
together)
- Change & defect logs are up-to-date and detailed
enough to track changes to the project.
Handing In Results
Each team shall submit exactly one copy of the assignment.
Please include at the top of each file the assignment number, your group
number, the names of your group members, and the file name.
Projects shall be submitted by copying all needed files into your group's
directory in the course AFS space in the following directory:
/afs/ece/class/ece649/Public/project/group#/project#/
(group# is your group number and proj# is the number of this project. you
may need to create this directory yourself)
Any submission that contains files with
modification dates after the project deadline will be considered late and
subject to a grade deduction (see
course policy page for
more information).
Submission shall be electronically in the form of a web page with text and
in-lined images, in HTML 2.0 format, viewable from both MS Internet Explorer
and Netscape Navigator. HTML 2.0 does NOT include java or javascript or some of
the more esoteric functions (frames, etc.). (In other words, we want
"plain-vanilla" html to eliminate problems printing and viewing.) Any
drawings shall be in non-animated GIF format. (You can use other graphics
formats at your own risk, but we must be able to view them in the web browsers
mentioned above). You can also submit your project in pdf format, but
make sure it prints correctly on a postscript printer. A regular
text editor should be sufficient for this assignment - you may want to make the
traceability tables in Excel or Word and use the 'Save as HTML' or 'Save as Web
Page' feature in the File menu. If you need some help with HTML please come to
Office Hours :)
Additionally, the result should be easily readable when
printed on a black-and-white laser printer. Each HTML file AND picture shall
include the team number and names of all members of the team.
Grading (75 points)
This assignment counts as one team grade. If you choose to divide the work,
remember that you will be graded on the whole assignment.
- 30 points for creating the
four modules listed above (DoorControl, DriveControl, CarButtonControl,
HallButtonControl). Your elevator must pass 5 acceptance tests on these
modules (three that will be provided to you, as well as two others).
Each of the 5 acceptance tests will be worth
6 points.
We will recompile these four modules before running the acceptance tests for
grading. For the other control modules (Dispatcher, LanternControl, and
CarPositionControl) you may use the .class files we provided from Project 1
(you will be writing these modules in the next project stage).
We do not expect perfection, but to receive full credit your elevator must 1)
deliver all the passengers and 2) not activate the emergency brake.
- 10 points for testing one sequence
diagram. Include in your submission the test files you used to do this.
- 10 points for unit testing the
DriveControl object. Include in your submission the test files you used
to do this.
- 10 points for the complete design
package. You should include all scenarios, sequence diagrams,
requirements, statecharts, traceability etc. that you have done up-to this
point. These materials should represent the most up-to date version of
your elevator system, including all changes you have made (which should be
tracked in a dated change log).
- 10 points for performing defect tracking. This should include all
major defects and resulting changes to your project.
To receive full credit for the assignment the test files you create must be
formatted correctly and fully commented to explain what they are doing.
Please continue to use the hand-in formats and directory structures from
previous projects, with any necessary extensions or alterations.
- 5 points: what can be improved about this project? Include even
minor bugs so we know to fix them. If you found nothing, then so state.
Back to course home
page