Software Engineering CEN4020 Term Project (Spring 2001)

BMW Sedan Tracking System (BSTS)

all design, coding and documentation by

Philip J. Porvaznik

CONTENTS AND COMPONENTS

Problem Boundaries

Requirement Analysis

System Design

Program Design

Coding

Appendix: Visual Basic Source Code

Testing: Unit, Integration, and System

System Delivery

Maintenance

Documentation

Demonstration

Appendix: Term Project Assignment

 

PROBLEM BOUNDARIES and REQUIREMENT ANALYSIS

We have been given a software engineering project that is called the "BMW Sedan Tracking System" (hereafter BSTS) that is to keep track of the inventory and sales (orders) of 3- 5- and 7- series sedans at a typical BMW dealership. We are given 14 weeks to complete the BSTS project,  so here I want to set out some initial boundaries and some requirements needed to solve the problems I see in my analysis of the assignment.

Since this appears to be a standard database type software project, I had to decide a couple of things. First, which language would best facilitate the ease of implementing a "relational" database? The choice here was easy: Visual Basic (VB 6 is the latest version). Since 90-95% of personal computers today run on Windows 95/98/2000 operating systems, the choice of VB 6 (which is built around the Windows Graphical User Interface) was also made. This language would also make the design rather simple, since VB is perfectly suitable for designing databases compatible with such popular and powerful Microsoft database programs as MS Access. VB does much of the work for you "behind the scenes" (what is called "encapsulated code"). Using the "Visual Data Manager" that is built into VB 6, one can design an Access compatible database even if Access is not installed on the particular machine using the software. So VB 6 is the way to go here. Anyone attempting to do this assignment in C++ or Pascal or (worse) COBOL is really making it much harder on themselves.

The assignment requires your typical Add, Delete, Search of both car inventory and car sales (or orders), and the databases must somehow be linked together. This I noticed immediately so I had to decide how I was going to link the databases (make them "relational"). Fortunately this is fully automated using the "Visual Data Manager" of VB6 or the said MS Access software. The key design element was to decide on a "primary" field (I call it the "Tracking Code") that would be contained in both the Inventory and Sales databases. In the Inventory database this must be a unique field, while the Sales database uses the same Tracking Code to point to a specific BMW in the Inventory.

In addition, the following BMW specifications must be supplied: model number, performance, handling capability, instrumentation and controls, safety and security, exterior and interior design, audio system, comfort and convenience, maintenance program, warranties, and extra packages. Now the question I asked myself: where am I going to find these specs in some detail to make this project somewhat realistic? Answer: the World Wide Web of course! One web site was particularly helpful since it laid out in specific detail the kind of specs required for the assignment: the www.BeverlyHillsBMW.net site.

For example, I found the following in the animated "Flash" portion of the site:

S=Standard O=Optional A=Available thru BMW
SP=Included in optional Sports Package PP=Included in optional Premium Package

BMW 323 Series
 

323I coupe

323I sedan

323I convertible

       

PERFORMANCE & EFFICIENCY

     

2.5-liter dual overhead cam (DOHC), 24-valve inline 6-cylinder engine

S

S

S

Double VANOS steplessly variable valve timing

S

S

 

Dual resonance intake system

S

S

 

5-speed manual transmission with direct 5th gear

S

S

 

5-speed steptronic dual-mode (automatic/clutchless manual) transmission with Adaptive Transmission Control (ATC)

O

O

 

5-speed manual transmission

   

S

4-speed automatic transmission

   

O

       

HANDLING, RIDE & BRAKING

     

Strut-type front suspension with forged-aluminum lower arms, hydraulic cushions

S

S

 

Multi-link rear suspension with cast-aluminum upper transverse arms

S

S

 

Front and rear anti-roll (stabilizer) bars

S

S

 

Twin-tube gas-pressure shock absorbers

S

S

 

Sport suspension calibration

S

SP/SPP

 

All-season Traction

   

S

Engine-speed sensitive, variable-assist power steering

S

S

S

Dynamic Stability Control

S

S

 

Four-wheel ventilated anti-lock disc brakes with electronic front/rear proportioning

S

S

 

All-season tires

   

S

Four-wheel ventilated disc brakes

   

S

