Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software development.

Similar presentations


Presentation on theme: "Software development."— Presentation transcript:

1 software development

2 1 - The Software Development Process
2 - Software Development Languages & Environments 3 - High Level Programming Language Constructs 4 - Standard Algorithms

3 1 - The Software Development Process

4 The 7 Stages of the Software Development Process
1 Analysis 2 Design 3 Implementation 4 Testing 5 Documentation 6 Evaluation 7 Maintenance The Iterative Process The SDP is described as iterative because it stages may be revisited as a result of information gained at later stages. E.g. An error found during the Testing phase may cause the code (Implementation) or even the algorithm (Design) to be re-written.

5 The 7 Stages of the Software Development Process
Key Task Personnel Documentation 1 Analysis To define the extent of the software task to be carried out Client & Systems Analyst Software Specification 2 Design To design a method of solving the stated problem Systems Analyst & Project Manager Algorithm (Pseudocode, Structure Diagram) 3 Implementation To write code in a chosen programming language Project Manager & Programmer Program Code 4 Testing To test that the program matches the specification (Programmer) and Independent Test Group Sets of Test Data and Test Reports 5 Documentation To produce documentation to be distributed with the software Client, Systems Analyst and Programmer User Guide and Technical Guide 6 Evaluation To report upon the quality of the software according to given criteria Project Report/Evaluation 7 Maintenance To make changes to the software after the product is handed over to the client Varies depending on extent of changes. Programmer and Client are essential at this stage Maintenance Report. May involve re-write of above or, more typically, details of the upgrade.

6 Documentation in the Software Development Process
Software Specification A formal specification of the scope of the boundaries of the problem. It often forms part of a legally binding contract between the client and the development team. Algorithm A description of how the problem will be solved. It may be text-based (i.e. pseudocode) or graphical (e.g. structure diagrams or flow charts). Structured Listing A formatted printout of the actual code. It is likely to include line numbers, highlighting of key words (bold, capitals etc) indentation and blank lines (white space). Test Report A list of test data with predicted and actual output. It may also include comments on behaviour of software (memory, processor use, known conflicts etc) User Guide A set of instructions on how to install and use the software. It may include tutorials and FAQs. Technical Guide Includes descriptions of the technical requirements (RAM, disc space etc.) It may also chart the development history, known bugs and fixes, upgrades etc. Evaluation Report A report accompanying the software for the client. It will compare the software to the original specification and comment on the quality of the software according to a number of criteria. See Evaluation section for criteria. Maintenance Report This is a short report detailing the maintenance and confirming that it has been carried out.

7 Personnel in the Software Development Process
Client The client commissions the software, describing the scope and boundaries of the problem to the analyst Systems Analyst The Systems Analyst agrees with the client the detailed specification of the software to be written. This should be completed to the satisfaction of both parties before the design or coding is carried out. Project Manager This individual is responsible for keeping the project on track, from receipt of the software specification until software is delivered to the client. Deadlines will be monitored and interim reports on progress delivered. Programmer The programmer is responsible, individually or as part of a team for converting the algorithm into program code. Independent Test Group The independent test group (ITG) carries out testing of the software. This may involve modular or component testing (looking at subsections of code) as well as testing of the finished product.

8 1 Analysis The analyst extracts information from the client, and other relevant people, during requirements elicitation. This may take the form of interviews with clients and their staff, observation of current system, examination of an existing system and all paperwork (source documents). It is important that the task is fully understood before any design starts. The client and the analyst agree the scope and boundaries of the problem. Any assumptions should be made clear at this point. The program specification is produced as a result of this stage. It documents the Inputs, Processes and Outputs. It may form part of the software contract and it is therefore a legally binding document.

9 Carpet Area Calculator Display Carpet Area Required
2 Design The Design Stage involves the designing the user interface as well as designing the structure and logic of the system. Text-based Algorithm Pseudocode is where the design is written in a code-like version of English. One line of pseudocode usually translates as one line of program code. Example of pseudocode algorithm used for input validation. 1 Start conditional loop Get value from user IF value < minimum OR value > maximum THEN Display error message 4 End loop when value > = minimum AND value <= maximum Graphical Design Notation This can be used to describe the overall structure of the proposed program without describing how the programs are solved as with block diagram below. The notation might focus on the flow of control in the software or how data should flow around the system. Each of the above is an example of top-down design. This is where a task is broken into smaller and smaller parts until the sub-tasks are very simple to solve. The process of taking the stages and refining them further is also known as stepwise refinement. Bottom-up design methodology also exists, although it is often considered inefficient or poor practice. Carpet Area Calculator Calculate Floor Area Display Carpet Area Required Get Room Dimensions

