DITEC - Software Engineering

84
Diploma in Information Technology Module VII: Software Engineering Rasan Samarasinghe ESOFT Computer Studies (pvt) Ltd. No 68/1, Main Street, Pallegama, Embilipitiya.

Transcript of DITEC - Software Engineering

Page 1: DITEC - Software Engineering

Diploma in Information Technology

Module VII: Software Engineering

Rasan SamarasingheESOFT Computer Studies (pvt) Ltd.No 68/1, Main Street, Pallegama, Embilipitiya.

Page 2: DITEC - Software Engineering

Contents1. What is software?2. Software classification3. Attributes of Software4. What is Software Engineering?5. Software Process Model6. Waterfall Model7. Prototype Model8. Throw away prototype model9. Evolutionary prototype model10. Rapid application development11. Programming styles12. Unstructured programming13. Structured programming14. Object oriented programming15. Flow charts

16. Questions17. Pseudo codes18. Object oriented programming19. OOP Concepts20. Inheritance21. Polymorphism22. Encapsulation23. Generalization/specialization24. Unified Modeling Language25. Class Diagrams26. Use case diagrams27. Software testing28. Black box testing29. White box testing30. Software documentation

Page 3: DITEC - Software Engineering

What is software?

A software is a collection of instructions that enables a user to interact with the computer or have the computer perform special task for them.

Page 4: DITEC - Software Engineering

Software classification

• System Software– Directly controlling the hardware resources and

supports the operation of application software.

• Application Software– Serves the user requirements in a particular

application domain.

Page 5: DITEC - Software Engineering

Software classification

• Generic Software (off the shelf)– Available on open market to any customer who is

able to buy it.

• Custom Software (bespoke)– Developed specially for a customer requirement.

Page 6: DITEC - Software Engineering

Generic Software vs Custom Software

Less expensiveMore reliableImmediate installationMore user friendlyUser requirements are not completely satisfiedCannot accommodate future changes

More expensiveLess reliableDelay due to high development timeLess user friendlyCompletely satisfiedCan easily accommodate future changes

Generic Software Custom Software

Page 7: DITEC - Software Engineering

Attributes of Software

• Maintainability• Dependability• Efficiency• Usability• Security• Reliability• Robustness• Customizability• Scalability• Accessibility• Extensibility

Page 8: DITEC - Software Engineering

What is Software Engineering?

Software engineering is concerned with application of theories, methods and tools to develop and maintain software systems that behave reliably and efficiently, are affordable to develop and maintain, and satisfy all the requirements that customers have defined for them.

Page 9: DITEC - Software Engineering

Software Engineering Process ModelA software process model is a set of predicted procedures or set of stages to be use to develop a fully tested software system timely.

Software Process Model

Page 10: DITEC - Software Engineering

• Waterfall model• Prototyping model• Rapid application development model• Spiral model• V-model• Join application development model• Incremental development model

Software Process Models

Page 11: DITEC - Software Engineering

Waterfall Model

Page 12: DITEC - Software Engineering

Waterfall Model

• A linear sequential development model.• Because of the cascade form one stage to another it

is known as waterfall model.• Divided project activities into isolated stages and

each stage should complete before next started.• Concurrent activities are not possible.• Need to wait until end of the life cycle to see the

outcome.• Suitable for develop systems which has stable

requirements.

Page 13: DITEC - Software Engineering

Waterfall Model Stages

Stage 1: Requirement Definition

• The system services, constraints and goals are established by consulting with the system users.

• They are define in a manner which is understandable by both users and the development staff.

Page 14: DITEC - Software Engineering

Waterfall Model Stages

Stage 2: System and Software designing

• Partitions the requirements either hardware or software.

• Involves representing the software system functions in a form that may be transformed into executable programs.

• Identifying and describing fundamental software system abstraction and there relationships.

Page 15: DITEC - Software Engineering

Waterfall Model Stages

Stage 3: Implementation and unit testing

• Implementation consists of converting the physical designing into set of actual programs and a set of database tables.

• The software is realized as a set of programs or program units.

• Unit testing involves verifying that each unit meets it’s requirements.

Page 16: DITEC - Software Engineering

Waterfall Model Stages

Stage 4: integration and system testing

• Individual program units are integrated and tested as a complete system.

• Ensure the software requirements have been met.

• After testing the software system is delivered to the customer.

Page 17: DITEC - Software Engineering

Waterfall Model Stages

Stage 5: Operation and maintenance

