Unit 1 - Approaches to Software Development Flashcards
Define a system
an assembly of components that are connected together in an organised way
A software system is built to meet requirements. What must a successful software project do?
Resolve the diverse and possibly conflicting needs of users in a disciplined way;
Satisfy the users’ expectations;
Have been developed and delivered in a timely and economical manner;
Be resilient to the changes that will be introduced during its operational lifetime.
What is the system boundary?
The system boundary is simply a conceptual line that divides the system that we wish to study from ‘everything else’. It is useful to think of a system’s environment as being made up of those things which are not part of the system, but which can either affect the system or be affected by it.
Hospitals are a domain where you can find software being put to a variety of uses. A hospital might, for example, join together a series of patient-monitoring systems along with the database management system that manages medical records, to make a larger system with a different scope. A forward-looking hospital might also wish to go further and add weather-forecasting software. The extension would allow planners to deal with the ebb and flow of patients that arise according to the season. Beds may be allocated, and other resources, such as drugs, can be bought in preparation.
In the above, we suggested that two systems, for patient monitoring and managing medical records, might be combined into a single system. Suggest an additional function that might be possible with the combined system that would not have been possible with either of the two original systems alone. What can you say about the boundary of the combined system compared with the boundaries of the original systems?
Suppose the monitoring system detected that a patient taking a common drug had a heart problem. If the two systems were combined, it would possible to automatically check whether the heart problem might be due to a known allergy recorded in the patient’s record.
The boundary of the combined system encompasses a wider scope than the combined boundaries of the separate systems because of their relationship.
What are the three important characteristics of software that affect its development?
Malleability. Software is easy to change (all programmers are often tempted to ‘tweak’ their code). This malleability creates a constant pressure for software to be changed rather than replaced. Every change that is made to the software introduces the possibility of new errors.
Complexity. Software is often complex. Complexity can usually be recognised, but it is less easy to define. One item of software can be considered more complex
than another if the description of the first requires more explanation than that of the second. Part of that complexity arises from the potential variety of pathways
between the components of a system. The number of errors is likely to depend on the complexity of a system.
Size. It is likely that there will be more errors in a large piece of software than there will be in a small one.
For each of the three characteristics of software mentioned above, explain how errors might arise in a piece of developed software.
Malleability: every time a change is made to a piece of software it introduces the possibility of a new error; the easier it is to make changes, the greater the chances of introducing new errors into the software.
Complexity: the more complex a piece of software becomes, the more chances there are of introducing an error.
Size: there are likely to be more errors in a large piece of software than in a small one.
(a) What is the defining quality of a good software system, and what are its main characteristics?
(b) How might greater flexibility make a software system more affordable?
(c) Give two reasons why a delivered software system might not meet its users’ needs.
(a) A good software system is one that meets its users’ needs. We can characterise a good software system as useful, usable, reliable, flexible, affordable and available.
(b) Users’ needs will change over time. The time taken to implement the changes in requirements is less than if that software were inflexible. Since labour costs are the most significant component of software costs, flexible software is more affordable.
(c) Software systems are usually out of date even as they are being developed, since users’ needs:
- are often missed during requirements capture;
- change with time.
Legacy systems often have what characteristics?
are large;
are critical to the business;
have been changed a number of times since their inception;
are difficult to understand because of either a lack of documentation about their
internal structure or a lack of experience within the group responsible for them;
are difficult to maintain because of the above factors.
(a) Suggest a means of measuring the maintainability of a software system.
(b) How does a legacy system relate to the attributes of a good software system?
(c) Suggest a reason why legacy systems will always be a problem.
(a) We could measure the effort required by a developer to locate and eventually implement a given change to a software system. We could classify that effort in two components: the effort needed to locate and fix errors (bugs); and the effort needed to adapt the software system to meet its users’ needs.
(b) A legacy system is lacking in flexibility. It may have started out with all the characteristics of a good software system, yet those characteristics may have changed over time. The longer a software system is used, the more difficult it will become to maintain, because of the number of changes made since its development. So it gradually loses its maintainability. As a software system ages, the quality of applied changes will be affected by their affordability and the relative importance of the system. Ultimately all the staff who developed and knew about the software system may have moved on, so those new staff allocated to its maintenance may not fully comprehend its features. This can happen to all software systems, including those being developed today.
Thus a legacy system still serves some useful purpose, but there are problems that make it less flexible and maintainable (and so affordable) than it was originally.
(c) The inherent malleability of software makes it easy to change. You have already seen that a legacy system is lacking in flexibility as a result of the number of changes made to it during its operational lifetime. (The analogy with metal-working through malleability is useful. Once a blacksmith forms some component, usually in iron, there is a limit to the number of times that it can be heated, formed and cooled before that component becomes brittle and hence liable to failure.)
This explains why our ability to bolt features and fixes onto a legacy system means that it will eventually become too fragile, and it will become precarious to go any further. The staff issues mentioned in (b) compound these problems.
What is the main technique to simplify the construction of a complex software solution?
The main technique for dealing with such messy situations is decomposition. We can decompose a problem into smaller and smaller parts or chunks until each one can be comprehended or dealt with by an individual.
What are modules?
internal boundaries and smaller subsystems identified within the system,
What is heroic programming?
An individual attempting to develop a complex system.
What are projections and partitions?
A projection overlaps (there are elements that are found in more than one projection).
A partition is an independent sub-problem.
What is coupling?
In software engineering, the term coupling is used to refer to the degree of interdependence among the different components of a system.
What is circular dependency?
Where chains of independent modules join up in a particularly strong (or high) form of coupling.
Two classes need to be coupled in order to communicate. What factors indicate coupling?
A inherits from B A has an attribute of class B A has a method that uses an instance of class B as an input or output argument A knows of a public attribute of class B
What is an interface to a module?
In general, we say that the interface to a module defines how other modules can use that module. An interface is the means of connecting one module to another. It tells you what to expect about the behaviour of a given module and what services the module will provide without telling you how those services will be provided. An interface encapsulates what we know about the class.
When a module provides services to other modules and in turn uses services from other modules, what is this called?
These required services are called its context dependencies.
What is cohesion?
Cohesion is a way of describing how closely the activities within a single module are related to each other
What is abstraction?
Abstraction is a particular way of viewing a complex problem. The idea is to group together similar objects or situations and, while ignoring the differences, focus on one particular aspect of the problem.
(a) Why might you consider splitting up a large project into smaller chunks?
(b) How does the complexity of a software system affect the maintenance task?
(c) What is a module?
(d) Why does it help to have low coupling in a software system?
(e) Give examples of the kinds of information that would be valuable when considering a change to a given module.
(f) What are the context dependencies of a module? How do they relate to a module’s interface?
(g) What are the benefits of using modules with defined interfaces?
(h) Why does it help to have high cohesion in the modules of a software system?
(i) What characteristics should a module display that will help to ensure that it is easy and cheap to develop and maintain, and that errors are kept to a minimum?
(j) Why is it important to achieve a balance between coupling and cohesion?
(a) There is a limit to how much a person can understand at any one time. So there is a limit to the size of a software system that any one person can deal with. By splitting a large project into smaller chunks, it is possible to identify a number of more manageable tasks for those involved.
(b) It is essential to be able to make a change to a software system without having to know all about that system. Each change becomes difficult when the flow of control and dependencies within programs are complex. The greater the number and nature of the dependencies, the harder it is to maintain a software system.
(c) A module is any identifiable part of a software system that is considered separately. For example, modules may be subroutines (in a procedural language equivalent to methods), classes (in an object-oriented language), library functions or other constructs that may be treated independently.
(d) With low coupling, there are few dependencies between modules. Therefore changes made to one part (one or more modules) of a software system are less likely to propagate throughout the whole system. (A clear record of the dependencies between modules helps you to predict the impact of a proposed change to a software system.)
(e) There are two kinds of information that contribute to the analysis of a proposed change, and these are as follows.
- What assumptions have been made in other modules (clients) that call upon the module in question? An understanding of the expected services of a module will help assess the risks associated with a particular change.
- Which modules are clients of the module in question? This information indicates how far a change may propagate through the software system.
(f) The context dependencies for a module are those services that the module needs in order to work correctly. You can express the context dependencies for a module in terms of other interfaces. In effect, you can express the responsibilities of a module in terms of its interface and context dependencies. If the context provides the services that the module needs, then the module can guarantee the provision of the services described in its interface.
(g) The benefits are as follows:
- developers will need to know only about the module’s interface (its syntax and what it achieves – its semantics), not how it provides those services, and consequently developers can be more productive;
- developers can understand aspects of the software system more thoroughly,
so fewer bugs will be introduced;
- it should be easier to find bugs, as irrelevant modules are avoided;
- the possibility of module reuse is increased once it is known what that module provides and requires.
(h) With high cohesion, a module carries out a sensible set of operations or activities; ideally, high cohesion implies just one major abstraction per module. The interface abstracts away from what a developer must know in order to use a module. The developer can concentrate on the work required and create software that is useful, usable, reliable and affordable. Indeed, high cohesion tends to make a module more usable.
(i) A module should have low coupling and high cohesion, a good abstraction, and a well defined interface that is an encapsulated abstraction of a well understood concept.
(j) In constructing a system, we may have a choice between a smaller set of loosely coupled, less cohesive modules, or a larger set of tightly coupled, more cohesive modules. In the former case each module may be difficult to understand; in the latter case the relationships between them may be over-complex. We need to strike an appropriate balance.
(a) What are the characteristics of a component?
(b) How does the concept of an architecture contribute to component reuse?
(c) Which form of decomposition might be used in a software architecture?
(a) A component is a module that is considered to be a sufficiently good abstraction for the problem in hand. A component should be capable of being reused in future projects having the same software architecture, or being easily replaced at a later date within the existing software system. A good component has a well defined interface and is an encapsulated abstraction of a well understood concept.
(b) The architecture of a (software) system embodies high-level decisions about the overall structure of the system, and this architecture may apply to more than one system. (An approach called product-line development, covered later in M363, will produce a sequence of systems that have much in common, through a shared architecture, and makes software more affordable if it uses the same components.)
(c) Complexity is best managed by decomposing a problem into smaller sub problems. The basic form of decomposition used in a software architecture is partitioning to meet a number of separate concerns. For example, we might want to separate the user interface from the core business services.
(a) Why would a good software system need to be both useful and usable?
(b) If a piece of software contained bugs, how might they affect the usefulness and usability of that software?
(a) If a software system is not useful, it will not meet the users’ needs; if it is not usable, the users will be hindered from performing the tasks they need the software for.
(b) If a piece of software contained bugs, it might not meet the users’ needs at all in some respect, or it might meet their needs but in a way that affected usability and made it harder for users to carry out particular tasks.
Give the characteristics of an engineering approach that support the argument that software development is an engineering discipline.
Software development follows an engineering approach provided that those involved:
- are concerned with meeting a clear set of requirements that are defined as clearly as possible;
- use a defined process with clear activities, each of which has at least one identifiable end-product;
- can apply their skills and experience to the tasks demanded of them;
- regard validation and verification to be as essential as building the software itself;
- make sensible use of tools and standards.