So I took the basic outline of this data to design the BMW Inventory database. This is described in detail below under System and Program design. I also noticed in looking at this site and others that contain BMW specs is that there are not that many different types of 3- 5- 7- series sedans. From the information I gathered, there are the 323i, 330i, 528i, 540i, 540iA, 740i, 740iL and 750iL with the various combinations of extra package cars: the sport, the premium, and premium-sport along with the "standard" BMW package. So we aren't talking a huge amount of information going into the Inventory database, perhaps less than 50 different combinations of BMWs. As for the sales or orders database, this would have to be more flexible since the numbers of sales would be unknown and less predictable. If this were a "real-life" project, I would have to talk with the BMW dealership sales staff to determine what kind and how much information would be required to keep track of its customers. For purposes of the assignment, I decided on the typical customer information: name, address, city, state, zip, phone, date sold, and car history. The car history I decided to do as an open "memo" format (2000 characters allowed) where one could enter as much information required to keep track of various dates, repairs, maintenance, oil change, tune ups, etc.

That covers most of the problem boundaries and requirements. Now on to my specific design strategy.

SYSTEM DESIGN

Since I immediately decided on Visual Basic 6 because of the ease of implementing relational databases, I had to decide on the form of the user interface. The design of interfaces is again easy and straightforward in VB and one can be quite creative with styles and colors. I decided there was to be one user interface to manage the Inventory database, and one to manage the Sales database.  After a few "rough sketches" the final form of the interface looks like this (in Visual Basic these are called "forms" and the program code is designed around the actions of the buttons in the form) :

The buttons (around which the VB code is designed) include Add new car, Search all cars, Search stock/orders/sold,  Manage sales, Show detail car data, Sell this car, Delete this car permanently, increase/decrease stock, increase/decrease order, and Close/exit. Most of these are self-explanatory. These buttons control the basic actions required to design the BSTS project: Add new car produces a blank form with which to add new data; Search all cars brings up a form with which to search any number of criteria; Search stock/orders/sold allows one to search a particular model based on their In Stock, On Order, and Total Sold units; Show detail car data does just that, and brings up a form showing the user the exact details of the specifications (see description of the letter symbols and codes used below).

 In addition, there is a data control at the bottom of the form which controls how a user can step through the Inventory database a record at a time, forward or backward. This was very easy to implement in VB 6, one only needs to tell the VB compiler where the database is located, which text boxes contain the fields, and the "tie in" is done automatically with encapsulated code (in fact no source code at all is needed to produce the "browse database" aspect of the form).

The button "Manage sales" immediately brings up the second form, which is used to manage the Sales database. Again after a few "rough sketches" this form now looks like this:

The buttons here (around which the VB code is designed) include Add new sale, Search all sales, Manage inventory, Delete this sale permanently, and Close/exit. Again, these are self-explanatory. In addition, there is the data control at the bottom that controls the step through (forward and backward) the Sales database. The car history field is a "memo" format and any number of lines can be inputted (up to 2000 characters allowed).

When one chooses Search all cars, or Search all sales, a search form pops up which looks as follows (this is the car inventory search form, there is one for sales, and another one for stock/order/sold) :

 

There are two relational databases I am using to keep track of the BMW Inventory (including all the unique specifications). The database tables, field names, constraints, and symbols are described below. This was the easiest way I could reason to keep track of the various number of specifications, using a letter code (for example A through N) for each type of specification. Below is a detailed description of the two databases: BMW Inventory and BMW Sales.