• The system installed and put into practical use.• Involved correcting errors which were not

discovered in earlier stages.• Improving implementation as new

requirements are discovered.• Normally this is the longest life cycle phase.

Page 18: DITEC - Software Engineering

Extended Waterfall Model

• Due to the above discussed disadvantages, the waterfall model was modified with the concept of backtracking.

• As a result, the Extended Waterfall Model introduced.

Page 19: DITEC - Software Engineering

Extended Waterfall Model

Page 20: DITEC - Software Engineering

Prototype Model

Prototype is a working model of the actual System

There are two types of prototype model.

1. Throw away prototype model2. Evolutionary prototype model

Page 21: DITEC - Software Engineering

Throw away prototype model

Page 22: DITEC - Software Engineering

Throw away prototype model

• Prototype is use to gather requirements and there after it will be thrown away.

• Further designing, construction and implementation will be done using the normal life cycle stages.

• Requirements gathering can be exactly done by using the prototype

• Even to develop prototype consumes lot of time and effort , therefore once a prototype is thrown away it’s a waste of time and money.

Page 23: DITEC - Software Engineering

Evolutionary prototype model

System Complete

System Architecture

Identify Prototype Quick Design

Construct And Use The

System

Revise Prototype

Deliver System

Yes

No

Page 24: DITEC - Software Engineering

Evolutionary prototype model

• Prototype is use to gather requirements and it will become the final system.

• Both the prototyping process as well as the development process will be combine together.

• Prototype will not be thrown away and it is not wasting effort and cost like throw away prototype.

Page 25: DITEC - Software Engineering

Rapid Application Development (RAD)

Page 26: DITEC - Software Engineering

Rapid application development model (RAD)• This is a software process model which uses to

develop applications rather quickly.• The entire system is broken down into several

manageable stages and each stage analyzed, designed, developed, tested and implemented simultaneously

Rapid Application Development (RAD)

Page 27: DITEC - Software Engineering

Stages in the RAD

1. Business modeling• The information flow among business functions

is modeled.• Find answers for the following questions:

What information drives the business process?What information is generated?Who generate it?Where does information go?Who process it?

Page 28: DITEC - Software Engineering

Stages in the RAD

2. Data modeling• The information flows are refined into set of

data objects.• The attributes of each objects and

relationships between these objects defined.

Page 29: DITEC - Software Engineering

Stages in the RAD

3. Process modeling• The data objects are transformed to achieve

the information flow necessary to implement the business function.

• Processes are created for adding, modifying, deleting and retrieving data objects.

Page 30: DITEC - Software Engineering

Stages in the RAD

4. Application generation• Using fourth generation techniques rather

than using conventional third generation programming languages.

• In possible cases automated tools/reusable components are use to facilitate construction of the software. (Ex: DB query tools, reports, graphics manipulation, interface designs)

Page 31: DITEC - Software Engineering

Stages in the RAD

5. Testing and turnover• Since the RAD process use many reusable

components that have been tested, it reduces the overall testing time.

• How ever the new components should be tested.

Page 32: DITEC - Software Engineering

Programming Styles

There are 3 main programming styles

1. Unstructured Programming2. Structured Programming3. Object Oriented Programming

Page 33: DITEC - Software Engineering

Unstructured Programming

• Unstructured programming is the historically earliest programming paradigm.

• It is a procedural program, the statements are executed in sequence as written.

• This type of programming uses the goto statement. A goto statement allows control to be passed to any other place in the program.

• Difficult to understand the logic of the program.

Ex: Machine language, Cobol

Page 34: DITEC - Software Engineering

Structured Programming

• Structured programming is a subset of procedural programming that enforces a logical structure to make it more efficient and easier to understand and modify.

• Use of the goto statement is discouraged. • Structured programming using 3 controls constructs:

– Sequence– Selection– repetition

Ex: C, Pascal, Ada

Page 35: DITEC - Software Engineering

Object Oriented Programming

• Object-oriented programming (OOP) is a programming model organized around objects rather than actions and data rather than logic.

• It is becoming more popular as a designing technique, because it has an ability to represent complex relationships, data and data processing with suitable notations.

Ex: Java, C++, C#

Page 36: DITEC - Software Engineering

Flow Charts

A flowchart is a diagrammatic representation of the process involved in arriving at a solution to a problem.

Page 37: DITEC - Software Engineering

Flow Chart Notations

Start / End of the program

Input / Output

Process

Decision / Repetition

Flow

Connector

