Presentation is loading. Please wait.

Presentation is loading. Please wait.

Marr CollegeHigher Software DevelopmentSlide 1 The Software Development Process – 4 hours.

Similar presentations


Presentation on theme: "Marr CollegeHigher Software DevelopmentSlide 1 The Software Development Process – 4 hours."— Presentation transcript:

1 Marr CollegeHigher Software DevelopmentSlide 1 The Software Development Process – 4 hours

2 Marr CollegeHigher Software DevelopmentSlide 2 Software Development Process The Software Development Process The SDP consists of seven main stages that are followed to develop software. They are: 1.Analysis 2.Design 3.Implementation 4.Testing 5.Documentation 6.Evaluation 7.Maintenance

3 Marr CollegeHigher Software DevelopmentSlide 3 Software Development Process The iterative nature of the SDP The SDP is iterative as any of the stages may be revisited throughout the project. Example: If an error is found in the maintenance stage (after release) then the implementation stage will be revisited to fix the code.

4 Marr CollegeHigher Software DevelopmentSlide 4 Software Development Process The Software Specification The Software Specification is a document that defines the scope and boundaries of the project and becomes legally binding between the client and the developers.

5 Marr CollegeHigher Software DevelopmentSlide 5 Software Development Process Personnel involved the SDP Client - commissions the software project as a result of an identified ‘need’. Systems Analyst – Investigates the client’s current system and designs the new or upgraded system. Project Manager – Project leader who manages the project and the development team. Ensures deadlines being met and resources are in place. Programmer – Implements the designs (pseudocode etc.) into program code. Independent Test Group – tests the software to identify any errors by testing subroutines, modules and the completed program.

6 Marr CollegeHigher Software DevelopmentSlide 6 Software Development Process Analysis The Systems Analyst meets with the client, interviews and observes users of the current system and identifies what the program has to do, in a process known as Requirements Elicitation. The result is the production of the Software Specification.

7 Marr CollegeHigher Software DevelopmentSlide 7 Software Development Process Design The design process is methodical and involves designing and representing algorithms as pseudocode and/or structure diagrams.

8 Marr CollegeHigher Software DevelopmentSlide 8 Software Development Process Design Algorithm An algorithm is a sequence of actions that, when performed in the correct order, will solve a problem or task in a finite number of steps. Example: Here is a simple algorithm to convert a Fahrenheit temperature to Celsius: 1 Subtract 32 from Fahrenheit temperature 2 Multiply by 5/9ths to get Celsius temperature So, 98.6°F - 32 = 66.6 66.6 * 5/9ths = 37°C What happens if you swap steps 1 and 2 - do you get the same answer?

9 Marr CollegeHigher Software DevelopmentSlide 9 Software Development Process Design Pseudocode Pseudocode is a design notation that combines English language and Maths with programming language constructs.

10 Marr CollegeHigher Software DevelopmentSlide 10 Software Development Process Design Pseudocode Note: Pseudocode is not specific to any programming language. It is a design notation that can be implemented by programmers in any programming language Here is the Fahrenheit conversion algorithm represented as pseudocode to be implemented as program code: 1.1 Get temp(°F) 1.2 Set temp(°F) = temp(°F)-32 1.3 Set temp(°C) = temp(°F)*0.556 1.4 Display temp(°C) 1.1 Get temp(°F) 1.2 Set temp(°F) = temp(°F)-32 1.3 Set temp(°C) = temp(°F)*0.556 1.4 Display temp(°C)

11 Marr CollegeHigher Software DevelopmentSlide 11 Software Development Process Design Structure Diagram A Structure Diagram is another design notation that represents algorithms in a chart or graphical form Here is the Fahrenheit conversion algorithm represented as a structure diagram to be implemented as program code: Covert °F to °C 1.1 Get temp (°F) 1.3 Set temp(°C) = temp(°F)*0.556 1.4 Display temp(°C) 1.2 Set temp(°F) = temp(°F)-32

