Designing data dictionaries

Any solution will use appropriate data stores, data types and provide accurate data validation. 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

Include all variables (including counters and file handles), tuples, arrays and functions.

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 Graphical User Interfaces. 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 length, type, format and range 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.

Trace tables 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

  • 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.
Move on to Test
next