Database I -- INVENTORY
Field Names # chars and format
TrackCode
ModelNumber
EngineType
TransType
HandCapType
InstConType
SafSecType
TireType
ExtDesignType
IntDesignType
AudioType
ComfConvType
MaintProgType
WarrProgType
ExtraType
NumInStock
NumOnOrder
NumSold
7 chars
10 chars
1 char, either A to D, or X
1 char, either A to E, or X
up to 20 chars, any combo of A to N, and X
up to 10 chars, any combo of A to E, and X
up to 20 chars, any combo of A to N, and X
1 char, either A to N, or X
up to 10 chars, any combo of A to F, and X
up to 20 chars, any combo of A to N, and X
1 char, either A to C, or X
up to 20 chars, any combo of A to N, and X
1 char, either A or B, blank or X
1 char, either A or B, blank or X
1 char, either A to C, blank or X
7 chars (convert to numeric when needed)
7 chars (convert to numeric when needed)
7 chars (convert to numeric when needed)
TrackCode
One unique tracking code for each single unique vehicle, used to point to specific BMW in INVENTORY for the SALES database
ModelNumber
typical models include 323i, 330i, 528i, 540i, 540iA, 740i, 740iL, 750ilL
Performance and Efficiency
EngineType
A = 2.5 liter dual overhead cam (DOHC), 24 valve in-line 6 cyl
B = 2.8 liter DOHC 193 hp, 24 valve in-line 6 cyl
C = 4.4 liter light alloy 282 hp, 32 valve V8 with 4 overhead cam
D = 5.4 liter light alloy V12 with 2 overhead cam
X = other
TransType
A = 5-speed manual trans with direct 5th gear
B = 5-speed steptronic dual-mode (auto/clutchless manual)
C = 5-speed manual trans
D = 4-speed auto trans
E = 4-speed auto trans with Adaptive Transmission Control (ATC)
X = other
Handling Capability (Ride and Braking)
HandCapType
A = strut-type front susp with forged-alum lower arms, hydr cush
B = multi-link rear susp with cast-alum upper transv arms
C = front/rear anti-roll stabil bars
D = twin-tube gas-press shock absorb
E = sport susp calib
F = all-season tract
G = all-season tires
H = Dynamic Stability Control (DSC)
I = Dynamic Brake Control (DBC)
J = engine-speed sensitive, var assist power steer
K = four-wheel vent disc brakes
L = four-wheel vent anti-lock disc brakes with elec front/rear prop
M = M Technic sport susp
N = self-level rear susp
X = other
Instrumentation and Controls
InstConType
A = service interval indicator with miles-to-service readout
B = check control vehicle monitor system with pictogram
C = 4-function on-board computer
D = integrated on-board navigation
E = external temp display
X = other
Safety and Security
SafSecType
A = anti-lock braking system (ABS)
B = Head Protection System (HPS)
C = Driver and passenger front airbag suppl restraint system (SRS)
D = front-door-mounted side-impact airbags
E = interlocking door anchoring system
F = Battery Safety Terminal (BSF)
G = auto fuel cut-off
H = central double-lock system with console switch
I = Coded Driveaway Protection
J = Height adjust front safety belts with auto tension
K = Rollover Protection System (RPS)
L = Auto Lock Retract (ALR)
M = Crash sensor turns on hazard/int lights and unlocks doors
N = Remote entry and security system
X = other
Wheels/Tires
TireType 
A = 15 x 6.5 double spoke alloy wheels, 195/65R 15 91H all-season tires
B = 16 x 7.0 V spoke, 205/55R 16 91H all-season
C = 17 x 8.0 Star spoke, 225/45R 17 91W perform
D = 15 x 7 alloy, 205/60R 15 all-season
E = 16 x 7 alloy, 225/50R 16 perform
F = 15 / alloy, 225/60R 15 all-season
G = 16 / cross spoke, 225/55R 16 all-season
H = 16 / 20 spoke alloy, 225/55R 16 all-season
I = 17 / cross spoke bolted alloy, 235/45R 17 perform
J = 17 / radial style alloy, 235/45R 17 perform
K = 16 x 7.5 ellipsoid style alloy, 235/60R all-season
L = 16 x 7.5 radial spoke alloy, 235/60R 16 all-season
M = 18 x 8.0 front 235/50ZR, 18 x 9.5 rear 255/45ZR 18 parallel spoke alloy with perform
N = 17 x 8.0 alloy, 235/55R 17 all-season run-flat tires
X = other
Exterior Design
ExtDesignType 
A = Metallic Paint
B = Halogen free-form foglights
C = Xenon low-beam headlights with auto-level
D = heated windshield-washer jets and mirrors
E = heated door mirrors
F = Park Distance (PDC)
X = other
Interior Design -- Seating and Trim
IntDesignType
A = 6-way power front seats
B = 10-way power front seats with power headrests
C = 10-way adjust front sport seats
D = 8-way power 2-way manual front sport seats
E = 14-way power front seats with lumbar support
F = 16-way comfort seats with lumbar and upper backrest
G = 3-position driver's seat memory
H = Leatherette upholstery
I = Montana leather upholstery
J = genuine leather upholstery
K = front and rear adjust headrests
L = 2-stage thermo control heated front seats
M = genuine Myrtle wood trim
N = high-gloss trim
X = other
Audio System
AudioType 
A = anti-theft AM/FM stereo/cassette with 10 speakers
B = Harmon Kardon audio system with 12 speakers
C = In-dash CD player in place of cassette
X = other
Comfort and Convenience
ComfConvType 
A = auto a/c and air recir
B = auto climate control
C = dual digital auto climate with micro-filter vent
D = Car and Key Memory
E = keyless entry with multi-func remote
F = 2-way power glass moonroof with sliding int sunshade, wind deflect
G = tilt-telescopic steering
H = auto-dim inside rear-view mirror
I = power front and rear windows
J = cruise control
K = dual power heated outside mirrors
L = electric int trunk release
M = pre-wiring for cell phone, alarm, garage door open
N = Ambiance Lighting
X = other
Maintenance Program
MaintProgType 
A = Full 4 year/50000 miles
B = 3 year/36000 miles (can upgrade to Full)
(blank = none)
X = other
Warranty Program
WarrProgType 
A = 4 year/50000 miles
B = 3 year/36000 miles
(blank = none)
X = other
Extra Packages
ExtraType 
A = premium
B = sport
C = premium-sport
(blank = standard)
X = other
In Stock/On Order/Sold (or Delivered)
NumInStock
NumOnOrder
NumSold
Database II -- SALES
Field Names # chars and format
TrackCode
CustNameFirst
CustNameMid
CustNameLast
CustAddr1
CustAddr2
CustCity
CustState
CustZipCode
CustPhone
DateSold
CarHistory
7 chars (same as INVENTORY database)
up to 20 chars
up to 20 chars
up to 20 chars
up to 40 chars
up to 40 chars
up to 20 chars
2 chars
10 chars
up to 20 chars -- format (123) 123-1234
up to 10 chars -- format MM-DD-YYYY
memo up to 2000 chars
TrackCode
One unique tracking code for each single unique vehicle, used to point to specific BMW in INVENTORY for the SALES database
Customer Data
CustNameFirst
First name of customer sold to
CustNameMiddle
Middle name or initial of customer sold to
CustNameLast
Last name of customer sold to
CustAddr1
Address of customer line 1
CustAddr2
Address of customer line 2 (if needed)
CustCity
City of customer
CustState
State of customer (standard 2 letter abbrev: e.g. FL=Florida)
CustZipCode
Zip Code of customer
CustPhone
Phone number of customer
DateSold
Date car sold to customer
CarHistory
Complete car history, memo format up to 2000 chars
comments can include initial delivery dates, mileage, repairs, maintenance, tune ups, etc

 

