Home
Chapter 5
Contents
1. a Boundaries of problem AO documents should be revised and edited Definition Reguitemenis Q to reflect any changes made as the Q N software development cycle ha Design Developer s perspective progressed For example the d Specifications User s Perspective K specifications that were S lly H Log System Flowcharts Q created in Stage 1 will og have nace Sten PO ae O undergone modificatio refinement Data Flow Diagrams A ject s Structure Charts as the projects elopment has Paar QO unfolded Any ications that have Story ne been made be documented and Screen ae retainedwiththe original specifications ra fautidre Algorithms ASE d ana h fi gorithms tom Algorithms C tools use uring the software tandard Modules development process assist in ensuring a g Source Code Comments technical documentation is updated to L Documentation Mttinsic Documentation reflect the final nature of the product System models data dictionaries and algorithms must be particularly accurate Future maintenance developers will Fig 3 45 r quire these documents Technical docu ion is compiled 5 throughout the sofware development cycle The technical documentation we have ae examined in the SDD HSC course and that is create during the development of many software products is described in Fig 5 43 ne ae A GROUP TASK Activity QO Make up a table listing all the possible technical documentation types studied so far in
2. the Customers data structure oe Let us create the Custome data structure in both Visual Basic NET and Pascal Visual Basic NET O O O N Public Structu omerlype w Public Sun As String QY Puri ame As String QA Public Sex As Boolean Public Email As String End Structure Public Customers 500 As Customerlype However the above CustomerType definition creates strings of variable length This will work correctly if we use a sequential file however for a relative or random ac file we need to create fixed length strings so that ya ae will always be cisely the same length The following definition creates fixe Mength records Public Structure Customerlype cO lt VBFixedString 20 gt Public Surname As String Q lt VBFixedString 20 gt Public FirstName As Siringo Public Sex As Boolean lt VBFixedString 30 gt Public Email As sigh x A End Structure ws Public Customers 500 As yr 9 Pascal Ce Ce TYPE oe oc CustomerReclype RECORD a Surname ARRAY 1 20 OF Char O First are ARRAY 1 20 OF Char S Sex Boolean Email ARRAY 1 30 OF Char END Customerlype ARRAY 1 500 OF CustomerRecType VAR Customers CustomerlType i Software Design and Development The HSC Course KS i sor a Wt 6 G CG ao ck cok oO Implementation of software solutions we O NV GROUP TASK Investigation Examine another programming language and develop declaration statements for the above Custome
3. NX Ny 1 D 2 C 3 A 4 B Question 5 co cok Internal document igh ticorporated into the source code which includes comes and also intrinsi umentation such as meaningful variable and procedis 2a Suggested Solutions Internal doc ation will make it easier for the programmer to under exactly what th rce code is doing which makes it easier to determine whit parts of the code need modifying to achieve the specified changes Systems documentation such as systems flowcharts structure charts and DFDs provide an overview of the system and how the various parts interrelate This provides the programmer with the information to determine the role played by individual components of the system so they can better determine which parts need to be modified and the effects of those modifications on other parts of the system N i Software Design and Development The HSC Course KS i sor G CG ao SET sN 1 Whic type of documentation includes 20N 5 o hardware and software requirements together with step by step set up instructions A User manual B Reference manual C Installation guide D Tutorial ternal documentation is included in the source code comments used to explain the source code C self documenting code D All of the above The complexity of the language used in documentation should be determined by A identifying the intended audienc B the nature of the
4. The theory of quantum computing relies on spinning particles Many particles at the atomic level are known to spin The direction of the spin can be used to represent binary digits bits In quantum computing terms bits are known as qubits pronounced cubits We are not only able to set the direction of the spin but we are also able to read the direction of the spin for an individual qubit Using the mouse in the box analogy if we place particles in a box out of eyesight and apply energy each particle will be in two states at the same time If we have 8 particles in the box we are r enting 2 or 256 different states at the same time AIS an algorithm to the yarticles allows calculations to therefore take place on a 6 states concurrently If we expand our theory to many thousands or milli of particles the potential processing ability becomes mind boggling AC i Although quantum computers are still ve a theoretical possibility there are many companies investing heavily i it research and development Why the investment One very practical use Nes around security of data Current methods of encrypting data rely on the that breaking the encryption is not possible with today s processing ae is said that if all the computers in the world worked continuously on breakingjust one modern military encryption code it would ta about the same amom of time as the universe has been in existence Quana computers coul ntially break encryption codes i
5. a i 8 oo oo 288 Chapter 5 ao ao D a HARDWARE ENVIRONMENT TO ENABLE QO IMPLEMENTATION OF THE SOFTWARE SOLUTION All software solutions are designed with particular hardware requirements in mind The installation guide will include specifications in regard to minimum requirements possible additional hardware and appropriate drivers Large custom systems are usually designed for a specific hardware configuration Solutions designed for a broad market need to operate on a variety of hardware configurations The hardware reqtuitements need to be specified and tested before software sns are released p0 Minimum Hardware Configuration oC Q oO The minimum hardware requirements will vary ft e Processor type and speed different software solutions The checklist s n e RAM size and type Fig 5 44 lists hardware items that ey be e Secondary storage size and considered by the software deve X for all access pees Q f D e Input devices solutions The minimum configur tion should allow e Output devices the software to operate successfully with acceptable e Network hardware oh performance and response Tied Chapter 6 Testing Fig 5 44 Ce and evaluating software so utions examines how the Checklist of hardware items requi hardware and oftware is tested to ensure for all software solutiogS performance meals expectations Possib ional Hardware Additional hardware items are those items supported by the software product but not
6. ENDFOR mS i Software Design spd BeVelopment The HSC Course so AC A metalanguage is A either an EBNF or railroad diagram B used to make sense of programming languages C another name for a high level language D used to describe the syntax of another language In EBNF lt thing gt means that lt thing gt A is repeated one or more times B is repeated zero or more times C is optional D can take on more than one value Which of the following is true of multi on 4 dimensional arrays A Data is stored in records B Each data item takes the value QO C All data items are g same data type D No two vs s can have the same invo A on defined variable fining the data type then declaring the variable B Declaring the variable then defining the data type C Determining the number of indexes then declaring the variable D Opening the data type and then reading its contents PN RND generates a random number in Oie range 0 to less than 1 INT RND 6 4 would result in integers in the range A 4 to 10 B 6to 10 C 4to 9 oe D 3 to 9 N A multi dimensional array requires 3 Ww indexes and needs to store 1000 dat X items Which Visual Basic satu achieves this task ce A DIM Test 10 10 1 B DIM Test 9 9 999 D DIM A da re containing a series of reco ould be A an array of records B a file C a multi dimens
7. Output using es full body suits incorporating pneumatic sensors is boca a reality using li and more responsive systems The computer opens and es a series of va ithin the glove or suit such that the user can feel objecti they are manipulate in the virtual world Voice recognition is continually being refined For instance early mobile phone voice P a I recognition was rudimentary and often failed to detect single words correctly Today complete J sentences are understood with amazing accuracy Devices are under development that 7 deteot lip movements causing directional a ice to home in on the vocal source These devices are able to operate in high noise O G environments or where there are groups of oS oO users of Q l l l Q Fig 5 45 k The following devices all introducedy n C Pen text scanning pen ws methods for human computer interacio e Games console devices such e Wii remote PS3 move Xbox Kinect which include various motion wide sound and other sensors within an integrated oR system e Handheld communighion devices such as the iPhone and other smart phones oc e Biometric deya such as finger print iris face recognition and other NS tric soan EA ices Tou sing devices including touch screens multi touch su movement sensors and touch pads e Scanning devices such as scanning pens for text phone cameras used to scan QR quick response codes smart card readers within EFTPOS terminals or
8. Price GST 19 0 Integer 9 20 0 Integer By combining single line stepping and watch a a expressions an automated desk checking system a PNA created that can be used to watch the EEEE NET displaying the RN e of particular expressions The watch surre ae of warhed varrables and window is similar to an individual row of a ressions as the code runs manual desk ees an expression whose the watch window as 9m 232 Inte RAN gt 3 54 se 9 9 0 10 0 eger check GROUP TASK Discussion Q A subroutine is under dev ment that reads a sequential file of records As each record is PA us calculations are made A logic error exists as some of the c ons on particular records are incorrect Explain how the use aap line stepping and watch expressions could be used to help ge e problem ROUP TASK Activity ao Use a programming environment with which you are familar to perform the following Write a short program to find the average of 10 random numbers between 1 and 100 inclusive Create watch expressions for each of the variables in your code Step through the code line by line to ensure it is operating correctly o routine Step out options 9 6 28 Integer aS 6 166 Integers O Software Design spd Development The HSC Course so coe co 9 yy os oo 274 Chapter 5 ao so V V Q Qy BA Q Ly HSC style questions 1 1 4 1 A new software application has been install
9. Translation is the process of converting high level code or source code into machine executable code High level languages cannot be understood directly by computers they need to be converted to a form that is understood by the processor This is similar to speaking in German to an English speaker The German needs to be translated into English before the meaning can be understood Source code is said to be machine Source i ndent This means it can be used eae on a number of different processors In sor pN cO reality some changes are normally O ao required for this to occur Executable Tran eT Translator Translator code on the other hand is very B C y2 processor specific Each family of Q i processors will have different ee s language instructions Source og Executable Executable Executable A B C to be translated for use o ecific e 9 processors If our Ge speaker Fig 5 7 ce Different translators are used to create wished to convey the same message to ifi both an Baglish Q o and an Italian executable files for different processors RO the same or similar source code aN speaker he w uire two translators p q The neotton of the World Wide Web has resulted in pan Pm at can be implemented on a wide range of unknown processors Languages such as Java undergo a two stage translation process The source code is translated into byte code This byte code is distributed and
10. analogy one step Arter translator will no dot find various of a novel from German into English Ow sentences in Sina German difficult to translate into English TER ator would mak ote of these sentences At the end of the translation Ss these sentenc ould be analysed and perhaps the original meaning wi be acquired from the author The translator then goes back over the manuscript correcting their translation This is similar to a compiler listing all the errors found in the source c and the programmer going back and correcting these errors There is one impor difference however A compiler does not produce any actual machine code until entire source code is known to be correct in terms of the syntax of the source code ode tant the Compilers are used to produce executable code for the majority of commercial imilar interpreted products As a compiled program is aN up of machine c instructions it is very difficult for the details of the ori SO not available to users it is virtually impossi or sae to make changes to S product This makes it easier for software companies to provide quality support Y their products as they know precisely KY rkings of the application Cpa Compiled programs generally run faster and re efficiently than l ode urce code to be realised AC h This protects the intellectual rights of the author Pe As the source code is the for Executables created with sompa Wi always be machine specific
11. lt Hok gt lt Yot gt Which of the following best describes a Drim A A Drim begins with a Yot followed by one or more Hoks with a Yot at the end B A Drim begins with a Yot or a Hok which is followed C by another Hok with a Yot at the end a C A Drim is two Yots or a Drim is a series of one ge Hoks followed by a Yot D A Drim is a series of Hoks sunt fak Question 4 4 A programming language uses the aah ing syntax ws Digit 0 1 2 3 4 ye 6 7 8 9 Letter A B c D Lon Variable o Qi gt lt Letter gt lt Digit gt oR PRINT PRINT ene os lt Variable gt Assignment LET iable gt lt Variable gt lt Digit gt lt Letter gt Xon Statement lt P lt Assignment gt Loop FOR ble gt lt Digit gt To lt Digit gt lt Statement gt aaa a Draw a ailroad diagram to show the syntax of an Aseiganenty sO b ae why LET A 75 isa valid Assignment c Write program code using the syntax defined above which will print the numbers from 1 to 5 inclusive Suggested Solutions 1 D 2 N Rae og cO Question 4 a Assignment b A isa valid wigan A is a valid letter and a variable can be a lt 0 letter 75 isa sf because 7 and 5 are both valid digits and a gin be one o e digits coe 75 is a valid assignment because it is in the form LET ee variable and A and 75 are both valid variables as explained above c FORA 1To5 PRINT A
12. D Tutorial The sentence The aim of e is to capture all the oppon s s is an example of a E A procedural explanation B subjective explanation C technical explanation D conceptual explanation 10 Comments within the source code are ne Qn should be developed once the product is ready for distributi is statement Explain your answer used to explain the code Which of the following is true in regard to these comments A The hos explain the logic of t Ne that follows B h line of code should be Q preceded by a comment of code does rather than how it does it Each comment should precisely reflect the processing of the code fragment that follows ee They should explain what a section D ocumentation types Describe the main features of each CA ifferent forms of technical documentation Describe the main eapo a agree Electronic forms of user documentation are becoming commonplace Explain the advantages of electronic forms of user documentation over traditional printed forms Consider the point of view of the software developer and the user as part of your response Create a subroutine in a high level language with which you are familiar that splits a sentence into separate words The words are to be stored in an array Include suitable internal documentation as part of your solution Software Design a eax Development The HSC Course 9 of 9
13. Extract each colour value from the hex string Blue Val amp H amp Left HexCol 2 Green Val amp H amp Mid HexCol 3 2 Red Val amp H amp Mid HexCol 5 6 pum au Fig 5 41 Procedure containing comments describi the procedure and its logical ta ic After mments that incorrect as the code is modified In Basic a single quote is used to indicate a comment In C two forward slashes are used Examine a number of programming languages to determine how comments are indicated in the code Software Design spd Development The HSC Course so ck cok 284 Chapter 5 oe sor ow Intri documentation KA Intrinsic means belonging by its very nature Intrinsic documentation is therefore documentation that is part of the code by its very nature In other words the code is self documenting EES DE PROCEDURE A VAR B Integer There are two main types of intrinsic BEGIN B 1 WHILE B lt 10 DO BEGIN documentation the use of meaningful identifiers Writeln Count B B 1 END END and indenting of code Self documenting code is easier for humans to read The translator does not po Ween are what names are given to identifiers just as oon O nt Integer long as they are syntactically legal Translators G h Ae ignore indenting Count 1 2 WHILE Count lt 10 DO S An identifier is the name given to a robe BEGIN procedure function or instance of an t Th Write
14. FileName nMode Random CusLen Count 0 O oR While NOT EOF FileNum FileGet FileNum mers Count Count 1 R oc Count Count a0 x End While V o x The RetrieveCustomers procedure above is almost identical to the StoreCustomers procedure in terms of logic The condition to end the loop uses the EOF function this function detects the end of the file specified by FileNum Note The VB NET sequential and random access commands described above are similar to those described in the Software Design and Development Stage 6 Software and Course Specifications document There are other more efficient file access methods provided within the NET framework i Software Design and Development The HSC Course KS i G G ow Row coe Implementation of software solutions A A problem occurs with both procedures above if the file does not exist In this case the OPEN statement will create a new empty file The procedures still terminate correctly but an empty file will remain on the disk The Visual Basic Kill command is used to remove files The syntax is Kill lt Pathname gt Alter the procedures to correct this fault Consider the following unds for your farewell There irst prize is an iPod second prize of a free Mars bar from the canteen Imagine your Year 12 class are running a raffle t are 500 tickets to be sold to students at the sch is a music voucher and there are 20 ot
15. If a product is to operate on a different proces SN erating system then the source code will nee be recompiled an piler that produces the appropriate machine c instructions O P aes Activity O A files mpilers translate the entire source code into an executab assuming no errors are found These executables are run a later stage separate to the compiler Design a flowchart to describe the operation of a compiler GROUP TASK Research Make a list of programming languages which are generally compiled and Y briefly outline the main use of each language d to ode oc i Software Design and Development The HSC Course KS sor so a i 8 ia cor coe of 9 O oO 9 co 264 Chapter 5 ao WW The techni the pro cor a we and software tools discussed in the next section are at er assisting mer to detect and identify the source of logic errors On identified the programmer themself must correct the incorrect logic Consider the following A function is required that adds up counting ers For example the call Sumints 4 hould return the value 10 which is O 1 2 3 4 The function executes with no errors reported however the result returned is not correct Clearly the function contains one or more logic errors GROUP TA Identify and c O Ruain os are errors detected by the computer whilst a program is executing There are many possible reasons for the s
16. RFID scanners used for stock control in warehouses retail stores and libraries e Mind control devices such as Emotiv s Epoc Headset which is able to detect facial expressions emotional state and cognitive processes using 14 sensors i Software Design and Development The HSC Course KS i c c oe Row 9 O O oO ck cok A Implementation of software solutions AD NV yY iti Examine the games consoles smart phones and other devices owned by members of the class to identify all the input and output devices present GROUP TASK Activity Identify all the various scanners you encounter during a typical week Briefly explain how each scanner improves the abilt software to collect data compared to keyboard data entry GROUP TASK Discussion Emerging methods of input and ofi will no doubt continue to have a profound effect on future softwate products Discuss the effects you A perceive these changes ve for the development of future software ws solutions CY X ot Interney agc ss initiatives aor flexible ss to the internet and which utilise the internet in y new and innovative ways AE Sa so New device d software applications are regularly released whic ghd more Examples of newer internet related hardware and software initiatives at the time of printing include e Televisions mobile phones cameras cars white goods and other devices which increasingly include built in World Wide Web conn
17. by writing the new value Q under the appropriate identifier A desk check is particula N when the workings of a piece of source code are cok not fully understood T cess of working through the code statement by sees helps to make the R clear Often errors in the code will be detected as the check progre ese errors can then be corrected and a new NS eck comme gr Consider the following A function is under development that will perform a linear search for a particular element amongst an array of elements The function returns the value true if the item is in the list and false if it is not The function has been written in Visual Basic but contains errors Fig 5 31 shows the function in its current state et he programmer decides to perform a desk check of theff eode using the following test data array Public Functor Searchi Findltem As Boolean Animal 0 Frog i K n Dim Lo Wher Count As Long Animal 1 Dog Dim F As Boolean ws Animal 2 Cat FEY True Animal 3 Cow ower LBound Search Animal 4 Ant pper UBound Search 9 Animal 5 Moose oF Count Lower Ce 3 While Count lt Upper oc K If Search Count Searchltem Then X They decide to epform the desk Found True AS check four ONG using the Count Upper a followi AD calls End If P lt Count Count 1 Linear Animals Frog End While Linear Animals Cat Return Found Linear Animals Moose End Fun
18. essential for its operation Extra RAM may allow the product to operate with larger files Sound cards may allow for optional audio feedback for the sight impaired The addition of a network or internet connection may allow for foreign exchange rates to be updated electronically in financial packages Appropriate Drivers or Extensions are devices require software drivers to allow them to dthmunicate with the stem These drivers are also known as interfaces as t onvert signals from one device into those that can be understood by another e a hardware device can be used by a software solution its driver denen R installed and configured Most peripheral devices come packaged withodrivers for most popular operating systems or are able to use drivers included th the operating system The driver is XY installed as part of the installation of th hardware device ws would need to be installed as part of the installation of the software solution In this case the driver is an sion to the software package For example a Poe designed to monitor the climate within a green house includes custom drivers fi x th temperature and dity sensors These sensors are part of the minima a are requiremen Pihis product The drivers or extensions are ee e main application installed GROUP TASK Investigation Examine the hardware specifications for a number of commercial Custom built hardware may KGY a purpose built driver to be created This driver t co
19. good programming practic aclear and uncluttered sen ms one logical task per PR use of stubs x appropriate use of co structures and data structures writing for subsequent maintenance version control and regular backup recognition of relevant social and ethical issues e the process of detecting and correcting errors including types of error syntax errors and logic errors runtime errors including arithmetic overflow division by zero accessing inappropriate memory locations methods of errot detection and correction use of fl nega approach to the isolation of logic errors debugging output statements X Q oor checking desk checking structured walkthrough Pe a comparison of actual with expected output e use of software debugging tools including use of breakpoints resetting variable contents program traces single line stepping A Documentation of a software solution R forms of documentation including ww log book user documentation including user manual per manual installation guide tutorial online heli technical documentation including oo algorithms source code e use of application software includi BSS tools to assist in the documentation process N recognition of relevant social a ai issues Hardware environment tena le implementation of the software solution e hardware requirements including minimum configuration possible additional hardware appropriate de
20. process within the code should be preceded by a comment ction and Comments should explain what a section of code does rather than how it does it For example Find the largest value in the array is a better comment than Make the first array value the largest then loop around for each remaining array item checking it against the current largest If a value is larger it becomes the current largest value The second version of this ient is really echoing the code omments should summarise the code enabling future programmers to grasp the intention at a glance Fig 5 41 is a Visual Basic 6 0 procedure Reading the comments in this procedure explains clearly what the procedure accomplis The code itself provides DES out how the processing is accompli Comments that explai oie of code should be used Nei Only for particularly di explanation all our explain the logic in detail can easily become logic is a full GROUP TASK Investigation ao e code s logic necessary The code itself describes th nce are programmers whom we presume can read cod Private Sub RedGreenBlue ColValue Red Green Blue ColValue is the input and is the 24 bit colour value This procedure extracts the 0 255 value for each of the Red Green and omponents and returns them in the Sea same name Dim HexCghO First convert the colour value to hexadecimal T unction returns a string e g CO5F3A xCol Hex ColValue
21. product C the complexity of the D examining similar Kags S Examples of user et include XN A install tidy uides process diaries refi manuals and user A B Q als B installation guides internal documentation tutorials and user manuals user manuals reference manuals tutorials and system models user manuals reference manuals tutorials and installation guides D ntrinsic documentation includes all of e following A Meaningful identifier names indenting within control structures use of colour and spacing Comments meaningful identifier names and indenting within control structures Internal documentation algorithms and system models B D Objectives data dictionaries system models and feasibi studies Make a list of all the Make a list of UN each Doc wit oe 8 NY RO 6 T 9 RVS A document listing KA commands available in an application is known as a n A User manual B Reference manual C Installation guide D Tutorial A chronological record of the tasks undertaken duting the development of a software ton could be best described as Santernal documentation a log book C intrinsic documentation D asystem model A form of documentation that uses sample data to instruct the user in the use of a software product A User manual B Reference manual 7 C Installation guide oc
22. stored The third index ao determines individual products It is unlikely arch be more than 100 products from a particular supplier stored in a partic rehouse Each data item stored in 4 Q the array will be a string with a maximum ret 20 characters N For example Products 2 3 an yobe means that Widgets are from supplier ws number 2 and are stored in war se 3 Widgets are the 40th product from supplier 2 to be stored in warehous sc that each index begins at zero hence there is a oR supplier number 0 a wee ce number 0 and a product 0 a Let us create the Gs data structure in both Visual Basic and Pascal u we Y EBNF arn the previous page Visual bast eo A possible definition for our Products variable could be Public Products 10 4 99 AS String This statement is best placed in the declaration section of a module The Public keyword ensures that Products is a global variable available to all procedures and functions The first index has a range of 0 to 10 in Visual Basic 0 is the default for the lower bound so need not be included Pascal cO A possible definition for our Products variable could er ow TYPE Ree i Q ProductType ARRAY 0 19 OF Char o N ProductArrayType ARRAY O0 10 0 4 Q0 ProductType ws VAR ww Products ProductArray I OM oe n Pascal strings are not_s ard data types and must be defined as arrays of characters Once the of characters has been declared it can be used to defies o
23. structured walkthroughs GROUP TASK Discussion Why do you think comments and suggestions should be collected but not responded to until after the walk through is complete Surely it would be oy better to discuss any issues during the walk through Discuss Q Kse of expected output cO When initial test data items are created the expe utput from these inputs should be calculated by hand Once the subroutine een coded the test data is entered and the output from the subroutine is compare to the expected outputs If the actual and expected output hen this provides a good indication that the subroutine is performing accur If they do not match then clearly a logic error has occurred Further techniq e employed to determine the source of the error If the test data has be signed to test every path through the source code and ev boundary conditio a 100 match between actual and expected output meaing the i ically correct It does not necessarily mean the source ood is source code AN efficient high ality or free of runtime errors For large programs it is impractical to test every path through the entire program A typical application can contain many thousands of lines of code The number of test data sets easily runs into the billions If subroutines have been designed using the one logical task per subroutine rule then it should be possible to perform the test on each subroutine Currently test driven development TD
24. translated on the end user s machine into executable code specific to the user s machine Each end user machine has translation software installed to perform the byte code to machine code translation in the case of Java this software is known as the Java Virtual Machine JVM A different JVM is installed for different operating systems and devices This system can be likened to the s ls used to represent mathematical processes A Germanys thematician writes formulas using mathematical symbols which are efstood throughout the O world English and Italian speakers are able to translate ese mathematical symbols ae themselves into their own language Q Let us now examine the two most common metho s of translation e Interpretation NY ws e Compilation We will then examine the mon process in detail ot A A ldn t it be better if we could just have one standard transl programmers could use K Do you agree with this statement Discuss whi GROURTASK Discussion xO A laf e variety of translators are available for the C language V x ANN all NC GROUP TASK Research Java executes on a broad range of devices Using the internet or otherwise create a list of different devices which utilise a JVM to execute Java code X i Software Design and Development The HSC Course KS sor so at r oe Implementation of software solutions aan NO a O Interpr Each line or statement of
25. Briefly describe each using diagrams as examples where appropriate X lt i Software Design spd BeVelopment The HSC Course So oF S oo 1 Which of the following forms of documentation would be most useful to a maintenance programmer A Online help Qe Gantt chart Ni S C Story board S cO D Structure chart cO AO a 2 Which of the following are all examples AF documentation Q A Installation guide reference pial system models and design N specifications i B Reference manual tutori Wine help and intrinsic documentation ws C User manuals tutorials online help and installation guides D Online help p models and user manuals oR 3 Which of the fo gwing best describes the purpose of internal documentation O A Toim readability of source code QO B T ave the efficiency of code execution V C T Provide assistance to users of the software amp o protect the intellectual property rights of the develope 4 A software developer uses software that simulates many users entering data into their application simultaneously This software is an example of which of the following A COTS package B CASE tool C Reverse engineering OD Test data Ni amp cr Unention 5 of You have been contracted to make modification to a existing software application that you did not write Outline TWO examples ef dcumentation that would be useful when making the modifications Justify ION oices
26. Consider ete ot NA Over a number of ye he following languages have been consistently ranked the top 20 acoord to a variety of different surveys N S A Q e Visual Basic inclu ing Vv NET e JavaSetipt e Python e C e Delphi e C e Pascal e CH e Lisp e Objective C e Ruby e PHP e Perl N i Software Design and Development The HSC Course KS aos aos at r AO C gt sed as ltem can take the y Q oC value a or b tena y oe Le c S L X 9 co ook Xo Implementation of software solutions ser a aww GROUP TASK Research Each class member is to research the general nature of a few of the above languages Share a summary for each language with the class LANGUAGE SYNTAX REQUIRED FOR SOFTWARE SOLUTIONS In this section we examine the syntax of programming languages The syntax of programming languages is described using metalanguages In the Preliminary course a EBNF and railroad diagrams We will use aN metalanguages to escribe the syntax of commands used to define and lti dimensional arrays arrays of records files and random number generators USE OF EBNF AND RAILROAD DIAGRAMS Before we begin using these metalangua Q describe the syntax of programming languages let us revise the syntax of t talanguages themselves Q Interpretation F example Railroad Diagram example oS Terminal Symbol for a reserv O son O word BEGIN is a reserved word BEGIN Q Terminal symbol
27. D methodologies are becoming popular When TDD is used then thorough tests together with test data yare written prior to cading Passing these tests indicates the source code is achi ving its purpose As new ubroutines are coded new tests are added all these tes Gs be rerun each time new G or modified code is added to the project Often th source code for the test routines ti can be as large as the source code for the actual g a GROUP TASK Activity If every path and every War condition has been tested and the output matches eree the expected output then surely the code must be free of errors Thi Statement is not true Can you give examples of errors in code that willnot be found by testing each path and boundary O GROUP TASK Research aw Many universities now teach computer science using a tesiGren development TDD methodology Research using the internet or otherwise to find examples of teaching resources used by computer science departments in universities which demonstrate TDD i Software Design and Development The HSC Course KS i so coe X Q ce ce ao Implementation of software solutions a D SOFT OOLS FOR DETECTING ERRORS IN CODE o Most software development environments include tools to assist the programmer in the task of isolating errors in the source code The majority of environments include automatic syntax checking as statements are entered Different envir
28. In this section we examine the total documentation required before software solutions are released to clients Documentation can be split into two broad categories user documentation and technical documentation These categories describe the intended audience of the dANnentation The nature of the software product and its Ra audience will etermine the language and complexity of each docume item O USER DOCUMENTATION G CG oO Users are the final operators of the product ee entation targeted at users needs to O be directed at their level of knowledge ae pertise A game designed for use by RY children will require very different uger documentation to a product designed to Ry automate the operations of a lar aNboration The end users of the system must be identified before the production fuser documentation commences oo There are many types G documentation possible In this section we exami G four specific types n a that are provided with the majority of soft cS products Each fase documentation types is commonly provided in either ted or electronic ats Q Installati Cuide QA Installation guides should provide the user with sufficient information to successfully install the software product on their machine s Hardware and software requirements will be included together with step by step instructions to guide the user through the set up process Often notes are included to help resolve common installation problems Hardware r
29. Ko Which cor Ss oO 224 Chapter 5 In this chapter you widen to e identify an appropriate fang ge to solve a particular problem recognise the appropriateness of either a sequential or event driven approach to solve a particular problem develop syntactically correct code to solve a problem in a given language interpret metalanguage definitions for commands in a selected language produce syntactically correct statements using the metalanguage definitions produce a generic metalanguage definition for a set of syntactically correct statements that use the same command implement a s from a complex algorithm using syntactically correct st i explai e of tokens and the role of the parsing process during the rain of source code to machine code cognise that machine code is the only code able to be executed by a mputer identify the most appropriate translation method for a given as use the features of both a compiler and an interpreter in the implementation of a software solution a recognise interpret and write machine code instructions for a em fragment employ good programming practice when devel opino justify the use of a clear modular structure cua routines to ease the design and debugging process differentiate between types of errors wo the cause of a specific error and determine how to correct it effectively use a variety of app DS correction techniques to locate the cause of a ek E phen correct it produce user documen E poania s
30. TO lt OF The characters written b abc KQ as they appear tes are used me QY to encl Kv ols used by the AN metalang d ge Non terminal symbol Item is dienes ia defined elsewhere or a choice between two Item alternatives Either Item or lt Item 1 gt lt Item2 gt n Item2 ltem2 Item Se Optional part Item followed il optionally by a Thing ene RY Ws Possible repetition This is an Item repeated zero or more GC Becton oe C pall gt ot times Repetition That is an loa That lt Item gt lt Item gt repeated one or mor tim Grouping A AN is an Item followe eserved word _ FOO or ke the reserved word Fooglesi lt liemzroO B90 BOO GROUP TASK Activity Create an EBNF and railroad diagram for a Boogle A Boogle always begins with an Item followed by one of more Foogles and can either end with a That or a This Create a series of five legitimate Boogles using your metalanguage descriptions op O mS i Software Design spd Development The HSC Course so S O EBNF diagrams to perform these actions are described 3 X oe oe 228 Chapter 5 QO sor ye ye N N MET GUAGE DESCRIPTIONS OF PROGRAMMING WAGES Let us examine metalanguage descriptions for defining and using multi dimensional arrays arrays of records files and random number generators in a variety o
31. Thea store and retrieve data from secondary storage devices is vital tio plications lai jl Explain the processes involved when writing source code to read from and write to disk files A new programming language called Zenith has been developed Zenith uses a Base 3 number system for all its calculations hence only the digits 0 1 and 2 are required In Base 3 we count 1 2 10 11 12 100 101 102 110 111 112 120 121 The railroad diagrams below describe the syntax of this language gt V Qe o R gt D Logical 4 ev ar NST Logical Operation sorrel Identifier H Operator H A Decision HEN H Condition 1G ON YO Assignment Identifier Assignment 12 Write down five legal Zenith identifiers 1QNonvert the Zenith assignment command into an EBNF diagram op Zenith uses a multi purpose assignment command This comet performs the usual assignment function together with input and output Create a code ragm t in Zenith that will get a number then print out all the numbers from 1 to that auat Division is not included as a standard oper i Zenith Write a code fragment in Zenith that performs division using repeated subtr You will need two outputs the quotient and the remainder ot O lt 2 Software Design al The HSC Course O gor go ck cok 240 Chapter 5 oe sor VY V TRANSLATION METHODS IN SOFTWARE SOLUTI
32. Winner Then WinNum Wi rizeWinners CheckCounter 482 CheckCou Winum End If Ch weahter CheckCounter 1 End ye Fig 5 33 The Visual Basic VB NET environment in break mode lt i Software Design spd Development The HSC Course O yon go a WS 6 aa 9 R ost oe 272 Chapter 5 O vo Q Q YO X Resetti 4ble contents Altering the value of variables during the execution of code can be useful in determining the nature of an error The ability to alter a variable s contents can also allow the programmer to determine which values are causing errors without the need for the variable to actually attain that value as a consequence of execution Often the contents of a variable will be changed whilst execution has been halted by a breakpoint For instance in Fig 5 33 we see that PrizeWinners 1 482 In the tse window we could enter an assignment age alter the value of eWinners 1 to a different value to test a particular scen SK Inserting assignment statements within the source code itself can also be used to ao temporarily alter the contents of variables For e xample if the programmer wishes to Q ensure a particular piece of code is execute n se a temporary assignment N statement can force execution to Sat articular direction Perhaps a particular calculation is causing problems varia included in the calculation can be reset to differing values to allow the Prog er to thoroughly analyse the c
33. X yo As part of a software company s ongoing quality assurance procedures the following rules are followed by all programmers as they code subroutines e Global variables are not to be used e Subroutines must perform a single logical task e Completed subroutines must be peer checked prior to inclusion in why these rules will likely improve the quality of the conipany s products oo Suggested Solutions mS i 1 A The code operates without displaying an golin it cannot be a runtime or syntax error The error is in the logic underly ying the calculation 2 B The body of the loop is never exe hence numberOfStudents is 0 when XY the division is attempted in li 0 ws 3 B Answer B effective mps the calculation and display of the average lines 100 and 110 When there are no students Although D also solves the co problem it is thematically correct to display an average of zero whe A there are FA marks entered AO CN Question 4 V The wide use of Global variables means that the use of the Samer le names as a lo ariable will cause conflict and developers can never be where global values have been changed If no global variables are allowed at all then all data that needs to be shared between routines will need to be passed as parameters between the routines concerned In this way the different programmers involved in the development of the software have much more flexibility in their choice of variable names without fear
34. alculation Program traces Q ot Tracing in terms of e detection refers to tracking some aspect of the software program trace e Aone order of execution of statements to be tracked Q changing con of variables to be tracked Both these types of poe lve analysin ll the flow of execution Various forms of trace are possible Some programming environme 2 can display each line of code as it is executed at slow speed Others allow you to analyse the call stack when a breakpoint is encountered The call stack is a list of subroutine names from the current call back to the main program Many COTS products particularly data oriented products are able to produce a trace file This file maintains a log of all the transactions that have taken place This trace log can be analysed to identify the source of an error Many development environments provide a window contat Oui the variables local oie the current subroutine together with their current v nd data type This list is cO updated each time the contents of a variable chal This window is used in AO conjunction with breakpoints or single line step ints xamining the changing contents Q of variables can assist in tracing the source ores GROUP TASK Discussi Division by zero engi oe runtime errors are highlighted by the system where cur Often the calculation that ultimately caused the runtime je Ce at fault Discuss methods of identifying the true source of these errors using breakpoints rese
35. ants is installing a computer system to improve the productivity of their processes The software has been written by HospSys a software development company specialising in software solutions for the hospitality industry The restaurants will be connected to their head office via dedicated modem connections The software has been written and an installation guide is Mily being prepared n installer employed by HospSys will complete t tual installation of the software The installer will also provide the initial trairtiag to users There are two audiences involved in this installaon the restaurant personnel and the installers from the software company Specifie sections of the installation guide are directed at each of these two soups Th installer will have a copy of the entire installation guide whereas the restau t personnel require items pertinent to their particular installation tasks O Let us examine items that are included in the restaurant personnel section of the Ce installation guide Hardware and s e requirements Qy e File ser ing Windows Server e Manager s workstation and ine detailing minimum disk and RAM POS Point of Sale t rfal with requirements receipt printer e Workstations for order entry e Network hub and associated cabling e EFTPOS terminal with dedicated e Modem with dedicated phone line phone line Installation steps 1 Order Receive hardware and ftware from external vendor 2 gt n i nstalla
36. bes how well structured modularised and documented source code should be created It also explains methods of error detection and correction Documentation of the final solution for various audiences is vital for the ongoing Ort of a software product We examine a number different forms of ocumentation for users and future developers Software solutions must operate with hardware pa Sting software We consider the hardware and software requirements of N software products Finally we examine some emerging technologies es likely to affect future software development CHOOSING AN APPROP oth PROGRAMMING LANGUAGE There are numerous facto Owdasider when selecting an appropriate programming language for a specific pee nature of the gst 9 vironment and device When Apple s iPhone and iPadn released AN were limited to Objective C C or C programming ges and sna droid developers where limited to Java Although i these remain nguages of choice for the development of most smart ron apps many other Ae can be used For software applications running on des tops the range of languages is extensive however rightly or wrongly it is often the experience of the developers that becomes the overriding selection criteria Web based software commonly contains two separate elements the server side code and the client side code which often runs within the user s browser In most cases one language is used for the server side and quite a differen
37. cordLength is required for rando ess files and specifies the length of a record ws in bytes The length of a record oan determined using the Len function Closing a file is performe he FileClose statement cok CloseFile a lt FileNumber gt NAN If the o ment is used without a FileNumber then all files sore opened wit Open statement will be closed For RA access files writing and reading data to and from a PO with the FilePut and FileGet statements WriteToFile FilePut lt FileNumber gt lt RecordVariable gt lt RecNumber gt ReadFromFile FileGet lt FileNumber gt lt RecordVariable gt lt RecNumber gt If RecNumber is omitted then the next record is used each time a FilePut or Fileget is executed The first record in a file is RecNumber 1 mS i Software Design spd Development The HSC Course G or so oot cot 234 Chapter 5 QO sor Co D Ao VO For sequent ies writing and reading data to and from a file is a Oshed with the Write and Input statements In Visual Basic each field of a record Yhust be written to and read from sequential files explicitly This was not the case for random files where a complete record is read written as a complete unit WriteToFile Write lt FileNumber gt lt Variable gt lt Variable gt ReadFromFile Input lt FileNumber gt lt Variable gt lt Variable gt Multiple data i
38. creen dumps that includes a user manual a tutoria fe help differentiate between types of user documentation identify the personnel who would be likely to use the different types of documentation produce technical documentation for an implemented software solution recognise the need for additional hardware identify potential compatibility issues for a newly developed software solution recognise the implications of emerging technologies for the developer in terms of the code written to make use of these technologies recognise the ipo of emerging technologies for the code develop cess make you more able to n the interrelationship between hardware and software fferentiate between various methods used to construct software solutions describe how the major components of a computer system store an manipulate data explain the implications of the development of different R explain the relationship between emerging technologies a development N identify and evaluate legal social and ethical is Si umber of contexts construct software solutions that address Isocial and ethical issues apply appropriate development methods olve software problems apply a modular approach to i well structured software solutions and evaluates their apply project manage the software developm create and justify the need for the various types of documentation required for a software solution selects and applies appropriate software to facilitate the design and develop
39. ction Fig 5 31 Lin Animals Bat EEAS ea Linear search Visual Basic function with errors i Software Design and Development The HSC Course KS i G CG ao ck cok oe Implementation of software wins lt 9 YO V The desk check for the Linear Animals Frog call is reproduced below Found Finditem Lower Upper Count Search Count True Frog o 5 0 Frog True 5 6 The code correctly finds Frog and returns the value true Lets now perform the desk check with the second test call LinegePsnimals Cat OW rouna FindiItew Lower Upper Count Seqefibount True Cat O 5 0 Fr G ae l Pid oe 4 Q ke g Cat K True Q GROUP Activity Co the desk check with the remaining two calls ine r Animals Moose and Linear Animals Bat ere are actually 2 errors in this function What are thesegefors and how can they be corrected Structured walk through Structured walk throughs as the name suggests are more formal than peer checks The developer or team of developers present their work to a group of interested parties This group may include representatives from management marketing and potential users with the aim being to present the software ddermally work through fe ts functionality The developers walk the group step b Ses through each aspect of C the program As the walk through continues c
40. d transparent Hopefully it will work Note that the comment is reflective describes what has been achieved identifies a particular stumbling block and possible approaches to dealing with it Fig 5 39 Software Design and Development Stage 6 Software and Course s a p22 op i Software Design and Development The HSC Course KS sor so oO 9 Discuss how the regular use of a cot Implementation of software solutions ee Wo log book would assist in the development of software projects within the SDD HSC coutse Source Code Documentation The source code itself is probably the most important form of technical documentation It is virtually impossible to isolate logic errors in an application ithout access to the original source code hor source code to be a valuable technical O resource for future maintainers it must be intelligently documented Documentation within the source code is often called internal Ly Internal documentation can take forms comments and intrinsic documentation Let us ene ach of these in turn N e Comments QO Comments Intrinsic Documentation Indenting Code Q Q ce Meaningful Identifiers Other Formatting Features Fig 5 40 Source code documentation can take many Jorn S e information for future programmers The transla my hores DO remark statements within the code Each proce fi logical
41. ectivity e Social networking software which operates on a wide range of devices and is integrated within a wide range of other software applications Location based applications that utilise GPS coordi ind internet connectivity to map locations in real time G e Wireless connectivity at ever increasing spss which allows people to remain connected regardless of their location o ity The National Broadband Network which is planned to provide optical fibre ws to the premises of most homes ant businesses throughout Australia GROUP TASK Research Use the internet to research new and innovative computer based devices Write a paragraph on at least two such devices Compile a class summary of all the devices found mS i Software Design spd Development The HSC Course so 1 Consistent user interfaces allow users to A transfer skills to new products B concentrate on the tasks at hand C predict the results of their actions D All of the above 2 EBNF and railroad diagrams A are used to describe algorithms P describe the syntax of programming languages C are important forms of user documentation D can be altered by the programmer to suit the particular project 7 Parsing is a process used during Q syntactical analysis Parsing ensures A each statement contains elements that are legal parts of the langua av B source code is free of licen C that source code can
42. ed A number of users report that the result of a calculation performed by the application is incorrect What type of Quoertor has occurred N RA A Logical A O B Syntax cO AO C Runtime ow i D User Refer to the following algorithm when agering Question 2 and 3 Line numbers are included to assist when answering tion 3 10 BEGIN 20 E a fstudents 0 30 alStudentMarks 0 oc 40 ow INPUT studentMark N sao WHILE studentMark gt 0 N X totalStudentMarks totalStudentMa rk t dentMa rk 70 numberOfStudents numberOfStudents 1 80 INPUT studentMark 90 ENDWHILE 100 averageMark totalStudentMarks numberOfStudents 110 PRINT averageMark 120 END If the above algorithm is implemented and the first mark ehtered is negative then an error occurs What type of error is this AN AN G A Arithmetic overflow error AO i B Division by zero error AO i Q C Logic error N D Syntax error RN 3 Which of the following addi io lines best corrects the first mark entered is negative error Ni A 95 number amp gendents numberOfStudents 1 B 95 IF erOfStudents lt gt 0 THEN ENDIF 3S TAS C con IF studentMark lt 0 THEN 4 15 ENDIF K D 93 IF numberOfStudents 0 THEN 94 numberOfStudents 1 95 ENDIF i Software Design and Development The HSC Course KS c J oe p a 6 g Q oO S 9 ck coe ao Implementation of software solutions A Q Questi
43. ent is used to create a user de data type DefineDataType TYPE lt varname gt ARR lt range gt lt range gt OF lt type gt A FILE OF lt type gt ws RECORD lt varn lt type gt lt varname gt lt type gt END The VAR statement is use wate variables of the required types ot DeclareDatalype V lt varname gt lt varname gt lt type gt g NAS name gt lt varname gt lt type gt xO varname lt le lt letter gt lt digit gt ow ranger nt gt lt constant gt QA GROUP TASK Discussion Examine the above EBNF diagrams Discuss the essential differences between the two languages particularly in regard to declaring arrays Note The EBNF and railroad diagrams used in this chapter explain features necessary for this course The actual EBNF and HO roductions for these statements include many more features which have been omitted rposes of clarity i Software Design and Development The HSC Course KS sor O O ao Oe Or a QO Implementation of software solutions COY Q Q gt N Using raul dimensional arrays ge Consider the following A program requires a multi dimensional array called Products to be available to all procedures and functions Th Products array is to have three indexes The first index rbeing from 0 to 10 is ed to represent the Supplier There is a maximum of 11 suppliers The second index represents one of the five warehouses where the product is
44. equirements should be clearly stated Often a minimum set of hardware requirements will be given together with a recommended We N Many products require other software to be installed on the gst prior to installation Q operating systems being the most obvious example _ C ow The main section of the installation guide dibes the steps that need to be y2 undertaken to install the product For sm Applications this can be as simple as t placing a CD ROM in a drive and wad for the installation program to auto run ws Large systems often require significant direction from the user particularly in regard to configuring the system for particular installation site For large systems an installer from the softwa pany or one of its distributors often performs or co directs the installation process Whilst is should K expected it is not uncommon to encounter errors dupi WQ installation s The large variety of hardware and software aX infations availabl t all be tested As a consequence installation errors can occur The installation guide should attempt to address the most common Nee A good installation guide will also provide support contact details in the event that the user cannot resolve an installation problem i Software Design and Development The HSC Course KS i aos aos paes r cO ck cot ao Implementation of software solutions a V y N ee fags Consider the following A chain of restaur
45. f high level languages Declaring multi dimensional arrays and arrays of records In general declaring a variable for use within a program involves two stages Firstly if the data type or structure does not already exist in the langes then it must be ed Secondly a variable of the required type is declared Q Visual Basic NET AO The Structure statement is used to create a user efined data type AccessModifier Dim Public Priv Q Identifier lt Letter gt lt Letter gt lt Digit gt _ DimStatement lt AccessMdifis gt lt Identifier gt lt Positivelnteger gt As lt Type gt cok StructureStatement essModifier gt Structure lt Identifier gt Xo a lt DimStatement gt yo lt DimStatement gt A O End Structure N The m n element above can be any of the availablevtypes included within Visual Basic String Integer Double Boolean etc or it can be a user defined type that has been declared using a Structure statement The description of the DimStatement above indicates that arrays can be declared directly without using the StructureStatement To declare an array the identifier is followed by the upper bound in brackets such as Private MyArray 4 As String to declare a string array called MyArray with 5 elements subscript 0 to 4 However r cord data structures require definition using a eee and then eclaration using a DimStatement cO Pascal O The TYPE statem
46. h execute cycle 1 rogram development techniques aim to produce efficient and err e software solutions Describe at least five techniques that are available to software di ahs that assist them in this task O a Select a new input device such as a recent game contr ier nning device biometric device or touch device Research how the device operates to collect data from the device within source code Q New technologies are constantly appearing Using the internet explore the most recent advances in CPU technology Compare the d processing capabilities of these new processors with those available ten years ago evolve at such a large pac O RS x Wig RVS u think processing speeds and capabilities will continue to ONA ONA lt i Software Design spd BeVelopment The HSC Course So oF S oo a Wt 6 a
47. her N A As a keen Software Design and ANE ment class you decide to create program to manage the N Different routines have been a to different Public Structure TicketType Public Surname AS String Public FirstName AS String Public Year AS Integer End Structure Public Tickets 500 AS Ticke og Fig 5 4 The Tickets data structur members of your SDp cla ss Fred not his real name has given the task of writing the r that creates the winners wn for his honesty but he is Fred is a N 12 raffle certainly capable programmer The main data structure is an array of records called Tickets The details of the Tickets data structure are given in Fig 5 4 Fred has developed an algorithm for this task and has just completed coding the algorithm in Visual Basic NET Public PrizeWinners 22 As Integer Public Sub Winners aim Winner As Integer WinNum As Integer aa cy pena Dim rand As New Random K WinNum 1 AN om While WinNum lt 22 av Winner rand Next 0 500 co PrizeWinners WinNum Winner A 4 Q CheckWinner WinNum Winner Q Q st CheckCounter 1 aw While CheckCounter lt WinNuf wv If PrizeWinners Check ter Winner Then WinNum were CheckCou R inNum End lf are V CheckCounter 1 T W NS WinNum 1 n ile K End Sub Fig 5 5 Fred s Winners VB NET procedure GROUP TASK Investigation Examine the Winners procedure ignoring the call to the CheckWinner procedure Explain in
48. her with shortcut keys and a brief explanation Fig 5 38 op A quick reference card showing commonly d shortcut keys used comma i Software Design and Development The HSC Course ow so coe R k ENY Implementation of software solutions Aa ow N Tutoria exe Tutorials provide instruction in the use of software products using example scenarios The user is lead step by step through the processes included in the product The user performs the tasks under the direction of the tutorial Tutorials are designed so users can experience real world use of the application before using their own data Often sample data files are provided with applications for use during tutorials These sample files are used to familiarise users with the functions available in the software Pict without the risk of damaging the real data The use n files means that isers do not need to input vast amounts of data to experi eal life scenarios Tutorials should be split into individual less Gach lesson concentrates on developing a particular set of skills Users can through the tutorial at their own pace and as time constraints allow Particul ssons can be undertaken as the user requires the skills K i Paper based tutorials although NY amon are being replaced by electronic versions Usually a small C a the screen is used to direct the user through the tutorial GROURT ASK C Xe n reference manual
49. information needs to be presented using a format that is appealing accessible and consistent Often much of the information traditionally contained in a user manual will be included in help files that are a directly from within the application User 280 Chapter 5 manuals can be organised in a number of ways depe rn the nature of the ehculty in this way users eir skills Topics can be are described first with less anual Software products containing terms of function For example a user contain topics on general ledger accounts slasing Each topic describes the functionality of that working through the manual progressively incr se presented in order of usage Commonly use Gk common tasks described in the latter part of t a large number of tasks can be arran manual for an accounting package RN receivable and inventory and pu particular aspect of the package Each topic within Ae er manual should provide two explanations of each of he software s functions a conceptual explanation procedural explanation Conceptual explanation N ain what the function is and why the user may ne use that function For example a topic describing a save function explains what and why saving is necessary for instance Saving stores a copy of the file in a permanent location Saving ensures the file is not lost if a power failure or runtime error occurs Procedural explanations describe how a process is performed using the software Fo
50. ional array Both A and B If a digit is defined in EBNF to be 1 2 3 4 5 A syntactically correct HINum is A HELLO 1 2 1 BYE B HELLO1232 BYE C HELLO 4BYE k HE 3 BYE data structure i is declared in Pascal eerie following statements is ThisType RECORD This Integer That Boolean END ThisThat ARRAY 1 3 OF ThisType Which of the following is correct A An array of records exists called ThisThat It contains six data 1 B Each record of type mere contain six data items NY C A variable decla y ype ThisThat will bea ay with 3 records D A variable of type ThisThat will contain two records Each record containing three fields What is the purpose of the following fragment of Visual Basic code Count 1 While Count lt 0 Result r Next O 2 Tot esii Total Result 1 he Count 1 hil A loop counts from 1 to 1000 1000 random numbers are totalled Each number is either a 0 ora 1 B The number of 0s and the number of 1s generated is calculated for 1000 random numbers Each random number can be either a 0 or al One thousand Os and 1s are wo generated The total of all stored in Total 0 and a all the 1s in Total q 1000 random ru fe rom 0 to 1 are generated Each number is added to the total after it is generated af N Wottware Design and Development The HSC Course 8 ck coe oe Implementation of software solutions ae 11
51. ipated Most KO programming environments jallow the program to intervene when a runtime error occurs Exception ing is a common technique used by many langua Subroutines sho written to anticipate and deal with runtime errors t ay occur Error see tines should attempt to correct the problem if this is sible they shqudy empt to save any data files before exiting QA GROUP TASK Investigation Explore the help files in a programming environment with which you are familiar Determine how the language deals with the detection and avoidance of runtime errors O lt 2 Software Design pa The HSC Course cO C or Or at r AO se AO C AO X 9 co oot 266 Chapter 5 ao sor Wi V TECH QUES FOR DETECTING ERRORS IN CODE RYS Many techniques are available to the software developer to assist in the creation of error free source code In this section we examine a number of techniques commonly used during the implementation stage of the software development cycle Each method aims to reduce the number of logic errors in the final code We will examine the following techniques e Stubs oy Drivers oe mS j e Flags oe cO e Debugging output statements C e Peer checking oO e Desk checking a RN Q y R e Structured walkthrough RNY RNY e Use of expected output Stubs oe ot A stub is a small subroiitine used in place of a yet to be coded subroutine The us stubs allows hi hej level subroutines
52. iscussion Y You are writing a anc h e t sorts an array of data Unfortunately all is not well your subro is not working as expected Stubs drivers flags and debuggin ei tatements are all methods of error correction Discuss how of these techniques could be used to isolate the source f s in your sort function to correct for the original successful develepyrent of software products Software Design spd BeVelopment The HSC Course so cO of te sor cor coe 268 Chapter 5 ao sor oe V Many sem oe developttat companies require that each subroutine 4 he checked as part oftheir quality assurance strategy Errors that go unnoticed or whcorrected and are released to the public can cost software companies both in terms of direct financial costs as well as customer satisfaction Formal peer checking involves programmers formally signing each other s work to verify they have thoroughly checked each coded subroutine Informal peer checking is used by virtually all programming teams The flow of comments and ideas between team members is crucial to the ADY development Ay software product This is particularly true in the GaSe of detecting and orrecting errors O Desk checking G Desk checking is the process of working thr an algorithm or piece of source code by hand A table with a column for each variable is used As the algorithm or code is l worked through by hand changes toNtariables are made
53. k software applications Classify each as either a minimum requirement or an additional hardware item X i Software Design and Development The HSC Course KS sor so oot ao Implementation of software solutions EJ D D YY YY Q O EMERGING TECHNOLOGIES New advances in both hardware and software continue to have a profound effect on our daily lives The implications of these technologies will have far reaching effects for software developers Software developers must remain up to date with current and emerging technologies if they are to remain competitive The Information Technology industry is renowned for its speed of evolution Let us consider some emerging hardware and software technologies that have the potential to alter both the human environment and the oe process cO Quantum Computers ow i a Quantum theory postulates that matte be in more than one state at the same time For example a mouse held in a se box could be either dead or alive We don t know the state of the mouse the box is opened Quantum theory suggests that whilst in the box the motse effectively both dead and alive Strange as this may seem science has fo hat photons a component of light actually behave in aS manner Photons Pe e as waves and at the same time behave as particles physics defie ws of classical physics however it does explain the a of nuclear reactions and has helped unravel the mysteries of DNA Q g
54. kes a significant amount of time and x effort to learn a new ves nd to become an expert requires experience which Rey can only be pang r time Therefore it is often better to select a languag the developer RG lready familiar with rather than choose a new langy despite the ness anguage being more appropriate for a particular project K e Even goes or sequential approach Software applications hig Yequire a oasis user interface GUI often use an event driven approach This means subroutines within the software execute in response to events initiated by the user such as clicking a button or selecting from a menu Other events such as an incoming network message or a sensor detecting movement are also events the system can detect The design of event driven code is different to sequential code as there is no definite start and end A sequential program has a single start the processing commences and then finally the program ends The code controls the der of execution which includes directing the user through the logic Event Miven programs are controlled and led by the us KS the user initiates AN commands the program runs the code associated with that event AO e Maintainability Does the language encourage Circe good practice in terms of eA well structured and self contained module ch are easy to maintain and reuse 4 Q Is there a large community of programmes and a large library of code which can R be examined for ongoing support NY ws
55. ln Count Q design specification for the projectwill normally Count Count describe the naming conventio sto be used within END the project In this text o generally used END Fig 5 42 ck mixed case for identi eo or example in Fi 1g Intrinsic documentation makes SOUT 5 42 the procedure uS called OneToTen or could code understandable for hum we have been called 6neToTen Some developers use the undersc aracter to separate words for example One_To_Ten wanna practicege ee upper case for all constant identifiers Identifiers should describe the purpose of the element it represents Ka a variable is used to store client s names and addresses then appropriate identifiers could be ClientDetails ClientInfo or perhaps just Clients Procedure and function names should describe the processing that occurs within the subroutine For example ExtractDate or SortArray c l names should begin with a mnemonic that identifie particular type of ontrol Text box identifiers commence with txt fo ample txtDate Labels commence with Ibl for example IblResponse List bo ith Ist combination boxes av with cbo and so on Adhering to these en enhances the readability of the source code Many programming languages have their own naming oo In Visual Basic sections of code within control st res improves the readability of code Many programming environments include automatic indentation settings Consistent use of indenting allows
56. ment of software solutions communicate the processes involved in a software solution to an inexperienced user use and describe a collaborative approach during the software development cycle develop and evaluate effective user interfaces in consultation with appropriate p ny re iques to maximise the productivity of a coe ge In this chapter you w 4 NA ion Implementation of the desi ing an appropriate language e the different programming languages and the appropriateness of their use in solving different types of problems construction of syntactically correct code that implements the logic described in the algorithm Language syntax required for software solutions e use of EBNF and railroad diagrams to describe the syntax of statements in the selected language The need for translational to machine code from source code e translation methods in software solutions including compilation ane pretation advantages and disadvantages of each method e steps ihe esaion process analysis including token generation lexi 1S ata analysis including parsing code generation the role of machine code in the execution of a program e machine code and CPU operation instruction format use of registers and accumulators the fetch execute cycle use ofa program counter and instruction register Q execution of called routines Ce linking including use of DLLs Techniques used in developing metre fat e the use of
57. most important technique is A B C QD t Which of the following is true of logic Q errors A They are discovered during translation They are usually discovered at runtime They always cause a halt in execution They result from misspelt ed words O eer checking to use a clear modular structure use of debugging output statements to use drivers and stubs peer and desk checking B C D The difference betwee and desk checking i A Peer che the process of i ough the code by hand ecking is performed omatically by the computer B Desk checking is the process of working through the code by hand Peer checking involves analysing and checking code written by others Peer checking is used by large software developers to ensure code is error free Desk checking is used to ensure algorithms are logically correct Desk checking and peer checking are different names for essentially the same process Constants used throughout a program should be assigned to an identifier Why is this the case A The value need only be chang aw one place by future rosin programmers The code execute Sod Calculations wi asier to understan XN All ora ve amp B C RY 6 Q B T 8 2 oe 10 Which of the following is true of syntax errors A They are always discovered during translation They are always discovered at runtime Can result in unexpected ou
58. n an instant yo A RY GROUP TASK Discussion Quantum computers if they become a reality will revolutionise the computing industry How do you think the availability of virtually unlimited processing power will affect the software development industry mS i Software Design spd Development The HSC Course so coe coe coe X Q 4 ws 290 Chapter 5 ao oS V RVS A Human computer interaction Research continues to improve the interaction between humans and computers the aim being to simulate human communication using computers Humans communicate using eye movements facial expressions touch and voice These inputs combine to create each human message The challenge for researchers is to create systems that are ablexto mimic this process foy ects specialising in artificial vision are currentl wie to follow the eye J p g y y movements of a user Eye movements are analysed a d to move a cursor on the y analy oe computer screen or alter the view appropriately ie user moves through a virtual world y amp Users can direct computers and game ydorisoles using body movements Video R cameras and other sensors are used detect even small hand and finger movements RN The software responds intuitively instance current dance games are able to detect Y timing and small body mone and shooting games can accurately determine the oo precise direction a person inting
59. ner XO hanged by the end users D each statement the rules of the high le a guage In regard t e of the CPU in the exec igh oftware which of the foll g is true A Assembler code is the native language of the CPU Each assembler instruction corresponds to a precise hard wired process Each high level language calculation corresponds to one implementation of the fetch execute cycle Microcode instructions are used to activate one implementation of the fetch execute cycle The control unit translates high level instructions into microcode The source code must be distributed with a particular product What is the wv most likely reason for this A The program must be translated wv using a compiler B The software needs pel ed by the user C The program is written for translation N n interpreter D Thes N e is in the public doa 8 9 Source code need not be distributed with the final product Which of the following could be used A Interpretation B Compilation C Byte code or other intermediate code D Either B and C A program r s the user to make a selectio a total of 20 items The rO priate screen element to use id be a series of check boxes B series of radio buttons C list box D menu If the RAND function returns a decimal between 0 and less than 1 then RAND 21 4 will return a value from A 0 to less than 25 B 4to less than 21 oc C 4
60. ntime error is generated if this situation occurs Often Ko Jeet d inputs result in division by zero errors For oR example calculating the average of a list of numbers will result in a division by zero error if a 1S RRO l O Accessing in Opriate memory locations occurs when an attempt is miig ge a value to ONentifier that either does not exist or is of a different ype For exampl n array called ThisArray is declared with a subscript A to 10 an attempt to assign a value to ThisArray 11 will cause a runtime error Usually the error message will be something like Subscript out of range If we haye fente eroris a variable of integer type called Mylnteger and mnm another called MyString declared to hold characters then assigning MyString to Mylnteger will result in a rystime error such as Type mismatch Microsoft Visual Basic Nations other runtime errors are possible many Fig 5 27 A pat occurring as a result of a logic error in the code me error message indicating O A G For example stack overflow errors often occ gS POACEAE RAS HESTEN when a subroutine inadvertently makes a reso call A recursive call is when a Q subroutine calls itself Each time a functio isa led an entry is placed onto the stack Recursive calls can result in an attem lace an infinite number of calls onto the K stack resulting in a stack overflow ime error Runtime errors resulting fr he current project can often be antic
61. of ambiguity or conflict arising when the various modules are pulled together into the final product each subroutine performs one logical task only and i is ined appropriately to eflect that task it is much easier to locate the source a errors during the testing programmer who is not the person who ori wrote it In addition future ee phase It is also easier for peer checking as the logi uch easier to follow by a oO ae maintenance programmers can be more conga BP hen they improve the processing of a routine as the job it performs is a sin ar task R The requirement to have each ro checked by another programmer prior to ws including it into the final vers the code helps ensure the code is error free as well as ensuring that th oe code adheres to the standards expected by the oR company It also means t A final released version of the source code is mo G coherent without Ka subroutine reflecting the individual preferences oe developer who Nr This makes it much easier to maintain such code K er t is to ae ce a particular company or to remove errors found later T enous TASK Discussion Question 4 lists three rules Suggest other possible rules or guidelines that would also assist a software company s ongoing quality assurance mS i Software Design spd BeVelopment The HSC Course so at 276 Chapter 5 AO O SET sy 1 Many techniques are available to reduce the number of errors in the final solution The
62. of each stage of development More importan books are use dar eflective devices By examining the log books mistake or nies development can be analysed Future projects ga NA more effectiv anaged to ensure such issues do not continue to arise Consider the following The following log book description is from the Software Design and Development Stage 6 Software and Course Specifications document available on the NSW BOS v This description refers to a log book you might use t working on a t as part of the SDD HSC course Q cO Log books cO AO 4 Log books are used to document the progress of a projed Fatries should include e date G 4 Q e description of the progress or lack thereof made since the last entry e tasks achieved NN ws e descriptions of stumbling blocks orsigsu s encountered and how they were managed Ww e details of possible approaches jpcoming tasks 9 e reflective comments e reference to resources ues Ce Log books may en d using spreadsheets blogs handwritten entries or electronic journ gt entries oe s to a fellow developer may be useful as they contain time x stamps A s TAS book entry may look like April 10 problems with images I am so pleased the coding for my ow finally donekThis morning I spent some time importing the pictures for each scree t I had some trouble with it The one problem I still have to fix is the transparency so I will try to import each in GIF format and make the backgroun
63. ommehtsare written down for future av consideration No attempt is made to correct or justify aspects of the product the aim 4 Q being to receive feedback on the product as elds YE Structured walk throughs are normall Wiken as formal meetings Each person i agi Sdance at a structured walk through sh be given all Ea relevant documentation pri he meeting This allows them to have annoy fall view and feel for the product and its Aen The walk through itself should be a mons ration of the product and its design Co ts can either be made verbally or may be icted to written comments In either case a response to comments should not occur spuctured walk throu N during the walk through rather at a later time undertaken as formal meetings when they can be considered carefully Structured walk throughs can be used to evaluate the design at different levels Their aim is to explain in a structured manner the operation of some part of the design and development process and to obtain feedback from interested parties They may be amp lo mS Software Design spd Development The HSC Course Q G AO Row of 9 sor a i 8 oot 270 Chapter 5 Ze PN YY VO used tocak ihrough the logic within an algorithm the source codes for a specific module or they may be used to evaluate the final product orice it has been implemented in code In fact most aspects of the software design and development process can be evaluated using
64. onments will provide different tools to assist in the identification and isolation of logic and runtime errors The following five tools are commonly available to assist in the detection of logic and Pogam o O cO e Resetting variable contents G ow e Program traces ow i 4 Ql e Single line stepping RY QO e Watch expressions ws Breakpoints yS Breakpoints are used to t rily halt the execution of the code Once execution cok has stopped it is possi examine the current value of each variable By oo breakpoints at O oints within the code it is possible to locate the source K error Setting ain is performed in one of two ways Many avropa Aan a break ement which is entered in the code where a break i sired Other environments provide a menu item that inserts a breakpoint at the current cursor position In Visual Basic once a break point is reached execution halts see Fig 5 33 By holding the mouse over identifiers in the source code the current value held in the variable is displayed An immediate window allows for code to be entered for instant execution Public PrizeWinners 22 As Integer Public Sub Winners cP Dim Winner As Integer WinNum As Integer CheckCou Cis nteger Dim rand As New Random A WinNum 1 While WinNum lt 22 Q Winner rand Next 500 RN PrizeWinners WinNum Winner CheckWinner WinNum Winner CheckCounter 1 While CheckCounter lt Wi If PrizewWinnkes ounter
65. puter itself s working or an appli n Caused by aborts unexpect hardware malfunction or a serious software bug Hardware drivers are normally loaded by the operating system These are programs that provide an interface between the operating system and any hardware devices amp i Softwar Design and Development The HSC Course sor ow so ck coe oe Implementation of software solutions aes YO installe Re computer For example hard disks floppy disks er drives sound cards monitors printers scanners modems etc The hardware driver itself can generate runtime errors in which case a total system crash does not occur If the problem is more substantial an operating system runtime error will occur in which case it is likely the computer will crash e Application software Runtime errors generated by application software can have a number of causes Arithmetic overflow division by zero errors and accessing inappropriate memory RN tions are three common possible causes An arithmetic overflow error occurs when a value is assigned to a variable that is AC outside the range allowed for that data type Forexample in many programming languages a variable declared as an Integer has range from 32768 to 32767 Trying 4 Q to assign a value outside this range to an iggn ier declared as an integer variable will result in an overflow error Division by zero is undefined in WW natios hence a ru
66. r checking involves other team members in the task of analysing Fig 5 30 each other s work to detect and correct errors Informal peer checking is crucial to the ck coe ao Implementation of software solutions ar Q N Fig 5 29 flapdare used to signify the occurrence of a certain 4 par A chequered flag is used torsignify the end of a motor race r the race is over or it is not r can determine the flow of control NY ag variables at different points in the code ws broutines have been called This assists in the detection f the or Often a debugging output statement will be progre iv moved as ing process continues In this way the flow of xecntion tah the code can be precisely monitored Eventually the source of the error is detected Often output statements will be used to display the contents of variables at crucial stages during execution This allows the programmer to monitor changes in the contents of variables whilst the code executes The precise place in the code where an erroneous calculation has occurred can then be determined t statements are often used in conjunction with stubs drivers and flags In these cases the output statement is used to indicate a particular vent as occurred A stub may contain an output statement to confirm it was a y called Drivers usually contain statements to output the results of a call to a slibroutine and the value of flags needs to be displayed during execution GROUP TASK D
67. r controls the subroutine Drivers are required when software projects are coded using a bottom up design methodology Lower level subroutines are developed before higher level subroutines Because of this it is necessary to write a driver to test the operation of each subroutine as it is being coded oh Software Design and Development The HSC Course KS i so so a WH 8 Flags QA A flag is used to indicate that a certain condition has been met Usually a Flag is set to either true or false that is most flags are Boolean variables We have examined the use of flags within algorithms in chapter 4 and then again in relation to the operation of the CPU earlier in this chapter In each case cO In terms of error detection flags are used to check cS if certain sections of code have been executed gA Certain conditions have been met For example if a subroutine is called a ppl flag may be set to true By examining the value of the flag the paae e through the program Setting the valye a assists the programmer with the detection of the source of bugs Debugging output statemper S ot Strategic placement of mporary output statements can help to isolate the somes errors By pact ut statements within called subroutines the porma n determine whieh Ko ete ors will occur that seem to be programmer Colleagues on the development team are often able to see the problem from a fresh point of view Pee
68. r example To save a file open the file menu and click on save Screen are often used to assist with procedural explanations dumps Mig 5 37 amp AN Reference manuals are designed to be an efficie gik of information In terms of software a reference manual should succinctly scribe each command within the application Reference manuals are not AX ghed to be read from start to finish rather The TER UAI Estimator A Edit View A N pn ees Save As Print Exit Fig 5 37 A screen dump displaying NS the Save command they will be read in random order as n rise Each command within the application The ae ae uick Reference Guide should be listed in alphabstigar er This Q Spoon assists the user in l cating required Men Commana Keys _ Function information without t ed to refer to the me New Ge Ni Cresta einew ie ile Open Ctrl O Open an existing fil contents or inde es Normally each File Save Ctr S Save the cur command is i together with a brief Mis print ogee Emt sie descripjon y Aia a succinct example to Meat Delite Shift tthe current illustrat t usage DEIET Jace ene Help Using Fal Open help Often a quick reference card is included in view individual Pn ae ee ed a z the user s documentation package This Wiew AlStudents F3 Switch to ali student card lists all the commonly used commands i esuada View By Course F4 be poeraily toget
69. ration of an interpreter GROUP TASK Research Make a list of programming languages which are generally interpreted at runtime and briefly outline the main use of each language Kox mS i Software Design spd BeVelopment The HSC Course G G or Ov a r cor oot 242 Chapter 5 Ze Q O N ompi O cont g xO G The source code is translated into executable code The executable code can later be executed without any need for the translator Compilation is a batch process input to this process is the high level source code and the output is the executable The file or files Errors encountered during the compilation process are normally relayed as a series of messages to the programmer All coding errors are reported at the end of an unsuccessful compilation operation Ly ahaa of a compiler can be likened to a translator tr se Biter a book into a RA eign language Imagine a translator is converting a o ritten in German O English The translator will translate G the entire text of the novel Once the oO manuscript in English has been S produced in its entirety it is printed and distributed It is difficult for The English translatio readers of the English A ON The translator converts the entire distributed separately to the into n is on realise the language used Nihe a En original German versi original German book L ese Fig 5 9 The Compilation can be likened to the translation
70. rs data structure We now need to develop the sub BEGIN StoreCustomers FileName programs to store and retrieve the Open Filename for output Customer s records from a disk Count 0 filAs the developer you have WHILE Count lt 500 cote ready created an algorithm to Write cue ustomers Count complete the storage task see Fig ie C 5 3 Retrieving the records will Gose Fi j use the identical algorithm except END s Ustomers instead of writing the records to Q R Fig 5 3 R the file we will be reading them x Algorithm to store customer details to file ws from the file Let us now examine the Q statements required to complete these file access co tasks in Visual Basic G Visual Basic N ERO ENY The required F A crams are ow The A statement is used to open or create a file and AS for input or output OpenFile FileOpen lt FileNumber gt lt FileName gt lt Mode gt lt Access gt lt Share gt lt RecordLength gt Mode Append Input Output Random Access Read Write Read Write S LockRead LockWrite LockRead Write Shared Ni e lt integer gt oo G FileName is used to specify the full path includin snc ename to the file Mode can be Input Append or Output for sequential file T andom for random access files Filenumber is an integer between 1 and 511 Eeh file opened must have a unique file number The next free file number c obtained using the FreeFile function A Re
71. s a significant time overhead Because the interpreter only receives one high level language statement at a time it is not able to look ahead and translate each statement in the most efficient manner Other methods of translation are able to optimise their output based on the overall view of the total source code Users of interpreted programs must have a copy of the interpreter installed on their chines for execution to take place This requirement inv further costs and lt onieiory overheads for the users of interpreted ee use the actual source code is distributed to users the developer has limit ntrol over his intellectual AC h rights Users can easily access the source code an usei for their own purposes Currently interpreted languages are routinely on web servers to write server side N Q scripts PHP and Microsoft s ASP ommon interpreted examples When customising existing applications oft scripting language is interpreted For most compiled languages a interpreter is also available for use as a development tool by software develop Onn software development environments include an interpreter for use duringseoding which allows the programmer to execute sma segments of code RR as they are coding The final distributed product is Prod using a compiler fos AS Ww GROUP TASK Activity OS Hitt Interpreters translate each of line of code and then execute it if no errors are found Create a flowchart to describe the ope
72. s and tutorials are the primary gas of viding instruction and information to users Examine th as documentation included in various commercial software packages Evaluate each item in terms of its intended function How could these items be improved Online Help Each of the above types of user documentation can be in either printed or electronic online form It is now common for most user documentation to be provided online ra than as printed manuals Online documentation can be ided as Adobe PDF tles which are often similar in structure to more a manuals however dedicated hypertext documents are now more com ypertext help documents allow users to efficiently search for specific i many cases they allow context sensitive help to be provided from within th ation When the user selects help within the application they are directed to yeo ost relevant help topic automatically Online help can be truly online me it is stored on a remote web server and hence requires an internet connection o it can be stored on locally on the user s machine Currently many P of aon only provide truly online internet based help This has the advantage tha Cis ae company can update the help files as requir A and all users will i iately have access to the new content In addition inter help such as us pport forums and the ability to ask questions or ee es aluable additions to an applications support options GROUP TASK Research Consider a pop
73. source code is translated into machine code and then immediately executed If errors exist in the source code they will cause a halt to execution once encountered by the interpreter The actions of an interpreter are similar to that of a speech interpreter If our German speaker wishes to have a conversation with an English speaker EREE ET themthe speech interpreter translates each message fram German s nt nce into English as soon as it is ips A poken in German The English version is fe Q then spoken to the English speaking ae recipient If the speech interpreter cannot za is English translation e is spoken to English Q understand a German sentence he is Ken to speech en er ti ter NE unable to translate it into English T ey oN CEAPA Fig 5 8 Speech translation can be likened to source code interpretation German sentence must be changed form the speech interpre can understand before the cor slation can take place Because the interpreter is there at the time the communication takes place it is easy to make an on the spot change and then tinue with the translation process High level lan interpreters provides similar advantage to the developer Errors are generated occur and cape orrected Translation and execution can then continue ey Interpretation does slow down the process of execution significantl h statement must be translated into executable code before it is executed The translation process create
74. sual Basic the function could b e written as follows Ky Fig 5 2 k ws Algorithm for the FindProductNumber function Function NextProductNumber sup As Integer ByVal ware As Integer As Integer 9 Dim count As Integer Ce Ce eg ee A count 0 GROUP TASK Activity If Produc ware count Then N uctNumber count c ine Create some sample data f a ENTE products array Complete a desk check End While of the Visual Basic code Explain in Return NextProductNumber words the processing taking place This End Function function is similar to one of the searches from chapter 4 explain the similarities op oftware Design and Development The HSC Course KS i O aos aos oO 9 3 oe cok QO Implementation of software solutions OY V V Pascal RVS O Railroad diagrams for the pre test loop and binary selection structures in Pascal are Binary diti K fat Selection iF H Condition H THEN HStatemen Pre test WHILE Do Statement C ELSE H Statement For those readers not familiar with Pascal a statement can be made up of multiple s ents When multiple statements are used then the ke BEGIN and END te used to group the statements Semi colons are used separate each statement within a multiple statement G In Pascal the function could be written as x p s FUNCTION NextProductNumber Sup Inte Ware aes Integer Q VAR Count Integer BEGIN oo ot FindProd
75. t language is used for the client side code For ae PHP is commonly used on the server and JavaScript on the client side D Kox mS i Software Design spd Development The HSC Course G or so oe Implementation of software solutions AE t For some projects there will be little choice due to wy coe on coe X Q ws oo oo 226 Chapter 5 QO So N When Re a programming language a variety of different exes should be considered including e The nature of the project Different languages are suited to the solution of different types of problems An artificial intelligence application will be suited to a different language compared to software to run an online store The best language to write a low level hardware driver will be very different to the best language to write a platform game Research is required to determine the most Suitable language for the type of software project amp er The intended environment including hardware operatiig system and network use cO has a large impact on the most suitable language Eher are interpreted languages ao designed for use on web servers and others which operate within client web browsers Some languages compile down tome intermediate code such as Java s S byte code and will execute on myke different operating systems Other languages or language variants are d si ned for smart phones or tablets K e The experience of the progr ers It ta
76. tems can be written to a sequential file with one Write statement imiarly multiple data items can be read from a sequential file with one Input tatement Data is stored in the file with commas betweeteach data item and any strings are enclosed in double quotes cO AC Let us now implement our StoreCustomers GE irieveCustomers procedures in Q Visual Basic NET We will use a random ss file for this purpose although a N sequential file would have fulfilled our requirements equally well ws Public Sub StoreCustomers FileName AS String ww Dim Count As Integer FileNum teger CusLen As Integer 9 FileNum FreeFile C gt Ce CusLen A OARS D FileOpen FileNum ame OpenMode Random CusLen O Count 0 Q yo While Count A 0 PN FilePul Fl Num Customers Count Count 1 QA Count Count 1 End While FileClose FileNum End Sub We use the FreeFile function to obtain the next available file number The Len function is used to find the length of a customer record As all the customer records are the same length we can find the length of any record in this case we ve found the l of the first record These values are used as parameters ii the statements that ollow cO The RetrieveCustomers procedure could be implementedas follows ane Public Sub RetrieveCustomers FileName As PON y2 Dim Count As Integer FileNum As Integer usle As Integer FileNum FreeFile K RY CusLen Len Customers 0 FileOpen FileNum
77. the struc abe the code to be seen at a glance The beginning and OR end of each control s stands out this assists in visually describing the He The rules of pseu ieee insist on the use of indentation similar rules eS ache implemented Vite cae code Indenting is the process of setting lines om back from the left margin Indenting RY Many o W features are commonly used to improv oe intrinsic readabi of code Leaving blank lines between comments an e code they describe Colour can be used to visually differentiate between comments reserved words operators and operands Ensuring each line of code can be viewed without the need for scrolling Most programming languages provide a continuation character that is used to indicate that the statement continues on the next line Any factors that increase the readability of the source code and are part of the code are classified as intrinsic documentation i Software Design and Development The HSC Course KS y sor so a i 8 ia ck cok Noy Implementation of software solutions ee X X GROUP TASK Research Search the Internet for code samples in a variety of different high level languages Comment on the intrinsic documentation used What identifier naming conventions have been used Other forms of technical documentation Throughout the software development z OW vyele various forms of documentation A are created These models diagrams and Problem Needs of client
78. ther data structures a GROUP TASK Investigation Examine another programming language and develop declaration statements for the above Products array Y S lt 2 Software Design al The HSC Course O gor Ro ck cok 230 Chapter 5 3 we YY VO One of CT that uses the Products array is described in the PEs t below IPO CHART Client Choog Soft Pty Ltd Date 29 2 2001 Project Warehousing System Programmer Melissa Davis Module NextProductNumber Page 15 of 28 Input Process Output Supplier Number Warehouse Examine each product in turn with Supplier Number Number and Warehouse number If Product is empty then this Index provides N the next available Product Number Return the product number to the calling on le NextProductNumber O module Return 1 if no space availab ae Fig 5 1 P IPO Chart for the FindPr umber function NA Melissa has already NES algorithm for this function aA algor is shown in Fig 5 2 Let s implement the ef uctNumber function in both Visugh sic and Pascal or Visual Basic N A ios an for the pre test loop structuri isual basic is Is Statement Products Pre test Condition a End While Sup Ware Count Blank For binary selection the Visual Basic pies eth mace ountS railroad diagram is 4 Statement p End If Add 1 to Count a If Condition then oe tion ev Q In Vi
79. tion 3 or F cable installation for eoa AN 5 AO i 3 Schedule hardware network ew dl Q installation l N i 4 Organise and install two phone K A i TA in ae lines One near file server and Fig 5 36 one beside POS terminal 5 Liaise with bank and Or EFTPOS terminal i sta d 6 Inform HospS TM schedule an installation date Complete application softw installatio dule employees of restaurant for initial training Tram completa by HospSys installer System considered Live O Gantt chart for the installation of the HospSys product 9 S GROUP TASK Discussion The HospSys system is a client server application Each evening data from each restaurant in the chain is uploaded to head office As part of the installation process the installer must ensure all aspects of the system are operational Create a Gantt chart that could be included in the installer s section of the installation guide mS i Software Design spd Development The HSC Course so N ws ws OW Software product Topics can be ordered in terms of OW Reference Manual CG eo 9 so a i 8 oot ao ao gt S S User ap A Quality user manuals aim to provide concise and accurate information 1n regard to the operation and purpose of software Topics in user manuals describe what tasks the software can complete why these tasks are required and how these tasks are completed using the software The
80. to be tested Stubs do not perform eal processing they aim to simulate the processing that will occur Aire final subroutine be replace Stubs are used to set the value of any variables affecting their calling routines and then end Sometimes a stub may include an outptt statement to inform the programmer that the call to the stub has been successful The creation of stub subroutines is required when software projects are coded using a top down design methodology Because higher level subroutines are created before lower level subroutines it is necessary to create dummy subroutines This enables testing of the higher level subroutines whilst they are being coded Rite driver in general terms provides an interface between two components A driver controls the operation of some device For example a hardware driver is a program that provides link between the operating system and a specific hardware device Another example i printer driver used to control the ae printer a Fig 5 28 In terms of software dev ie a diver is a The siverofacar provider an terface co subroutine written to test the operation of one or between the environment and the car T more other subroutines Commonly drivers set driver controls the operation of RO the value ofa quired variables call the Q subroutine a tested and output the results of the subroutine call I eareiice the driver i nterface between the subroutine and the programmer Thed ive
81. to less than 25 x D 0 to less than 4 V Dynamic link libraries RN are used to add functionality t level languages Which of the following is true of DLLs A DLLs must be distributed with the final software product B DLLs are combined within the executable file by the linker C DLLs are only required for E Sats D Each D st be present on the y ine for the software ct to execute correctly ducts need to be specified Why is this the case A Software products are often designed for specific combinations of hardware configuration B It is often not possible for software developers to predict the hardware environment on which their products will be installed 3 C Software solutions will oper ww more efficiently under icular hardware conditions N D All ofthe above A use 10 pain requirements for new software N d O Software Design and Development The HSC Course ad Py ad ov X 3 Implementation of software solutions 3 Wi X ou of source code into executable files is necessary for all E ven Explain the processes involved in this translation process The fetch execute cycle takes place for every task completed by a computer Explain the processing that takes place to execute a simple high level language assignment statement such as Count 1 Answer in terms of the operations that take place within the CPU including references to the fetc
82. tputs They always result from misspelt reserve s P are detected whilst the prog ing They can be the f hardware faults faults in the operating system BIOS or hardware drivers C application software errors D All of the above If a program is coded using a top down design methodology which of the following would be required to test each 2 module A flags B stubs C drivers D break points Quality solutions A perform the stated task without error B will solve a single logical task are superior in efficiency D B C D maintainability and design provide superior documentation to other ae A temporary me that calls other subrouti assist in their testing is called stub driver C flag D main program Temporarily halting the execution of code so that the contents of variables can be examined and altered is accomplished using A watch expressions B single line stepping oc C program traces K N D break points KA i Software Design and Development The HSC Course so cor cor 3 Implementation of software solutions A ih cota software solution can be done from the top down or from tei up What does this sefe mean What techniques are required when coding using each of the thodologies The Pascal code fragment that follows attempts to find all the factors of a number Factors are numbers that divide evenl
83. tting variable contents a progah traces i Software Design and Development The HSC Course KS i sor so a i 8 ia Single line spping gw Single line execution after each statement is executed Each z statement is simple keystroke allows execution to continue to the next statement For example in VB NET the F8 key steps function calls assist in isolating an error to a pa mean that procedure and function calls a cor Ww N O Implementation of software solutions A stepping is the process of halting SE Step into Step Over Shift F8 highlighted as it is executed A ee step out Aenean Fig 5 34 Stepping tools in VB NET through the code line by line a large number of Si line stepping can become somewhat monotonous w cedure calls or loops are involved Most lana ide variations on the O single line stepping idea Commands to allow sen step over procedure and ub completed before execution once again alts eas Ee ava This style of stepping allows the roa to Winner 54 Integer concentrate on code within the er level ara mee oe a subroutine A a a fe Watch expressions Ce g ia o Dear A watch ex value is up T execution po es Usually watch expressions are vari names In Fig 5 35 the variable E Ae toes CheckCounter Winner and PrizeWinners have ait f a been entered as watch expressions Watch gu Peger expressions can also be calculations such as eui bese
84. uctNumber Count 1 O TO WHILE Countes 0 VN BEGIN BEGIN FindProductNumber Count Count 100 END Count Count 1 END NO ue Ware Count THEN QO GROUP TASK Discussion The compiler ignores the spacing and indenting in the above Pascal code The code would operate exactly the safm if no spacing or indenting was used Discuss the reasons for incl spacing and indenting in source code GROUP TASK fnvestigation Examine another programming language and develop the oo function in this language mS i Software Design spd Development The HSC Course so cO O cor coe AS 232 Chapter O aar AN Ni Usi N ds and fil sing aga records an es K SS LILA Consider the following Imagine that you work for Bizzy Soft Pty Ltd a software development company that writes business applications You are currently working on a product to manage customer details for businesses pay eurrent project requires an array of records called cuaimhers This array of ecords needs to store up to 500 customers The details fi h customer include their Surname First Name Sex and Email address Sur s and First Names have a maximum length of 20 characters Email addresses rip to 30 characters and the Sex can hold one of two values A i You have been allocated the task of writing two subroutines for this product One to ws save all the customer records to diskyan another to retrieve them from disk back into X
85. ular software application installed on your computer Research and briefly describe all the various types of online help available to users of this software application mS i Software Design spd Development The HSC Course so cor coe ws coe cot 282 Chapter 5 ar we yo TECH o Technical documentation is designed for an audience who are gt een and knowledgeable in regard to the subject matter In terms of software products technical documentation primarily describes the structure and engineering behind a product Whilst software is being developed thorough documentation should be maintained These documents form the basis of the final technical documentation Personnel ingadved in maintaining upgrading and supporting software tions make use of echnical documentation os cO Log Books or process diaries Q Keg A log book records the systematic series of oy that have occurred during the Q development of a project Log books or pro diaries are often utilised during the N design and development of products ah industries Maintaining a log book is a ws method of chronologically recordi e processes undertaken to develop a final ww product Individual members e development team can maintain their own log books or a central log book eam be maintained for each product under development oR The purpose of main eyes log books is twofold Firstly the information can bene to determine the nine cost
86. vice drivers or extensions Emerging technologies e the effect of emerging hardware and software technologies on the development process such as iPhone Wii remote handheld communication devices scanning pen biometric devices multi point surface software radio frequency identification social networking software i Software Design and Development The HSC Course so g so cor YO VO D amp GA GA 5 IMPLEMENTATION OF SOFTWARE SOLUTIONS COW implementation of software solutions is the third si software development cycle During this stage of development the sour is written and tested That is the plans and designs formulated in stage t N in a programming language we We first briefly examine a varie adie programming languages with an emphasis on their appropriatene solving different types of problems The syntax of high level programmi aaa is then examined using metalanguages such as EBNF and railroad ming Jen This information will allow for the creation of syntactically coreg g e code ao The source cds transate into machine code We examine this cos of translation moe ing compilation and interpretation The machine code pbs code is then ted by the CPU This process of execution is studie h particular eig to the components and actions occurring within the CPU These actions result in the execution of machine code commands Program development techniques are examined This section descri
87. words how Fred has completed the required task O Software Design spd Development The HSC Course so cot 236 Chapter 5 ao ao V Q Puoig s recenrnerveer A As Integer ByRef B As Integer ee Dim seind As New Random If Tickets B Year lt 11 And rand Next 0 5 lt gt 0 Then A A 1 Elself A lt 3 And A Tickets B Year lt gt 13 Then A A 1 End If End Sub Fig 5 6 Fred s CheckWinner VB NET procedure GROUP TASK Investigation yon mS Now include the call to the CheckWinner presi in your 3 investigation What has Fred done to outcome of the raffle ae What is the significance of Fred s us wi rather than ByVal for the 4 Q parameters to the procedure ae a os x HSC style questions 5 Ce 1 P p A Consider the folloyibe EBNF statements when answering Questions 1 and 2 oe ChoogS BIC D A Nigs alb cld QA Ving lt Choog gt lt Niss gt Ruke lt Choog gt lt Niss gt lt Ving gt 1 Which of the following is a legitimate Ruke A ABab B AaAaAa C bBecc D CcABCD Qe Which of the following railroad diagrams correctly defi a Ving cO A Ce AO Choog Niss 8 B D Niss i Software Design and Development The HSC Course KS sor so a Wt 6 ia oo oo ao Implementation of software solutions Br ye K A 3 InBNF a Drim is defined as follows KA Drim lt Yot gt lt Hok gt
88. y into a number For example the factors of 8 are 1 2 4 and 8 The TRUNC function returns the integer part of a number This code fragment contains a number of errors Readln Number Count 0 WHILE Count lt Number DO D BEGIN QY IF Number Count TRUNC Number Count THEN Writeln NUmber Coun t Count Count 1 END Perform a desk check of the above code using e input What errors are encountered Suggest ways of correcting these errors BANE desk check again with your corrected code 13 The above problem can be solved in a more elegant and efficient manner Make changes to the code to make it more elegant ient The modules for a large C een developed separately Apparently all subroutines in each module has been thoroughly_te on its own These modules are now being combined to form the total solution A number rs are occurring when the code is executed o 14 List and descri N types of errors that could be occurring Give an example of each itty 15 For ao error types identified in question 14 describe a possible myo isolating the ONA ONA mS i Software Design spd BeVelopment The HSC Course G or O ck cok 278 Chapter 5 ao sor Qy ow DOCUMENTATION OF A SOFTWARE SOLUTION N Throughout the development of a software solution various forms of documentation are created We have already discussed the need for continually updating documentation throughout the development process
89. ystem to generate a runtime error The error or bug can be linked to either hardware or software problems As we are primarily interested in software let us consider the possible source of software R ime errors O e BIOS Basic Input Output System BIOS settings are stored in CMOS Comp CMOS is a type of RAM that requires off Incorrect CMOS settings will e Operating system OR Runtime errors generate by te operating system can result various sources Often BIOS dhardware driver or application A are errors will cause an operati stem runtime error The all too familiar MS Windows family blue screen is the result of an operating system runtime error e Hardware drivers Sige Pascal function to add up counting numbers The BIOS provides the interface between the Function SumInts SumTo Integer Integer VAR Counter Sum Integer BEGIN Counter 0 Sum 0 wna deer gt SumTo DO G Counter Counter 1 Counter Sum Counter Sumints SumTo END Fig 5 26 Including logic errors Bug An error or defect in software ot hardware that causes a program to malfunction Apparently a real moth trapped between two relays caused the first ee bug erating system and the hardware ary Metal Oxide Semiconductor little power to retain its contents A battery in the system box supplies p wer o the CMOS when the computer is turned AN result in runtime errors Crash A serious computer failure O The com
Download Pdf Manuals
Related Search
Related Contents
Sony SA-WM200 Subwoofer Sony XS-R6943 Marketing Specifications User Manual Manual ADT3D Digitus USB 2.0-KVM switch, 2-port Vous - Agrica User Manual - B&H Photo Video Digital Cameras, Photography Advanced Products for Alternative Healthcare Copyright © All rights reserved.
Failed to retrieve file