12 Marr CollegeHigher Software DevelopmentSlide 12 Software Development Process Design Flow chart A flow chart is another design notation that shows the sequence of operations required to complete a task. This chart shows the sequence of reading customer accounts and calculating the amount due for each customer. After an account has been processed, the program loops back to process the next one.

13 Marr CollegeHigher Software DevelopmentSlide 13 Software Development Process Design Top-down design is where a task or problem is broken down into stages that can be solved as individual parts. This structure diagram illustrates a top-down approach to identifying the stages of the problem solution. Top-down design Is the process of breaking a problem down in to sub-problems.

14 Marr CollegeHigher Software DevelopmentSlide 14 Software Development Process Design Stepwise Refinement Stepwise-refinement is the process of refining stages down into steps. Each step can then be coded in a programming language.

15 Marr CollegeHigher Software DevelopmentSlide 15 Software Development Process Implementation This is where the programmer(s), overseen by the project manager, convert the pseudocode (algorithms) into programming code e.g. Visual Basic, C++, Java etc. ‘Program Code tempF = txtTempF.Text tempF = tempF-32 tempC = tempF*0.556 lblTempC = temp(°C) ‘Program Code tempF = txtTempF.Text tempF = tempF-32 tempC = tempF*0.556 lblTempC = temp(°C) Pseudocode 1.1 Get temp(°F) 1.2 Set temp(°F) = temp(°F)-32 1.3 Set temp(°C) = temp(°F)*0.556 1.4 Display temp(°C) Pseudocode 1.1 Get temp(°F) 1.2 Set temp(°F) = temp(°F)-32 1.3 Set temp(°C) = temp(°F)*0.556 1.4 Display temp(°C) A formatted printout of the program code is known as a structured listing. It includes indentation, white space and internal commentary.

16 Marr CollegeHigher Software DevelopmentSlide 16 Software Development Process Testing Testing should be both systematic and comprehensive i.e. methodical with test reports of predicted and actual results kept, and tested under all operational situations with a full range of test data. The three types of testing are normal, extreme and exceptional. Example Program should only accept whole values in the range 0 to 100: Normal data: 2, 34, 66 etc. Extreme data: 0,100 Exceptional: -1, 156, abc, 2.9 etc. Example Program should only accept whole values in the range 0 to 100: Normal data: 2, 34, 66 etc. Extreme data: 0,100 Exceptional: -1, 156, abc, 2.9 etc. Acceptance (beta) testing is when independent test groups and/or the client try out the software and report back any bugs to the development team prior to final release.

17 Marr CollegeHigher Software DevelopmentSlide 17 Software Development Process Documentation To produce documentation to be distributed with the software. The two main documents are the user guide and the technical guide. 1 User Guide A set of instructions on how to install and use the software perhaps including tutorials and FAQS. Can be in both a booklet or electronic format. 2 Technical Guide Describes hardware requirements e.g. CPU, RAM space on hard disk etc.

18 Marr CollegeHigher Software DevelopmentSlide 18 Software Development Process Evaluation An evaluation report is prepared and supplied to the client with the release of the software. Evaluation Reliable No design faults Correct output Portable Cross platform Efficient Low processor and memory overheads Maintainable Readable i.e. internal commentary, indentation etc. Modular i.e. uses procedures and functions. Robust Copes with errors Does not crash Fit for purpose Does the program meet the spec?

19 Marr CollegeHigher Software DevelopmentSlide 19 Software Development Process Maintenance Begins once the software has been released and put into use. Involves the client who uses the software and the programmers to make any necessary changes. There are 3 types of maintenance. Corrective: Fixing any errors that were not detected during the testing phase. Adaptive: To alter the software to work with a new operating system or new hardware. Perfective: Add new functionality at the request of the client. Corrective: Fixing any errors that were not detected during the testing phase. Adaptive: To alter the software to work with a new operating system or new hardware. Perfective: Add new functionality at the request of the client. Corrective maintenance is part of the contract whereas adaptive and perfective are usually at additional expense to the client.