Page 38: DITEC - Software Engineering

Flow Charts

• Question 1:Draw a flowchart to develop a program to input the student index number, name and total marks scored in three modules and display the students index number, name and average marks on the screen.

Page 39: DITEC - Software Engineering

Flow Charts

• Question 2:Draw a flowchart to develop a program to input student number, name, module 1 marks and module 2 marks and display student number, name, average marks and total marks.

Page 40: DITEC - Software Engineering

Flow Charts

• Question 3:A student has sat for an exam and following details were entered through the keyboard: student number, name, and average marks.If he average is greater than 50 student will be graded as “Pass” otherwise graded as “Fail”. Draw a flowchart to display the student name, average and grade.

Page 41: DITEC - Software Engineering

Flow Charts

• Question 4:Draw a flowchart to input two numbers from the keyboard and evaluate and display the maximum value.

Page 42: DITEC - Software Engineering

Flow Charts

• Question 5:Draw a flowchart to develop a program to input student no, name, module 1 marks and module 2 marks by keyboard. Calculate and display student no, average and the grade. The grading system is as follows. Average > 75 grade is “distinction”, 50 - 75 grade is “credit”, 25 - 50 grade is “Pass” and less than 25 is “Fail”.

Page 43: DITEC - Software Engineering

Flow Charts

• Question 6:Draw a flowchart to calculate and display the sum of first five natural numbers.

Page 44: DITEC - Software Engineering

Flow Charts

• Question 7:Draw a flowchart to input a number from keyboard, and there after calculate and display the factorial number.

Page 45: DITEC - Software Engineering

Pseudo Codes

Pseudo code consists of short, English phrases used to explain specific tasks within a program's algorithm. Pseudo code should not include keywords in any specific computer languages. It should be written as a list of consecutive phrases.

Page 46: DITEC - Software Engineering

Pseudo Codes

One of the concepts in programming is…

PROGRAM = DATA + ALGORITHM

Data Data types: String, Integer, Real Data usage: Variable, Constant Data scope: Global data, Local data

Algorithm Sequence Selection Repetition

Page 47: DITEC - Software Engineering

Object Oriented Programming

• Object-oriented programming (OOP) is a programming language model organized around objects rather than actions and data rather than logic.

• Object oriented programming becoming more popular as a designing technique, because it has an ability to represent complex relationships, data and data processing with suitable notations.

Page 48: DITEC - Software Engineering

Object Oriented Programming

Male Female

SonFather Mother Daughter

Family system

Objects

Page 49: DITEC - Software Engineering

Object and Class

An object is person, place or thing which consist of data and behaviors. The data of an object is its properties (attributes) and behaviors represent how an object acts and reacts.

A class is simply a representation of a type of object. It is the blueprint / template that describe the details of an object. Class is composed of three things: a name, attributes, and operations.

Page 50: DITEC - Software Engineering

Object Instance

Object instance is uniquely identified occurrence of an object

Book

Book_idTitleAuthor

LendingReservationReading

Book

001 – ASciencePeter

LendingReservationReading

Object instance

Page 51: DITEC - Software Engineering

Object Oriented Programming Concepts

Inheritance Polymorphism Encapsulation Generalization Specialization

Page 52: DITEC - Software Engineering

Inheritance

Inheritance is sharing of attributes and operations among classes based on a hierarchical relationship.

Vehiclev-noModelcolorDriveStop

Busv-noModelcolor

DriveStop

Carv-noModelcolor

DriveStop

Super class operations and attributes are inherited to the sub classes

Page 53: DITEC - Software Engineering

Polymorphism

• Polymorphism is simply the ability for an object behaves differently depending on its type.

• Ex: both cat and dog are animals which has the same method called makeNoise(). But they are making noise in different ways.

Page 54: DITEC - Software Engineering

Polymorphism

Page 55: DITEC - Software Engineering

Encapsulation

• According to encapsulation attributes and operations are encapsulated (hidden) within the object.

• The outside world know what the object can do but don’t know how it does or where data is stored. These features are hidden from the user.

Page 56: DITEC - Software Engineering

Generalization / Specialization

Generalization and specialization both refer to inheritance but the approach in which they are implemented are different.

If many similar existing classes are combined to form a super class to do common job of its subclass, then it is known as Generalization.

If some new subclasses are created from an existing super class to do specific job of the super class, then it is known as Specialization.

Page 57: DITEC - Software Engineering

Generalization / SpecializationVehicle

v-noModelColorDriveStop