PROGRAM DESIGN and CODING

That describes the basic system design, user interfaces and data structures. Now for some specific program design and coding strategies. As mentioned before, Visual Basic code is written around the "action buttons" of the user interface. Once the interface is designed, one can begin to think about what the specific buttons are to do and how the code must be written to perform the task of the buttons. In the BSTS, there are essentially 17 action buttons on the main two forms (Inventory and Sales), in addition to three buttons each (Search, Clear, Done) for the three search forms. So this means there are to be 17 different subroutines (in VB 6 these are noted by the various Private Sub SubName_Click in the source code -- meaning a single-click private subroutine -- that is, a local or non-global subroutine). Some of the more important button actions in "pseudo-code" form are as follows:

ADD NEW CAR or ADD NEW SALE

(1) Create a blank form at the end of the Inventory (Sales) database

(2) Set focus to the first field and allow entry

(3) Add the record and update

These involve one or two lines of code and is rather easy using the Visual Basic recordset object (e.g. BMWInventory.Recordset.AddNew).

SEARCH ALL CARS or SEARCH ALL SALES or SEARCH STOCK/ORDERS/SOLD

(1) Gather the appropriate search criteria entered in the search form

(2) Begin at the start of the first record in the Inventory (or Sales) database

(3) Compare the search criteria to each individual field in the current record

(4) If we have a match, increment total number of matches, display in a "Flex Grid"

(5) Continue through to the end of the Inventory database

These were the most complex routines of the whole project, but still rather straightforward since I am using a sequential search, comparing one record at a time. The total number of records I anticipate not exceeding around 50 in the BMW Inventory database, so even the "largest" amount of data would produce instantaneous search results (less than 1 second). The number of customers in the Sales database could be a couple thousand eventually, but still the results would be immediately returned given the speed of modern "Access" type databases.

MANAGE INVENTORY or MANAGE SALES

(1) Make the current BMW Inventory (or Sales) forms not visible

(2) Make the other form visible (for Inventory that would be Sales, and vice versa)

This is a simple way to switch back and forth between the two main forms (Inventory vs. Sales). Again, one or two lines of code will do the trick.

DELETE THIS CAR (SALE) PERMANENTLY

Again, this is done with one or two lines of code deleting the current record (e.g. BMWInventory.Recordset.Delete). This is not rocket science, brain surgery, or air-traffic control software. Wait, that might be next semester! I do ask the user to confirm that they wish to delete with a Message box warning.

SHOW DETAIL CAR DATA (only on Inventory form)

(1) Gather the current car Inventory data and specs in the text boxes 

(2) Compare each field element using a Case-Select with all the various specs possible

(3) For multiple strings (those involving ABCDEF etc) examine these characters one a time

(4) Keep a running Detail String

(5) Output the Detail String to a large text box

This is an extra button I added to allow the user to see the detail specs for the currently displayed BMW (rather than simply ABCDEF in the text boxes). This button "translates" the letter symbols into the real specs in English (again BMW specs taken from the web site www.BeverlyHillsBMW.net)