20 Marr CollegeHigher Software DevelopmentSlide 20 Languages and Environments – 6 hours

21 Marr CollegeHigher Software DevelopmentSlide 21 Languages and Environments Procedural Languages Programs follow a sequence from start to finish and can be split into sub- programs called procedures. Languages such as Pascal, Comal and Basic are procedural and nowadays are mainly used for learning programming. Sample Pascal code

22 Marr CollegeHigher Software DevelopmentSlide 22 Declarative Languages Declarative (logic) programming has no fixed start or end point; are collections of facts and rules; and use pattern matching to answer queries. Languages and Environments Declarative languages such as Prolog and LISP are used predominantly in the field of Artificial Intelligence. Here are some facts: Parent (Liz, Tom). means that Liz is a parent of Tom Female (Liz). means that Liz is female Male(Tom). Parent(Bert, Tom). Here is a rule: Mother(X, Y) :- means that X is a mother of Y IF Parent(X, Y), Female(X) X is a parent of Y AND X is female! Query could be Mother(X, Tom) which would give the answer X=Liz

23 Marr CollegeHigher Software DevelopmentSlide 23 Event-driven Languages An object-oriented programming paradigm where objects on the interface have their own code attached e.g. a command button. Visual Basic and Java are examples of event-driven languages. The code is executed in response to events e.g. form load, button click etc. Languages and Environments

24 Marr CollegeHigher Software DevelopmentSlide 24 Languages and Environments Programs written in high-level languages need to be translated into low- level (machine code) for processing and executing by the CPU. This is done by a translator program. Translators There are two types of translator program: interpreters compilers

25 Marr CollegeHigher Software DevelopmentSlide 25 Languages and Environments Interpreter programs translate HLL code into machine code one line at a time. Advantages: easy to find errors good for learners Disadvantages:  programs slow as have to be continually interpreted  interpreter program always in memory Interpreters

26 Marr CollegeHigher Software DevelopmentSlide 26 Languages and Environments A Compiler program translates the whole program (source code) into a machine code version (object code) that can be run without the compiler being present. Advantages: programs execute fast as CPU ready translator program only needed at the time of compiling different compilers can be written for different platforms. Compilers Disadvantages:  slow to compile as whole program translated  also may not run if syntax errors.

27 Marr CollegeHigher Software DevelopmentSlide 27 Scripting Languages Programs written as scripts are used to automate or extend the functionality of software applications. Languages and Environments A Macro is a script written in Visual Basic for Applications (VBA). The user records a series of actions in an application such as MS-Excel. Code is generated and saved as a program script. The macro can then be assigned to a keystroke. Used to simplify and repeat complex or frequently used commands.

28 Marr CollegeHigher Software DevelopmentSlide 28 Module Libraries A Module Library is a pre-written and pre-tested collection of subroutines and functions which the programmer can use to aid the development of the final program. Languages and Environments Advantages include: No code has to be written for problems already solved The code will have been checked for any errors The modules will be well documented

29 Marr CollegeHigher Software DevelopmentSlide 29 HLL Programming Constructs – 14 hours

30 Marr CollegeHigher Software DevelopmentSlide 30 String Operations The two string operations are concatenation and substrings. HLL Programming Constructs Concatenation is the joining together of two strings. This example will output “Good morning!” to a text box. Substrings are parts of strings that are extracted and used in some way. ‘Example first = “Good “ second = “morning!” whole = first & second lblMsg.Caption = whole ‘Example first = mid$(“Phil”,1,1) second = mid$(“Mitchell”,1,1) initials = first & second lblMsg.Caption = initials This example will output “PM” to a label.

31 Marr CollegeHigher Software DevelopmentSlide 31 Formatting of Input / Output Data can be input via text boxes, input boxes etc. Data can be output to the screen by setting properties such as font, colour etc. Concatenation can be used to output strings and numerical data. HLL Programming Constructs ‘Example lblMsg.Caption = “The total is “ & total & “!!” ‘Example txtAve.Text = Format(average,”.00”) ‘Example txtAve.Text = Format(average,”.00”) Use of pre-defined functions may also format output.

