63
CA228 Software Specification 1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution A software process model is an abstract representation of a process. It presents a description of a process from some particular perspective.

CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

Embed Size (px)

Citation preview

Page 1: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 1

Software ProcessA structured set of activities required to develop a software system

Specification Design Validation Evolution

A software process model is an abstract representation of a process. It presents a description of a process from some particular perspective.

Page 2: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 2

Software Process Models

Waterfall models Separate and distinct phases of specification and

development.Iterative models

Spiral model Rational Unified Process (RUP) Agile models

Page 3: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 3

Lifecycle Phases Requirements Analysis

System Design

Coding

Testing

Maintenance

Page 4: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 4

Requirements Analysis• “User requirements are statements, in a natural

language plus diagrams, of what services the system is expected to provide and the constraints under which it must operate” (Sommerville)

• Requirements determination – one of the greatest challenges

• Requirements specification – using a formalism such as the Unified Modeling Language (UML)

• Computer Assisted Software Engineering (CASE) • Requirements document

– system services (what the system does) – system constraints (how the system is constrained)

• Software Quality Assurance (SQA) – walkthroughs and inspections

Page 5: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 5

System Design

• “A software design is a description of the structure of the software to be implemented, the data which is part of the system, the interfaces between system components and, sometimes, the algorithms used.” (Sommerville)

• In practice the distinction between analysis and design is blurred – lifecycle models are iterative with increments – the same modeling language (e.g. UML) is used for analysis and

design

• Detailed design • Architectural design

Page 6: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 6

Coding• Translating a design into a program and

removing errors from that program.

• Programming is a personal activity - there is no generic programming process.

• Programmers carry out some program testing to discover faults in the program and remove these faults in the debugging process.

Page 7: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 7

Testing• Component or unit testing

– Individual components are tested independently;

– Components may be functions or objects or coherent groupings of these entities.

• System testing– Testing of the system as a whole. Testing of

emergent properties is particularly important.

• Acceptance testing– Testing with customer data to check that the

system meets the customer’s needs.

Page 8: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 8

Maintenance • Operation signifies the lifecycle phase

when the software product is used in day-to-day operations and the previous system (manual or automated) is phased out

• Operation coincides with the start of product maintenance– corrective (housekeeping)

– adaptive

– perfective

Page 9: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 9

Lifecycle Choice• Software engineering experience, skills

and knowledge of the development team

• Business experience and knowledge

• Application domain

• Business environment changes

• Internal business changes

• Project size

Page 10: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 10

Waterfall Model

Output from one phase is fed as input to the next phase.

One phase is completed, documented and signed-off before the next phase begins.

Advantages Each phase is well documented. Maintenance easier.

Disadvantages If there is a mismatch between what

the client wanted and what is built this will not be known until the product is deliveredRequirement

Analysis

SystemDesign

Coding

Testing

Maintenance

Page 11: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 11

Waterfall Strengths Easy to understand, easy to use Provides structure to inexperienced staff Milestones are well understood Sets requirements stability Good for management control (plan, staff,

track) Works well when quality is more important

than cost or schedule

Page 12: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 12

Waterfall Deficiencies

All requirements must be known upfront Deliverables created for each phase are

considered frozen – inhibits flexibility Can give a false impression of progress Does not reflect problem-solving nature of

software development – iterations of phases Integration is one big bang at the end Little opportunity for customer to preview the

system (until it may be too late)

Page 13: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 13

When to use the Waterfall Model

Requirements are very well known Product definition is stable Technology is understood New version of an existing product Porting an existing product to a new platform.

Page 14: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 14

Develop system version n

Validate system version n

YES

NODesign system version n

Systemcomplete

n = n+1

Iterative Models

• Deliver full system shell in the beginning• Enhance functionality in new releases

Page 15: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 15

Iterative Lifecycle with Increments

• Iteration in software development is a repetition of some process with an objective to enrich the software product

• Iterative lifecycle assumes increments – an improved or extended version of the product at the end of each iteration

• Iterative lifecycle assumes builds – executable code that is a deliverable of an iteration.

• Iterative lifecycle assumes short iterations between increments, in weeks or days, not months.