10 3 Implementation Language Source of name Used for Ada Logo FORTRAN
This stage involves the coding of the algorithm in a given language. Some factors involved in choosing a language, other than programmer expertise could be: - Type of problem e.g. Prolog in AI - Hardware and software compatibility - Datatypes available - Features and constructs available The table below shows a few programming languages and their uses. Note, there are many more: Language Source of name Used for Ada After Countess Lovelace US Military Systems Logo Greek for “thought” Education FORTRAN FORmula TRANslation Early Scientific Language COMAL Common Arithmetic Language

11 4 Testing Type of Test Data Description Examples Normal data
Testing should be both systematic and comprehensive. Systematic testing is carried out in a methodical manner so that any errors found can be fully documented and the results repeated. Comprehensive testing will cover all possible operational situations and a full range of input data. Test data should cover normal, boundary and out-of-range data. Examples of each type are given below, using whole number percentage data. Type of Test Data Description Examples Normal data Data within expected/normal range 1, 23, 56, 73, 99 Boundary data Data at limit of what is considered normal 0, 100 Out of range data Data outside of expected/normal range -1, 101, X, 2.6 After the program has been written, it is sometimes given to a group of trusted users so that they might try it out under normal working conditions. They can then pass information back to the development team so that they can make adjustments and improvements to the software prior to full release. This is known as beta testing. Acceptance testing must also be carried out to prove to the client that the software is fully implemented.

12 5 Documentation Software Specification Algorithm Structured Listing
A formal specification of the scope of the boundaries of the problem. It often forms part of a legally binding contract between the client and the development team. Algorithm A description of how the problem will be solved. It may be text-based (i.e. pseudocode) or graphical (e.g. structure diagrams or flow charts). Structured Listing A formatted printout of the actual code. It is likely to include line numbers, highlighting of key words (bold, capitals etc) indentation and blank lines (white space). Test Report A list of test data with predicted and actual output. It may also include comments on behaviour of software (memory, processor use, known conflicts etc) User Guide A set of instructions on how to install and use the software. It may include tutorials and FAQs. Technical Guide Includes descriptions of the technical requirements (RAM, disc space etc.) It may also chart the development history, known bugs and fixes, upgrades etc. Evaluation Report A report accompanying the software for the client. It will compare the software to the original specification and comment on the quality of the software according to a number of criteria. See Evaluation section for criteria. Maintenance Report This is a short report detailing the maintenance and confirming that it has been carried out.

13 6 Evaluation Evaluation Criteria Description Robustness Reliability
The evaluation report will state whether the software is fit for purpose, that it does all the tasks defined in the software requirements document. The software is also evaluated in terms of robustness, reliability, portability, efficiency and maintainability: Evaluation Criteria Description Robustness The ability of software to cope with errors during running. This might include NOT crashing when out of range data is entered. Reliability How well the software operates without stopping due to design faults. The software should not crash if the data entered is within acceptable limits, it should also give a correct and predictable output as a result. Portability The ability of software to run on a system other than the one it was designed for. If software is portable, it should require little or no change to enable it to run on the new system. Efficiency The amount of memory and processor time the software uses. Maintainability The ease with which changes can be made to the software. Factors affecting maintainability include: Readability – internal commentary, white space, meaningful variable names Modularity – use of functions or sub-routines Language – Familiar language like VB or C, or something more obscure.

14 7 Maintenance Evaluation Criteria Description Corrective Adaptive
Maintenance is the final stage of the process. It takes place from the point the software has been delivered to the client and may go on for years afterwards. Professional software developers often make more money from maintaining old software than writing new software from scratch! The three types of maintenance are corrective, adaptive and perfective maintenance. Evaluation Criteria Description Corrective Fixes errors not found during the testing stage. The cost of making these changes is the responsibility of the programming team. Adaptive Carried out to adapt the software to a change in its environment. For example to cope with a new operating system or new item of hardware. The costs of this type of maintenance are usually met by the client as it is extra to the original specification. Perfective Carried out to add new features, or make other amendments, requested by the client. As this is also beyond the original specification, the client will usually pay extra for these changes.

15 2 - Software Development Languages & Environments

