1 Chapter 7: Software Development Stages Test your knowledge - answers 1. What is meant by constraints and limitations on program design? Constraints and limitations are based on such items as operational, technical, social and economic factors that influence the design of a program. 2. Explain the 80/20 rule. There is a general rule that 80% of software design and development is devoted to input and output; and 20% to the processing requirements. 3. List the features for a good input screen, a good output display? Good Input Screen Features When designing input screens only data necessary for immediate processing should be input. Using codes rather than having to type the full name for fields is a faster and efficient way of entering data. A menu screen displays a list of processing options. The use of check- and radio-buttons, slider bars, drop-down and list boxes and other such devices provides a way of limiting the choice of the user and so limiting the amount of errors that can be made. Error messages need to be easily understood and also appear professional. Good Output Display Features Display screens should be attractive to the user, easy to navigate and also well arranged. Information should be presented logically and in an orderly manner. Screen navigation should be kept consistent. Screens with lots of bells and whistles are also not inappropriate. 4. What is meant by the term user-friendly? Software is considered to be user-friendly when it is easy to operate and use. The operator should not need manuals to start operating the software at an entry level. Clear instructions should be given within the program using buttons, menus, toolbars and so on to reduce the user s need to memorize codes, or instructions on how to perform sequences of tasks. Even by simply having a help-function built into the program reassures the user that they can continue working with their software whilst the program itself provides assistance with their query. These features all contribute to being user-friendly.
2 5. List the 8 different types of data validation techniques. Existence Checks: Certain fields need to have data entered, such as an account number or member ID number. Data Type Checks: For example if a field is designated to only contain integer numeric values, entries other than integer numeric data should cause an error. Numeric Range Checks: often data needs to be between minimum and maximum values. Text Range Checks: often a program requires a user to input only a limited range of text data such as state lived in, male or female, title. This type of data is difficult to validate as spelling mistakes can easily occur or users can use capitals or not. Check boxes, radio buttons, grouped radio buttons, lists and drop down lists can be used to limit the choice of input. Reasonableness Checks: reasonableness refers to values that may be questionable. Comparison Checks: two or more items can be compared. Counting Checks: counting checks refer to a predetermined list of data items that need to be entered Sequence Checks: sequence checks are used when data is expected to be in some sort of order. 6. List the steps in designing a program and associated data structures. The first step in the design stage is to define the structure of the overall program. The control sequence/relationships between the modules are shown in a structure chart. Layout diagrams define the format for the input and output screens and reports. The external file structures must be defined. The internal data structures local and global data, and any special data structures are selected. Data transfer parameter passing - between modules is specified The purpose of each module the processing that will occur - is described. 7. What is top-down decomposition software design? In the design process, it is best to divide the program into modules and then divide them further into smaller sub-modules. This process is called design by top-down decomposition. The process is finished when each part may be clearly and simply defined as a single purpose module. The emphasis with this method is on the processing aspect of the program, and consideration of the data storage requirements is mostly secondary. 8. What is a layout diagram? Layout diagrams should represent in detail the information the user will see on the screen or on paper. 9. When is a story board design used? For event/object-based programming design, a storyboard approach is probably most suitable. Therefore, the layout for each screen can be designed and the algorithms belonging to the objects and events can be attached to the layout on another sheet. 10. What is meant by file structure design? File structures need to be specified in detail. The type of file structure must be specified serial, sequential, random access or index. Lists of data stored need to be developed. Such lists are called data dictionaries and describe in detail the data and information stored in the file.
3 11. What is meant by data storage and parameter design? The data storage requirements of each module are also defined. The local and global variables need to be named and the type (data format) of data stored specified. Sometimes special data structures such as arrays, stacks, lists, queues need describing in detail in a similar way to normal variables. A major consideration after the processes have been modularised and the data storage requirements have been designed is to specify the way data is transferred from one module to another. The types and names of the parameters used to pass data from one module to another need to be specified. 12. What is an IPO diagram and why is it used? For each module the local and global variables and processing should be specified in an Input- Processing-Output (IPO) diagram. Input Processing Output 13. List the three main criteria for designing layout diagrams. The main criteria for layout diagrams are: Data input and information output should be clearly distinct from each other; Different types of information should be clearly distinct from each other; Each screen or page should have a title that indicates the type and purpose of the information; the use of sub-titles is very useful for this purpose. 14. What needs to be specified for each object in a storyboard for an object-based program design? Each object on the storyboard layout needs to be named, and the properties, data and events associated with them described. The algorithm associated with each event can then be described. Some objects may have more than one event associated with them and so will have more than one algorithm attached. 15. List the three algorithm design tools that are commonly used. Various design tools can be used to represent an algorithm: flow charts, Nassi-Schneidermann charts, and pseudocode. Pseudocode (or Structured English) is the most popular algorithm design tool used as it is very similar to the actual programming code. 16. What is a desk-check and why is it used? The last part of the design stage is checking the logic of the algorithms. This is checked using specially designed test data and a process of stepping through the algorithm called deskchecking. It is easier to correct errors in the design stage than later on when the coding has been completed or when the program has been released to the user. One reason for the relative ease of correction is that the checking is done on paper, rather than using expensive hardware and software, and time-consuming debugging procedures. Other reasons for changes being costly in the final program include the 'ripple effect' that occurs between an integrated set of program modules when a change is made to one of them.
4 17. Match the file processing commands with their correct explanation. Changes the current directory. Creates a subdirectory. Erases an external file, on disk usually Moves the current position pointer of a file to a specified record in the file. Reads one or more values from a file depending on the type of record declared at the current pointer position. Removes an empty subdirectory. Renames an external file. Returns the current directory of a specified drive. Returns the current position of the file pointer. Returns the current size of a file. Returns the end-of-file status of a file. If true the file pointer is past the last component in the file. Writes one or more values to a file at the current pointer position. CHANGEDIRECTORY MAKEDIR ERASE SEEK READFILE REMOVE DIR RENAME GETDIR FILEPOSITION FILESIZE EOF WRITEFILE 18. Explain how a bubble sort works with an example. The bubble sort algorithm passes through the data the number of times that there are data elements, bubbling the largest data element to the top. Students should deskcheck the procedure in Figure 7-12 with a few sets of data nearly sorted, partially sorted and completely unsorted 19. Explain how a linear search works with an example. A linear search begins at one end of a list, and searches through the list until it finds the required data element, or the end of the data is reached. This type of searching method is useful for searching through data that is not sorted into search key value sequence. Students should deskcheck the procedure in Figure Explain how a binary search works with an example. A binary search requires the data to be sorted in the sequence of the search field values. The method starts by examining the item in the middle of the list for the sorted field. This choice effectively divides the data items into two halves, one with values greater than or equal to the search value and one with values lower. After comparing the search key value with the value of the examined element the algorithm decides which half the required data element is in. One half of the data is further examined by the halving operation in the same way, and so on. The process works by dividing the list into two parts (binary parts) each time, the half that contains the data and the rejected half. This type of searching method is useful for processing sorted index files that are small enough to be loaded into memory. Index files can also be sorted in this way when the file is too large to fit into the memory. The index file is sorted on the field that is being searched. For instance by the ID number of a product or person, and also contain the associated file position number of the product or person. The file position number is used to find the rest of the data about the product or person from the disk file. Students should deskcheck the procedure in Figure 7-14 using sorted lists of varying lengths from 6 items to more than 100 items. 21. Why is data validation needed in a program? Data input of the wrong type and size needs to be caught using the appropriate data validation techniques or else the output will not be correct garbage in, garbage out (GIGO)
5 22. List the various techniques that can be used to test data validation sections of a program. Test data tests the data validation during data input from the keyboard, input device or a file. Data input of the wrong type and size needs to be caught using the appropriate data validation techniques. In this circumstance, the input process refers to data input in human readable form, data retrieved from digital storage in files, and data received from communication devices. If the input algorithm is designed for the processing of integers then it should be able to catch and reject text data (spaces, letters and special characters such as $, %, units of measurement, and all the others), no data, and decimal numbers. That the full range of integer data is correctly accepted should also be tested by using very large and small positive and negative integers and zero. If the algorithm is designed for the processing of real numbers, then it should be able to catch and reject text data (spaces, letters and special characters such as $, %, units of measurement, and all the others), no data, and integer numbers with no decimal places. Correct acceptance of the complete range of real data should also be tested by using very large and small positive and negative real numbers and zero. Correct acceptance of the optional formats of real numbers needs to be tested as real numbers can be in decimal or exponential format. If the algorithm is designed for the processing of text data then it should be able to correctly handle text data with extra spaces, tabs and/or line feeds between words, and be able to correctly interpret special characters (such as and ) that can cause problems with text processing, no data and text with too many characters. The full range of expected valid and invalid file formats need to be tested with the program by allowing the program to try to open them for processing and to process them. 23. How should boundary numbers in programs be tested? Numerical condition statements need to have all numbers at the boundary tested, and values just at either side of the boundary. For example Sales > 100 should be tested with the Sales values of 99, 100, and 101. The same testing should be done with range testing as well to ensure that the values just in the range and just out of the range are correctly processed. 24. How many combinations of test data should be used to test this statement, what are they and what are the expected results? IF Answer < 4 AND Found = False THEN Person = John ELSE Person = Sue Answer Found Result 3 True Sue 4 True Sue 5 True Sue 3 False John 4 False Sue 5 False Sue 25. What is meant by an initialisation error? Give an example. Also a very common problem is that the initial values of some variables may not be re-set from the last set of calculations. The initialisation sections of any algorithm must be given special consideration in both design and testing. For example a total or counter variable may not be re-set to zero before the next set of data is totalled or counted. Therefore loops and modules must be executed at least twice to check that the second execution is not compromised by variables containing data left over from previous processing 26. What is the purpose of logic test data? Logic conditions such as AND, OR and NOT need to be tested with all logical combinations of values. For example Answer >= 30 OR Found = True needs to be tested with Answer values of 29, 30 and 31, with Found values of True and False. This means a total of SIX combinations need to be tested for this compound test situation.
6 27. Name one numerical calculation that can crash a program? How can this be guarded against? One special circumstance that needs to be tested for is division by zero. Since, on most platforms, the execution of a divide by zero instruction usually causes the operating system to immediately terminate program execution. Programs need to branch around the division operation if the divisor is found to be zero. 28. How can unusual data that can crash a program arise? Unusual data can occur in program use for a number of reasons. 1. The data entered may not have been validated properly. 2. Unusual data may appear that was not found in the analysis stage. 3. Unusual combinations of data that were not anticipated in the analysis and algorithm design stages are passed to a module for processing. 4. Hardware problems can produce faulty data. 29. What is a testing table and why are they needed? Name the columns that usually used? For each item of test data the expected result needs to be determined or calculated and used to check the actual result in the testing stage after the program has been coded and debugged. The test data is recorded in a testing table that is also used to record the reasons for the testing, how the test is to be performed, the component tested and the actual result. 30. What is a style guide? The following items will usually be specified in a style guide, or list of formats and conventions, to provide a consistent interface and message to the user. Each organisation or software developer usually wants to present an image to the public or user and this message can be presented through the user interface design and tested by checking that the following items match the style guide and common formats and conventions What is the difference between a format and a convention? A format is the way that a document or screen is set out, for example portrait or landscape. A convention is a commonly understood way or rule for doing something, for example, the way that dates are written 32. List the items that need to be checked when testing the content of a screen or printout. Checking the information content: Spelling; Alignment of text in labels and fields; Positioning of text; Font - limited number of shapes and sizes used; Meaningful titles, instructions, error messages, labels and caption; Use of capitals, lower case and serif/san serif; Money conventions are followed, placement of $ signs and number of decimal places. 33. List the items that need to be checked when testing the colours of a screen or printout. Check the colours used: Colours - number of colours should be no more than about three; Use of colours to emphasise important information; Consistency of colour for common purposes; Contrast of colours colours should contrast for easier reading, especially for disabled people.
7 34. List the items that need to be checked when testing the alignment and positioning of items on a screen or printout. Check alignment and placing of items on the screen: The edges of the objects line up Size of common purpose objects (e.g. all labels same size) Use position and size to emphasise important information such as input and output in different positions, buttons in consistent positions to one side away from the information Flow of objects (usually left to right, top to bottom for Western societies) to guide user Crowdedness of the screen (objects not too close together, size of windows, amount of white space on output) 35. What is the difference between a syntax error and a logic error? In the debugging stage two types of error need to be corrected: 1. Syntax Errors: these types of errors are caused by the programmer not using the correct syntax when entering the program code. Modern program development environments provide wizards and other aids that limit the number of syntax errors. The one type of error that is hard to eliminate is misspelt identifier names. For example mistake = misteak; Syntax errors are detected during the compilation/interpretation of a program. 2. Logic Errors: these types of error require the actual results of the program to be compared to the expected results that have been worked out in the design process. If the algorithms have been designed carefully, and desk-checked with thoroughly designed test data there should be very few of these errors. 36. Explain three techniques for debugging programs. Setting Test Data Each module should be tested separately before being linked with other programs and the values that are passed to the module should be specifically set up to test the module. This can be done by setting up the test data in the normal program or by creating a special calling program or driver. In addition, variables with special values may need to be set in the module to test a specific set of circumstances. Another technique that performs the same purpose but is more flexible is to insert extra input statements and extra repetition loops so the programmer can more easily test the module without needing to use the normal data input processes. Tracking Variables The tracking of the value of variables can be done in a number of ways. Extra print or display lines of code can be inserted that printout the values of specific variables as the program works. Another method is to display message dialogs with the value of some of the variables when a specific combination of circumstances has occurred. These will require input to proceed and serve the purpose of pausing the program so that the programmer can check what is happening at each stage. The code is stepped through one line or section at a time. This can be achieved by inserting pause statements or statements that require input to proceed at various crucial steps in the program. This technique is very time consuming and is therefore only used if a particularly difficult bug needs to be found. Debugging Tools Most modern programming environments have in-built debugging tools that facilitate the implementation of some of the techniques described above. The display of the values of variables, the pausing of programs at selected stop points or values and the stepping through of programs can be easily done. 37. Why is internal documentation required for a program? As the code is written it needs to be documented so that the author can understand it later. More importantly, careful documentation is essential, as other programmers will need to remove defects or make modifications in the future.
8 38. List the items in a program that require documentation. The internal documentation comments that need to be supplied are the following. Introductions to each module that describe; o the purpose of the module and any limitations and constraints, o the author of the module, o the date the module was coded, o the name and number of the module in relation to the whole program, o a version or build number, o and a list of any modifications, the date, by whom and why they were made. Explanation of the purposes of variables, file and data structures and other declarations; Explanation about the passing of data to and from the module; Explanations about the purpose of each processing structure blocks of code, iteration loops and selection structures; Explanations of lines of code that use special functions of the language or implement complex aspects of the problem solution. 39. Explain the difference between alpha and beta testing? The initial debugging stage is called Alpha Testing and takes place within the Development Stage and is done by the programmer or specialist programmer/testers. The next testing stage is called Beta Testing and is separate as it takes place outside the developmental stage environment and often in the implementation stage. In beta testing specially selected testers, usually future users and reviewers, are asked to test the software in their own premises or in specially set up test sites. 40. List the different types of technical documentation for a program? During the development of the program a range of documentation has been accumulating. When the program is completed and implemented the documentation needs to be collected together and stored for easy future access. This documentation will be definitely be required as programs often need modifications to them due to changing requirements and bugs that are discovered in daily operation. All the documentation from the various stages needs to be kept including any designs that were made but not implemented and any factors that were considered but discounted in the final design. Of course, all testing documentation needs to be kept to aid in the eradication of bugs, and discovering why they have occurred. 41. List the different types and purposes of user documentation. One essential part of implementation is the production of instructions for the users. Operating instructions can be just simple help cards or more complicated procedure manuals to be followed when using the programs. User manuals can provide more detailed explanations of how the programs work and can be used, and often include some technical documentation. Tutorials are often needed for complex programs that cannot be learnt in a short time.
9 42. What sections should a user s guide contain? Part One: Program Information Title of the program Author/s of the program Date and version of the program Publisher of the program Purpose of the program Functions provided by the program Data required Output produced Hardware, software required to use program Where to find help and additional support Part Two: Step-By-Step Guide Starting the program and retrieving the files required. Instructions for entering or editing data Data Validation Saving the data Production of the output: this section should be structured around the functions and parts of the program. o Describes what the program will do with the data, what the user can expect to see happen and the responses expected by the program from the user. o The sequence of control through the program should be described and the options available to the user. o How to produce and print reports should be described. Terminating the task 43. List the various types of training that a user can undertake. External course at schools, colleges, institutes of technologies, technical and further education colleges, adult education centres, universities that are either private or public organisations or businesses. Internal courses run by staff from the business or organisation, or from one of the external training providers. The courses can be short or long term, introductory or higher level courses. Learning on the job under the guidance of a specialised internal instructor or a fellow staff member. Self-paced learning from books, videos, or computer based training software (CBT) specially developed for the software. 44. List the criteria for selecting a particular type of training. The choice of training depends on many factors such as: The size and complexity of the software; The costs of the training; The timing of the training before, during or after implementation; The location of the training; The level of expertise in the organisation; The type of implementation method chosen direct conversion, phase-in method, parallel systems, or pilot approach. 45. What is a program patch? A patch may need to be developed and installed to solve a problem that is causing the users to lose productivity. A patch is a piece of code that is inserted into or patched into a program. The patch may be a new version of a part of the program such as a re-written DLL file or part of the main program.
10 46. Describe two main techniques for collecting data to evaluate software? For evaluating software there are two specific procedures that need to be set in place bug and problem reporting, and improvements reporting. As well as the reporting procedures there are usually more formalised techniques such as user and customer surveys and review meetings. 47. What are the usual naming conventions for files, variables and objects in programs? A file and folder name should include a reference to the type of data that is stored in the file, the version of the file and the purpose of the file. For example, English Analysis Othello Assignment Two - May 25 Version 3. The user should not need to open the file to determine if the correct file has been selected, especially when there are a number of similar files required for use in a program or authored software. Objects and variable names usually follow the following pattern with the first two being the minimum required: <prefix><body><qualifier><suffix> Prefix - indicates the type of object or the data stored in the variable, or the scope of the object or variable, e.g. btn for button, int for integer data, txt or str for text data, gint for global integer variable, vid for video clip, img for image holder Body - describes the main purpose, e.g. calculate, name, animal Qualifier - a quality of the main purpose, e.g. first, tiger Suffix - additional information, e.g. 1, 2, 3, a, b, c, red, green Examples: btncalculate, txtnamefirst, imganimaltiger2, gintbilltotal 48. What are version controls and build numbers? Why are they needed? Version control is therefore a necessity for backing up, archiving and disposing of files. Also for security reasons tracking of changes made to parts of a program need to be performed. If there are problems later with security of intellectual property contained in or associated with the code owners of the software need to know who might have leaked the code or other information, Also if bugs are later found the developers usually need to know who developed a section of a program so that the programmer can help to remedy the problem, and to monitor the quality of work being done by various programmers. Version control provides an easy way of managing backups as well. The term software build number refers to the final executable file. When software is being tested the build number is important to know so that the latest version is being tested. The build number is different from the version control number as it applies to the final compiled product that is a combination of many other files each with their own version number.