ditec - software engineering
TRANSCRIPT
Diploma in Information Technology
Module VII: Software Engineering
Rasan SamarasingheESOFT Computer Studies (pvt) Ltd.No 68/1, Main Street, Pallegama, Embilipitiya.
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
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.
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.
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.
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
Attributes of Software
• Maintainability• Dependability• Efficiency• Usability• Security• Reliability• Robustness• Customizability• Scalability• Accessibility• Extensibility
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.
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
• Waterfall model• Prototyping model• Rapid application development model• Spiral model• V-model• Join application development model• Incremental development model
Software Process Models
Waterfall Model
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.
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.
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.
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.
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.
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.
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.
Extended Waterfall Model
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
Throw away prototype model
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.
Evolutionary prototype model
System Complete
System Architecture
Identify Prototype Quick Design
Construct And Use The
System
Revise Prototype
Deliver System
Yes
No
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.
Rapid Application Development (RAD)
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)
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?
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.
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.
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)
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.
Programming Styles
There are 3 main programming styles
1. Unstructured Programming2. Structured Programming3. Object Oriented Programming
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
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
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#
Flow Charts
A flowchart is a diagrammatic representation of the process involved in arriving at a solution to a problem.
Flow Chart Notations
Start / End of the program
Input / Output
Process
Decision / Repetition
Flow
Connector
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.
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.
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.
Flow Charts
• Question 4:Draw a flowchart to input two numbers from the keyboard and evaluate and display the maximum value.
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”.
Flow Charts
• Question 6:Draw a flowchart to calculate and display the sum of first five natural numbers.
Flow Charts
• Question 7:Draw a flowchart to input a number from keyboard, and there after calculate and display the factorial number.
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.
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
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.
Object Oriented Programming
Male Female
SonFather Mother Daughter
Family system
Objects
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.
Object Instance
Object instance is uniquely identified occurrence of an object
Book
Book_idTitleAuthor
LendingReservationReading
Book
001 – ASciencePeter
LendingReservationReading
Object instance
Object Oriented Programming Concepts
Inheritance Polymorphism Encapsulation Generalization Specialization
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
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.
Polymorphism
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.
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.
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
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.
Unified Modeling Language (UML)
• Class Diagrams• Use Case Diagrams
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.
Class Diagrams
StudentNameAddressPhone
DisplayAddEditDelete
Class Name
Attributes
Operations
Structure of a Class
Relationships
• Association• Aggregation• Composition• Generalization
Association
• An association is a relationship among classes or objects.
• Ex: Student follows Course, Lecturer teaches Student, Manager manages company.
manager company
Aggregation
• When an object has an another object, then you have got an aggregation between them.
• Ex: Library has Students
Student Library
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.
Generalization
Person
Employer Customer
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* *
A Sample Class Diagram
A sample class diagram
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.
Use Case Diagram Notations
Actor
Use Case
Communication Extend/include
System Boundary
A Sample Use Case Diagram
A Sample Use Case Diagram
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…
Unit Testing
Unit Testing focuses verification effort of the smallest unit of the software component or module.
Integration Testing
Verifies the incorporation of components into a program structure.
Validation Testing
Validation Testing is testing traceability to the software requirements.
System Testing
Validates software once it has been incorporated into a large system. (hardware, people, information)
Testing Approaches
There are two main testing approaches
1. Black Box Testing2. White Box Testing
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.
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.
Software Documentation
Documentation are two types
1. Documents for programmers2. Documents for users
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
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
The End
http://twitter.com/rasansmn