Software Engineering exam preparation.
Practice questions for every unit in the style of the R23 end exam, a model answer for each, and a one-page revision summary. Built on the official syllabus units.
- Practice questions in the exam's style
- Drafted with AI and checked by a second AI pass. Doubtful points were verified against public sources. Report a mistake
- Units
- 5
- Questions
- 60
- 2-mark
- 30
- 10-mark
- 30
- Done
- Checked on
Exam guide
Paper pattern
Semester-end theory paper, 70 marks, from the JNTUK B.Tech R23 Regulations, end-examination pattern for theory subjects.
- Question 1 · 20 marksTen compulsory short-answer questions of 2 marks each (two from every unit).
- Questions 2 to 6 · 50 marksFive either/or questions of 10 marks each, one per unit. You answer one of the two in each.
- The semester-end examination carries 70 marks; internal assessment carries 30.
- Mid-semester examinations are separate: a 20-minute objective paper (10 marks) and a 90-minute subjective paper with three either/or questions of 10 marks (condensed to 15 marks).
- The regulations text does not state the length of the end examination. Use the duration printed on your hall ticket or question paper.
How to split your time
This plan assumes a 3-hour paper. If yours is different, keep the same proportions. Marks per minute stay roughly even across Question 1 and the 10-mark answers.
- 10 minRead the paper and choose one option in each either/or question
- 30 minQuestion 1: ten short answers (about 3 minutes each)
- 130 minQuestions 2 to 6: one 10-mark answer per unit (about 26 minutes each)
- 10 minFinal check of numbering, calculations and diagrams
Study tips for Software Engineering
- Learn each life cycle model as a labelled figure, then write its phases, its advantages and limitations, and one kind of project it suits, so you can draw and compare any two models.
- Practise the estimation calculations with a calculator: basic COCOMO effort and duration for each mode, Halstead length, volume and effort, and a function point count, writing every formula before you substitute values.
- Draw a context diagram and a level-1 DFD for one small system such as a library or a payroll, and check that every data flow in the context diagram appears in the level-1 diagram.
- For testing, take a short function, draw its control flow graph, compute its cyclomatic complexity three ways, and write equivalence-class and boundary-value test cases for its inputs.
Introduction and Software Life Cycle Models
Syllabus: Evolution of software engineering; Software development projects; Exploratory style of software development; Emergence of software engineering; Notable changes in software development practices; Computer system engineering; Software life cycle models: basic concepts; Waterfall model and its extensions; Rapid application development (RAD); Agile development model; Spiral model
One-page revision summary
- Software engineering is the systematic, disciplined and measurable approach to developing, operating and maintaining software.
- Programming evolved from an art practised by a few experts, through a craft of shared rules of thumb, to an engineering discipline based on principles.
- A program is small and written by one person for personal use, whereas a software product is large, team-built, documented, tested and maintained for many users.
- Software development projects are of two types: product development for a wide market, and services such as building customised software, maintenance, testing or consultancy for particular clients.
- Generic software is built for many customers with features chosen from market needs, while customised software is built to the requirements of one client.
- The exploratory build-and-fix style has no specification or design, so its effort grows almost exponentially with program size.
- Abstraction and decomposition help developers overcome the short-term memory limit of about seven items.
- Program design moved through control flow-based, data structure-oriented, data flow-oriented and object-oriented design as programs grew larger.
- Modern practice prevents errors through reviews in every phase instead of correcting them late, and treats coding as only a small part of development.
- In computer system engineering, the system requirements are partitioned between hardware and software, the two are developed in parallel, and they are then integrated and tested together.
- A software life cycle model is a descriptive and diagrammatic representation of the phases of a product, with entry and exit criteria for each phase.
- A documented life cycle model makes a team work in a disciplined way and lets the project manager monitor progress phase by phase.
- The classical waterfall phases are feasibility study, requirements analysis and specification, design, coding and unit testing, integration and system testing, and maintenance.
- The iterative waterfall model adds feedback paths to earlier phases, but none into the feasibility study, and aims at phase containment of errors.
- The V-model pairs each development phase on its left arm with a matching testing phase on its right arm, so tests are planned while development proceeds.
- The incremental model builds a core first and adds features in successive increments, while the evolutionary model also lets requirements be refined as customers use each version.
- RAD shortens development through time-boxed prototypes that the customer evaluates and that are refined into the delivered system rather than thrown away.
- Agile models such as XP and Scrum deliver working software in short iterations and value customer collaboration and response to change over documentation and fixed plans.
- The spiral model is a risk-driven meta model in which each loop is a phase with four quadrants and the number of loops depends on the risks.
Learn these by heart
- Software engineering: applying a systematic, disciplined and quantifiable approach to developing, operating and maintaining software.
- Classical waterfall order: feasibility study → requirements analysis and specification → design → coding and unit testing → integration and system testing → maintenance.
- Spiral loop quadrants: determine objectives → identify and resolve risks → develop and verify → review and plan next loop; radius = cumulative cost.
- Agile manifesto values: individuals and interactions, working software, customer collaboration and responding to change, valued over processes and tools, comprehensive documentation, contract negotiation and following a plan.
- Short-term memory holds about seven items; abstraction and decomposition are the two principles that overcome this limit.
- The prototyping model throws its prototype away; RAD refines its prototype into the final system.
2-mark questions
1 Distinguish between a program and a software product. 2 marks
A program is usually small, written by one person for personal use, with little documentation and limited testing; its user is often its own developer. A software product is large, built by a team for many users, and comes with a proper user interface, user and technical manuals, systematic testing and planned maintenance.
2 What are abstraction and decomposition? Why does software engineering need them? 2 marks
Abstraction means concentrating only on the aspects of a problem that matter for the present purpose and ignoring the rest. Decomposition means dividing a large problem into smaller, nearly independent parts that are solved one at a time. Both are needed because a person can hold only about seven items in short-term memory.
3 What is computer system engineering? 2 marks
Computer system engineering deals with developing systems that need both hardware and software, such as a robot controller or an embedded device. After the system requirements are fixed, the work is partitioned into hardware and software parts, the two are developed in parallel (until the hardware is ready, the software is tested on a hardware simulator), and then they are integrated and tested together.
4 What is a software life cycle model? Why are phase entry and exit criteria needed? 2 marks
A software life cycle model is a descriptive and diagrammatic representation of the phases a software product passes through, from its inception to its retirement, and of the order of activities in them. Entry and exit criteria state when a phase may start and when it is complete, so the project manager can track progress objectively instead of by guesswork.
5 What is the prototyping model? When is it preferred? 2 marks
In the prototyping model, a quick working mock-up (prototype) with limited functionality is built and shown to the customer to settle the requirements; the prototype is then thrown away and the actual system is developed, usually by the iterative waterfall approach. It is preferred when the requirements, the user interface or the technical solution are unclear at the start.
6 Why is the spiral model called a meta model? 2 marks
The spiral model is called a meta model because it subsumes the other life cycle models. A single loop of the spiral resembles the waterfall model, its risk-resolution step uses prototyping, and its loop-by-loop growth of the product follows the iterative and evolutionary approach. A project can therefore use whichever style suits the risks of each phase.
10-mark questions
1 Explain how software engineering evolved from an art to an engineering discipline. Describe the exploratory style of software development and explain why it breaks down for large programs. 10 marks
Software engineering is the systematic, disciplined and measurable approach to developing, operating and maintaining software. It did not begin that way: like older engineering fields, it grew out of individual skill.
Evolution from an art to an engineering discipline:
1. Art: In the early days, writing good programs was seen as an art. A few gifted programmers relied on personal, unwritten tricks, and their knowledge was not shared, so the quality of a program depended entirely on who wrote it.
2. Craft: As more programs were written, good practices began to be shared, passed from experienced programmers to newcomers by example and informal advice. These rules of thumb were useful, but they were neither organised nor justified.
3. Engineering discipline: Today the subject is built on principles, standard techniques and documented past experience. Its methods are systematic and repeatable, and they let developers weigh cost, schedule and quality against each other. Building construction followed the same path, from master craftsmen to civil engineering.
The exploratory style:
In the exploratory (build-and-fix) style, the programmer starts coding after only an informal understanding of the problem. The program is run, bugs are fixed as they appear, and the cycle of coding, testing and fixing repeats until the program seems to work. There is no written specification, no separate design and little documentation.
Why it breaks down for large programs:
1. Effort and development time grow almost exponentially with program size, whereas with software engineering principles they grow nearly linearly.
2. The code becomes unstructured and hard to understand, so maintenance is very costly.
3. Without documents, several programmers cannot coordinate their work, so the style does not support team development.
4. Errors are found late, when they are most expensive to fix.
The underlying reason is a limit of human cognition. A person can hold only about seven independent items in short-term memory. A small program fits within this limit, but a large one has far more interacting parts than one mind can track. Software engineering overcomes the limit with two principles: abstraction, which hides the details that do not matter at the moment, and decomposition, which divides the problem into small parts that are handled one at a time.
In conclusion, software engineering replaced personal skill with systematic methods, and these methods become essential once a program grows beyond what one person can keep in mind.
2 Trace the emergence of software engineering through the evolution of program design techniques. What notable changes in software development practice did this bring? 10 marks
Software engineering emerged gradually. Each increase in program size exposed the weakness of the existing design technique and led to a better one.
Stages in the emergence of software engineering:
1. Early computer programming: Programs were written in assembly language and were only a few hundred lines long. Each programmer followed a personal, exploratory style.
2. High-level language programming: Languages such as FORTRAN, ALGOL and COBOL reduced the effort of coding and allowed programs of a few thousand lines, but development remained exploratory.
3. Control flow-based design: As programs grew, unrestricted GOTO statements tangled their control flow into "spaghetti" code. Designers began to plan the control structure first, using flow charts, and structured programming arose. It uses only sequence, selection and iteration, which were shown to be enough for any program, so structured programs are easier to read, test and maintain.
4. Data structure-oriented design: Designers then realised that the structure of the data matters more than the control flow. The data structures are designed first and the program structure is derived from them, as in the Jackson structured programming method and the Warnier-Orr method.
5. Data flow-oriented design: The major data items and the processing steps that transform them are identified, and the flow of data between them is drawn as data flow diagrams (DFDs). The technique can model any system, not only software.
6. Object-oriented design: The natural objects of the problem, such as employees or accounts, are identified first, together with relationships such as composition, reference and inheritance. The approach is simple and encourages reuse, so it lowers development effort.
Notable changes in software development practice:
- The emphasis moved from correcting errors to preventing them; errors are caught in the phase in which they are introduced.
- Coding became only a small part of the work; requirements specification, design and testing take a large share of the effort.
- A clear requirements specification is written before design begins.
- A distinct design phase uses standard techniques.
- Periodic reviews are held in every phase to detect errors early.
- Testing is systematic, with test cases planned in advance.
- Good documents are produced, which improve visibility and make maintenance easier.
- Projects are planned with estimation, scheduling and metrics, and CASE tools support many activities.
In conclusion, software engineering emerged from a series of design techniques, each answering the problems of larger programs, and it turned development into a planned and reviewable process.
3 Explain the classical waterfall model and its phases. How does the iterative waterfall model overcome its main shortcoming? 10 marks
The classical waterfall model is the most basic software life cycle model, and most other models are extensions of it. It divides development into phases carried out strictly one after another, like water falling down a series of steps. Every phase has entry and exit criteria and ends with a document that the next phase uses.
Phases of the classical waterfall model:
1. Feasibility study: The team understands the problem, considers alternative solutions and uses a cost-benefit analysis to decide whether the project is financially and technically worthwhile.
2. Requirements analysis and specification: The customer's requirements are gathered and analysed to remove ambiguity, inconsistency and incompleteness, and are recorded in the software requirements specification (SRS) document.
3. Design: The requirements are transformed into a structure that can be coded, using a procedural approach (structured analysis and structured design) or an object-oriented approach.
4. Coding and unit testing: Each module of the design is coded and tested in isolation.
5. Integration and system testing: The modules are integrated in a planned, incremental way, and the complete system is tested against the SRS through alpha testing (within the developing organisation), beta testing (by friendly users) and acceptance testing (by the customer).
6. Maintenance: After delivery the software is corrected (corrective), adapted to new platforms (adaptive) and enhanced with new features (perfective).
Shortcomings of the classical model:
- It assumes that no mistakes are made, so an error found in a later phase cannot be corrected.
- Change requests after the requirements phase are hard to accommodate.
- The customer sees working software only at the end, and incremental delivery is not supported.
- Phases do not overlap, so team members may sit idle waiting for the previous phase to finish.
The iterative waterfall model:
The iterative waterfall model removes the first shortcoming by adding feedback paths. When an error is detected in a later phase, work returns to the phase in which the error was introduced, the error is corrected there, and the documents of the later phases are revised. In the figure, a feedback arrow leads from each phase, from design onwards, to the phase just before it, so an error can be traced back step by step to its source. There is no feedback path into the feasibility study, because a project once accepted is not normally abandoned.
The model also stresses phase containment of errors: a review at the end of every phase tries to catch errors in the same phase in which they were made, because an error costs more to fix the later it is found.
In conclusion, the waterfall models are simple and suit well-understood projects, but handle changing requirements and risks poorly.
4 Explain the spiral model of software development with a neat diagram. Discuss its advantages and disadvantages. 10 marks
The spiral model, proposed by Barry Boehm, is a risk-driven software life cycle model. Its diagram is a spiral with many loops, and each loop represents one phase of the software process; for example, the first loop may deal with feasibility and the next with requirements. The number of loops is not fixed: the project manager decides it according to the risks the project faces. A risk is any adverse circumstance that might prevent the project from completing successfully.
Each loop passes through four quadrants:
1. Determine objectives: The objectives of the phase are identified, along with alternative ways of reaching them and the constraints, such as cost and schedule, on each.
2. Identify and resolve risks: The alternatives are evaluated and their risks are analysed in detail. Steps are taken to reduce every major risk, often by building a prototype. For example, if it is uncertain whether a chosen database can respond quickly enough, a prototype of the data access part is built and measured.
3. Develop and verify: The next level of the product is developed and verified, using whichever approach suits the remaining risks.
4. Review and plan next loop: The customer reviews the results so far, and the plan for the next loop is made.
The radius of the spiral at any point shows the cumulative cost spent so far, and the angular position shows the progress made within the current phase. Because a single loop resembles the waterfall model, the risk step uses prototyping and the product grows loop by loop as in the evolutionary model, the spiral model is called a meta model: it subsumes the other models.
Advantages:
- Risks are identified and handled early, before they become costly problems.
- It suits large, complex projects whose risks are not clear at the start.
- The customer reviews the product in every loop, so changes can be absorbed.
- It combines the strengths of the waterfall, prototyping and evolutionary models.
Disadvantages:
- It is complex to manage and needs staff skilled in risk analysis.
- It is too costly for small or low-risk projects.
- The number of loops and the total cost are hard to estimate in advance.
- The project can fail if its risks are judged wrongly.
In conclusion, the spiral model is best for large, high-risk projects where careful, repeated risk analysis justifies its extra cost.
5 Explain the rapid application development (RAD) model. For which projects is it suitable and unsuitable? Compare it with the prototyping and iterative waterfall models. 10 marks
The rapid application development (RAD) model aims to deliver working software quickly and cheaply while making it easy to accommodate change requests. It combines prototyping with incremental development.
Main features:
1. Customer participation: A customer representative works closely with the developers and evaluates every version.
2. Time boxing: Development is divided into short, fixed time boxes, and in each one a working prototype of a few features is built.
3. Prototype refinement: Each prototype is refined using customer feedback and becomes part of the delivered system; it is not thrown away.
4. Tools and reuse: Visual development tools, code generators and reusable components are used heavily to speed up construction.
5. Minimal documentation: Communication is mostly face to face, so little documentation is produced.
How RAD proceeds:
- Requirements planning: Users and developers agree on the scope and main requirements in a short workshop.
- User design: Developers build a prototype, and users try it and suggest changes.
- Construction: The prototype is refined into working features using tools and reuse. User design and construction repeat, driven by user feedback, until the users accept the features.
- Cutover: The accepted features are tested, the users are trained and the system is installed.
RAD suits:
- Customised software developed for one customer.
- Non-critical software, where some loss of performance or reliability is acceptable.
- Projects with a tight schedule.
- Large software that can be split into features developed separately.
RAD does not suit:
- Generic products for many customers, whose features are decided by the market rather than by one customer.
- Software that needs very high performance or reliability, such as an operating system or flight control software.
- Projects with no similar earlier products and few reusable components.
- A monolithic system that cannot be divided into features.
Comparison with other models:
1. Prototyping model: Its prototype is thrown away once the requirements are understood, whereas a RAD prototype is refined into the final product.
2. Iterative waterfall model: All functionality is delivered together at the end and change requests are hard to absorb. RAD delivers features quickly and welcomes change, but its code is harder to maintain because documentation is weak.
In conclusion, RAD gives fast delivery and close customer involvement, provided the system can be built from reusable parts in short time boxes.
6 Explain the agile development model: the values and principles of the agile manifesto, the practices of Extreme Programming and the working of Scrum. 10 marks
Agile development is a family of life cycle models designed to deliver working software quickly and to accept changing requirements at any stage. Examples are Extreme Programming (XP), Scrum, Lean development, Crystal, DSDM and feature-driven development. Instead of one long plan, the work is done in short, time-boxed iterations, each of which delivers a small working increment.
Values of the agile manifesto:
1. Individuals and interactions are valued over processes and tools.
2. Working software is valued over comprehensive documentation.
3. Customer collaboration is valued over contract negotiation.
4. Responding to change is valued over following a plan.
Important agile principles:
- Satisfy the customer through early and continuous delivery of useful software.
- Welcome changing requirements, even late in development.
- Deliver working software frequently, every few weeks to a few months, preferring the shorter interval.
- Let business people and developers work together daily, preferably face to face.
- Treat working software as the main measure of progress, and keep a sustainable pace.
Extreme Programming takes good practices to the extreme: pair programming (two programmers at one computer, so code is reviewed continuously), test-first development, continuous integration, small frequent releases, simple design, refactoring and an on-site customer.
Working of Scrum:
1. The product owner maintains the product backlog, a prioritised list of features, often written as user stories.
2. In sprint planning, the team moves the top items into the sprint backlog.
3. The sprint is a fixed time box of one month or less, often two to four weeks. Each day the team holds a daily scrum of about 15 minutes to report progress and obstacles, and the scrum master removes the obstacles.
4. The sprint ends with a working increment, which is shown to the stakeholders in a sprint review. A retrospective then improves the way the team works, and the next sprint starts from the updated backlog.
Advantages: quick delivery of useful software, easy handling of change, high customer satisfaction and early detection of problems.
Disadvantages: little documentation makes later maintenance harder, success depends on skilled and co-located teams, effort is hard to estimate at the start, and the approach suits large, distributed or safety-critical projects less well.
In conclusion, agile models trade heavy planning and documentation for close customer collaboration and frequent delivery of working software.
Software Project Management and Requirements Analysis
Syllabus: Software project management complexities; Responsibilities of a software project manager; Metrics for project size estimation; Project estimation techniques; Empirical estimation techniques; COCOMO; Halstead's software science; Risk management; Requirements gathering and analysis; Software requirements specification (SRS); Formal system specification; Axiomatic specification; Algebraic specification; Executable specification and 4GL
One-page revision summary
- Software project management is harder than other project management because software is invisible, easily changed, complex, unique to each project, must fit exactly and is built by intellect-intensive teams.
- A project manager's work splits into project planning (estimation, scheduling, staffing, risk management, quality and configuration plans) and project monitoring and control, with the plan recorded in the SPMP document.
- Sliding window planning plans a project in stages and refines the estimates as more becomes known.
- Lines of code is simple to count but depends on language and coding style and is known accurately only after coding.
- Function points measure size from five counted parameters (inputs, outputs, inquiries, internal logical files and external interface files) and can be computed from the SRS.
- The feature point metric extends function points by also counting algorithms, to reflect algorithmic complexity.
- Estimation techniques are empirical (expert judgement, Delphi), heuristic (fitted expressions such as COCOMO) or analytical (Halstead's software science).
- Expert judgement depends on one person and suffers from individual bias and oversight; Delphi uses several anonymous experts and a coordinator over repeated rounds.
- Basic COCOMO estimates effort from KLOC and development time from effort, with separate coefficients for organic, semidetached and embedded projects.
- Intermediate COCOMO multiplies the nominal effort by an effort adjustment factor built from 15 cost drivers, and complete COCOMO estimates subsystems separately.
- Halstead's software science treats a program as operators and operands and derives its length, volume, difficulty and effort from their counts.
- Risk management identifies project, technical and business risks, ranks them by risk exposure, and contains them by avoiding, transferring or reducing them.
- Requirements are gathered by studying documents, interviews, task analysis, scenario analysis and form analysis, and analysed to remove anomalies, inconsistencies and incompleteness.
- An SRS states functional requirements, non-functional requirements and goals of implementation, and should be concise, complete, consistent, unambiguous, verifiable, traceable and modifiable.
- A formal specification gives a precise, checkable mathematical description; model-oriented methods build a state model, while property-oriented methods state axioms or equations.
- An axiomatic specification gives each operation a pre-condition and a post-condition written in first-order logic.
- An algebraic specification defines a type by its operations and the equations relating them, and should be complete and have the finite and unique termination properties.
- An executable specification can be run as a prototype; 4GLs such as SQL state what is wanted rather than how, but give slower programs and suit narrow domains.
Learn these by heart
- Basic COCOMO: E = a × (KLOC)^b person-months and Tdev = c × E^d months, with (a, b, c, d) = organic (2.4, 1.05, 2.5, 0.38), semidetached (3.0, 1.12, 2.5, 0.35), embedded (3.6, 1.20, 2.5, 0.32).
- Average staff size = effort / development time = E / Tdev.
- Function points: FP = UFP × TCF, where TCF = 0.65 + 0.01 × DI and DI is the sum of 14 ratings from 0 to 5.
- Halstead: η = n1 + n2, N = N1 + N2, V = N log2 η, D = (n1/2) × (N2/n2), E = D × V, T = E/18 seconds, estimated length = n1 log2 n1 + n2 log2 n2.
- Risk exposure RE = probability × loss; risk leverage = (RE before − RE after) / cost of reduction.
- Requirements analysis removes three problems: anomaly, inconsistency and incompleteness.
2-mark questions
1 What is the Delphi technique of cost estimation? 2 marks
Delphi estimation is an empirical technique that refines expert judgement. A coordinator gives each expert the SRS and an estimation form. The experts estimate anonymously, without discussing with one another. The coordinator circulates a summary of the estimates, with the reasons given for unusual ones, and the experts revise theirs. The rounds repeat until the estimates converge.
2 A module has n1 = 12 distinct operators, n2 = 10 distinct operands, N1 = 40 operator occurrences and N2 = 30 operand occurrences. Find its Halstead vocabulary, length, volume, difficulty and effort. 2 marks
- Vocabulary η = n1 + n2 = 22
- Length N = N1 + N2 = 70
- Volume V = N log2 η = 70 × 4.4594 = 312.16 bits
- Difficulty D = (n1/2) × (N2/n2) = 6 × 3 = 18
- Effort E = D × V = 18 × 312.16 ≈ 5,619 elementary mental discriminations
3 Distinguish between functional and non-functional requirements, with one example of each. 2 marks
Functional requirements state what the system must do: the services it offers, each taking some input and producing an output, for example "issue a book to a library member". Non-functional requirements state how well it must work or under what constraints, such as performance, reliability, security and usability, for example "a catalogue search must answer within 2 seconds".
4 Give an axiomatic specification of a function max(x, y) that returns the larger of two integers. 2 marks
An axiomatic specification gives an operation's pre-condition (true before the call) and post-condition (true after it returns) in first-order logic.
max(x, y : integer) : integer
pre: true
post: (result = x ∨ result = y) ∧
result ≥ x ∧ result ≥ yThe pre-condition true means every pair of integers is a valid input.
5 Differentiate between model-oriented and property-oriented formal specification. 2 marks
A model-oriented specification builds a mathematical model of the system's state from sets, relations, functions and sequences, and defines each operation by how it changes that model; Z and VDM are examples. A property-oriented specification builds no model; it states the properties the system must satisfy as axioms or equations, as in algebraic specification.
6 What is a fourth-generation language (4GL), and how is it related to executable specification? 2 marks
A 4GL is a very high-level, mostly non-procedural language in which the user states what result is wanted, not how to compute it; SQL, report generators and form generators are examples. A 4GL description runs directly, so it works as an executable specification: the specification itself is a working program, though usually slower than an equivalent 3GL program.
10-mark questions
1 Why is software project management more complex than managing other kinds of projects? Describe the responsibilities of a software project manager. 10 marks
Software project management is the planning, monitoring and control of a software project so that the product is delivered on time, within budget and with the required quality. Several features of software make this harder than managing, say, a construction project.
Complexities of software project management:
1. Invisibility: software cannot be seen until it runs, so its progress is hard to judge; the manager must rely on documents, reviews and demonstrations. 2. Changeability: software looks easy to change, so customers keep changing the requirements, even late in development. 3. Complexity: even a moderate program has thousands of parts that interact in many ways, so problems and risks are hard to foresee. 4. Uniqueness: every project differs from earlier ones, so past experience applies only partly. 5. Exactness of the solution: parts must fit exactly; one mismatched parameter in an interface can make the system fail. 6. Team-oriented, intellect-intensive work: the work is done by teams of skilled people, and the number of communication paths, n(n − 1)/2 for n members, grows quickly.
Responsibilities of a software project manager:
They fall into two groups: project planning, done after the feasibility study and before development starts, and project monitoring and control, carried out throughout the project.
1. Estimation: estimate the size of the product, then the effort, cost and duration. 2. Scheduling: break the work into tasks, order them and set milestones. 3. Project staffing: decide how many people of which kinds are needed, and when. 4. Risk management: identify, assess and contain risks. 5. Other plans: the quality assurance plan and the configuration management plan. 6. Monitoring and control: track progress against the plan and revise it when needed. 7. Other duties: writing project proposals, negotiating with and reporting to the customer, giving presentations, and managing and motivating the team.
The planning activities depend on one another. Size estimation comes first, because effort estimation is based on it; cost estimation and duration estimation follow from the effort; project staffing needs both effort and duration; scheduling comes last.
The results of planning are recorded in the software project management plan (SPMP) document. Because accurate planning is hard at the start, planning is often done in stages and refined as the project proceeds; this is called sliding window planning.
In conclusion, a good project manager needs a sound knowledge of estimation and planning techniques together with skills in communication, decision making and tracking.
2 What is risk management in a software project? Explain risk identification, risk assessment and risk containment, with an example of ranking risks by risk exposure. 10 marks
A risk is an uncertain event that, if it occurs, can harm a project by delaying it, raising its cost or lowering the quality of the product. Risk management is the set of activities by which the project manager finds such events early and plans to limit their damage. It is repeated throughout the project, as shown below.
1. Risk identification: the manager lists the risks the project faces, often with checklists drawn from earlier projects. Risks fall into three classes:
- Project risks: problems with budget, schedule, staff, resources or the customer, such as a key developer leaving.
- Technical risks: problems in design, implementation, interfacing or testing, such as ambiguous or incomplete specifications or an unfamiliar technology.
- Business risks: for example building a product nobody wants, or losing management support for the budget.
2. Risk assessment: each risk is ranked by the probability p that it occurs and the loss L it causes if it does. Its risk exposure is RE = p × L. Example, with R1: a key developer leaves; R2: requirements change late; R3: a third-party library proves unsuitable:
Risk p Loss (Rs.) RE = p × L (Rs.)
R1 0.3 5,00,000 1,50,000
R2 0.5 2,00,000 1,00,000
R3 0.1 8,00,000 80,000The ranking is R1, R2, R3, so R1 is handled first even though R3 has the largest loss.
3. Risk containment: plans are made for the top-ranked risks, using three strategies:
- Avoid the risk: remove its cause, for example by agreeing with the customer to drop a risky requirement, or by giving incentives that reduce staff turnover.
- Transfer the risk: pass the risky part to a third party, such as a specialist subcontractor, or buy insurance.
- Reduce the risk: plan to limit the damage, for example by training a second developer on R1's work.
A reduction step is worth taking only if it lowers the exposure by more than it costs. This is measured by risk leverage = (RE before − RE after) / cost of reduction. Suppose cross-training costs Rs. 40,000 and cuts the loss if the key developer leaves from Rs. 5,00,000 to Rs. 1,50,000. RE after = 0.3 × 1,50,000 = Rs. 45,000, so leverage = (1,50,000 − 45,000) / 40,000 = 1,05,000 / 40,000 = 2.625. A leverage above 1 means the step pays for itself.
4. Risk monitoring: at each milestone the risks and their exposures are reviewed, new risks are added, and the cycle starts again.
In conclusion, risk management turns vague worries into a ranked list with a planned response for each risk.
3 Explain the lines of code (LOC) and function point (FP) metrics for project size estimation. Compute the function points of a project with 24 external inputs, 16 external outputs, 22 external inquiries, 4 internal logical files and 2 external interface files, all of average complexity, when its 14 general system characteristics add up to 42. 10 marks
Project size is the most basic quantity in planning, because effort, cost and duration are all estimated from it. Size measures the problem the software solves, not the bytes of the program. The two widely used size metrics are lines of code and function points.
Lines of code (LOC)
LOC counts the source lines of the delivered program, leaving out comments and blank lines. Before coding, the manager estimates it by dividing the system into modules, estimating each module's lines from similar past work, and adding them up. LOC is simple, but it has serious drawbacks:
- It measures the text of the code, not the functionality delivered, and it varies with the language and the programmer's coding style.
- It reflects only coding, although design, testing and documentation take a large share of the effort.
- It can be counted accurately only after the code is written; at the start of a project it is a guess.
- It penalises good practice: reuse or a higher-level language gives fewer lines for the same function.
Function points (FP)
FP measures size from the functions the software offers, so it can be computed from the SRS and does not depend on the language. Five parameters are counted and weighted by complexity. With the standard average weights:
Parameter Count Weight Total
Inputs (EI) 24 4 96
Outputs (EO) 16 5 80
Inquiries (EQ) 22 4 88
Files (ILF) 4 10 40
Interfaces (EIF) 2 7 14
Unadjusted FP (UFP) 318Next, each of 14 general system characteristics, such as data communications, performance and reusability, is rated from 0 to 5 by its degree of influence. Here the ratings add up to DI = 42.
- Technical complexity factor (also called the value adjustment factor): TCF = 0.65 + 0.01 × DI = 0.65 + 0.42 = 1.07
- FP = UFP × TCF = 318 × 1.07 = 340.26 ≈ 340 function points
TCF lies between 0.65 and 1.35, so the adjustment changes UFP by at most 35 per cent either way. At an assumed productivity of 10 FP per person-month, the effort is about 340 / 10 = 34 person-months. If a problem supplies its own weights, use those instead.
FP has weaknesses too: it treats every function as equally hard to build, ignoring algorithmic complexity, and the counting needs judgement. The feature point metric extends FP by also counting the algorithms.
In conclusion, LOC is easy to count once the code exists, while FP can be estimated early from the requirements and allows fair comparison across languages.
4 Classify project estimation techniques. Explain the basic COCOMO model and use it to estimate the effort, development time and average staff size of a 40 KLOC project in each of its three modes. 10 marks
Project estimation techniques fall into three classes:
1. Empirical techniques: educated guesses based on past experience. In expert judgement one expert estimates the whole project; Delphi gathers anonymous estimates from several experts over repeated rounds until they agree. 2. Heuristic techniques: project parameters are assumed to follow a mathematical expression fitted to data from past projects, such as effort = a × (size)^b. COCOMO is the best-known example. 3. Analytical techniques: results are derived from basic assumptions about the work; Halstead's software science is an example.
Basic COCOMO
COCOMO (Constructive Cost Model) first places a project in one of three modes:
- Organic: a small, experienced team builds a well-understood application, such as a payroll system.
- Semidetached: the team mixes experienced and new members, or knows only some aspects of the system, such as a compiler.
- Embedded: the software is tightly coupled to hardware or strict operating rules, such as a flight-control system.
Basic COCOMO estimates effort E in person-months (PM) from size in KLOC, and development time Tdev in months from E:
E = a × (KLOC)^b
Tdev = c × (E)^d
Mode a b c d
Organic 2.4 1.05 2.5 0.38
Semidetached 3.0 1.12 2.5 0.35
Embedded 3.6 1.20 2.5 0.32Example: size = 40 KLOC.
Organic:
- E = 2.4 × 40^1.05 = 2.4 × 48.10 = 115.4 PM
- Tdev = 2.5 × 115.4^0.38 = 2.5 × 6.08 = 15.2 months
- Average staff = E / Tdev = 115.4 / 15.2 ≈ 7.6, about 8 people
Semidetached:
- E = 3.0 × 40^1.12 = 3.0 × 62.27 = 186.8 PM
- Tdev = 2.5 × 186.8^0.35 = 2.5 × 6.24 = 15.6 months
- Average staff = 186.8 / 15.6 ≈ 12 people
Embedded:
- E = 3.6 × 40^1.20 = 3.6 × 83.65 = 301.1 PM
- Tdev = 2.5 × 301.1^0.32 = 2.5 × 6.21 = 15.5 months
- Average staff = 301.1 / 15.5 ≈ 19 people
Effort grows faster than size (b > 1), while development time grows far more slowly than effort (d < 1). Moving from organic to embedded multiplies the effort by about 2.6 but hardly changes Tdev: the extra work needs a larger team, not more months.
Intermediate COCOMO refines the nominal effort by multiplying it by an effort adjustment factor (EAF), the product of multipliers for 15 cost drivers grouped into product, computer, personnel and project attributes, such as required reliability, analyst capability and use of software tools. Complete COCOMO goes further: it estimates the subsystems separately, each with its own characteristics, and adds the results.
In conclusion, basic COCOMO gives a quick early estimate, which the refined models improve.
5 Explain requirements gathering and analysis, including the problems an analyst must remove from the gathered requirements. Describe the contents and characteristics of a good SRS document. 10 marks
Requirements analysis and specification is the phase that finds out exactly what the customer needs and records it, before any design starts. It has two parts: requirements gathering and analysis, carried out by system analysts, and requirements specification, which produces the software requirements specification (SRS) document.
Requirements gathering
The analyst collects requirements from the customers, the end users and existing records, using techniques such as:
1. Studying existing documentation: manuals, forms and reports of the current system. 2. Interviews: talking to each kind of user, since different groups need different features. 3. Task analysis: breaking each service the system must provide into the steps that make it up. 4. Scenario analysis: working through example sequences of user actions and system responses, including the cases where something goes wrong. 5. Form analysis: studying the input forms and output reports the users already handle.
Requirements analysis
The analyst studies the gathered information to understand the problem, the data input and output, and any difficulties. Three kinds of problem must be removed:
- Anomaly: a requirement that can be read in more than one way, such as "the system shall respond quickly".
- Inconsistency: requirements that contradict each other, such as one user saying a member may borrow 5 books and another saying 3.
- Incompleteness: a requirement that was missed, such as a low-stock alert with no statement of who receives it.
The analyst resolves these by going back to the users, so gathering and analysis repeat until the requirements are clear.
Contents of the SRS
- Functional requirements: the services the system offers, each with its input, processing and output.
- Non-functional requirements: qualities and constraints such as performance, reliability, security, usability, and the hardware and operating system to be used.
- Goals of implementation: general guidance for development, such as likely future changes to plan for.
Characteristics of a good SRS
- Concise, complete and consistent.
- Unambiguous and verifiable: each requirement can be checked by a test.
- Traceable and modifiable: well structured, so a requirement can be followed into design and code and changed easily.
- A black-box view: it states what the system must do, not how.
- It specifies the response to undesired events, such as invalid input.
In conclusion, the SRS is the agreement between customer and developer and the reference for design, testing and maintenance, so errors removed at this stage are the cheapest to fix.
6 What is a formal specification? Explain axiomatic and algebraic specification with suitable examples, and comment on executable specifications and 4GLs. 10 marks
A formal specification describes a system in a mathematical notation, so that its meaning is exact. A formal specification language has a syntactic domain (the notation), a semantic domain (the meanings) and a satisfaction relation that decides whether an implementation meets the specification. Formal specifications are unambiguous, can be checked by tools and expose gaps and contradictions early; but they are hard to learn, laborious for large systems and hard for customers to read, so they are used mainly for critical parts. Methods are either model-oriented (Z, VDM) or property-oriented (algebraic specification).
Axiomatic specification
Each operation is given, in first-order logic, a pre-condition that must hold before it is called and a post-condition that must hold when it finishes. To write one:
1. Find the range of inputs on which the operation must work and state it as the pre-condition. 2. State the required output as a predicate on the inputs: the post-condition. 3. Add any changes the operation makes to its input parameters.
Example, integer square root:
isqrt(x : integer) : integer
pre: x ≥ 0
post: result × result ≤ x ∧
(result + 1) × (result + 1) > xFor x = 10 only result = 3 satisfies the post-condition, since 9 ≤ 10 < 16.
Algebraic specification
A type is defined by its operations and equations relating them, with no model of how values are stored. Constructor operations build every value; the equations give the effect of each other operation on each constructor. A stack of integers:
Types: stack, integer, boolean
Syntax:
create : → stack
push : stack × integer → stack
pop : stack → stack
top : stack → integer
isempty : stack → boolean
Equations:
isempty(create) = true
isempty(push(s, x)) = false
pop(push(s, x)) = s
top(push(s, x)) = x
Exceptions:
pop(create), top(create) = errorUsed as left-to-right rewrite rules, the equations simplify any expression:
top(pop(push(push(create, 5), 9))) = top(push(create, 5)) = 5
A good algebraic specification is complete (every required fact follows from the equations), has the finite termination property (every rewriting stops after a finite number of steps) and has the unique termination property (applying the equations in any order gives the same result).
Executable specification and 4GL
If a specification language can be executed, the specification itself becomes a prototype that users can try, which validates requirements early, though it usually runs far slower than a hand-written program. Fourth-generation languages (4GLs) apply this idea in practice: in SQL, SELECT name FROM student WHERE cgpa > 8 states what is wanted and the system decides how. 4GLs suit data-processing applications, which share many common patterns, but give less efficient programs and serve only narrow domains.
In conclusion, formal methods trade extra effort for precision.
Software Design, Agility and User Interface Design
Syllabus: Overview of the design process; Characteristics of a good software design; Layered arrangement of modules; Cohesion and coupling; Approaches to software design; Agility and the cost of change; Agile process and Extreme Programming (XP); Other agile process models and the agile tool set; Overview of the SA/SD methodology and structured analysis; Developing the DFD model of a system; Structured design, detailed design and design review; Characteristics of a good user interface and basic concepts; Types of user interfaces; Component-based GUI development and user interface design methodology
One-page revision summary
- Design turns the SRS document into a design document in two stages: high-level design fixes the modules, their calls and interfaces as a structure chart, and detailed design fixes each module's data structures and algorithms.
- A good design is correct, understandable, efficient and maintainable, and understandability comes from meaningful names, modularity and a layered arrangement of modules.
- In a layered design a module calls only modules in the layer below it; keep fan-out low, while high fan-in shows useful reuse.
- Aim for high cohesion and low coupling, because functionally independent modules isolate errors, can be reused and can be understood one at a time.
- Function-oriented design decomposes the system top down into functions that share a centralised state, while object-oriented design builds it from objects that keep their own state and interact by messages.
- Agility is the ability to respond quickly to change, and agile processes aim to flatten the cost-of-change curve through incremental delivery, simple design, refactoring and continuous testing.
- XP repeats four activities: planning with user stories and velocity, simple design with CRC cards and spike solutions, test-first pair programming with continuous integration, and automated unit and acceptance testing.
- Scrum organises work into sprints drawn from a prioritised product backlog, with short daily Scrum meetings and a demonstration at the end of each sprint.
- Other agile process models include Adaptive Software Development (speculation, collaboration, learning), DSDM (incremental prototyping in fixed time-boxes), Crystal (a family of methods chosen by team size and criticality), Feature Driven Development (small client-valued features), Lean Software Development (eliminating waste), Agile Modeling and the Agile Unified Process.
- The agile tool set is as much social as technical: index cards and sticky notes for stories, whiteboards and visible progress charts for status, and tools for automated testing, continuous integration and version control.
- SA/SD has two parts: structured analysis builds a DFD model in the user's terms by top-down decomposition, and structured design maps that DFD model into a structure chart.
- A context diagram has exactly one bubble, a level-1 DFD usually has three to seven bubbles, and every level must be balanced with the level above it.
- Use transform analysis when all inputs are processed alike (afferent branch, central transform, efferent branch) and transaction analysis when different kinds of input take different paths.
- Detailed design writes a module specification for every module, and a design review checks traceability, correctness, maintainability and ease of implementation before coding.
- A good user interface is quick to learn, use and recall, prevents errors and allows undo, stays consistent, gives feedback and supports both novices and experts.
- User interfaces are command language-based, menu-based (scrolling, walking or hierarchical menus) or direct manipulation, and modern GUIs combine all three.
- Component-based GUI development builds the interface from standard widgets supplied by a toolkit, such as windows, menus, buttons, text boxes and dialog boxes, which gives a consistent look and feel.
- A typical GUI design methodology examines the use case model, builds task and object models, selects a metaphor, designs the interaction with a rough screen layout, works out the detailed presentation and graphics, constructs the GUI and then inspects the interface for usability.
Learn these by heart
- Cohesion, lowest to highest: coincidental, logical, temporal, procedural, communicational, sequential, functional.
- Coupling, lowest to highest: data, stamp, control, common, content.
- Good design rule: high cohesion and low coupling give functional independence.
- Fan-out is the number of modules a module calls directly; fan-in is the number of modules that call it directly.
- XP values: communication, simplicity, feedback, courage and respect.
- DFD balancing: the data flows into and out of a bubble must match those of its decomposition at the next level.
- Design review checks: traceability, correctness, maintainability and implementation.
2-mark questions
1 What is meant by a layered arrangement of modules? Define fan-in and fan-out. 2 marks
In a layered design the modules sit in levels, and a module calls only modules in the layer below it, never one in a higher layer. Fan-out of a module is the number of modules it calls directly; fan-in is the number of modules that call it directly. Low fan-out keeps modules simple, and high fan-in shows reuse.
2 Distinguish between function-oriented design and object-oriented design. 2 marks
Function-oriented design decomposes the system top down into functions that share a centralised system state, as in SA/SD. Object-oriented design views the system as a set of objects, each keeping its own data (a decentralised state) and offering operations on it; objects cooperate by passing messages. The two approaches complement each other.
3 What is meant by the cost of change, and how does an agile process try to reduce it? 2 marks
The cost of change is the effort and money needed to make a change to the software. In a conventional process it rises steeply as the project moves from requirements to design, coding and testing. An agile process aims to flatten this curve through small increments, simple design, refactoring and continuous testing, so that late changes stay cheaper.
4 What is a sprint in the Scrum agile process? 2 marks
A sprint is a fixed time-box of a few weeks, at most about a month, in which the team builds a working increment from the highest-priority items moved from the product backlog to the sprint backlog. New work is not normally added during a sprint; short daily Scrum meetings track progress, and a demonstration to the customer ends it.
5 What is a data dictionary, and why is it needed along with a DFD model? 2 marks
A data dictionary lists every data item used in a DFD model, such as data flows and data stores, with its meaning and composition, for example issue request = member id + book id. It gives all developers one agreed meaning for every name and helps to check that the DFD levels use data consistently.
6 What is component-based GUI development? Give examples of components. 2 marks
In component-based GUI development the interface is assembled from ready-made user interface components, called widgets, supplied by a toolkit: windows, menus, push buttons, text boxes, check boxes, radio buttons, list boxes, scroll bars and dialog boxes. Because users already know how these behave, the interface is quicker to learn, looks consistent and is faster to build.
10-mark questions
1 Give an overview of the software design process, explaining its outcomes and how design activities are classified. What are the characteristics of a good software design? 10 marks
Software design is the activity that turns the requirements in the SRS document into a form that programmers can code directly. Its input is the SRS document and its output is the design document.
The main outcomes of the design process are:
- the modules that make up the software;
- the control relationships among the modules, that is, which module calls which;
- the interfaces among modules, that is, the data items they exchange;
- the data structures of each module;
- the algorithms needed to implement each module.
Design activities are classified into two stages:
1. High-level (preliminary) design: the problem is decomposed into modules, and the control relationships and interfaces among them are fixed. The result is the software architecture, usually drawn as a structure chart.
2. Detailed design: the data structures and algorithms of every module are worked out. The result is a module specification for each module.
After detailed design, the design document is reviewed, and only then does coding begin.
The characteristics of a good software design are:
1. Correctness: it implements every function stated in the SRS document.
2. Understandability: it is easy to follow. This needs consistent and meaningful names for modules and data, a modular structure in which the problem is decomposed into modules with high cohesion and low coupling, and a neat layered arrangement of modules. In a layered arrangement a module calls only modules in the layer below it and does not depend on the layers above, which makes the design easier to understand and to debug.
3. Efficiency: it uses resources such as memory, processor time and development effort economically.
4. Maintainability: it is easy to change when bugs are fixed or requirements change.
Understandability deserves the most attention, because a design that is easy to understand is also easy to check for correctness, to code and to maintain, and maintenance takes a large share of the total cost of software. Functionally independent modules also isolate errors, can be reused and can be understood one at a time.
In conclusion, design proceeds from high-level design to detailed design, and a good design is correct, understandable, efficient and maintainable, with understandability achieved through good names, modularity and layering.
2 What are the characteristics of a good user interface? Explain the main types of user interfaces with their merits and demerits. 10 marks
The user interface is the part of the software through which users work with it, so its quality strongly affects how the whole product is judged.
The characteristics of a good user interface are:
- Speed of learning: novices learn it quickly, helped by meaningful command names, metaphors from everyday life and consistency.
- Speed of use: commands take little time and effort to start and run.
- Speed of recall: once learnt, commands are easy to remember.
- Error prevention and recovery: it blocks likely mistakes, for example by greying out invalid choices, and lets users undo actions.
- Consistency: similar commands look and behave alike on every screen.
- Feedback: every action gets a visible response, such as a progress bar.
- Support for different skill levels: menus for novices and shortcuts for experts.
- Attractiveness, and user guidance through online help and clear error messages.
Two basic concepts: a mode-based interface allows different sets of commands in different states, while a modeless interface offers the same commands at all times; and a GUI uses windows, icons and a pointing device, while a text-based interface uses only characters on the screen.
User interfaces are of three main types:
1. Command language-based interface: the user types commands, as in an operating system shell. Merits: flexible, fast for experts, and commands can be combined into complex ones. Demerits: hard to learn, users must recall command names, and typing errors are common.
2. Menu-based interface: the user picks a command from a list, so recognition replaces recall. Merits: easy for novices, little typing and fewer errors. Demerits: slower for experienced users, and complex commands are hard to compose. Large menus are organised as scrolling menus (the list scrolls), walking menus (choosing an item opens a sub-menu beside it) or hierarchical menus (choosing an item replaces the menu by a sub-menu, moving down a tree).
3. Direct manipulation interface: objects appear as icons and the user acts on them directly, for example by dragging a file icon to the trash. Merits: very easy to learn and largely language independent. Demerits: complex commands, such as deleting all files of one type, are hard to express, and repetitive work is slow for experts.
Modern GUIs mix these types, offering menus and icons together with keyboard shortcuts.
In conclusion, a good interface is quick to learn, use and recall, prevents errors and stays consistent, and the right mix of interface types for the expected users helps achieve this.
3 Define cohesion and coupling. Explain the different classes of cohesion and coupling with an example of each, and state which a good design should aim for. 10 marks
Cohesion measures how strongly the functions inside one module belong together; coupling measures how strongly two modules depend on each other. A good design has high cohesion and low coupling. Such modules are functionally independent: an error stays inside one module, a module can be reused, and each module can be understood alone.
The classes of cohesion, from lowest to highest, are:
1. Coincidental: the functions are unrelated and grouped at random, for example one module that issues books, computes salaries and prints mark lists.
2. Logical: the functions do similar kinds of work, for example all the output routines of a program in one module.
3. Temporal: the functions run in the same span of time, for example the initialisation routines run at start-up.
4. Procedural: the functions run one after another as steps of one procedure, though they may work on different data, for example read card, check PIN and show menu in an ATM session.
5. Communicational: all the functions refer to or update the same data structure, for example push, pop and display on one stack.
6. Sequential: the output of one function is the input of the next, for example read marks, then validate marks, then compute grade.
7. Functional: all the elements work together to perform one single function, for example a module that only computes income tax.
The classes of coupling, from lowest to highest, are:
1. Data coupling: modules pass only elementary data items, such as an integer or a character, as parameters, for example compute_fine(days_late).
2. Stamp coupling: modules pass a composite data item such as a C structure or record, for example a whole student record when the called module needs only a few fields.
3. Control coupling: one module passes a flag that decides which statements the other executes, for example print_report(mode) where mode selects the code that runs.
4. Common coupling: modules share global data, for example several functions updating one global counter.
5. Content coupling: modules share code, for example a jump from one module into the middle of another module's code.
In conclusion, designers aim for functional or sequential cohesion and for data coupling, and avoid coincidental cohesion and content coupling, so that the design is easier to understand, test and maintain.
4 What is agility? Explain how agility affects the cost of change, and describe the Extreme Programming (XP) process with its values and key practices. 10 marks
Agility is the ability of a software team to respond quickly and effectively to change, whether in requirements, in the team or in technology. An agile process values working software over heavy documentation, and it stresses close customer collaboration, small self-organising teams and rapid incremental delivery.
Agility and the cost of change: in a conventional process the cost of making a change rises steeply as the project advances. A change during requirements gathering is cheap, but the same change during system testing can force rework of the design, code and tests. Agile proponents argue that a well-run agile process flattens this curve, because software is delivered in small increments, the design is kept simple and refactored, and continuous testing and pair programming catch problems early. Late changes therefore cost less than in a plan-driven process.
Extreme Programming (XP) is a widely used agile process built on five values: communication, simplicity, feedback, courage and respect. Its work is organised into four framework activities that repeat for every increment:
1. Planning: the customer writes user stories, each describing a required feature, and gives each a priority. The team estimates the cost of each story in weeks; a story needing more than three weeks is split into smaller stories. Customer and team then choose the stories for the next release. After the first release, project velocity, the number of stories completed in that release, is used to estimate later delivery dates.
2. Design: XP keeps the design simple, building only what the current stories need. CRC (class-responsibility-collaborator) cards organise the classes. For a hard design problem the team builds a spike solution, a quick prototype that lowers the risk. Refactoring improves the internal structure of the code without changing its external behaviour.
3. Coding: unit tests are written before the code they test (test-first coding). Code is written by pair programming: two programmers share one workstation, one writing and the other reviewing as it is written. Each pair's code is integrated with the rest often (continuous integration).
4. Testing: the unit tests are automated and run repeatedly, so every change is regression tested. Acceptance tests, written from the customer's user stories, check each software increment before it is released, and the customer's feedback then feeds the planning of the next iteration.
In conclusion, by working in short cycles with simple design, test-first coding and constant customer feedback, XP puts agility into practice and keeps the cost of change low.
5 Explain the SA/SD methodology and the symbols of a DFD. Develop the context diagram and the level-1 DFD for a library circulation system in which members borrow and return books and the librarian asks for an overdue report. 10 marks
SA/SD (structured analysis and structured design) is a function-oriented design methodology. Structured analysis takes the functional requirements in the SRS document and decomposes them, top down, into a DFD model; structured design then maps the DFD model into a structure chart, the high-level design. Analysis uses the user's terms, while design adds implementation detail.
Structured analysis rests on three ideas: top-down decomposition, divide and conquer (each function is decomposed independently of the others) and graphical representation of the results as DFDs.
The DFD symbols are:
- Process (bubble, a circle): a function that transforms data, numbered 1, 2, 3.
- External entity (rectangle): a person or system outside the software that supplies or receives data.
- Data flow (labelled arrow): data moving between two symbols.
- Data store (two parallel lines, drawn here as a cylinder): data held for later use.
Developing the DFD model of the library circulation system:
1. Context diagram (level 0): the whole system is one bubble, 0 Library circulation system, joined to its external entities. Member sends an issue request and return details and receives an issue slip and a fine receipt; Librarian sends a report request and receives an overdue report.
2. Level-1 DFD: the context bubble is split into its main functions, usually three to seven bubbles. Here there are three: 1 Issue book, 2 Return book and 3 Overdue report, with the data stores Members, Books and Loans. Many texts draw external entities only in the context diagram and let the boundary flows of a level-1 DFD enter and leave at its edge; the figure repeats Member and Librarian only to show where each flow goes.
3. Issue book reads member details and book details, writes a new loan to Loans and sends an issue slip. Return book reads the loan record, computes any fine, writes the returned loan back and sends a fine receipt. Overdue report reads loan data and sends the overdue report.
4. Balancing: the six data flows that cross the boundary in the context diagram appear in the level-1 DFD and no new external flows are added, so the two levels are balanced. Each bubble can be decomposed further (1.1, 1.2) in the same way.
5. Every name is entered in the data dictionary, for example issue request = member id + book id.
Mistakes to avoid: more than one bubble in the context diagram, unbalanced levels, unlabelled data flows, and showing control logic such as loops or decisions.
In conclusion, the DFD model, built level by level and kept balanced, is the main output of structured analysis and the input to structured design.
6 Explain transform analysis and transaction analysis in structured design. A library circulation system has three level-1 processes, Issue book, Return book and Overdue report, each started by a different kind of request: derive its structure chart, and explain detailed design and design review. 10 marks
Structured design maps the DFD model produced by structured analysis into a structure chart, which shows the modules of the software, which module calls which, and the data passed between them. A structure chart uses rectangles for modules, arrows from the calling to the called module, small labelled arrows for the data passed, a double-edged rectangle for a library module, a diamond for selection and a looping arrow for repetition. Unlike a DFD, it shows calls between modules rather than data moving through processes.
Two strategies are used:
1. Transform analysis suits a DFD in which all the input data are processed in a similar way, entering at the same bubble. The DFD is split into the input (afferent) branch, the central transform and the output (efferent) branch. The root module gets one module for each part (first-level factoring), and each of these is then factored further.
2. Transaction analysis suits a DFD in which different kinds of input, called transactions, take different paths through different bubbles. A transaction-centre (root) module reads the input, decides its type and calls the one module that handles that transaction; each transaction module is then designed by transform analysis.
Applying transaction analysis to the library circulation system:
1. The issue request, the return details and the report request are three transactions, one for each level-1 bubble.
2. The root module, Library circulation, calls Get request, which reads a request and returns its type.
3. The root then calls exactly one of Issue book, Return book or Overdue report.
4. Factoring each transaction: Issue book calls Validate member and Record loan; Return book calls Compute fine and Close loan; Overdue report calls Find overdue loans.
Detailed design: for every module in the structure chart the data structures and algorithms are now decided and written as a module specification, usually in pseudocode or structured English, ready for coding.
Design review: before coding, a review team with design, coding, testing and maintenance viewpoints checks the design for:
- Traceability: every DFD bubble maps to a module, and every module traces back to a requirement.
- Correctness: the data structures and algorithms are right.
- Maintainability: the design will be easy to change later.
- Implementation: it can be built efficiently within the available time and budget.
Defects found are recorded and corrected before coding begins.
In conclusion, transform or transaction analysis turns the DFD into a structure chart, detailed design completes each module, and a design review checks the result before coding.
Coding, Testing, Reliability and Quality Management
Syllabus: Coding and code review; Software documentation; Testing: basic concepts; Black-box testing; White-box testing; Debugging and program analysis tools; Integration testing; Testing object-oriented programs; Smoke testing and general issues in testing; Software reliability and statistical testing; Software quality and quality management systems; ISO 9000 and the SEI Capability Maturity Model; Other quality standards and Six Sigma
One-page revision summary
- The coding phase turns each module's design into code; coding standards are enforced rules, coding guidelines are recommendations, and code review comes after a clean compile and before unit testing.
- A code walkthrough is an informal review in which members trace the code by hand, while a code inspection is a formal, checklist-driven review with fixed roles and a follow-up.
- Gunning's fog index rates how readable a document is from its average sentence length and its share of words with three or more syllables; a higher index means harder text.
- A developer's mistake leaves a fault (bug or defect) in the code, and a failure is the wrong behaviour seen when the faulty code runs; some texts use the word error for the fault itself.
- Testing proceeds in three levels: unit testing of each module, integration testing of the interfaces between modules, and system testing of the whole product against the SRS.
- Black-box tests come from the specification (equivalence classes and boundary values), while white-box tests come from the code structure (statement, branch and path coverage), and a good test suite uses both.
- Mutation testing makes small changes (mutants) to the program and checks whether the test suite detects each one; data flow testing selects paths from the definitions to the uses of each variable.
- Static analysis tools examine source code without running it, for example finding unused variables or coding standard violations, while dynamic analysis tools run the program and report the statement and branch coverage reached.
- When debugging, first understand the design of the program, fix the cause rather than the symptom, and rerun regression tests after every fix, because a correction can introduce new errors.
- In object-oriented testing the class is the basic unit, and tests must cover object states, inherited methods in each subclass and every polymorphic binding, often with state-based tests from state machine models.
- Smoke testing checks that a new build's basic functions work before detailed system testing, which includes alpha, beta and acceptance testing and performance tests such as stress and volume testing.
- General issues in testing include test documentation, such as the test plan and the test summary report, and regression testing, which reruns earlier tests after a change to confirm nothing that worked is broken.
- Reliability depends on where the remaining faults lie and how the software is used, so it is measured with MTTF, ROCOF, POFOD and availability from tests that follow the operational profile.
- Reliability growth models, such as the Jelinski-Moranda model, predict how reliability improves as faults are removed, which helps decide when testing can stop.
- Quality systems evolved from product inspection to quality control, then quality assurance, and then total quality management (TQM), which stresses continuous process improvement.
- ISO 9001 is the ISO 9000 standard that applies to software development organisations, and ISO 9000-3 gives guidance on applying it to software.
- The SEI CMM levels are Initial, Repeatable, Defined, Managed and Optimizing, and each level above Initial is reached by satisfying its key process areas.
- CMMI integrates several maturity models, ISO/IEC 15504 (SPICE) assesses process capability, and the Personal Software Process (PSP) helps individual engineers plan their work and log their time and defects.
- Six Sigma improves existing processes with DMAIC and designs new ones with DMADV, aiming at no more than 3.4 defects per million opportunities.
Learn these by heart
- Cyclomatic complexity V(G) = E − N + 2 = number of binary decision nodes + 1 = number of bounded regions + 1.
- MTBF = MTTF + MTTR, and availability = MTTF / (MTTF + MTTR).
- ROCOF = number of failures / operating time; POFOD = failed demands / total demands.
- Verification asks "are we building the product right?"; validation asks "are we building the right product?"
- A stub stands in for a lower-level module that is called (top-down); a driver calls the module under test (bottom-up).
- ECP takes one representative value from each class; BVA tests each boundary and the value just across it.
- CMM levels in order: 1 Initial, 2 Repeatable, 3 Defined, 4 Managed, 5 Optimizing.
- Six Sigma means at most 3.4 defects per million opportunities.
2-mark questions
1 Distinguish between verification and validation in software testing. 2 marks
Verification checks whether the output of each development phase conforms to what the previous phase specified; it asks "are we building the product right?" Reviews, inspections and unit testing are verification activities. Validation checks whether the finished software meets the customer's requirements; it asks "are we building the right product?" System and acceptance testing validate the product.
2 Differentiate internal and external documentation of software. 2 marks
Internal documentation lives inside the source code: module headers, comments, meaningful identifier names and a readable layout, all of which help maintainers understand the code. External documentation is kept outside the code: the SRS, design documents, test documents, the users' manual and the installation manual. Both must be updated whenever the code changes.
3 Name and briefly explain four approaches to debugging. 2 marks
- Brute force: add print statements or use a debugger to watch variables; simple but slow.
- Backtracking: trace the code backwards from the statement where the symptom appears.
- Cause elimination: list the possible causes and test each until one is confirmed.
- Program slicing: examine only the statements that can affect a chosen variable at a point.
4 Why do object-oriented programs need testing techniques beyond those used for procedural programs? 2 marks
In object-oriented programs the class, not the function, is the unit of testing. Encapsulation hides object state, so methods must be tested in each state. Inherited methods must be retested in every subclass, where they run in a new context. Polymorphism and dynamic binding let one call run different methods, and each binding needs a test.
5 What is smoke testing and why is it done? 2 marks
Smoke testing is a quick check, run on each new build before detailed system testing, that the most basic functions of the integrated software work: it starts, accepts input and handles its main features. A build that fails the smoke test goes back to the developers, because detailed testing of an unstable build would waste effort.
6 What is Six Sigma in quality management? 2 marks
Six Sigma is a data-driven quality method that reduces process variation until no more than 3.4 defects occur per million opportunities. Existing processes are improved through the DMAIC cycle (Define, Measure, Analyse, Improve, Control), and new processes are designed through DMADV (Define, Measure, Analyse, Design, Verify).
10-mark questions
1 Distinguish coding standards from coding guidelines. Explain the two code review techniques, code walkthrough and code inspection. 10 marks
Coding turns the module specifications of the design into source code. Good organisations make programmers follow coding standards and guidelines, and they review every module after it compiles without errors and before unit testing, because a review finds the errors themselves, not just their symptoms.
Coding standards are rules that every programmer must follow, and reviews check them. Examples:
- a standard header for each module: name, author, date, purpose, functions and global variables used, and modification history
- naming conventions for global variables, local variables and constants
- one fixed convention for returning error conditions from functions
Coding guidelines are good practices that are recommended rather than enforced. Examples:
- avoid clever code that is hard to understand
- avoid obscure side effects, such as changing a global variable inside a function
- do not use one identifier for several purposes
- keep functions short and avoid GOTO statements
Code walkthrough
1. It is an informal review. The code is given to a small team a few days before the meeting.
2. Each member selects some test cases and traces the code by hand to see what it does for them.
3. In the meeting the members discuss what they found; the aim is to discover errors, not to fix them.
4. Managers usually stay away, so that the meeting is not seen as an evaluation of the programmer.
Code inspection
1. It is a formal review that hunts for common kinds of programming errors using a checklist: uninitialised variables, loops that never end, array indices out of bounds, a mismatch between actual and formal parameters, wrong logical operators or precedence, comparing floating-point values for equality, and improper storage allocation and deallocation.
2. Roles are fixed: a moderator who leads, the author, a reader who paraphrases the code, inspectors, and a recorder who logs defects.
3. It runs in stages: planning, an overview meeting, individual preparation, the inspection meeting, rework by the author, and a follow-up in which the moderator checks every fix and orders a re-inspection if needed.
A walkthrough is cheap and spreads understanding of the code; an inspection is more rigorous, and its defect logs show which kinds of error the organisation makes, so its coding standards can be improved. Both cost far less than finding the same errors later in testing.
2 What is integration testing? Explain big-bang, top-down, bottom-up and mixed integration testing, and the roles of stubs and drivers. 10 marks
Integration testing follows unit testing. Its aim is to find errors in the interfaces between modules, such as wrong parameters passed in a call or misunderstood return values, while the modules are combined step by step. The structure chart from the design shows which module calls which, and it fixes the order of integration. In the chart below, M calls A, B and C, A calls D and E, and C calls F.
Stubs and drivers
- A stub is a dummy version of a lower-level module that the module under test calls; it returns fixed or simple results.
- A driver is a small program that calls the module under test, passes it test data and shows the results; it stands in for the higher-level caller.
Approaches
1. Big-bang: all the modules M to F are linked at once and tested as a whole. No stubs or drivers are needed, but when a test fails the error could lie in any interface, so debugging is very hard. It suits only very small programs.
2. Top-down: testing starts with M, with stubs standing in for A, B and C. The stubs are replaced by the real modules one at a time, and finally D, E and F are added. Only stubs are needed and a skeleton of the whole system can be shown early. But the lower modules, which often perform input and output, are missing at first, so it can be hard to give the top modules the test data they need.
3. Bottom-up: D, E and F are tested first, each with a driver. Then A is tested with D and E, C with F, and B on its own, and finally M is added. Only drivers are needed, separate subsystems can be tested at the same time, and the low-level utilities are tested thoroughly. But no working version of the whole system exists until the last module is added.
4. Mixed (sandwich): top-down and bottom-up testing run together, so testing starts as soon as modules become available at either end. Both stubs and drivers are needed, but neither end has to wait for the other.
Modules can also be added in two ways. In incremental integration one module is added to the partly integrated system at a time; in phased integration a group of related modules is added in each step. Phased integration needs fewer steps, but incremental integration makes a failure easier to trace to the module just added. After each addition the earlier tests are rerun (regression testing) to check that nothing that worked before is broken.
Integration testing thus delivers a complete system, with every interface checked, that is ready for system testing.
3 A function grade(m) takes an integer mark m and returns Fail for 0 to 39, Pass for 40 to 59, First class for 60 to 74 and Distinction for 75 to 100; any other value returns Invalid. Design black-box test cases for it using equivalence class partitioning and boundary value analysis. 10 marks
Black-box testing designs test cases from the specification alone, without looking at the code. A test case states an input and its expected output, and a test suite is the set of test cases for the function. Two techniques work together here: equivalence class partitioning (ECP) and boundary value analysis (BVA).
Step 1: Equivalence class partitioning
The input domain is divided into classes such that the function treats every value in a class the same way, so one value can represent the whole class. From the specification:
- valid classes: 0 to 39 (Fail), 40 to 59 (Pass), 60 to 74 (First class), 75 to 100 (Distinction)
- invalid classes: below 0 and above 100 (Invalid)
One representative from each class gives six test cases:
Class Input Expected
below 0 -5 Invalid
0 to 39 20 Fail
40 to 59 50 Pass
60 to 74 67 First class
75 to 100 88 Distinction
above 100 120 InvalidStep 2: Boundary value analysis
Programmers easily slip at the edge of a class, for example by writing m > 40 where m >= 40 is meant. BVA therefore tests each boundary and the value just across it:
Input Expected Boundary
-1 Invalid lower limit
0 Fail lower limit
39 Fail Fail/Pass
40 Pass Fail/Pass
59 Pass Pass/First
60 First class Pass/First
74 First class First/Dist.
75 Distinction First/Dist.
100 Distinction upper limit
101 Invalid upper limitStep 3: The test suite
The two sets share no input, so the suite has 6 + 10 = 16 test cases. Each is run and its output compared with the expected value; any mismatch is a failure to be debugged. The value of BVA shows clearly here: with the slip m > 40, a mark of 40 wrongly gives Fail, yet all six ECP inputs still give the right result, and only the BVA input 40 exposes the fault. If the mark can be typed as text, a non-numeric input such as "abc" forms one more invalid class and needs one more test case.
ECP keeps the suite small by removing redundant tests, and BVA adds the edge values where off-by-one errors hide, so together they give good black-box coverage with few test cases.
4 Draw the control flow graph of a function that counts the positive and negative values in an integer array, find its cyclomatic complexity by three methods, and derive test cases for statement, branch and basis path coverage. 10 marks
White-box (structural) testing designs test cases from the internal structure of the code. The function below counts the positive and negative values in an array a of n integers:
void count_signs(int a[], int n)
{
int i = 0, pos = 0, neg = 0; /* 1 */
while (i < n) { /* 2 */
if (a[i] > 0) /* 3 */
pos++; /* 4 */
else if (a[i] < 0) /* 5 */
neg++; /* 6 */
i++; /* 7 */
}
printf("%d %d", pos, neg); /* 8 */
}Step 1: Control flow graph (CFG)
Each numbered statement is a node and each possible transfer of control is an edge. Node 1 initialises i, pos and neg. Node 2 tests whether i is less than n, node 3 whether a[i] is positive and node 5 whether it is negative; each decision has a true and a false edge. Node 7 goes back to the loop test, and node 8 prints pos and neg.
The edges are 1→2, 2→3, 2→8, 3→4, 3→5, 4→7, 5→6, 5→7, 6→7 and 7→2, so E = 10 and N = 8.
Step 2: Cyclomatic complexity V(G)
1. V(G) = E − N + 2 = 10 − 8 + 2 = 4
2. V(G) = decision nodes + 1 = 3 + 1 = 4 (nodes 2, 3 and 5)
3. V(G) = bounded regions + 1 = 3 + 1 = 4 (the loop and the two if statements each enclose one region)
All three methods agree: the function has 4 linearly independent paths, so basis path testing needs at least 4 test cases.
Step 3: Test cases
Path a[] Output
P1 1-2-8 (n = 0) 0 0
P2 1-2-3-4-7-2-8 {5} 1 0
P3 1-2-3-5-6-7-2-8 {-3} 0 1
P4 1-2-3-5-7-2-8 {0} 0 0- Statement coverage: one test, a = {5, -3} with n = 2, executes every node from 1 to 8 (output 1 1).
- Branch coverage: that test never takes the false edge 5→7, so a zero is added: a = {5, -3, 0} with n = 3 covers all 10 edges (output 1 1).
- Basis path coverage: the four tests P1 to P4, one for each independent path; together they also cover every edge.
Covering every independent path therefore implies covering every branch, and covering every branch implies covering every statement, but not the other way round. Here each condition is a single comparison, so condition coverage is the same as branch coverage. V(G) also measures how hard a module is to understand and test, so a module with a high value is a candidate for splitting.
5 During statistical testing an ATM system handled 2,000 transactions in 1,000 hours of operation and failed 5 times. The operating times between failures were 120, 150, 200, 230 and 300 hours, and the repair times were 2, 3, 4, 5 and 6 hours. Explain statistical testing, and compute MTTF, MTTR, MTBF, ROCOF, POFOD and availability. 10 marks
Software reliability is the probability that the software works without failure for a stated time under stated conditions of use. It cannot be judged from the number of remaining faults alone: a fault in rarely used code hardly troubles users, while one in frequently executed code causes many failures. So reliability is measured from the failures observed in testing that imitates real use.
Statistical testing
1. Define the operational profile: the probability with which each kind of input occurs in use. For this ATM, suppose cash withdrawal 60%, balance enquiry 25%, mini statement 10% and PIN change 5%.
2. Select test inputs in the same proportions. For 2,000 transactions: 1,200 withdrawals, 500 balance enquiries, 200 mini statements and 100 PIN changes.
3. Run the tests and log every failure with the time at which it occurs.
4. Compute the reliability metrics. If the target is not reached, fix the defects and test again; otherwise release the software.
The metrics
- MTTF (mean time to failure): the average operating time between two successive failures.
- MTTR (mean time to repair): the average time taken to find and fix the fault after a failure.
- MTBF (mean time between failures): MTTF + MTTR, the expected time from one failure to the next.
- ROCOF (rate of occurrence of failures): the number of failures per unit of operating time.
- POFOD (probability of failure on demand): the chance that a request for service fails.
- Availability: the fraction of time the system is ready for use.
Calculation for the given data (5 failures, 2,000 demands)
Total operating time
= 120 + 150 + 200 + 230 + 300 = 1000 h
MTTF = 1000 / 5 = 200 h
MTTR = (2 + 3 + 4 + 5 + 6) / 5 = 4 h
MTBF = MTTF + MTTR = 200 + 4 = 204 h
ROCOF = 5 / 1000 = 0.005 failures per hour
POFOD = 5 / 2000 = 0.0025
Availability = MTTF / (MTTF + MTTR)
= 200 / 204 = 0.9804 (98.04%)So the ATM runs 200 hours between failures on average, 1 request in 400 fails, and it is available 98.04% of the time. The times between failures grow from 120 to 300 hours, which shows reliability growth as defects are removed.
Statistical testing gives a realistic reliability figure because the tests follow actual use, but an accurate operational profile is hard to build, and many test runs are needed before the result is statistically sound.
6 What is a quality management system? Explain the five maturity levels of the SEI Capability Maturity Model and compare CMM with ISO 9000 certification. 10 marks
A quality product is fit for its purpose: it meets its requirements and is also correct, usable, portable, reusable and maintainable. A quality management system (QMS) is the structure, responsibilities, procedures and resources an organisation uses to achieve quality. Quality systems evolved from inspecting finished products, to quality control (finding and removing the causes of defects), to quality assurance (good processes give good products), and on to total quality management (TQM), which seeks continuous process improvement.
The SEI Capability Maturity Model (CMM), developed by the Software Engineering Institute of Carnegie Mellon University, grades the maturity of an organisation's software process on five levels. Each level above the first is reached by satisfying its key process areas (KPAs).
1. Initial: work is ad hoc and chaotic, no processes are defined, and success depends on individual effort; schedules and budgets slip.
2. Repeatable: basic project management is in place, so success on similar earlier projects can be repeated. KPAs include software project planning and software configuration management.
3. Defined: management and development processes are documented and standardised across the organisation, and staff are trained in them. KPAs include organisation process definition, training programme and peer reviews.
4. Managed: process and product measurement is in place; quality and productivity goals are set and measured with metrics. KPAs include quantitative process management and software quality management.
5. Optimizing: the metrics drive continuous process improvement, defects are analysed to prevent them recurring, and new technology is adopted in a planned way. KPAs include defect prevention, technology change management and process change management.
CMM compared with ISO 9000
- Scope: ISO 9000 is an international family of quality standards for any industry; CMM was built specifically for software.
- Result: ISO 9000 certification is pass or fail; CMM places an organisation at one of five levels, which gives a step-by-step road map for improvement.
- Focus: ISO 9000 stresses a documented quality system that satisfies customers; CMM stresses improving the software process itself.
- Use: an ISO 9000 certificate is issued by an accredited registrar after an audit; CMM is used both by customers to evaluate a contractor's capability and by an organisation to assess itself.
Other standards and methods include CMMI, which integrates several maturity models, ISO/IEC 15504 (SPICE), which assesses process capability, and Six Sigma, a separate data-driven method that drives defects down to 3.4 per million opportunities.
CASE, Software Maintenance and Software Reuse
Syllabus: CASE and its scope; CASE environment and its architecture; CASE support in the software life cycle; Other characteristics of CASE tools; Second-generation CASE tools; Characteristics of software maintenance; Software reverse engineering; Software maintenance process models; Estimation of maintenance cost; Software reuse: definition and why little reuse has happened so far; Basic issues in any reuse program; A reuse approach and reuse at organization level
One-page revision summary
- CASE is the use of software tools to automate and support development and maintenance; its scope covers every life-cycle phase and cross-phase work such as project management, configuration management and documentation.
- Upper CASE tools support planning, requirements analysis and design, lower CASE tools support coding, testing and maintenance, and integrated CASE spans the whole life cycle.
- A CASE environment integrates its tools through a central repository, so data entered once is shared by all tools and kept consistent.
- The architecture of a CASE environment has four layers: user interface, tool set, object management system and repository.
- CASE supports prototyping with screen and report painters, structured analysis and design with DFD and structure chart editors and balancing checks, coding with skeleton code generation, and testing with test generation and coverage analysis.
- Other desirable characteristics of CASE tools are suitable hardware needs, documentation support, project management, an external interface, reverse-engineering support, a multi-user data dictionary interface, and tutorial and help.
- Second-generation CASE tools aim at intelligent diagramming, design-code integration, data dictionary standards for multi-vendor tools, customisation, and multi-user, multi-platform working.
- Maintenance is corrective, adaptive or perfective, with preventive maintenance often added as a fourth type.
- Lehman's laws: a used program must change or become less useful, its structure degrades with each change unless it is restructured, and its rate of development stays roughly constant.
- Legacy systems are old, unstructured and poorly documented, and are usually maintained by engineers other than the original developers.
- Reverse engineering first makes cosmetic changes to the code, then recovers the module specification, the design and the requirements specification in turn.
- Maintenance process model 1 changes the code directly and updates the documents afterwards, and suits small reworks.
- Maintenance process model 2 (re-engineering) reverse engineers to the requirements, applies the changes and forward engineers new code; it costs more but gives better structure and documentation.
- Maintenance cost estimates use the annual change traffic and are refined by an effort adjustment factor for experience, familiarity, complexity and reliability.
- Specifications, designs, code, test cases, documents and domain knowledge can all be reused, but reuse stays low because reusable components are hard to create, find, understand and adapt, and management support is weak.
- The basic issues of a reuse program are component creation, indexing and storing, search, understanding, adaptation and repository maintenance.
- Domain analysis finds components common to a family of applications; a mature domain moves from knowledge reuse to standard components and then to application generators.
- Organisation-level reuse assesses each product's reuse potential, refines it by generalising names, operations and exceptions and isolating platform calls, and enters it into the repository.
Learn these by heart
- ACT = (KLOC_added + KLOC_deleted) / KLOC_total.
- Annual maintenance cost = ACT × development cost, refined by multiplying by the EAF.
- Basic COCOMO, organic mode: E = 2.4 (KLOC)^1.05 person-months.
- CASE environment layers, top to bottom: user interface, tool set, object management system, repository.
- Re-engineering = reverse engineering + changes to the specification + forward engineering.
- Reuse program issues: creation, indexing and storing, search, understanding, adaptation, repository maintenance.
- Maintenance types: corrective (errors), adaptive (new environment), perfective (enhancements), preventive (preventing future problems).
2-mark questions
1 What is CASE? Distinguish upper CASE tools from lower CASE tools. 2 marks
CASE (computer-aided software engineering) is the use of software tools to automate and support the activities of software development and maintenance. Upper (front-end) CASE tools support the early phases: planning, requirements analysis and design, for example DFD editors. Lower (back-end) CASE tools support coding, testing and maintenance, for example code generators, test tools and reverse-engineering tools.
2 What is the role of the central repository in a CASE environment? 2 marks
The central repository, or data dictionary, holds all project information in one place: requirements, DFDs, structure charts, data definitions, plans and links to code. Every CASE tool reads and writes it, so data entered once is shared by all tools, kept consistent across phases, checked for completeness, and used to generate documents and trace changes.
3 Distinguish corrective, adaptive and perfective maintenance. 2 marks
Corrective maintenance removes errors found while the software is in use. Adaptive maintenance changes the software so that it keeps working in a new environment, such as a new operating system, hardware platform or interfacing system. Perfective maintenance adds functions or improves performance in response to new or changed user requirements.
4 Define software reverse engineering. How does it differ from re-engineering? 2 marks
Software reverse engineering is the process of recovering the design and the requirements specification of a product by analysing its code, usually to understand and document a legacy system; it does not change the product. Re-engineering goes further: after reverse engineering, the required changes are made to the recovered specification and design, and new code is forward engineered from them.
5 A software product of 80 KLOC cost ₹48 lakh to develop. In a year, 6 KLOC is added and 4 KLOC is deleted. Find its annual change traffic (ACT) and annual maintenance cost. 2 marks
ACT = (KLOC_added + KLOC_deleted) / KLOC_total = (6 + 4) / 80 = 0.125.
Annual maintenance cost = ACT × development cost = 0.125 × ₹48 lakh = ₹6 lakh per year.
6 What is domain analysis? Why is it needed in a reuse program? 2 marks
Domain analysis is the study of a family of related applications in one problem area (a domain), such as banking or telecom billing, to identify the concepts, requirements and solutions they share. It is needed because reusable components must suit many applications of the domain, not just one, and they can be identified only from this wider view.
10-mark questions
1 What is CASE? Explain the scope and benefits of CASE, and describe the CASE support available in each phase of the software life cycle. 10 marks
Computer-aided software engineering (CASE) is the use of software tools to automate, support and integrate the activities of developing and maintaining software. A CASE tool is any tool that helps in some phase, such as a DFD editor or a test coverage analyser; a CASE environment links many tools through a shared repository so that they work on the same project information.
Scope of CASE. CASE covers the whole life cycle and the activities that run across it. Upper (front-end) CASE tools support planning, requirements analysis and design; lower (back-end) CASE tools support coding, testing and maintenance; integrated CASE spans both. Project management, configuration management and documentation tools apply in every phase.
CASE support in the software life cycle:
1. Prototyping: screen and report painters let the analyst design the user interface, define the control flow between screens, and store and retrieve sample data, giving an executable prototype that users can try. Its data definitions go into the repository so that later phases reuse them. 2. Structured analysis and design: tools draw levelled DFDs, structure charts and, in modern tools, UML diagrams. They enforce the notation, check that each DFD level is balanced with its parent, and keep the data dictionary up to date. Consistency and completeness checks catch errors before coding starts. 3. Code generation: complete code generation is rarely practical, but a tool can produce skeleton code from the design: module headers with comments, record and class declarations taken from the data dictionary, and user-interface code from the prototype. It should keep traceability between design items and source files. 4. Testing: tools generate test cases, provide drivers and stubs, measure statement and branch coverage, compute metrics such as cyclomatic complexity, rerun regression tests after every change and report the results. 5. Maintenance: reverse-engineering tools rebuild design diagrams from code, and configuration management tools track versions and change requests.
Benefits of CASE:
- Lower cost and shorter schedules, because routine work is automated.
- Better quality, because consistency checks find errors early and standards are enforced.
- Documents that are complete and consistent with the design.
- Less drudgery: engineers spend their time on design, not on redrawing diagrams.
- Easier maintenance, since the repository traces each requirement to design and code.
- Better project management through estimation and scheduling tools.
In conclusion, CASE tools support every phase from prototyping to maintenance, and they give the most value when they share one repository.
2 What is software reuse? Explain what can be reused and the benefits of reuse, and discuss why little reuse has happened so far. 10 marks
Software reuse is the use of existing software artefacts, or the knowledge behind them, to build new software instead of developing everything from scratch. Reuse may be ad hoc, when an engineer copies something remembered from an old project, or systematic, when an organisation plans, builds and manages components for reuse.
What can be reused:
- Requirements specifications of similar products.
- Designs and architectures.
- Code: functions, classes, packages, libraries and components.
- Test cases, test plans and test data.
- Documentation such as user manuals.
- Knowledge and experience of the domain, including cost estimates and project plans.
Reusing a specification or a design can save more than reusing code alone, because the later work built on it may be reusable as well.
Benefits of reuse:
- Lower development cost and shorter delivery time.
- Higher reliability, since reused parts have already been tested and used.
- Lower project risk, because the cost and behaviour of an existing part are known.
- Consistency and common standards across an organisation's products.
Why little reuse has happened so far. Almost everyone agrees that reuse is valuable, yet in most organisations only a small part of each new product is built from reused parts. The reasons are both technical and managerial:
1. Creating reusable components is hard. A component must be general enough for applications not yet known, which needs extra design, documentation and testing effort. 2. It is difficult to predict which components future projects will need, so components built in advance are often never used. 3. Finding a component is difficult without a good classification scheme and a searchable repository. 4. Understanding a component written by someone else takes time, especially when its documentation is poor. 5. Adapting a component that does almost, but not exactly, what is needed can cost nearly as much as writing it again. 6. Components often depend on a particular platform, language or data format. 7. Managers hesitate to fund reuse, because the extra cost falls on the current project while the benefit goes to later ones. 8. Engineers have little incentive to reuse when productivity is measured in lines written, and some distrust anything not developed by their own team. 9. Legal and ownership questions make organisations hesitant to share components.
In conclusion, reuse has lagged less for lack of technology than for lack of planning: it needs domain analysis, a managed repository and steady management support.
3 Draw and explain the architecture of a CASE environment. What other characteristics should CASE tools have, and what features are expected of second-generation CASE tools? 10 marks
A CASE environment is a set of CASE tools integrated so that they share information about the project. With stand-alone tools the engineer must re-enter the same data in each tool; an integrated environment stores it once in a central repository and lets every tool use it.
Architecture of a CASE environment. A modern CASE environment is built in four layers:
1. User interface: a consistent framework of menus, commands and windows for reaching every tool, so that learning one tool makes the next easier to use. 2. Tool set: the individual tools, such as analysis and design tools, a code generator, test tools, a document generator and project management tools. Each works on the shared project data rather than on private files. 3. Object management system (OMS): the tools see the product as logical entities such as specifications, designs, data definitions and plans, with relations between them. The OMS maps these entities onto the storage below and offers services such as version and configuration control, so a tool need not know how the data is stored. 4. Repository: the central data store (data dictionary) holding all project information, which gives sharing, consistency and traceability.
Other characteristics of CASE tools:
- Hardware and environment: run on the organisation's existing hardware and operating systems.
- Documentation support: produce deliverable documents in standard formats directly from the repository.
- Project management: support estimation, scheduling and progress tracking.
- External interface: import and export data in standard formats so that designs can be exchanged and reused.
- Reverse-engineering support: build design models from existing code.
- Data dictionary interface: concurrent access by several users, queries and reports, with integrity and security.
- Tutorial and help: on-line help and tutorials for new users.
Second-generation CASE tools. Features expected of the next generation of tools include:
1. Intelligent diagramming: automatic layout of symbols and routing of arrows, so diagrams stay readable as they change. 2. Integration with the implementation environment: design and code kept consistent in both directions, so a change in one is reflected in the other. 3. Data dictionary standards: a common repository format, so tools from different vendors can be combined, with the user acting as the system integrator. 4. Customisation: users define their own object types, notations and checking rules to suit their method. 5. Multi-user and multi-platform working: a team on a network shares one repository from different machines. 6. Support for newer methods such as object-oriented design, with reverse engineering of existing code.
In conclusion, the OMS and the repository are what turn separate tools into an environment, and second-generation tools carry that integration further.
4 What is software reverse engineering? Explain the reverse-engineering process and the two software maintenance process models with a diagram. When is each model preferred? 10 marks
Software reverse engineering is the process of recovering the design and the requirements specification of a product by analysing its code. Many legacy products have poor or out-of-date documentation and their original developers have left, so reverse engineering is often the only way to understand them well enough to change them safely.
Reverse-engineering process:
1. Cosmetic changes: the code is first made readable without changing what it does. A pretty printer reformats the layout; variables, data structures and functions get meaningful names; complex conditions are simplified; deeply nested if statements become case statements; and goto jumps are replaced by structured constructs. 2. Module specification: each module is studied, with cross-reference and call-graph tools, and what it does is written down. 3. Design recovery: the module structure (structure chart), data flow and data structures are drawn from the module specifications. 4. Requirements specification: the functions of the whole product are written down as a requirements specification.
Each step raises the level of abstraction: code, module specification, design, requirements specification.
Maintenance process models. The activities of maintenance depend on how large the change is and on the state of the product. Two broad models are used.
Model 1 suits small reworks: the code is changed directly and the documents are updated afterwards. Its steps are:
1. Gather change requirements. 2. Analyse the change requirements. 3. Devise code change strategies. 4. Apply the code change strategies to the old code. 5. Update the documents. 6. Integrate and test.
Most of the effort goes into understanding the existing code, often by running it on test cases to locate a bug or the place where a change belongs.
Model 2 suits large reworks, legacy products with a poor design and code structure, and products with a high failure rate. It is software re-engineering: the product is reverse engineered up to its requirements specification, the change requirements are applied there to give new requirements, and the product is forward engineered again through design and module specification to new code.
Model 2 costs more, because reverse engineering must be done first, but it gives a better-structured design, good documentation and often more efficient code. Model 1 is cheaper when the rework is small; as the part of the product that must be reworked grows, model 2 becomes the cheaper choice.
In conclusion, reverse engineering recovers lost understanding, and the choice between changing the code directly and re-engineering depends on how much of the product must change.
5 Explain the characteristics of software maintenance. How is the cost of maintenance estimated? A 50 KLOC product was developed in organic mode. In a year 4 KLOC is added and 1 KLOC is deleted. Estimate the annual maintenance effort and cost at ₹80,000 per person-month, and the effort if the effort adjustment factor for maintenance is 1.15. 10 marks
Software maintenance is any change made to a software product after it is delivered. Software does not wear out, but it must change: errors show up in use, the platform changes, and users ask for more. Over the life of most products, maintenance takes more effort than the original development.
Characteristics of software maintenance:
- Types: corrective (removing errors found in use), adaptive (fitting the software to a new platform or interfacing system) and perfective (enhancements that users request). Preventive maintenance, done to prevent future problems, for example by correcting latent faults or restructuring code so that later changes are easier, is often added as a fourth type.
- Lehman's laws: a program that is used must change continually or become progressively less useful; its structure degrades with every change unless effort is spent to restructure it; and the rate of development of a large program stays roughly constant over its lifetime.
- Legacy software: much maintenance is done on old products that are unstructured, poorly documented and built on outdated platforms, by engineers other than the original developers.
- Maintenance has a poor image, although understanding and safely changing someone else's code is demanding work.
Estimation of maintenance cost. Boehm's COCOMO-based method uses the annual change traffic (ACT), the fraction of the source code that changes in a year:
ACT = (KLOC_added + KLOC_deleted)
/ KLOC_total
Annual maintenance cost
= ACT × development costThe annual maintenance effort (AME) is found the same way from the development effort, in person-months (PM). The estimate is only approximate, because staff experience, familiarity with the product, product complexity and required reliability all change it, so it is refined by multiplying by an effort adjustment factor (EAF) from the cost drivers.
Worked example. Basic COCOMO, organic mode: E = a(KLOC)^b with a = 2.4 and b = 1.05.
E_dev = 2.4 × 50^1.05
= 2.4 × 60.80 = 145.9 PM
ACT = (4 + 1) / 50 = 0.10
AME = ACT × E_dev
= 0.10 × 145.9 = 14.59 PM per year
Cost = 14.59 × ₹80,000
= ₹11,67,200 (about ₹11.67 lakh)
With EAF = 1.15:
AME = 14.59 × 1.15 = 16.78 PM per yearSo the product needs about 14.6 person-months of maintenance each year, costing about ₹11.67 lakh; with the adverse cost drivers this rises to about 16.8 person-months (about ₹13.4 lakh). Over five years of service the unadjusted figure alone is about 73 PM, half the development effort.
In conclusion, maintenance is continual and costly, and ACT-based estimates, though approximate, help an organisation budget for it and judge when re-engineering would be cheaper.
6 Explain the basic issues in any reuse program. Describe a reuse approach based on domain analysis, and explain how reuse is achieved at the organisation level. 10 marks
Reuse succeeds only when an organisation plans for it. Every reuse program must deal with a set of basic issues, follow a reuse approach, and build reuse into its everyday work.
Basic issues in any reuse program:
1. Component creation: deciding which reusable components to build, mostly from domain analysis, and designing them to be general. 2. Component indexing and storing: classifying each component and storing it, with its documentation, in a reuse repository so that it can be found. 3. Component search: helping engineers find a component that matches a need, by browsing or by searching on its classification. 4. Component understanding: giving a clear picture of what a component does and how to use it, through documentation, examples and specifications. 5. Component adaptation: changing a component that almost fits without breaking it; ideally components are reused without any change. 6. Repository maintenance: adding new components, retiring obsolete ones and updating search attributes as needs change.
A reuse approach:
- Domain analysis: a family of applications in one domain, such as banking, is studied to find the concepts and solutions they share, and these become the reusable components. As a domain matures, reuse grows from knowledge alone, to standard components, and finally to programs produced by application generators.
- Component classification: a faceted scheme describes each component by several independent facets, such as the function it performs, the objects it works on and its application area, which makes search precise.
- Searching: the engineer narrows the facets step by step in a browsable repository.
- Reuse without modification: an application generator is a generic program that produces a complete program from a short description of the parts that vary, written in application terms; report and form generators are examples. It gives the highest reuse but works only in mature domains and is costly to build.
Reuse at organisation level. Each finished product is handled in three steps:
1. Assess its potential for reuse: will its function be needed again, how common is that function in the domain, is it hardware dependent, and can a non-reusable part be split or parameterised to become reusable? 2. Refine it for greater reusability: generalise names so they do not refer to one application, generalise operations by adding those likely to be needed, generalise exception handling, and isolate operating-system and input/output calls behind a portability interface. 3. Enter it, with its documentation, into the reuse repository.
This also needs commitment from top management, incentives for engineers who create and reuse components, and easy access to the repository.
In conclusion, reuse works when components are created, stored, found, understood and adapted systematically, with management support.
Public sources that settled doubtful points
Only the points the second AI pass doubted were looked up. These are the pages that confirmed or contradicted them; nothing here is copied from them.
35 pages
- Algebraic specification (Wikipedia)
- Confluence (abstract rewriting) (Wikipedia)
- Modeling Data Flow Diagrams (Software Engineering Virtual Lab, IIT Kharagpur)
- Spiral model (Wikipedia)
- Rapid application development (Wikipedia)
- Structured program theorem (Wikipedia)
- The Scrum Guide
- Principles behind the Agile Manifesto
- SWEN 256: Function point estimation and COCOMO (RIT course slides)
- COCOMO (Wikipedia)
- Halstead complexity measures (Wikipedia)
- Counting function points (Rutgers course notes)
- Introduction to Function Points (Auburn course reading)
- CITS5502 Lecture 5: Risk management (University of Western Australia)
- Wideband delphi (Wikipedia)
- Algebraic specification of abstract data types (UNC course notes)
- Extreme programming (Wikipedia)
- Cohesion (computer science) (Wikipedia)
- Structured Design and structure charts (CSJM University lecture notes)
- Fagan inspection - Wikipedia
- Software inspection - Wikipedia
- Six Sigma - Wikipedia
- Capability Maturity Model - Wikipedia
- Gunning fog index - Wikipedia
- Cyclomatic complexity - Wikipedia
- Software reliability testing - Wikipedia
- Smoke testing (software) - Wikipedia
- ISO/IEC/IEEE 90003:2018 - Guidelines for the application of ISO 9001:2015 to computer software
- ISO/IEC 90003 - Wikipedia
- Lehman's laws of software evolution (Wikipedia)
- Estimating Software Maintenance, seminar slides, University of Zurich
- Software maintenance (Wikipedia)
- Summary of Chikofsky and Cross, Reverse Engineering and Design Recovery: A Taxonomy (Georgia Tech)
- Computer-aided software engineering (Wikipedia)
- Eichmann, Design of a Lattice-Based Faceted Classification System (NASA NTRS)
Further reading
Titles only, for your own study. Nothing on this page is copied from them. The units follow the official JNTUK R23 CSE syllabus (PDF) ↗.
- Fundamentals of Software Engineering · Rajib Mall
- Software Engineering: A Practitioner's Approach · Roger S. Pressman
- Software Engineering · Ian Sommerville
- Software Engineering: Principles and Practices · Deepak Jain