32 Marr CollegeHigher Software DevelopmentSlide 32 Multi-way Selection The CASE statement improves the IF..THEN..ELSE construct where more than two conditions are possible. HLL Programming Constructs ‘Implement using CASE Select Case mark Case Is >= 70 grade = “A" Case Is >= 60 grade = “B" Case Is >= 50 grade = “C" Case Else grade = “Fail" End Select ‘Algorithm using nested IFs If mark >= 70 Then grade = “A" Else If mark >= 60 Then grade = “B“ Else If mark >= 50 Then grade = “C" Else grade = “Fail" End If CASE makes the code more readable so aids maintenance.

33 Marr CollegeHigher Software DevelopmentSlide 33 Variables A variable is the name used to store a single item of data within a program. HLL Programming Constructs Examples Integer variables store whole numbers e.g. Dim age As Integer Real variables store decimal numbers e.g. Dim price As Single String variables store text e.g. Dim pname as String Boolean variables store either TRUE or FALSE e.g. Dim Swaps As Boolean

34 Marr CollegeHigher Software DevelopmentSlide 34 1D Arrays HLL Programming Constructs An array is a name given to a list of items of data in a program. The list is stored in contiguous memory locations. Here is an array nums(10) of integers between 1 and 9: (1)(2)(3)(4)(5)(6)(7)(8)(9)(10) 3625639457 Here is some VB code to setup and array: ‘Example: 1D array Dim nums(10) As Integer Here is some VB code to setup and array: ‘Example: 1D array Dim nums(10) As Integer Here is some VB code that would input data to an array: ‘Example: Input to array For c = 1 To 10 nums(c) = inputbox(“Enter number etc. List1.additem nums(c) Next c Here is some VB code that would input data to an array: ‘Example: Input to array For c = 1 To 10 nums(c) = inputbox(“Enter number etc. List1.additem nums(c) Next c

35 Marr CollegeHigher Software DevelopmentSlide 35 Modularity Well written code makes use of modular programming. This simply means that programs are organised into modules or sub-programs. HLL Programming Constructs Advantages Each sub-program can be developed and tested as a standalone program Bugs can be located within a specific sub-program Maintenance can be carried out on each Programs can be sub-divided and developed by many programmers The two main types of modules are subroutines (procedures) and functions.

36 Marr CollegeHigher Software DevelopmentSlide 36 Procedures HLL Programming Constructs A procedure is a subroutine that performs a specific task in a program. A procedure can be invoked by: a)an event e.g. Private Sub cmdCalculate_Click() b)being called when needed e.g. Call Validate Here’s how to create a procedure in VB6: Private Sub InputNames() Statements End Sub

37 Marr CollegeHigher Software DevelopmentSlide 37 Functions A function is a subroutine that always returns a value e.g. a function could be used to return the result of a calculation. HLL Programming Constructs Note: The value returned from the function must always be assigned to a variable or a control! If CalcTax() was a function then you could return a value to a label e.g. lblAmount.Caption = CalcTax() Here’s how to create a function in VB6: Private Function CalcTax () As Single Statements End Function or you could return a value to an expression e.g. Amount = Estimate *.2 + CalcTax() *.14

38 Marr CollegeHigher Software DevelopmentSlide 38 User-defined Functions A user-defined function is a subroutine that is coded by the user and ‘called’ by another section of program code. It does not depend on an event. HLL Programming Constructs

39 Marr CollegeHigher Software DevelopmentSlide 39 Global Variables Global variables are declared at the start of a program and can be used anywhere in the program. HLL Programming Constructs Pros and cons Can be used anywhere in the program Declared once at the start  If value changes then changes for the rest of the program  Can be changed by mistake