16 Software Development Languages & Environments
There are several classifications of programming language with which you should be familiar: procedural, declarative, event-driven and scripting languages. Procedural Language This is the type of language that most programmers are familiar with. They are high-level languages that use commands and keywords to describe instructions to the computer. It usually has a sequence of instructions with clearly defined start and end points, with each instruction leading to the next. Examples include PASCAL, TrueBasic, C and COMAL. Declarative Declarative languages are very different from procedural. Programs in these languages are generally a collection of facts and rules which fully describe the problem. The user will then type in a query which the program will compare to the information it knows about and returns an answer which matches the facts it holds. It will find this answer by pattern-matching the query with the stored rules to find out the missing information. Event-driven Event driven languages are similar to procedural languages in the way that the commands work. The difference is the way that applications written using them are designed and run. Program code is tied to buttons or other on-screen objects, and the code is run when the user performs a particular action (e.g. clicking a button or moving the mouse over an object). Scripting Scripting languages are also like procedural languages, but the main difference is where these small programs are used. Scripts are used to automate or extend the functionality of an application. An example of this is the use of VBA in MS Excel, MS Word or MS Access. The script might be activated through a keypress or by clicking a button.

17 Example TrueBasic PRINT “What is your name?” INPUT name$
Procedural Language Example TrueBasic PRINT “What is your name?” INPUT name$ PRINT “Hello “; name$ END

18 Example Prolog male(john). male(frank). parent(john,ruth).
Declarative Language Example Prolog male(john). male(frank). parent(john,ruth). father(X,Y):- parent(X,Y),male(X).

19 Event-Driven Language
Example Visual Basic Dim score as Integer Score = Inputbox(“Enter Higher Computing Score”) Select CASE score Case < 50 Msgbox(“Fail”) Case < 60 Msgbox(“B”) Case < 70 Case ELSE Msgbox(“A”) End select

