SE Unit - 2
SE Unit - 2
,NGIT)
Unit 2
• Consists of a collection of concepts, principles, methods, and tools that a software engineer calls upon on a
daily basis
• Equips managers to manage software projects and software engineers to build computer programs
• Provides necessary technical and management how to’s in getting the job done
• Transforms a haphazard unfocused approach into something that is more organized, more effective, and
more likely to achieve success
• Can subproblems be defined and are solutions available for the subproblems?
• Does the solution conform to the plan? Is the source code traceable back to the design?
• Is each component of the solution correct? Has the design and code been reviewed?
• Does the solution produce results that conform to the data, function, and behavior that are
required?
Seven Core Principles for Software Engineering (not included in current syllabus)
• The software should provide value to its users and satisfy the requirements
• Never design yourself into a corner; build software that can be easily changed and adapted
• Reuse of software reduces the long-term cost and increases the value of the program and the
reusable components
• Placing clear, complete thought before action will almost always produce better results
Practices -
4) Face-to-face communication is best, but also have a document or presentation to focus the discussion
9) Move on to the next topic a) after you agree to something, b) if you cannot agree to something, or c) if
a feature or function is unclear and cannot be clarified at the moment
10) Negotiation is not a contest or a game; it works best when both parties win
Planning Practice principles (not included in current syllabus)
6) Be realistic on how much can be done each day by each person and how well
The answers to these questions lead to a definition of key project characteristics and the resultant project plan
1) The information domain of a problem (the data that flows in and out of a system) must be represented
and understood
3) The behavior of the software (as a consequence of external events) must be represented
4) The models that depict information, function, and behavior must be partitioned in a manner that uncovers
detail in a layered (or hierarchical) fashion
5) The analysis task should move from essential information toward implementation detail
5) User interface design should be tuned to the needs of the end-user and should stress ease of use
7) Components should be loosely coupled to one another and to the external environment
9) The design should be developed iteratively; with each iteration, the designer should strive for greater
simplicity
Coding principles -
3) Pick a programming language that meets the needs of the software to be built and the environment in which
it will operate
4) Select a programming environment that provides tools that will make your work easier
5) Create a set of unit tests that will be applied once the component you code is completed
2) Select data structures that will meet the needs of the design
3) Understand the software architecture and create interfaces that are consistent with it
6) Select meaningful variable names and follow other local coding standards
8) Create a visual layout (e.g., indentation and blank lines) that aids code understanding
2) Perform unit tests (black-box and white-box) and correct errors you have uncovered
Testing Principles -
4) Testing should begin “in the small” and progress toward testing “in the large”
• Unit testing --> integration testing --> validation testing --> system testing
Test Objectives
2) A good test case is one that has a high probability of finding an as-yet undiscovered error
Introduction
• System engineering may take on two different forms depending on the application domain
– “Business process” engineering – conducted when the context of the work focuses on a
business enterprise
– Product engineering – conducted when the context of the work focuses on a product that is to
be built
• Both forms work to allocate a role for computer software and to establish the links that tie software to other
elements of a computer-based system
System
– A set of facts, principles, rules. etc., … to show a logical plan linking the various parts
• Defined: A set or arrangement of elements that are organized to accomplish some predefined goal by
processing information
• The goal may be to support some business function or to develop a product that can be sold to
generate business revenue
• Elements constituting one system may represent one macro element of a still larger system
• Example
– A factory automation system may consist of a numerical control machine, robots, and data entry
devices; each can be its own system
– At the next lower hierarchical level, a manufacturing cell is its own computer-based system that may
integrate other macro elements
• The role of the system engineer is to define the elements of a specific computer-based system in the
context of the overall hierarchy of systems
• A computer-based system makes use of the following four system elements that combine in a variety of
ways to transform information
– Software: computer programs, data structures, and related work products that serve to effect the
logical method, procedure, or control that is required
– Hardware: electronic devices that provide computing capability, interconnectivity devices that
enable flow of data, and electromechanical devices that provide external functions
– Database: A large, organized collection of information that is accessed via software and persists over
time
– Documentation: Descriptive information that portrays the use and operation of the system
– Procedures: The steps that define the specific use of each system element or the procedural
context in which the system resides
• The system engineering process begins with a world view; the business or product domain is examined to
ensure that the proper business or technology context can be established
• Within a specific domain, the need for targeted system elements is analyzed
• Finally, the analysis, design, and construction of a targeted system element are initiated
• At the bottom level, detailed technical activities are conducted by the relevant engineering discipline (e.g.,
software engineering)
at each view level
• Defines the processes (e.g., domain classes in OO terminology) that serve the needs of the view under
consideration
• Represents the behavior of the processes and the assumptions on which the behavior is based
• Explicitly defines intra-level and inter-level input that form links between entities in the model
• Represents all linkages (including output) that will enable the engineer to better understand the view
– A semi-automated solution
• Assumptions
– These reduce the number of possible variations, thus enabling a model to reflect the problem in a
reasonable manner
• Simplifications
• Limitations
– These help to bound the maximum and minimum values of the system
• Constraints
– These guide the manner in which the model is created and the approach taken when the model is
implemented
• Preferences
– These indicate the preferred solution for all data, functions, and behavior
• The Uniform Modeling Language (UML) provides diagrams for analysis and design at both the system
and software levels
• Examples
– Activity diagrams
– Class diagrams
– State diagrams
• “Business process” engineering defines architectures that will enable a business to use information
effectively
• It involves the specification of the appropriate computing architecture and the development of the software
architecture for the organization's computing resources
• Three different architectures must be analyzed and designed within the context of business objectives and
goals
– The data architecture provides a framework for the information needs of a business (e.g., ERD)
– The application architecture encompasses those elements of a system that transform objects within
the data architecture for some business purpose
– The technology infrastructure provides the foundation for the data and application architectures
• It includes the hardware and software that are used to support the applications and data
Product Engineering
• Product engineering translates the customer's desire for a set of defined capabilities into a working product
– Support infrastructure includes the technology required to tie the components together and the
information to support the components
• Requirements engineering elicits the requirements from the customer and allocates function and behavior
to each of the four components
• System component engineering happens next as a set of concurrent activities that address each of the
components separately
– Each component takes a domain-specific view but maintains communication with the other domains
• Design modeling maps the analysis model into data/class, architectural, interface, and component design
Planning and Managing the Project (ref. – Soft. Engg. – Theory and practise 4th Ed. - Shari L.P. & J.M. Atlee )
Objectives
• Risk management
Tracking Progress
Project Schedule
• Portrays the interactions among the activities and estimates the times that each task or activity will take
– Documents
– Demonstrations of function
– Demonstrations of subsystems
– Demonstrations of accuracy
• Precursor: event or set of events that must occur in order for an activity to start
Example –
– landscaping phase
• Work breakdown structure depicts the project as a set of discrete pieces of work
• Adding estimated time in activity graph of each activity to be completed tells us more about the project's
schedule
– Reveals those activities that are most critical to completing the project on time
• Real time (actual time): estimated amount of time required for the activity to be completed
• Available time: amount of time available in the schedule for the activity's completion
• Slack time: the difference between the available time and the real time for that activity
Gantt Chart
• Shows people assigned to the project and those needed for each stage of development
Expenditures Tracking
Project Personnel
– requirements analysis
– system design
– program design
– program implementation
– testing
– training
– maintenance
– quality assurance
Choosing Personnel
• Interest in work
• Experience with
– similar applications
• Training
• Management skills
Communication
– degree of communication
– develop an agenda
Work Styles
Fig : Horizontal axis: communication styles & Vertical axis: decision styles
• Understanding workstyles
– help to be flexible
– give information based on other's priorities
Project Organization
• Depends on
• Examples:
– Chief programmer team: one person totally responsible for a system's design and development
Fig : Each team member must communicate often with chief, but not necessarily with other team members
• Good project management means finding a balance between structure and creativity
Effort Estimation
• Estimating project costs is one of the crucial aspects of project planning and management
• Estimating cost has to be done as early as possible during the project life cycle
• Type of costs
Fig : Uncertainty early in the project can affect the accuracy of cost and size estimations
• Key causes
– Overlooked tasks
– Lack of coordination of system development, technical services, operations, data administration, and
other functions during development
– Project team's experience with the application, the programming language, and hardware
• Expert judgment
• Top-down or bottom-up
• Analogy: pessimistic (x), optimistic (y), most likely (z); estimate as (x + 4y + z)/6
Difficulty
Type of software OE OM OH NE NM NH
Control 21 27 30 33 40 49
Input/output 17 24 27 28 35 43
Pre/post processor 16 23 26 28 34 42
Algorithm 15 20 22 25 30 35
Data management 24 31 35 37 46 57
Time-critical 75 75 75 75 75 75
Algorithmic Method: Watson and Felix Model
E = 5.5 + 0.73S1.16
– If R is the ratio between the actual effort, E, and the predicted effort, E’, then the effort adjustment
is defined as
Cumulative Cumulative
complexity experience
(CPLX) (EXP)
Tree charts Customer interface Programmer
complexity qualifications
Top-down design Application complexity Programmer machine
experience
Formal documentation Program flow Programmer language
complexity experience
Chief programmer Internal communication Programmer application
teams complexity experience
Formal training Database complexity Team experience
Formal test plans External
communication
complexity
Design formalisms Customer-initiated
program design
changes
Code reading
Unit development
folders
• Introduced by Boehm
• COCOMO II
– updated version
– E = bScm(X)
– where
• Application composition
• Early design
• Post architecture
Stage 1: Stage 2:
Application Early Stage 3:
Model Aspect Composition Desig n Post -
architecture
Size App lication Function points (FP) FP and language or source lines
points and language of code (SLOC)
• To compute application points, first we need to count the number of screens, reports and programming
language used to determine the complexity level
• Determine the relative effort required to implement a report or screen simple, medium or difficult
• Determine the adjustment factors expressed as multipliers based on rating of the project
Category Meaning
Very low Edit, code, debug
Low Simple front- end, back-end CASE, little integration
Nominal Basic life-cycle tools, moderately integrated
High Strong, mature life-cycle tools, moderately
integrated
Very high Strong, mature, proactive life-cycle tools, well-
integrated with processes, methods, reuse
– characterizing cases
– determining similarity
Evaluating Models
• It is important to understand which types of effort are needed during development even when we have
reasonably accurate estimate
Risk Management
What is a Risk?
Fig : PU: prob. of unwanted outcome ; LU: lost assoc with unwanted outcome
– Risk leverage = (risk exposure before reduction – (risk exposure after reduction) / (cost of risk
reduction)
• Personnel shortfalls
• Gold-plating
– algorithms
– tools
– coding languages
– testing techniques
Process Models and Project Management Enrolment Management Model: Digital Alpha AXP
• An organization that allowed technical focus and project focus to contribute to the overall program
• Matrix organization
– Combines people from different functional units into interdisciplinary work unit
• Each activity tracked using cost estimation, critical path analysis, schedule tracking
• Feasibility: Can this be done, and is there a good business reason for doing it?
• Life-cycle architecture: define the system and software architectures and address architectural choices and
risks
• Initial operational capability: readiness of software, deployment site, user training
• The Win-Win spiral model suggested by Boehm is used as supplement to the milestones
• Using COCOMO II
• The Ariane-5 destruction might have been prevented had the project managers developed a risk
management plan
– Risk exposure: prioritization would have identified if the inertial reference system (SRI) did not work
as planned
• We have trouble understanding the requirements that we do acquire from the customer
• We allow change to control us, rather than establishing mechanisms to control change
• Most importantly, we fail to establish a solid foundation for the system or software that the user wants built
• Building software is so compelling that we want to jump right in (before having a clear
understanding of what is needed)
• Project stakeholders will be able to better understand what they need only after examining early
iterations of the software
• The bottom line is producing a working program and that all else is secondary
• All of these arguments contain some truth, especially for small projects that take less than one month to
complete
• However, as software grows in size and complexity, these arguments begin to break down and can lead to
a failed software project
• Begins during the communication activity and continues into the modeling activity
• Builds a bridge from the system requirements into software design and construction
– the information, function, and behavior that will have a profound impact on the resultant design
– Inception
– Elicitation
– Elaboration
– Negotiation
– Specification
– Validation
– Requirements Management
• Some of these tasks may occur in parallel and all are adapted to the needs of the project
• All serve to establish a solid foundation for the design and construction of the software
Inception Task
– The effectiveness of preliminary communication and collaboration between the customer and the
developer
These questions focus on the customer, other stakeholders, the overall goals, and the benefits
These questions enable the requirements engineer to gain a better understanding of the problem and allow the
customer to voice his or her perceptions about a solution
• How would you characterize "good" output that would be generated by a successful solution?
• Can you show me (or describe) the business environment in which the solution will be used?
• Will special performance issues or constraints affect the way the solution is approached?
• Are you the right person to answer these questions? Are your answers "official"?
Elicitation Task
– Problems of scope in identifying the boundaries of the system or specifying too much technical
detail rather than overall system objectives
– Problems of understanding what is wanted, what the problem domain is, and what the computing
environment can handle (Information that is believed to be "obvious" is often omitted)
• Meetings are conducted and attended by both software engineers, customers, and other interested
stakeholders
• An agenda is suggested that is formal enough to cover all important points but informal enough to
encourage the free flow of ideas
• A "definition mechanism" is used such as work sheets, flip charts, wall stickers, electronic bulletin board,
chat room, or some other virtual forum
• The goal is to identify the problem, propose elements of the solution, negotiate different approaches, and
specify a preliminary set of solution requirements
• This is a technique that translates the needs of the customer into technical requirements for software
• It emphasizes an understanding of what is valuable to the customer and then deploys these
values throughout the engineering process through functions, information, and tasks
– Normal requirements: These requirements are the objectives and goals stated for a product or
system during meetings with the customer
– Expected requirements: These requirements are implicit to the product or system and may be so
fundamental that the customer does not explicitly state them
– Exciting requirements: These requirements are for features that go beyond the customer's
expectations and prove to be very satisfying when present
The work products will vary depending on the system, but should include one or more of the following items
• A list of customers, users, and other stakeholders who participated in requirements elicitation
• A list of requirements (organized by function) and the domain constraints that apply to each
• A set of preliminary usage scenarios (in the form of use cases) that provide insight into the use of the
system or product under different operating conditions
Elaboration Task
• During elaboration, the software engineer takes the information obtained during inception and elicitation
and begins to expand and refine it
• Elaboration focuses on developing a refined technical model of software functions, features, and constraints
– Domain classes are identified along with their attributes and relationships
• The end result is an analysis model that defines the functional, informational, and behavioral domains of the
problem
• Step One – Define the set of actors that will be involved in the story
– Actors are people, devices, or other systems that use the system or product within the context
of the function and behavior that is to be described
– Actors are anything that communicate with the system or product and that are external to
the system itself
• Step Two – Develop use cases, where each one answers a set of
• Will the actor have to inform the system about changes in the external environment?
• Scenario-based elements
– Describe the system from the user's point of view using scenarios that are depicted in use cases
and activity diagrams
• Class-based elements
– Identify the domain classes for the objects manipulated by the actors, the attributes of these classes,
and how they interact with one another; they utilize class diagrams to do this
• Behavioral elements
– Use state diagrams to represent the state of the system, the events that cause the system to
change state, and the actions that are taken as a result of a particular event; can also be applied to
each class in the system
• Flow-oriented elements
– Use data flow diagrams to show the input data that comes into a system, what functions are
applied to that data to do transformations, and what resulting output data are produced
Negotiation Task
• During negotiation, the software engineer reconciles the conflicts between what the customer wants and
what can be achieved given limited business resources
• Requirements are ranked (i.e., prioritized) by the customers, users, and other stakeholders
• Using an iterative approach, requirements are eliminated, combined and/or modified so that each party
achieves some measure of satisfaction
• Listen actively
• Be creative
• Be ready to commit
Specification Task
• It describes the function and performance of a computer-based system and the constraints that will govern
its development
• It formalizes the informational, functional, and behavioral requirements of the proposed software in both a
graphical and textual format
• Requirements
• Requirements traceability
• During validation, the work products produced as a result of requirements engineering are assessed for
quality
– the work products conform to the standards established for the process, the project, and the
product
• The formal technical review serves as the primary requirements validation mechanism
• Is each requirement consistent with the overall objective for the system/product?
• Have all requirements been specified at the proper level of abstraction? That is, do some requirements
provide a level of technical detail that is inappropriate at this stage?
• Is the requirement really necessary or does it represent an add-on feature that may not be essential to
the objective of the system?
• Does each requirement have attribution? That is, is a source (generally, a specific individual) noted for each
requirement?
• Is each requirement achievable in the technical environment that will house the system or product?
• Does the requirements model properly reflect the information, function, and behavior of the system to be
built?
• Has the requirements model been “partitioned” in a way that exposes progressively more detailed
information about the system?
• During requirements management, the project team performs a set of activities to identify, control, and
track requirements and changes to the requirements at any time as the project proceeds
• The requirements are then placed into one or more traceability tables
• These tables may be stored in a database that relate features, sources, dependencies, subsystems,
and interfaces to the requirements
• A requirements traceability table is also placed at the end of the software requirements specification