40 Marr CollegeHigher Software DevelopmentSlide 40 Local Variables HLL Programming Constructs Local variables are declared within a procedure or function and can only be used by that subroutine. Pros Different variables can have the same name Save memory as created and destroyed during subroutine runtime Make subroutines ‘standalone’ so easy to reuse in other programs Reduce risk of accidental change of global value

41 Marr CollegeHigher Software DevelopmentSlide 41 Parameter Passing HLL Programming Constructs The two methods of parameter passing are: i.By reference (in and out) A parameter is simply the value of a variable that can be passed between subroutines. age = 25 variableparameter Subroutine IN Subroutine INOUT ii. By value (in)

42 Marr CollegeHigher Software DevelopmentSlide 42 By reference HLL Programming Constructs Parameter passed is the actual variable itself. Any changes to the parameter persist beyond the call i.e. change the original value. Subroutine A 25age age = 25 Subroutine B Private Sub check (ByRef age) 25age age = 42 42age 42age Note: An array should always be passed by reference due to memory overheads.

43 Marr CollegeHigher Software DevelopmentSlide 43 By value HLL Programming Constructs A copy of the current value of parameter is passed in and any changes do not affect the original value. 25 age Subroutine ASubroutine B 25 a age = 25 Private Sub check (ByVal a) 42 a a = 42 Note: In sub B the variable a is an alias i.e. a copy of the actual parameter. alias

44 Marr CollegeHigher Software DevelopmentSlide 44 Advantages of parameter passing HLL Programming Constructs There are a number of advantages: Greater control of data flow Reduced risk of accidental change More efficient use of memory Sub-programs are more ‘self-contained’ Improved reliability and robustness Here’s how to pass parameters in VB6: Call AddVat (cost, total) Private Sub AddVat (ByVal c, ByRef total) statements End Sub

45 Marr CollegeHigher Software DevelopmentSlide 45 Standard Algorithms – 12 hours

46 Marr CollegeHigher Software DevelopmentSlide 46 VB6 CodePseudocode 1 Input Validation Validates program input and rejects invalid data. Standard Algorithms 1.1Get and store value 1.2Loop WHILE data is out with range 1.3 Display error message 1.4 Prompt user to re-enter value 1.5End loop num = InputBox (“Enter number between 1 and 10”) Do While num 10 MsgBox “Must be num between 1 and 10” Num = InputBox (“Enter number between 1 and 10”) Loop

47 Marr CollegeHigher Software DevelopmentSlide 47 2 Linear Search Searches a list for a target value. Standard Algorithms Pseudocode VB6 Code 2.1Get and store target value 2.2Loop for each item in the list 2.3 If current item = target value THEN 2.4 Display item and its location in list 2.5 End if 2.6End loop target = InputBox (“Enter target value”) For p = 1 To 10 If array(p) = target Then picResult.Print target & “found at position “ & p End If Next p

48 Marr CollegeHigher Software DevelopmentSlide 48 3 Counting Occurrences Counts the number of times (frequency) Standard Algorithms Pseudocode 3.1Set counter = 0 3.2Get and store target value 3.3 Loop for each item in the list 3.4 If current item = target value THEN 3.5 Increment counter 3.6 End if 3.7End loop VB6 Code times = 0 target = InputBox (“Enter target value”) For p = 1 To 10 If array(p) = target Then times = times + 1 End If Next p Remember to output e.g. to a label or control array etc.

49 Marr CollegeHigher Software DevelopmentSlide 49 Pseudocode 4 Finding Maximum Find largest value in a list. Standard Algorithms 4.1 Set max = first item 4.2 Loop for each remaining item in the list 4.3 If current item > max then 4.4 Set max = current item 4.5 Set position = counter 4.6 End if 4.7 End loop VB6 Code max = array(1) For p = 2 To 10 If array(p) > max Then max = array(p) pos = p End If Next p

50 Marr CollegeHigher Software DevelopmentSlide 50 5 Finding Minimum Standard Algorithms Finds the smallest value in a list….

51 Marr CollegeHigher Software DevelopmentSlide 51 5 Finding Minimum Standard Algorithms Set min to first item in list… 213562-953 (1)(2)(3)(4)(5)(6)(7) min

