±«Óătv

Designing data dictionaries

Any solution will use appropriate , and provide accurate data . This can be achieved by outlining all data stores in a data dictionary.

For our example, a simple data dictionary would contain:

NameData typeValidationExample dataNotes
validateNameFunctionN/AN/AFunction to capture, validate and return name
nameString <= & not Null'John'Name variable to be used in NAME function
valid BooleanN/ATRUE, FALSEA flag variable to start and stop validation loop
aInteger>0 AND <=101variable to store random number
bInteger>0 AND <=101variable to store random number
DataArrayArray structure to hold the name and score ["John",8]Array will hold data to be written to the text file
NamevalidateName
Data typeFunction
ValidationN/A
Example dataN/A
NotesFunction to capture, validate and return name
Namename
Data typeString
Validation<= & not Null
Example data'John'
NotesName variable to be used in NAME function
Namevalid
Data typeBoolean
ValidationN/A
Example dataTRUE, FALSE
NotesA flag variable to start and stop validation loop
Namea
Data typeInteger
Validation>0 AND <=10
Example data1
Notesvariable to store random number
Nameb
Data typeInteger
Validation>0 AND <=10
Example data1
Notesvariable to store random number
NameData
Data typeArray
ValidationArray structure to hold the name and score
Example data["John",8]
NotesArray will hold data to be written to the text file

Include all variables (including and ), , and .

Planning for system navigation

You should create appropriate navigation diagrams showing how the product will flow, or how interfaces can be accessed throughout the software. You can use an activity diagram to represent how your product will flow.

For example:

Example of a navigation diagram

You will need to design plans for the user interface, be they form-based, text-based or . It is important to show how these will look, so you should include visual mock-ups of the user interface.

For example:

Example of a mockup user interface on a mobile device

Planning for validation

All input from the end user must be validated. Your design plans should show how you plan to use , , format and checks along with error catching methods.

You should use pseudocode to demonstrate how user input will be validated to ensure that the data entered by a user is acceptable.

For example, an algorithm to validate the length of the user name could be represented as:

1   LENGTH = 51
2   WHILE LENGTH >= 51:
3 	INPUT NAME
4 	LENGTH =LENGTH(NAME)
5   PRINT NAME ACCEPTED

Algorithm dry run and refinements

When designing a solution, it is important that you test algorithms before implementation.

can be created to test algorithms. A trace table follows the state of the variables during each line of execution in the program.

A trace table for the text validation algorithm would look like:

Line NumberValue of LENGTHNAMEOUTPUT
151
251
351INPUT NAME
4206James Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice
2206James Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice
3206James Dr No From Russia with Love Goldfinger Thunderball You Only Live TwiceINPUT NAME
45James
55JamesNAME ACCEPTED
Line Number1
Value of LENGTH51
NAME
OUTPUT
Line Number2
Value of LENGTH51
NAME
OUTPUT
Line Number3
Value of LENGTH51
NAME
OUTPUTINPUT NAME
Line Number4
Value of LENGTH206
NAMEJames Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice
OUTPUT
Line Number2
Value of LENGTH206
NAMEJames Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice
OUTPUT
Line Number3
Value of LENGTH206
NAMEJames Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice
OUTPUTINPUT NAME
Line Number4
Value of LENGTH5
NAMEJames
OUTPUT
Line Number5
Value of LENGTH5
NAMEJames
OUTPUTNAME ACCEPTED
  • In lines 1 and 2, the length variable = 51.
  • In line 3 the user is asked to input their name.
  • In line 4, the length variable now equals the length of the user input. As the length is greater than 5, the code iterates back to line 2.
  • Once again, in line 3, the user is asked to input a value. This time the user enters a value with 5 characters and the name is now accepted.

Related links