Many of the images and tables used in this document have been taken from Object Oriented Software Engineering by Yogesh Singh,Ruchika Malhotra. Please support their efforts by buying a copy here.
It consists of two terms – object oriented, and software engineering.
It is a collection of information that itself act as a singular entity. It allows the user to focus completely on the task rather than on the tools.
For example – C++, etc.
With the help of this, reusability as well as abstraction is possible.
The necessity of developing a maintaining a large-size, complex, and varied functionalities software system has caused us to look for new approaches of software design and development.
The conventional approaches like Waterfall Model may not be very useful due to non-availability of iterations, no provision of reuse, and difficulty in incorporating changing requirements.We may also build every software system from scratch that results into a costly software system, including very high maintenance cost.
An object oriented approach may address such issues, that’s why it has become very popular in designing,developing, and maintaining large size software systems. Object oriented approach’s modelling ability helps us to represent the real world situations and visualize them.
It is a profession dedicated to designing, implementing and modifying so that the software is more affordable, maintainable, faster to build, and high quality.
OR
The establishment and use of some engineering principles in order to obtain economically developed software that is reliable and works efficiently on real machines.
It is a combination of programs, documentation and operating manual.
A certain set of instructions that are written for a specific purpose. It may contain statements to enhance the readability of the program.
Documentation is created and used during development. It is used to explain the code, what it does, and why it has been coded in a certain way.
Explains to the customer how the software is to be used. It is delivered along with the software to the customer, at the time of release.
The use of use cases was introduced in Object Oriented Methodology.
Bathtub and software curve bs
A class represents a template for different objects and describes how these objects are structured internally. Objects of the same class have the same definition, both for the operations, and for the information structures.
OR
It is a collection of objects and it doesn’t take any space in memory. It is also called a blueprint, or a logical entity.
There are two types:
Pre-defined
Their logic is already written somewhere, and we can use it by importing. For example - Scanner, Console, etc. in Java
User-defined
The logic for these classes is defined by the programmer.
Fundamental entities used to model any system. Anything and everything can be an object. It contains data(attributes) and operations(behaviors).
The wrapping up of data and functions into a single unit. It is also known as information hiding concept.
Data is hidden from the outside world. The only way to get and modify the data is through operations that are meant to operate on that data. This helps in minimizing impact of changes in the program.
Deriving a new class from existing class in such a way that the new class can access all the features and properties of the existing class.
The existing class is called parent class, super class, base class. The new class is called child class, subclass, derived class.
The ability of an instruction,message,etc. to take many forms in an object oriented system is called polymorphism.
Sender of a stimulus (message) doesn’t need to know the receiver’s class. The receiver can belong to an arbitrary class.
Achieved through function overriding.
For eg - Superclass OutputDevice, with Subclasses Printer and Monitor. Both have a function called ShowData(). Both implement it differently, and a program calling obj.ShowData() doesn’t need to know whether obj is a Printer or Monitor. As long as it is an OutputDevice, the program can call the function. The behaviour of the function depends on which subclass is being used.
Hiding of complexity of data and operations. Irrelevant details are hidden and important details are amplified to the outside world.
The major phases of software development using the object oriented methodology are:
Object Oriented Analysis
In this stage, problem is formulated. User Requirements are identified and then a model is built, based upon real world objects.
The analysis produces models on how the desired system should function and how it must be developed.
The models do not include any implementation details, so that it can be understood by any non-technical application expert.
Object Oriented Design
Object Oriented Design includes two main stages.
System Design
In this stage, the complete architecture of the desired system is designed. The system is conceived as a set of interacting subsystems, that in turn are composed of a hierarchy of interacting objects, grouped into classes.
System Design is done according to both the system analysis model, and proposed system architecture.
Here, the emphasis is on the objects comprising the system, rather than the processes in the system.
Object Design
In this phase, a design model is developed based on both the models in the system analysis phase and the architecture designed in the system design phase.
All the classes required are identified. The designer decides where
The new classes are to be created from scratch.
Any existing classes can be used in their original form,or
New classes should be inherited from the existing classes.
The associations between the identified classes are established and the hierarchy of the classes are identified.
Besides this, the developer designs the internal details of the classes, and their associations, i.e, the data structure for each attribute, and the algorithm for the operations
Object Oriented Implementation + Testing
In this stage, the design model developed in the object design is translated into code in an appropriate programming language or software tool. The databases are created and the specific hardware requirements are ascertained. Once the code is in shape, it is tested using different techniques in order to identify and remove errors from the code.
Known as Object Oriented Analysis
Known as Object Modelling Technique (OMT)
Analysis Phase
Classes and inheritance relationships are extracted from problem statement.
Identifies states and events in classes identified by object model.
Depicts functionality of the system by creating data flow diagrams.
Sys Design - HLD is developed taking implementation env., including DBMS,etc. into account.
Object Design - Objects are defined in detail. Algorithms and operations defined.
Implementation
Object Oriented Design - Combines analysis, design and implementation. Iterative and incremental.
High Level Process
Lower level process.
OOSE methodology, 5 models:
Object oriented modelling - constructing visual models based on real world objects - Helps in understanding problems and developing documents and producing code. - Well understood requirements, robust designs, etc, etc.
Most popular methodologies - OOD (Booch), OMT (Rumbaugh), OOSE (Jacobson). All were combined into Unified Modelling Language (UML).
Traditional | OO |
---|---|
The system is viewed as a collection of processes. | The system is viewed as a collection of objects. |
Data flow diagrams, ER diagrams, data dictionary and structured charts are used to describe the system. | UML models including use case diagram, class diagram, sequence diagrams, component diagrams, etc. are used to describe the system. |
Reusable source code may not be produced. | The aim is to produce reusable source code. |
Data flow diagrams depicts the processes and attributes. | Classes are used to describe attributes and functions that operate on these attributes. |
It follows a top-down approach for modelling the system. | It follows a bottom-up approach for modelling the system. |
It is non-iterative. | It is highly iterative. |
Software Process Framework is a foundation of complete software engineering process. It includes all the umbrella activities.
A generic process framework consists of 5 activities:
Communication
Requirement Gathering, extensive communication with customer
Planning
We discuss the technical related tasks, work schedule, risks, and required resources
Modelling
It is about building representations of things in the real world.
In modelling, a product’s model is created in order to better understand requirements
Construction
In SE, construction is the application of set of procedures that are needed to assemble the product. In this activity, we generate the code and test the product in order to maintain better product.
Deployment
In this activity, a complete or a non-complete product or software, are presented to the customers to evaluate, and give feedback.
On the basis of their feedback, we modify the products to supply a better product.
Umbrella Activities are a set of steps or procedures that the SE team follows to maintain the progress, quality, change and risk of the overall development task.
SE is a collection of 4 related steps. These steps are presented or accessed in different approaches, in different software process models.
These steps of umbrella activities will evolve through the phases of the generic view of SE.
Software Project Tracking and Control
Before the actual development begins, a schedule for development of the software is created. Based on that schedule, the development will be done.
However, after certain period of time, it is required to review the progress of the development and to find out the actions which are in need to be taken to complete the development,testing etc.
The outcome of the review may require the software development to be rescheduled.
FTR (Formal Technical Review)
SE is done in clusters or modules. After completing each module, it is good practice to review the completed module and find out and remove errors so that the next module can be prevented.
SQA
The quality of software, such as UX, performance, load handling capacity, etc. should be tested, and make sure it matches predetermined milestones.
This reduces the task at the end of the development process. It should be conducted by dedicated teams so that the development can keep going on.
SCM (Software Config Mgmt)
It’s a set of activities designed to control change by identifying the work products that are likely to change and establish relationships among them.
Defining mechanisms for managing different versions of these work products.
Document Preparation and Production
All the project planning, and other activities, should be documented properly.
Reusability Management
This includes the packing up of each part of the software project. They can be connected, or any kind of support can be given to them, later to update or upgrade the software at user demand or time demand.
Measurement and Metrics
This will include all the measurement of every aspect of the software project.
Risk Management
It is a series of steps that helps a software team to manage and understand uncertainty. It’s a really good idea to identify, assess, estimate its impact, estimate probability of threats, and establish a plan for what to do in case the problem actually occurs.
Often combined in Object Oriented Analysis.
Advantages
Disadvantages
Advantages
Disadvantages
Waterfall stages in many cycles
Risk-based.
Agile methodology:
Difference btw Conventional and OOP SDLCs
Conventional | OO | |
---|---|---|
Methodology | Functional, process driven | Object Driven |
Requirement | DFD, ER, Data dictionary | Use-case approach |
Analysis | DFD, ER, Data dictionary | Object identification and description, attribute and function determination |
Design | Structure chart, flowchart, pseudocode | Class Diagram, Sequence Diagram, Object Diagram, UML |
Implementation & Test | Implement process, functions | Implement objects and interactions among objects. |
Documentation | Many documents at the end of each stage | Document may or may not be produced at the end of each stage |
Describes the process in terms of roles, activities, artifacts,disciplines and workflows.
Who(roles) does what (artifacts), when (workflows), and how(activities).
Roles perform activities to produce artifacts.
Roles - Manager, Analyst, Tester, Developer, Designer.
Activities - Review Requirement, Generate use case, Define class, Prepare test plan.
Artifacts - SRS, Use case model, Class model, Design document, Source code, Test plan, user manual.
Organized along time. It has 4 phases.
These 4 phases run iteratively. Each iteration produces a new version of the software.
Essential Activities:
Artifacts produced:
Essential Activities:
Artifacts produced:
Essential Activities:
Artifacts produced:-
Artifacts produced:
A requirement is defined as a condition or capability to which a system must conform. It describes the “what” of the system, not “how”.
Every person who is affected by the system (directly or indirectly) is a stakeholder.
This can be both customers and users. Customers are those who ask for the software to be developed, request changes, approve the software, and also pay for the system. Users are those who use the system after it has been deployed. Customer’s preferences are given more importance compared to user.
Includes consultants, domain experts, maintenance people, etc.
Everyone involved in the development of the system - developers, programmers, testers, project managers, graphic designers, etc.
Any external people involved in the development of the software. Domain experts, consultants, third party testers, etc.
Techniques to understand what exactly the customer wants, i.e, to translate vague wants of customers into concrete requirements that can be formalized and written down.
Easy and simple technique
Can be formal or informal (Structured/non-structured)
Informal has free flow of discussion.
A questionnaire may be given to the stakeholders before the interview. We can ask any questions in the questionnaire, and get clarifications and remove ambiguities during the interview.
Based on discussion with each stakeholder, we prepare a list of requirements of each stakeholder
We then combine all the captured requirements , remove redundancies, inconsistencies and ambiguities.
Each member needs to create the following things
Used in the following way
For e.g, a student returns a book to the library. It is possible that the book is late. In that case, we will need to calculate the fine for the book. Therefore, the Return Book use case will be extended by Calculate Fine Use case.
Repeated functionalities in many use cases can be modelled into include relationship, using a singe use case.
For e.g, many use cases may require the Print function, so it can be converted into a separate use case and included in the other use cases.
Should contain :
Scenario is a particular path through the use case. In scenario diagrams:
Identifies and defines the real world objects that are involved in interaction with the system.
Class is a collection of objects with common attributes and operations. It is a template that groups attributes and operations together.
Name and Description | Notation |
---|---|
Association is a structural connection, usually bidirectional. Shows that two classes are linked in some way. May also have a name associated with it. For e.g, IssueBookController manages Transaction. manages is an association with a name. | |
Aggregation shows a whole-part relationship, i.e, class B is part of class A. E.g - Book is part of Library. In the notation, the diamond should represent the library, i.e, the whole part. | |
Composition is strong aggregation. In composition, class B is part of Class A, and only Class A. It cannot belong to another class, say C. In aggregation, a class can belong to/be part of 2 classes. For e.g, book can be part of Library as well as Computer Department. But Computer Department can belong to only one University. | |
Dependency - represents that a class depends on another class. Unidirectional. It means that one class is affected by changes in the other class, because it uses that class. If class A depends on class B, we show dependency through a dotted arrow from A to B. | |
Generalization - Relationship between parent and child class. Represents inheritance (is a) relationships. For example, Professor is an Employee, SecurityGuard is an Employee, Clerk is an Employee, etc. Represented by an arrow from child class towards parent class. |
Class diagrams should contain details about each classes as well as the relationships between them. For each class, we need to write:
Objects are shown in rectangles.
Lifetime/Lifeline of the object goes down along the y-axis. It represents the amount of time the object is alive in the use case.
Focus of control is represented by a vertical rectangle. It shows the time period for which an object is performing a specific event. An object may have multiple such focuses of control during the use case.
Messages are information or commands passed from one object to another. They are represented using arrows.
Simple Messages are interactions that may not be a procedure call.
Synchronous Messages are those in which the sending object waits for a response from receiving object.
Asynchronous Messages are those in which the sender doesn’t wait for a response.
Procedure call - Method call
Return Message - Return value for an incoming message. It’s not necessary that a message always has a return message.
Centralized | Decentralized |
---|---|
Controlling object responsible for flow of messages and order of events. | Participating objects can communicate with each other without any controlling object. |
Better because any change means only controller needs to be changed. | Better when messages are strongly coupled with each other. |
Allows new operations to be added easily | |
Parts of functionality can be reused | |
Extended use cases can also be added to sequence diagrams easily.
They are similar to sequence diagrams. Objects are shown as rectangles, and actors using stick figures. Classes are shown using the representation for that particular type of class (entity, interface,control).They don’t show events being time ordered. Messages are shown using arrows. Objects that interact with each other are connected by links (straight lines). One link can be used to pass many messages.
The time for which the object is alive, or till when it’s participating in some event, is not shown.
Events are ordered using numbers written next to the message.
Return messages are shown using dotted arrows.
Consists of the following steps.
We create a table for our system. It includes:
For example,
We create a detailed design for each class separately. It should include:
It is a five step process
For each test case, we need to show:
When we get to step 5 (assigning actual values), the input state (Valid/invalid) is replaced with actual values.
On running the test, we also add another column - Actual Output. This should be the same as the Expected Output.
For e.g, for the use case issue book:
This is the scenario diagram. Scenario matrix will be as shown:
Test Case Matrix will be as shown:
Putting actual values, it will look like:
Testing is the process of executing a program with the intent of finding faults. It’s the process of verifying the outcomes of every phase of development and validating the program by executing it with the intention of finding faults.
Verification | Validation |
---|---|
Process of reviewing documents and programs with the intention of finding faults. | Process of evaluating a system at the end of development to see if it satisfies the requirements. |
Static Testing | Dynamic testing |
Program Not Executed | Program is executed |
Inspections, walkthroughs, reviews. | Black/White box testing, non-functional testing |
Before validation | After verification |
Prevention of Errors | Detection of Errors |
Are we building the product right? | Are we building the right product |
About the process | About the product. |
Checklist contains important information that a particular document must contain. We can verify the document against our checklist.
It helps identifying duplicate information, missing information, and wrong information.
Every document may have a different checklist.
E.g.
etc.
For e.g, for two inputs \(100 \le a \le 1000\) and \(200 \le b \le 1200\), boundary value test cases are:
S.No | a | b |
---|---|---|
1 | 100 | 700 |
2 | 101 | 700 |
3 | 550 | 700 |
4 | 999 | 700 |
5 | 1000 | 700 |
6 | 550 | 200 |
7 | 550 | 201 |
8 | 550 | 1199 |
9 | 550 | 1200 |
Only tests a single fault at once. i.e, a and b both won’t simultaneously have boundary conditions. Total number of cases = \(4n+1\).
Also tests just below minimum and just above maximum, as well as all the test cases tested in boundary value. The program should identify these values as invalid.
Total number of cases = \(6n+1\)
Reference : Object Oriented Software Engineering - Yogesh Singh,Ruchika Malhotra.
We don’t assume single fault here. Many failures can occur together. Any combination of inputs may have:
Total number of cases = \(5^n\)
We add just below min and just above max to worst case testing. Total number of cases = \(7^n\).
The entire program is evaluated. We go into the internal structure of the program to test it. This is white box testing.
Eg:
Code:
1. int a;
2. input(a);
3. print("you entered",a);
4. if (a%2==0)
5. {
6. print("a is even");
7. }
8.else
9. {
10. print("a is odd");
11. } 12. print("Goodbye")
The graph will look like:
1
|
v 2
|
v3
|
v4
/ \
5 8
| |
v v6 9
| |
v v7 10
| |
v v12<--11
Remove sequential nodes.
S
|
v
N1
|
v
N2/ \
N3 N4/
\
N5
|
v N6
This is the final DD graph
Independent Paths in DD graphs are paths that introduces at least one new node or edge in its sequence.
Cyclomatic number= max number of independent paths.
It depends only on the decision structure of G. Addition/removal of functional statements doesn’t affect cyclomatic number.
V(G) = Cyclomatic Number = e-n+2P
e = edges
n= nodes
P = number of connected components
V(G)= number of regions of program graph.
For activity diagrams,
V(G) = Transitions - activities/branches + 2P