Motorbike

v-noModelcolorDriveStop

Car

v-noModelColorAirbagDriveStopReverse

Specialization

Generalization

Car and Motorbike specialize Vehicle to their own sub-type.

Vehicle Generalize what is common between Car and Motorbike

Page 58: DITEC - Software Engineering

Unified Modeling Language (UML)

• UML is a general purpose visual modeling language to visualize, specify and document software systems.

• The most important goal for developing UML is to define some general purpose modeling language which all modelers can use and it also needs to be simple to understand and use.

Page 59: DITEC - Software Engineering

Unified Modeling Language (UML)

• Class Diagrams• Use Case Diagrams

Page 60: DITEC - Software Engineering

Class Diagrams

• A class diagram shows the static structure of an object oriented model.

• Also it shows object classes and their internal structures (attributes and operations) and their relationships.

Page 61: DITEC - Software Engineering

Class Diagrams

StudentNameAddressPhone

DisplayAddEditDelete

Class Name

Attributes

Operations

Structure of a Class

Page 62: DITEC - Software Engineering

Relationships

• Association• Aggregation• Composition• Generalization

Page 63: DITEC - Software Engineering

Association

• An association is a relationship among classes or objects.

• Ex: Student follows Course, Lecturer teaches Student, Manager manages company.

manager company

Page 64: DITEC - Software Engineering

Aggregation

• When an object has an another object, then you have got an aggregation between them.

• Ex: Library has Students

Student Library

Page 65: DITEC - Software Engineering

Composition

• When an object contains the other object, if the contained object cannot exist without the existence of container object, then it is called composition.

• Ex: University consist from Buildings, Shirt consist from Collar, buttons, etc.

Page 66: DITEC - Software Engineering

Generalization

Person

Employer Customer

Page 67: DITEC - Software Engineering

Multiplicity

Multiplicity indicates the number of instance of one class linked to instance of another class.

One to One1 1

One to Many1 *

Many to Many* *

Page 68: DITEC - Software Engineering

A Sample Class Diagram

A sample class diagram

Page 69: DITEC - Software Engineering

Use Case Diagrams

A use case diagram is a graphical representation of a user's interaction with the system.

The purpose of use case diagram is to capture the dynamic aspect of a system.

Page 70: DITEC - Software Engineering

Use Case Diagram Notations

Actor

Use Case

Communication Extend/include

System Boundary

Page 71: DITEC - Software Engineering

A Sample Use Case Diagram

Page 72: DITEC - Software Engineering

A Sample Use Case Diagram

Page 73: DITEC - Software Engineering

Software Testing

• The objective of testing is uncover errors in a program as much as possible

• In testing a series of steps such as – Unit Testing– Integration Testing– Validation Testing– System Testing

Are planned and executed…

Page 74: DITEC - Software Engineering

Unit Testing

Unit Testing focuses verification effort of the smallest unit of the software component or module.

Page 75: DITEC - Software Engineering

Integration Testing

Verifies the incorporation of components into a program structure.

Page 76: DITEC - Software Engineering

Validation Testing

Validation Testing is testing traceability to the software requirements.

Page 77: DITEC - Software Engineering

System Testing

Validates software once it has been incorporated into a large system. (hardware, people, information)

Page 78: DITEC - Software Engineering

Testing Approaches

There are two main testing approaches

1. Black Box Testing2. White Box Testing

Page 79: DITEC - Software Engineering

Black Box Testing

• The program is considered as a black box which the internal logic is cannot seen by the testers.

• The expected output is checking against the input given to the program.

Page 80: DITEC - Software Engineering

White Box Testing

• Program is assumed as a transparent box where the internal logic is seen by the testers.

• The flows of every logical pathway are tested in a systematic approach.

Page 81: DITEC - Software Engineering

Software Documentation

Documentation are two types

1. Documents for programmers2. Documents for users

Page 82: DITEC - Software Engineering

Documents for Programmers

• InternalUsed in coding– Meaningful names for variables– Comments– Using standard style and format

• ExternalThese are the documents which carried out by designers, analysts and programmers to communicate– Requirements Specification – Design Specification– Feasibility Report

Page 83: DITEC - Software Engineering

Documents for Users

There are user manuals which is giving instructions and support for end users for using the software systems.

Explaining the purpose of the systemDetailed, descriptions and examples by screen

shots.Step by step guide for operating the systemTroubleshooting support

Page 84: DITEC - Software Engineering

The End

http://twitter.com/rasansmn