Professional Documents
Culture Documents
Use of Stubs and Flags
Use of Stubs and Flags
Use of Stubs and Flags
Due to the bottom-up method of development I have employed in the creation of my software solution,
stubs are not used very much if at all, as they simulate the lower level modules to test higher modules,
whilst I am creating lower level modules and need the higher level modules to be simulated. As such I
have extensively used drivers to allow access to the lower level modules.
This first driver I have used simulates the user inputting a new
entry in the database for equipment or rooms. The user
selects the type as well as inputs the name of the
equipment/room and submits it. It is used in order to allow
access to the module which inserts new entries for equipment
and rooms into the database.
Flags
Flags are variables (usually Boolean) which show that a certain condition has been met. Throughout my
software design major work, I have used flags in critical points in order to determine certain events
within the project as initiated by the user. For example, a key flag used within the booking system is the
“$loggedin” flag. This variable is set to true or false depending on whether the user is logged in or not.
This variable is used throughout the system to determine what pages are shown when the website is
accessed. If $loggedin is false, the user cannot access the bookings features of the website.
I have also used flags within the bookings system itself in order to check whether or not a user has
picked up, as well as returned a piece of equipment that they have booked.
Figure 5 Mysql database showing the use of pickupCheck and returnCheck flags
Anthony Zeater
The names of the flags are pickupCheck and returnCheck, storing a 1 if the item has been picked up and
returned respectively and a 0 if not. If an item has been picked up and not returned, the user cannot
delete their booking as this would allow them to get away with stealing the piece of equipment.