• Models:– Spiral– Rational Unified Process (RUP) – Model Driven Architecture (MDA)– Agile lifecycle with short cycles

Page 16: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 16

Incremental Development

• Break system into small components• Implement and deliver small components in sequence• Every delivered component provides extra functionality to user

design build install evaluate

design build install evaluate

design build install evaluate

increment 1

increment 2

increment 3

first incremental delivery

second incremental delivery

third incremental delivery

deliveredsystem

Page 17: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 17

Incremental Delivery

Rather than deliver the system as a single delivery, the development and delivery is broken down into increments with each increment delivering part of the required functionality.User requirements are prioritised and the highest priority requirements are included in early increments.Once the development of an increment is started, the requirements are frozen though requirements for later increments can continue to evolve.

Page 18: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 18

Incremental Development Advantages

Customer value can be delivered with each increment so system functionality is available earlier.Early increments act as a prototype to help elicit requirements for later increments.Lower risk of overall project failure.The highest priority system services tend to receive the most testing.

Page 19: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 19

Incremental Development Strengths

Develop high-risk or major functions first Each release delivers an operational product Customer can respond to each build Uses “divide and conquer” breakdown of tasks Lowers initial delivery cost Initial product delivery is faster Customers get important functionality early Risk of changing requirements is reduced

Page 20: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 20

Incremental Development Weaknesses

Requires good planning and design Requires early definition of a complete and fully

functional system to allow for the definition of increments

Well-defined module interfaces are required (some will be developed long before others)

Total cost of the complete system is not lower

Page 21: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 21

When to use Incremental Development

Risk, funding, schedule, program complexity, or need for early realization of benefits.

Most of the requirements are known up-front but are expected to evolve over time

A need to get basic functionality to the market early

On projects which have lengthy development schedules

On a project with new technology

Page 22: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 22

Spiral Development

Process is represented as a spiral rather than as a sequence of activities with backtracking.Each loop in the spiral represents a phase in the process. No fixed phases such as specification or design - loops in the spiral are chosen depending on what is required.Risks are explicitly assessed and resolved throughout the process.

Page 23: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 23

Spiral Model

Barry Boehm Evolutionary approach Iterative development

combined with risk management

Risk analysis results in “go, re-do, no-go” decision

Four major activities Planning Risk analysis Engineering Evaluation

Projectprogress

Planning Risk analysis

Customer evaluation Engineering

Initial requirementsgathering andproject planning

Planning followingcustomer evaluation

Customer evaluation

Risk analysis based oninitial requirements

Risk analysis based oncustomer reaction

Iteration 1 build

Iteration 2 build

“go, no-go”decision

Projectcost

Re

quire

me

nts

Ana

lysi

s

Sys

tem

De

sign

Imp

lem

enta

tion

Inte

gra

tion

an

dD

eplo

ymen

t

Projectprogress

Planning Risk analysis

Customer evaluation Engineering

Initial requirementsgathering andproject planning

Planning followingcustomer evaluation

Customer evaluation

Risk analysis based oninitial requirements

Risk analysis based oncustomer reaction

Iteration 1 build

Iteration 2 build

“go, no-go”decision

Projectcost

Re

quire

me

nts

Ana

lysi

s

Sys

tem

De

sign

Imp

lem

enta

tion

Inte

gra

tion

an

dD

eplo

ymen

t

Projectprogress

Planning Risk analysis

Customer evaluation Engineering

Initial requirementsgathering andproject planning

Planning followingcustomer evaluation

Customer evaluation

Risk analysis based oninitial requirements

Risk analysis based oncustomer reaction

Iteration 1 build

Iteration 2 build

“go, no-go”decision

Projectcost

Re

quire

me

nts

Ana

lysi

s

Sys

tem

De

sign

Imp

lem

enta

tion

Inte

gra

tion

an

dD

eplo

ymen

t

Page 24: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 24

Spiral Model

Plan next phases

Determine objectives,alternatives and constraints

Evaluate alternatives;identify and resolve risks

Develop and verify next-level product

Requirements plan

Development plan

Integration and Test plan

Concept of operation

Risk analysis

Risk analysis

Risk analysis

Prototype

PrototypePrototype

Software requirements

Requirements validation

System product design

Design validation

Acceptance test