52 Marr CollegeHigher Software DevelopmentSlide 52 5 Finding Minimum Standard Algorithms Is 3 less than 21? 213562-953 (1)(2)(3)(4)(5)(6)(7) min

53 Marr CollegeHigher Software DevelopmentSlide 53 5 Finding Minimum Standard Algorithms If yes then set min as 3. 213562-953 (1)(2)(3)(4)(5)(6)(7) min

54 Marr CollegeHigher Software DevelopmentSlide 54 5 Finding Minimum Standard Algorithms Is 56 less than 3? 213562-953 (1)(2)(3)(4)(5)(6)(7) min

55 Marr CollegeHigher Software DevelopmentSlide 55 5 Finding Minimum Standard Algorithms If no then do nothing. 213562-953 (1)(2)(3)(4)(5)(6)(7) min

56 Marr CollegeHigher Software DevelopmentSlide 56 5 Finding Minimum Standard Algorithms Is 2 less than 3? 213562-953 (1)(2)(3)(4)(5)(6)(7) min

57 Marr CollegeHigher Software DevelopmentSlide 57 5 Finding Minimum Standard Algorithms If yes then set 2 equal to min. 213562-953 (1)(2)(3)(4)(5)(6)(7) min

58 Marr CollegeHigher Software DevelopmentSlide 58 5 Finding Minimum Standard Algorithms Is -9 less than 2? 213562-953 (1)(2)(3)(4)(5)(6)(7) min

59 Marr CollegeHigher Software DevelopmentSlide 59 5 Finding Minimum Standard Algorithms If yes then set min equal to -9. 213562-953 (1)(2)(3)(4)(5)(6)(7) min

60 Marr CollegeHigher Software DevelopmentSlide 60 5 Finding Minimum Standard Algorithms Is 5 less than -9? 213562-953 (1)(2)(3)(4)(5)(6)(7) min

61 Marr CollegeHigher Software DevelopmentSlide 61 5 Finding Minimum Standard Algorithms If no then do nothing. 213562-953 (1)(2)(3)(4)(5)(6)(7) min

62 Marr CollegeHigher Software DevelopmentSlide 62 5 Finding Minimum Standard Algorithms Is 3 less than -9? 213562-953 (1)(2)(3)(4)(5)(6)(7) min

63 Marr CollegeHigher Software DevelopmentSlide 63 5 Finding Minimum Standard Algorithms If no then do nothing. 213562-953 (1)(2)(3)(4)(5)(6)(7) min

64 Marr CollegeHigher Software DevelopmentSlide 64 5 Finding Minimum Standard Algorithms -9 is the smallest value in the list. 213562-953 (1)(2)(3)(4)(5)(6)(7) min

65 Marr CollegeHigher Software DevelopmentSlide 65 Pseudocode 5 Finding Minimum Find smallest value in a list. Standard Algorithms 5.1 Set min = first item 5.2 Loop for each remaining item in the list 5.3 If current item < min then 5.4 Set min = current item 5.5 Set position = counter 5.6 End if 5.7 End loop VB6 Code min = array(1) For p = 2 To 10 If array(p) < min Then min = array(p) pos = p End If Next p

66 Marr CollegeHigher Software DevelopmentSlide 66 TASK – Find Min and Max Write a program that will: a)allow the user to input 10 scores between 1 and 6. The scores can be real i.e. 2.3, 5.6 etc. b)Calculate the total score i.e. each of the scores totalled up! c)Find the minimum and maximum score and subtract from the overall total to obtain a final score. Hint: final = total – (min + max) Use a function! d)Display all the scores on screen, along with the minimum, the maximum and the final score. e)Extension: Adapt the program to display each score on screen in ascending (sorted) order as it is entered by the user. Have fun!!! McLean Standard Algorithms


Download ppt "Marr CollegeHigher Software DevelopmentSlide 1 The Software Development Process – 4 hours."

Similar presentations


Ads by Google