SELL THIS CAR (only on Inventory form)

(1) Get the current Track Code from the text box

(2) Close the BMW Inventory form, make the Sales form visible

(3) Add a record to the Sales database, increment Total Sales for that car

(4) Set focus on the new Track Code taken from Inventory database

(5) Allow the rest of the customer data to be inputted

Again, rather simple, just a matter of saving the current Track Code from the Inventory, closing the Inventory form, opening the Sales form and add the new record with the new Track Code.

That's about all for the system and program design. I can only wish the project were more complex! If you want complex, try writing an Assembler for a 6502 8-bit microprocessor in BASIC! (I did in the 1980s with my 5K Commodore VIC20). Now for some testing.

 

TESTING: Unit, Integration, and System

The testing was rather simple so I combined the unit, integration and system testing. Again, we aren't talking rocket science or even Windows 2000!  I created a database with standard BMW models (namely those are the 323i, 330i, 528i, 540i, 540iA, 740i, 740iL, and 750iL). I entered what I anticipate would be the standard specs input for these models (taken from the BMW web sites). I also entered a number of customers in the Sales database and made some searches. The results: my BSTS passed with flying colors! I did all the pilot, alpha, beta, gamma and lambda testing for all the action buttons on the forms. They worked with very minor bugs on the first attempt (a few syntax errors I had to overcome here and there). For more rigorous testing, I might have to test the software at a real BMW dealership!

All the search routines work and display the data as expected. I could add some better formatting features, or more powerful string search routines since for a string comparison to be made true, the full strings must be compared not portions of them. There is also the issue of "case sensitivity" which could be cleared up if the dealership desired. One can enter all caps or all lower case but consistency would demand one or the other. I could force the strings to all upper case to solve this problem.

 

SYSTEM DELIVERY and MAINTENANCE

I'm not sure what the instructor wants here since there aren't any "user groups" as such for me to demonstrate the software. The "installation" occurred when I produced the .EXE file on my home computer and tested it myself. The demonstration will be made to the instructor the last week of classes. I guess I could make up something that I tested my BSTS with a large screen in a large auditorium in front of thousands of BMW executives. And then I sold my BSTS for hundreds of thousands of dollars. Some corrective maintenance would be as I mentioned, perhaps making the search routines more "robust" in their string comparisons (allowing comparison of partial strings, and forcing upper case upon input, etc).

 

DOCUMENTATION and DEMONSTRATION

For internal documentation, see the source code below. Again, the source code in Visual Basic (if done right with properly named variables, subroutines, etc)  is rather easy to understand. I maintain straightforward top to bottom logic flow.

As for exernal documentation and demonstration, the program is rather simple to use. When the .EXE file is executed (double clicked), assuming the database is placed in the correct folder on the C:/ drive (C:/BMWPJP -- see ReadMeFirst.txt), then the BMW Inventory form will be displayed showing the first record (BMW) of the database. From here, the user can press the following buttons with a single-click of the mouse:

ADD NEW CAR (OR SALE) = adds a blank record in Inventory (or Sales), allows the user to fill in the boxes with new info

SEARCH ALL CARS = brings up a search form, allows user to fill in the criteria (press Search to begin search, Clear to clear form, Done when done searching)

SEARCH STOCK/ORDERS/SOLD = brings up a search form, allows user to fill in Track Code, Model Number, and a minimum number of currently on stock, on order, sold (i.e. at least that many for that particular BMW), leave blank for ALL

MANAGE INVENTORY (OR SALES) = switches between Inventory vs. Sales forms and databases

SHOW DETAIL CAR DATA = does what it says, brings up detail specs of the current BMW shown in Inventory database

SELL THIS CAR = if you want to sell the current car shown in Inventory, this button will take the Track Code and add a new Sales record, you then input the customer information for that BMW

DELETE THIS CAR (SALE) PERMANENTLY = deletes the current BMW (or Sale) in Inventory (or Sales) database, waits for confirmation (Are You Sure? etc)

INCREASE/DECREASE STOCK = increase or decrease current stock by 1 for that BMW

INCREASE/DECREASE ORDER = increase or decrease current order by 1 for that BMW

CLOSE AND EXIT = closes the program and exits

The data CONTROL button on the bottom of the Inventory and Sales forms controls the records in the database. You can move one record backward or forward by pressing the single arrow <       >, or immediately jump to the beginning or end of the database by pressing the double arrow <<      >> respectively.

 

What is the phrase that pays? BMW is the Ultimate Driving Machine!

Appendix: Visual Basic Source Code