Integration and Test

Unit testing

Coding

Detailed design

Page 25: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 25

Spiral Quadrants

Determine objectives, alternatives and constraints

Objectives: functionality, performance, hardware/software interface, critical success factors, etc.

Alternatives: build, reuse, buy, sub-contract, etc.

Constraints: cost, schedule, interface, etc.

Evaluate alternatives, identify and resolve risks

Study alternatives relative to objectives and constraints

Identify risks (lack of experience, new technology, tight schedules, poor process, etc.

Resolve risks (evaluate if money could be lost by continuing system development

Develop next-level product Typical activites:

Create a design Review design Develop code Inspect code Test product

Plan next phase Typical activities

Develop project plan Develop configuration management plan Develop a test plan Develop an installation plan

Page 26: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 26

Spiral Model Strengths

Provides early indication of insurmountable risks, without much cost

Users see the system early because of rapid prototyping tools

Critical high-risk functions are developed first The design does not have to be perfect Users can be closely tied to all lifecycle steps Early and frequent feedback from users Cumulative costs assessed frequently

Page 27: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 27

Spiral Model Weaknesses

Time spent for evaluating risks too large for small or low-risk projects

Time spent planning, resetting objectives, doing risk analysis and prototyping may be excessive

The model is complex Risk assessment expertise is required Spiral may continue indefinitely Developers must be reassigned during non-development

phase activities May be hard to define objective, verifiable milestones that

indicate readiness to proceed through the next iteration

Page 28: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 28

When to use Spiral Model

When creation of a prototype is appropriate When costs and risk evaluation is important For medium to high-risk projects Long-term project commitment unwise because of potential

changes to economic priorities Users are unsure of their needs Requirements are complex New product line Significant changes are expected (research and exploration)

Page 29: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 29

Rapid Software Development

• Because of rapidly changing business environments, businesses have to respond to new opportunities and competition.

• This requires software and rapid development and delivery is not often the most critical requirement for software systems.

• Businesses may be willing to accept lower quality software if rapid delivery of essential functionality is possible.

Page 30: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 30

Requirements

• Because of the changing environment, it is often impossible to arrive at a stable, consistent set of system requirements.

• Therefore a waterfall model of development is impractical and an approach to development based on iterative specification and delivery is the only way to deliver software quickly.

Page 31: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 31

Characteristics of RAD Processes

• The processes of specification, design and implementation are concurrent. There is no detailed specification and design documentation is minimised.

• The system is developed in a series of increments. End users evaluate each increment and make proposals for later increments.

• System user interfaces are usually developed using an interactive development system.

Page 32: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 32

Rapid Application Development

• Agile methods have received a lot of attention but other approaches to rapid application development have been used for many years.

• These are designed to develop data-intensive business applications and rely on programming and presenting information from a database.

Page 33: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 33

RAD Environment Tools

• Database programming language• Interface generator• Links to office applications• Report generators

Page 34: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 34

A RAD Environment

DBprogramming

language

Interfacegenerator

Officesystems

Reportgenerator

Database management system

Rapid applicationdevelopment environment

Page 35: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 35

Interface Generation

• Many applications are based around complex forms and developing these forms manually is a time-consuming activity.

• RAD environments include support for screen generation including:– Interactive form definition using drag and drop techniques;– Form linking where the sequence of forms to be presented is

specified;– Form verification where allowed ranges in form fields is defined.

Page 36: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 36

Visual Programming

• Scripting languages such as Visual Basic support visual programming where the prototype is developed by creating a user interface from standard items and associating components with these items

• A large library of components exists to support this type of development

• These may be tailored to suit the specific application requirements

Page 37: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 37

An Iterative Development Process

Validateincrement

Build systemincrement

Specify systemincrement

Design systemarchitecture

Define systemdeliverables

Systemcomplete?

Integrateincrement

Validatesystem

Deliver finalsystem

YES

NO

Page 38: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 38

Advantages of Incremental Development

• Accelerated delivery of customer services. Each increment delivers the highest priority functionality to the customer.

• User engagement with the system. Users have to be involved in the development which means the system is more likely to meet their requirements and the users are more committed to the system.

Page 39: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 39

Problems with Incremental Development

• Management problems – Progress can be hard to judge and problems hard to find because

there is no documentation to demonstrate what has been done.

• Contractual problems– The normal contract may include a specification; without a

specification, different forms of contract have to be used.

• Validation problems– Without a specification, what is the system being tested against?

• Maintenance problems– Continual change tends to corrupt software structure making it more

expensive to change and evolve to meet new requirements.

Page 40: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 40

Prototyping

• For some large systems, incremental iterative development and delivery may be impractical; this is especially true when multiple teams are working on different sites.

• Prototyping, where an experimental system is developed as a basis for formulating the requirements may be used. This system is thrown away when the system specification has been agreed.

Page 41: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 41

Incremental Development and Prototyping

Incrementaldevelopment

Throw-awayprototyping

Delivered system

Executable prototype +System specification

Outlinerequirements

Page 42: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 42

Conflicting Objectives

• The objective of incremental development is to deliver a working system to end-users. The development starts with those requirements which are best understood.

• The objective of throw-away prototyping is to validate or derive the system requirements. The prototyping process starts with those requirements which are poorly understood.

Page 43: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 43

Software Prototyping

• A prototype is an initial version of a system used to demonstrate concepts and try out design options.

• A prototype can be used in:– The requirements engineering process to help

with requirements elicitation and validation;– In design processes to explore options and

develop a UI design;– In the testing process to run back-to-back tests.

Page 44: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 44

Benefits of Prototyping

• Improved system usability.• A closer match to users’ real needs.• Improved design quality.• Improved maintainability.• Reduced development effort.

Page 45: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 45

Back to Back Testing

Test data

Resultscomparator

Systemprototype

Applicationsystem

Differencereport

Page 46: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 46

The Prototyping Process

Establishprototypeobjectives

Defineprototype

functionality

Developprototype

Evaluateprototype

Prototypingplan

Outlinedefinition

Executableprototype

Evaluationreport

Page 47: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 47

Throw-Away Prototypes

• Prototypes should be discarded after development as they are not a good basis for a production system:– It may be impossible to tune the system to meet

non-functional requirements;– Prototypes are normally undocumented;– The prototype structure is usually degraded

through rapid change;– The prototype probably will not meet normal

organisational quality standards.

Page 48: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 48

Agile Methods

• Dissatisfaction with the overheads involved in design methods led to the creation of agile methods. These methods:– Focus on the code rather than the design;– Are based on an iterative approach to software development;– Are intended to deliver working software quickly and evolve this

quickly to meet changing requirements.

• Agile methods are probably best suited to small/medium-sized business systems or PC products.

Page 49: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 49

Principles of Agile Methods

Page 50: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 50

Problems with Agile Methods

• It can be difficult to keep the interest of customers who are involved in the process.

• Team members may be unsuited to the intense involvement that characterises agile methods.

• Prioritising changes can be difficult where there are multiple stakeholders.

• Maintaining simplicity requires extra work.• Contracts may be a problem as with other approaches to

iterative development.

Page 51: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 51

Extreme Programming (XP)

• Perhaps the best-known and most widely used agile method.

• Extreme Programming (XP) takes an ‘extreme’ approach to iterative development. – New versions may be built several times per

day;– Increments are delivered to customers every 2

weeks;– All tests must be run for every build and the

build is only accepted if tests run successfully.

Page 52: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 52

The XP Release Cycle

Break downstories to tasks

Select userstories for this

releasePlan release

Releasesoftware

Evaluatesystem

Develop/integrate/test software

Page 53: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 53

Extreme Programming Practices 1

Incremental planning Requirements are recorded on Story Cards and the Stories to beincluded in a release are determined by the time available andtheir relative priority. The developers break these Stories intodevelopment ŌTasksÕ.

Small Releases The minimal useful set of functionality that provides businessvalue is developed first. Releases of the system are frequent andincrementally add functionality to the first release.

Simple Design Enough design is carried out to meet the current requirementsand no more.

Test first development An automated unit test framework is used to write tests for a newpiece of functionality before that functionality itself isimplemented.

Refactoring All developers are expected to refactor the code continuously assoon as possible code improvements are found. This keeps thecode simple and maintainable.

Page 54: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 54

Extreme Programming Practices 2

Pair Programming Developers work in pairs, checking each otherÕs work andproviding the support to always do a good job.

Collective Ownership The pairs of developers work on all areas of the system, so thatno islands of expertise develop and all the developers own all thecode. Anyone can change anything.

Continuous Integration As soon as work on a task is complete it is integrated into thewhole system. After any such integration, all the unit tests in thesystem must pass.

Sustainable pace Large amounts of over-time are not considered acceptable as thenet effect is often to reduce code quality and medium termproductivity

On-site Customer A representative of the end-user of the system (the Customer)should be available full time for the use of the XP team. In anextreme programming process, the customer is a member of thedevelopment team and is responsible for bringing systemrequirements to the team for implementation.

Page 55: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 55

XP and Agile Principles

• Incremental development is supported through small, frequent system releases.

• Customer involvement means full-time customer engagement with the team.

• People not process through pair programming, collective ownership and a process that avoids long working hours.

• Change supported through regular system releases.• Maintaining simplicity through constant refactoring of code.

Page 56: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 56

Requirements Scenarios

• In XP, user requirements are expressed as scenarios or user stories.

• These are written on cards and the development team break them down into implementation tasks. These tasks are the basis of schedule and cost estimates.

• The customer chooses the stories for inclusion in the next release based on their priorities and the schedule estimates.

Page 57: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 57

Story Card for Document Downloading

Downloading and printing an article

First, you select the article that you want from a displayed list. Youthen have to tell the system how you will pay for it - this can eitherbe through a subscription, through a company account or by creditcard.

After this, you get a copyright form from the system to fill in and,when you have submitted this, the article you want is downloadedonto your computer.

You then choose a printer and a copy of the article is printed. Youtell the system if printing has been successful.

If the article is a print-only article, you canÕt keep the PDF versionso it is automatically deleted from your computer.

Page 58: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 58

XP and Change

• Conventional wisdom in software engineering is to design for change. It is worth spending time and effort anticipating changes as this reduces costs later in the life cycle.

• XP, however, maintains that this is not worthwhile as changes cannot be reliably anticipated.

• Rather, it proposes constant code improvement (refactoring) to make changes easier when they have to be implemented.

Page 59: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 59

Testing in XP

• Test-first development.• Incremental test development from

scenarios.• User involvement in test development and

validation.• Automated test harnesses are used to run

all component tests each time that a new release is built.

Page 60: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 60

Task Cards for Document Downloading

Task 1: Implement principal workflow

Task 2: Implement article catalog and selection

Task 3: Implement payment collection

Payment may be made in 3 different ways. The userselects which way they wish to pay. If the userhas a library subscription, then they can input thesubscriber key which should be checked by thesystem. Alternatively, they can input an organisationalaccount number. If this is valid, a debit of the costof the article is posted to this account. Finally, theymay input a 16 digit credit card number and expirydate. This should be checked for validity and, ifvalid a debit is posted to that credit card account.

Page 61: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 61

Test Case Description

Test 4: Test credit card validity

Input:A string representing the credit card number and two integers representingthe month and year when the card expiresTests:Check that all bytes in the string are digitsCheck that the month lies between 1 and 12 and theyear is greater than or equal to the current year.Using the first 4 digits of the credit card number,check that the card issuer is valid by looking up thecard issuer table. Check credit card validity by submitting the cardnumber and expiry date information to the cardissuerOutput:OK or error message indicating that the card is invalid

Page 62: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 62

Test-First Development

• Writing tests before code clarifies the requirements to be implemented.

• Tests are written as programs rather than data so that they can be executed automatically. The test includes a check that it has executed correctly.

• All previous and new tests are automatically run when new functionality is added. Thus checking that the new functionality has not introduced errors.

Page 63: CA228 Software Specification1 Software Process A structured set of activities required to develop a software system Specification Design Validation Evolution

CA228 Software Specification 63

Pair Programming

• In XP, programmers work in pairs, sitting together to develop code.

• This helps develop common ownership of code and spreads knowledge across the team.

• It serves as an informal review process as each line of code is looked at by more than 1 person.

• It encourages refactoring as the whole team can benefit from this.

• Measurements suggest that development productivity with pair programming is similar to that of two people working independently.