20 Example Scripting Language VBScript Sub ConvertTemp()
temp = Inputbox(“Enter temp in degrees F.”) Msgbox(“The temp is “ & Celsius(temp) & “ degrees C.” End Sub

21 Compilers Vs Interpreters
There are 2 types of translator program covered in the Higher Computing course: Compilers and Interpreters. Each translator functions differently and has its own advantages and disadvantages. Compilers Compilers take the whole program file (the source code) and translate it, producing a new file (the object code). This new file is in an executable form for the processor on the chosen platform. The main disadvantage is that the code will not run if there are any syntax (grammar) errors in the code. The advantage is that, once translated there is no need for further translation. This means faster execution of the program and no need to load the translator program into RAM. Interpreters Interpreters take the whole program file and translate and execute each line in turn. No object code is produced and the translator program must be present in RAM every time the code is executed. The main disadvantage of an interpreter is that the translator must be present and that each execution will involve translation, slowing the run down! However the interpreter will run all or part of the code even if there are errors in it. Example Loop example in TrueBasic FOR counter = 1 TO 100 PRINT “Hello Bob!” NEXT counter Consider the following example… The compiler translates all of the code before execution and therefore the PRINT statement will be translated once and run 100 times. However, the interpreter does not store the translation but translates and executes each line in turn. Therefore the PRINT statement will be translated 100 times and executed 100 times. That is 99 times more translations that the processor will have to carry out!

22 3 - High Level Programming Language Constructs

23 8 Saints 8.6 True Simple Data Types Integer String Boolean Single
There are several datatypes with which you should be familiar: String Saints Integer 8 Used for positive and negative whole numbers from to 32767 Mainly used for text of almost unlimited length Single 8.6 Boolean True Can store positive and negative numbers with a decimal point Can have 1 of only 2 states True or False

24 String Operations Example String Concatenation
Two operations that can be applied string variables are concatenation and the use of substrings. Example String Concatenation Concatenation is the adding together of two strings. The example opposite will display the word Bobcat on the screen. The add symbol( “+”) can be used in VB to concatenate strings. Dim first, second, whole As String first = "Bob" second = "cat" whole = first + second MsgBox (whole) Example Substrings Substrings are often referred to as string slicing. This is when parts strings are “pulled out” and used. This code sample will display the words “Ruth and John” on the screen. Dim first, second, third, fourth As String first = “Ruthless" second = “St. Johnstone" third = mid$(first,1,4) fourth = mid$(second,5,4) MsgBox (third & “ and ” & fourth)

25 Formatting of Input and Output
Visual Basic contains standard functions to alter the way the text and numbers look on screen. Number = Format/Function Applied Output Int(number) 123 Round(number) Round(number, 2) 123.46 Format(number, ".000") Print Format(number, "000.0") 123.5 Print Format(number, "fixed") Print Format(number, "currency") £123.46 Print Format(number, "percent") % Print Format(number, ".00\s") 123.46s Print Format(number, "\{00.00\}") {123.46} FontSize = 24 Print number

26 Multiple Outcome Selection
To make a decision about which piece of code to execute next, programs may feature selection using IF or CASE. Both options effectively do the same thing, but sometimes the CASE clause is easier to read. Nested IF statements CASE clause If mark >= 70 Then Print "A" ElseIf mark > 60 Then Print "B" ElseIf mark >= 50 Then Print "C" Else Print "Fail" End If Select Case mark Case Is >= 70 Case Is >= 60 Case Is >= 50 Case Else End Select

27 Example of Input Validation Subroutine
Modularity Modularity is a good thing in well-written code because it means that tasks can be divided amongst a team of programmers who each write part of the solution. Another good reason for using modules is that, should you need to change part of the program during the maintenance phase, the affected part can be pulled out and the new one dropped into place. Just like building blocks! Module Libraries A module library contains pre-written and pre-tested sections, or modules, of code. The advantages of using module libraries in the development of your software are: - you do not have to write code for tasks that are already solved - the code will already have been checked for errors - the modules should be well documented Example of Input Validation Subroutine Private Sub CommandButton_Click() Dim num Call get_value(num) Print "Number is " & num End Sub Sub get_value(num) Do num = InputBox("Enter value 1-10") If num < 1 Or num > 10 Then MsgBox ("Try again") Loop Until num >= 1 And num <= 10 .dll files Anyone who uses a PC will be familiar with .dll files. These dynamically-linked libraries are sections of code common to a number of pieces of software. Using these files allows the modules to be used by many programs and is more memory efficient.

28 Local Variables Vs Global Variables
Local variables exist only within a single subroutine and cannot be accessed from elsewhere in the code. Global variables are created in the main part of the program and are accessed from any part of the program. Parameter Passing By VALUE When a parameter is passed by value into a subroutine, an exact copy of the contents of the variable is used by the subroutine. The original variable is not changed by what the subroutine does. 8 8 By Val Main Program Subroutine Parameter Passing By Reference When a parameter is passed by reference into a subroutine, the original variable and its contents are passed and can be changed inside the subroutine. 8 8 By Ref 16 Main Program Subroutine

29 4 - Standard Algorithms

30 Input Validation Linear Search Counting Occurrences Finding Minimum
Standard Algorithms The standard algorithms with which you should be familiar with are: Input Validation Linear Search Counting Occurrences Finding Minimum Finding Maximum

31 Example Input Validation Pseudocode Visual Basic
Asks user to enter a number between 1 and 10 until they input a valid number Pseudocode Visual Basic Start loop Get number between 1 and 10 IF number < 1 or number >10 THEN Display “Invalid Number – Try Again!” END IF End loop when number >=1 and number <=10 DO num = Inputbox(“Enter number between ”) IF num < 1 OR num > 10 THEN Msgbox(“Invalid number – Try Again!”) LOOP UNTIL num >= 1 AND num <= 10

32 Example Linear Search 1 2 3 4 5 Pseudocode Visual Basic Hibs Hearts
United Saints Aberdeen myarray Searches for “Saints” in a list and displays appropriate message Pseudocode Visual Basic Set target to “Saints” Set position to 1 Set found to False Loop while Found is False and Not end of array IF current element of array = target value THEN Set found to True Display position END IF Add 1 to position End loop IF found is NOT True THEN Display “Not found” message target = “Saints” position = 1 found = False Do While found = False AND position <= 5 IF myarray(position) = target THEN found = True Msgbox(target & “ found at position “ & position) position = position + 1 Loop IF found <> True THEN Msgbox(target & “ does not appear in list”)

33 Example Count Occurrences 1 2 3 4 5 Pseudocode Visual Basic Saints
United Aberdeen myarray Counts number of times “Saints” appears in the list Pseudocode Visual Basic Set target to “Saints” Set counter to 0 For each element in the array IF current element = target value THEN Add 1 to counter END IF Next element Display value of counter target = “Saints” counter = 0 For element = 1 to 5 IF myarray(element) = target THEN counter = counter + 1 Next Msgbox(target & “ appears ” & counter & “ times”)

34 Example Find Minimum 1 2 3 4 5 Pseudocode Visual Basic 19 12 17 11 23
myarray Finds and displays the value of the lowest number in a list Pseudocode Visual Basic Set lowest to first element For each element in the array IF current element < lowest THEN lowest = current element END IF Next element Display lowest value lowest = myarray(1) For element = 2 to 5 IF myarray(element) < lowest THEN lowest = myarray(element) Next Msgbox(“ The lowest value is ” & lowest)

35 Example Find Maximum 1 2 3 4 5 Pseudocode Visual Basic 19 12 17 11 23
myarray Finds and displays value of the highest number in a list Pseudocode Visual Basic Set highest to first element For each element in the array IF current element > highest THEN highest = current element END IF Next element Display highest value highest = myarray(1) For element = 2 to 5 IF myarray(element) > highest THEN highest = myarray(element) Next Msgbox(“ The highest value is ” & highest)

36


Download ppt "Software development."

Similar presentations


Ads by Google