Contents
Planning
Requirements specification
Purpose
The Requirements (Analysis) Specification is a reference point for possible functional system changes during the software life cycle. It is also the basis for the test planing and for the acceptance test.
IEEE 830 - 1993 Standard gives detailed instructions how to do a requirements analysis and the specification.
The Requirements specification must answer the "What"-question: What must your software do?
Also, the use case driven approaches can be used. One solution is to follow the IEEE standard, and append the use cases into an appendix.
Instructions
The requirements definition is normally a group work between SW developer, possible project purchaser, marketing staff and the end user. Questionnaires, user surveys, checklists and/or prototyping may be used.
The specification is inspected before proceeding to subsequent phases. Clear acceptance criteria for the SW should be derived from the specification.
ISO 9000-3 recommends that attention should be given to the following issues:
- assignment of persons responsible for establishing the specification
- methods for agreeing on requirements and approving changes
- efforts to prevent misunderstandings such as definitions of terms and explanations of background of requirements
- recording and reviewing discussion results (memos)
Pressman R.S. [PRE1997] suggests a set of operational principles for requirements analysis:
- The information domain of a problem must be represented and understood
- The functions that the software is to perform must be defined
- The behavior of the software (as a consequence of external events) must be represented
- The models that depict information, function, and behavior must be partitioned in a manner that uncovers detail in a layered (or hierarchical) fashion
- The analysis process should move from essential information toward implementation detail
Davis [DAV1995] suggests a set of guiding principles for "requirements engineering":
- Understand the problem before you begin to create the analysis model
- Develop prototypes that enable a user to understand how human-machine interaction will occur
- Record the origin of and the reason for every requirement
- Use multiple views of requirements
- Prioritize requirements
- Work to eliminate ambiguity
Annotate each requirement. Minimum annotation classifies a requirement as essential, desired, or optional. [PHI2000]
Regardless of form, each requirement should include elements of five content areas: [PHI2000]
Functionality
- Describe what the software will do. Include an introduction to the function, inputs, processing, and outputs.
Performance
- How fast or reliably will the software perform its functions? Almost all performance requirements should be stated as quantities.
Design constraints
- Sources of constraints include complying with standards and hardware limitations. These and others limit the user interface, operating system, type of computer, programming language, and so on.
Attributes
- Utility, usability, maintainability, adaptability, installability, portability, understandability, simplicity, security, ...
External interfaces
- Explain how the software will interact with people, hardware, other software, and communications systems.
Document structure
1. Introduction 1.1. Purpose 1.2. Scope 1.3. Acronyms and definitions 1.4. References 1.5. Overview 2. General description 2.1. Product perspective 2.2. Product functions 2.3. User characteristics 2.4. General constraints 2.5. Assumtions and dependencies 3. Structural overview and specific requirements 3.1. Functional requirements 3.2. External interface requirements 3.3. Performance requirements 3.4. Design constrains 4. General requirements 4.1. Security requirements 4.2. Reliability requirements 4.3. Maintainability requirements 4.4. Portability requirements 4.5. Installation requirements 4.6. Administration requirements 4.7. Diagnostics requirements 5. Software generation and integration
A ReqSpec.doc for the inspection meeting memo is available.
Requirements check-list
From "Code Complete", by Steve McConnell (1993) pp. 33-34:
Content
- Are all the inputs to the system specified, including their source, accuracy, range of values, and frequency?
- Are all the outputs from the system specified, including their destination, accuracy, range of values, frequency, and format?
- Are all the report formats specified?
- Are all the external hardware and software interfaces specified?
- Are all the communication interfaces specified, including handshaking, error-checking, and communication protocols?
- Is the expected response time, from the user's point of view, specified for all necessary operations?
- Are other timing considerations specified, such as the processing time, data-transfer rate, and system throughput?
- Are all the tasks the user wants to perform specified?
- Are the data used in each task and the data resulting from each task specified?
- Is the level of security specified?
- Is the reliability specified, including the consequences of software failure, the vital information that needs to be protected from failure, and the strategy for error detection and recovery?
- Is the maximum memory specified?
- Is the maximum storage specified?
- Is the maintainability of the system specified, including its ability to adapt to changes in the operating environment, in its interfaces with other software, in its accuracy, and in its performance?
- Are acceptable trade-offs between competing attributes specified for example, between robustness and correctness?
- Is the definition of success included? Of failure?
Completeness
- Where information isn't available before development begins, are the areas of incompleteness specified?
- Are the requirements complete in the sense that if the product satisfies every requirement, it will be acceptable?
- Are you uneasy about any part of the requirements? Are some parts impossible to implement and included just to please your customer or your boss?
Quality
- Are the requirements written in user language? Do the users think so?
- Does each requirement avoid conflicts with other requirements?
- Do the requirements avoid specifying design?
- Are the requirements at a fairly consistent level of detail? Should any requirement be specified in more detail? Should any requirement be specified in less detail?
- Are the requirements clear enough to be turned over to an independent group for implementation and still be understood?
- Is each item relevant to the problem and its solution? Can each item be traced to its origin in the problem environment?
- Is each requirement testable? Will it be possible for independent testing to determine whether each requirement has been satisfied?
- Are all possible changes to the requirements specified, including the likelihood of each change?
Project plan
The first important step in project planning is to choose a development process that will fit the product and people.
The second major step in planning is to derive tasks and a way to execute them according to the process model chosen.
Standards play a significant role in planning. The IEEE's standard [1058.1 - 1987] states what should be in a project plan and how to arrange the contents. How to make a good plan [Dwayne Phillips]
Planning attempts to predict a software product. You cannot produce a large, complex software product successfully without it. It tells everyone what you want to happen, not so much what you expect to happen.
Planning is concerned with business goals. Solutions must serve the business in a timely and economic manner. They must accurately represent what software people can do for the business.
A plan requires four basic items:
- Task list
- Tasks are the building blocks of a plan. Each task has inputs and produces outputs. The task is not complete until a review approves the outputs.
- Resources
- Each task requires some degree of time, people, and equipment.
- Task network
- A task network shows task precedence. If the prerequisites are not present, create tasks to build them. If the outputs go nowhere, eliminate the task.
- Schedule/Milestones
- The simplest schedule consists of milestones for each task. A milestone consists of at least a date and description. The milestones give the project and its baselines high visibility. They show whether the project has progressed successfully to a significant point. Milestones are significant events in the project that indicate a gathering of key people to review the work done to date.
Do's and Don'ts
- Do use metrics
- Record all the relevant information about the project. How productive is the the project organization and persons in team. If an organization does not know how long it took to build their last product, they cannot plan for the next one.
- Do create plans that succeed
- For example, minimize dependencies on outside groups because they will let you down. Give your people ample time and resources.
- Do allow some preliminary design
- Builders cannot answer "How long will it take to build a house?" but they can answer "How long will it take to build a two-story, four-bedroom, three-bath, double-garage house in Temple City, California?" Those qualifiers come from preliminary design.
- Don't accept arbitrary plans unless you can negotiate the product
- If the manager want you to make a software product in six months, you need to consider priority selection. Accept an arbitrary plan only if you can have some flexibility in the product. If the manager really needs a new software in six months, give it to him, but select the highest priority user requirements that can be satisfied in that time.
- Don't play estimating games
- The project manager's most common game is to double the developer's estimate.
- Sometimes developers have already doubled or tripled their estimates and manager plays halving game...
- 'Trap the developer' is the managers game to get estimates in informal situations. He might ask something about the new project when team is for example in coffee break. Developer might find later than their wild guess have been converted to a firm plan...
WWWWWHH planning
WWWWWHH : Why, What, When, Who, Where, How, How Much (part of spiral software design)
- Objectives - Why is the system being developed?
- Milestones and Schedules - What will be done and When?
- Responsibilities - Who is responsible for a function? Where are they organizationally located?
- Approach - How will the job be done technically and managerially?
- Resources - How much of each resource is needed?
Document structure
Format of a software project management plan written according to the IEEE Std-1058.1-1987.
1. INTRODUCTION 1.1. Project Overview 1.2. Project Deliverables 1.3. Evolution of the SPMP 1.4. Reference Materials 1.5. Definitions and Acronyms 1.6. Overview of the Document 2. PROJECT ORGANIZATION 2.1. Process Model 2.2. Organizational Structure 2.3. Organizational Boundaries and Interfaces 2.4. Project Responsibilities 3. MANAGERIAL PROCESS 3.1. Management objectives and Priorities 3.2. Assumptions, Dependencies, and Constraints 3.3. Risk Management 3.4. Monitoring and Controlling Mechanisms 3.5. Staffing Plan 4. TECHNICAL PROCESS 4.1. Methods, Tools and Techniques 4.2. Software Documentation 4.3. Project Support Persons and Functions 5. WORK PACKAGES, SCHEDULE, AND BUDGET 5.1. Work packages 5.2. Dependencies 5.3. Resource Requirements 5.4. Budget and Resource Allocation 5.5. Schedule
A PrjPlan.doc for the inspection meeting memo is available.
The introduction is an overview of the people, process, and product for the project. It also states how to change the plan and defines key concepts.
Project organization describes how the people and process will be organized to produce a product. It shows the process model for the project (waterfall, evolutionary, spiral). It also discusses who's who in the project, their areas of responsibility, and their lines of communication.
Managerial process describes how the project manager will ensure that the project adheres to the plan. It contains constraints, policies, objectives, assumptions, and so on. It discusses risk management and the staffing plan (Rayleigh model). It also discusses how the project manager and upper management will obtain project status from the audits and status accounting the Configuration Management staff performs.
Technical process addresses the details of the software process, pointing to several other documents, such as commercially available texts and standards. The section specifies the type of computers, compilers, and component libraries, and so on. It also lists the other documents to be produced, including standards on how to write such documents, and their contents. It concludes by describing the support organizations and their functions in the project. These may include the Configuration Management staff, an independent verification and validation group, security staff, facilities maintainers, and technical writers.
The final section is "the plan". The task (work package) network is the foundation of this section. This is the place to sum up the time, cost, and equipment scattered throughout the network.
Technical specification
The technical design specification, or Software Design Description (SDD) describes the internal design of the software system. This formal specification will present a design to meet the requirements that the system is to achieve. It brings together the assumptions of the environment and the requirements presented in the software requirements specification, into a description of the software structure, software components, interfaces, and data necessary for the implementation phase. In essence, the SDD becomes a detailed blueprint for the implementation activity. In a complete SDD, each requirement must be traceable to one or more design entities.
The Technical specification must answer the "How"-question: How will your software fulfill the requirements?
In documenting the design of a software artifact, several different views of the design need to be considered, so as to meet the requirements of the different users of the design. Possible design views to be considered for incorporation in a Design Document include:
- Decomposition - the partition of the system into design entities;
- Dependency - the description of the relationships among entities and system entities;
- Interface - all the details of interfaces and relationships between the different design entities that make up the system;
- Detail - the internal design details of a design entity.
A selection of approaches is available for the design documentation. Those the project group are most familiar with might be the safest solutions. Course literature exists for familiarizing with the others.
IEEE Std 1016.1, Guide to Software Design Descriptions, provides examples of what should be included in a Design Document for a number of different design approaches.
- Function-oriented - e.g. Structured Analysis and Design (SA/SD)
- Data-oriented - e.g. Jackson Structured Programming
- Real-time control-oriented - e.g. the Ward and Mellor approach
- Object-oriented - e.g. the Coad and Yourdon approach
- Formal language-oriented - e.g. Z Language Specifications
For example, using the SA/SD, the Decomposition Description would be defined by Structure Charts; the Dependency Description would be defined by a set of Data Flow Diagrams; the Interface Description would be defined in a Data Dictionary and Context Diagram; and the Detail Description would be defined in the Process Specifications.
The selected design methodology should be identified. Some of the possibilities are listed below. Any combination seen best can be chosen.
- Data flow diagrams
- Flow charts
- Data Structure diagrams (Warnier-Orr, Jackson)
- State diagrams
- BNF diagrams
- Pseudocode
- Sample/documented code
- User task descriptions
- Descriptive text
- Yourdon
- Gane-Sorsen
- UML
Document structure
The following sample Table of Contents for a Software Design Description is based on ANSI/IEEE Std 1016-1987, Recommended Practice for Software Design Descriptions.
1. Introduction
1.1 Purpose
1.2 Scope
1.3 Definitions and Acronyms
2. References
3. Decomposition Description
3.1 Module Decomposition
3.1.1 Module 1 Description
3.1.2 Module 2 Description
3.2 Concurrent Process Description
3.2.1 Process 1 Description
3.2.2 Process 2 Description
3.3 Data Decomposition
3.3.1 Data Entity 1 Description
3.3.2 Data Entity 2 Description
4. Dependency Description
4.1 Intermodule Dependencies
4.2 Interprocess Dependencies
4.3 Data Dependencies
5. Interface Decomposition
5.1 Module Interface
5.1.1 Module 1 Description
5.1.2 Module 2 Description
5.2 Process Interface
5.2.1 Process 1 Description
5.2.1 Process 1 Description
6. Detailed Design
6.1 Module Detailed Design
6.1.1 Module 1 Detail
6.1.2 Module 2 Detail
6.2 Data Detailed Design
6.2.1 Data Entity 1 Detail
6.2.2 Data Entity 2 DetailA TecSpec.doc for the inspection meeting memo is available.
Testing plan
The purpose of a Test Plan is to describe the testing processes, defining the test domain, test strategy, test philosophy, test exit and entrance criteria, test configurations, and test tools employed to verify and validate a set of functionality. The Plan should also include information on schedules, resource allocations, and staff utilization.
The following IEEE standards provide more information on formal testing documentation:
- 829-1998 IEEE Standard for Software Test Documentation
- 1008-1987 IEEE Standard for Software Unit Testing
1012-1986 IEEE Standard for Software Verification & Validation Plans
1059-1993 IEEE Guide for Software Verification & Validation Plans
Document structure
For this course, one of the following structures is proposed into use. Other structures are accepted, but the used practice should preferably follow some accepted standard, and a reference should be given.
One example of a detailed structure:
1. Introduction 1.1 Overall Description 1.2 Test Plan Purpose 1.3 Test Plan Approach 2. Test Items 3. Tested Features 4. Features Not Tested 5. Testing Strategy and Approach 5.1 Syntax 5.2 Description of Functionality 5.3 Arguments for tests 5.4 Expected Output 5.5 Specific Exclusions 5.6 Dependencies 5.7 Test Case Success/Failure Criteria 6. Pass/Fail Criteria for the Complete Test Cycle 7. Entrance Criteria/Exit Criteria 8. Test Suspension Criteria and Resumption Requirements 9. Test Deliverables/Status Communications Vehicles 10. Testing Tasks 11. Hardware and Software Requirements 12. Problem Determination and Correction Responsibilities 13. Staffing and Training Needs/Assignments 14. Test Schedules 15. Risks and Contingencies 16. Approvals
An example of an informal structure:
1. Introduction 2. Unit Test Description 3. Integration Test Description 4. Validation Test Description 5. Testing Process Sequence 5.1 Unit Test Cases 5.2 Integration Test Cases 5.3 System Test Cases
Implementation
Coding rules
Spend even more time on the design before writing any lines of code. The more planning, the better the program.
Working on large software projects teaches quickly what one should never do, and this learning from mistakes can be avoided by studying documentation and books describing the problems of others. From them, you will quickly learn why design documents, coding standards and code comments improve the overall quality of the software.
Beauty is in the eye of the beholder. When writing code you should aim at readability with useful comments added, resulting in maintainable code. Efficient and documented algorithms should be researched, and if already researched, they should be re-used, not re-invented. There exists several different naming conventions, but the main point is that the same naming convention, whatever it is, is used everywhere in the project, and hopefully is inherited from earlier project files which are re-used. Some people say the code is not supposed to be pretty, but operational. This is fine if there is only one person working on the project and nobody will ever re-use any parts of it. Otherwise, always remember readability and documentation. If the code has to look ugly (perhaps due to optimization?), then explain the reasons behind it to the reader. Links
Here you should find links to coding guidelines, and other resources in the internet. Please let me know if you know of any links that I should add.
Some random texts and resources
Some coding guidelines:
Some documentation guidelines:
Source code documentation generator tool
Books
Some books worth reading:
"The Elements of Programming Style" by Kernighan & Plauger
"Code Complete" by Steve McConnell, Microsoft press.
- "Literate Programming" by Donald Knuth. ISBN: 0-937073-80-6
- "The C Programming Language" by Brian W. Kernighan and Dennis M. Ritchie. Published by Prentice Hall, 1988, 2nd Edition. ISBN 0-13-110362-8
- "Design Patterns: Elements of Reusable Object-Oriented Software" by Gamma, Helm, Johnson, and Vlissides
- "The Art of Computer Programming" by Donald E. Knuth.
- "Zen of Assembly Langauge" and "Zen of Code Optimization" by Michael Abrash. ZoAL ISBN: 0-673-38602-3, ZoCO ISBN: 1-883577-03-9
- "Writing Solid Code" by Steve Maguire. Microsoft. ISBN: 1-55615-551-4
- "Patterns of Software" by Richard Gabriel
- "Programming Pearls" and "More Programming Pearls: Confessions of a Coder", by Jon Bently, Addison-Wesley, 1986 and 1988.
- "Graphics Programming Black Book" by Michael Abrash
- "Large Scale C++ Software Design" by Lacos
- "Software Tools" by Kernigphan and Plauger
- "Thinking in Java" and "Thinking in C++" by Bruce Eckel (download)
- "Thinking in Patterns with Java" by Bruce Eckel (download)
- "Lions' Commentary on Unix : With Source Code" (ISBN 1573980137, Peer Communications), 1979
Testing
Unit testing
Integration testing
Formal Qualification testing
Project management
Planning
Inspections
Inspection session are proved to be the most efficient way to assure software quality. It is very simple and cost efficient way to eliminate mistakes in different phases of the project. The reason is simple; nobody wants to give a document to be inspected if it is not properly prepared. So designer will do their work more carefully when they know that there will be a meeting for inspecting the document.
However, it needs some preparation and training. Inspection session must be held very professional manner. The inspection and critic is for the product not for the author of the for example design document. So keep in fact and details.
Is is as well important that the author will deliver the documents to be inspected few days advance. This way participants can prepare and must prepare carefully for the inspection.
Inspection meeting
Inspection meeting is a formal meeting, which takes time from one hour to four hours. Longer meetings are not efficient, because people are later too tired to concentrate on important issues.
There are different roles for the participants in inspection meeting:
- Moderator is the chairman of the meeting
- Author is the creator of the document
- Follow up is the person who checks that all the corrections will be done
- Secretary is normally the Author
First issues are always formal:
- Is the document outlook and structure done according to company quality instructions and document templates?
Then the facts:
- The document is inspected through page by page. Each participant should inform own comments and opinions.
Inspection meeting memo template
A Template for the inspection meeting memo is available.
Reporting
Document reviews
Final report
some topics for the final report:
- Process:
- Which development model did you use?
- How did the choice affect your project?
- Method
- What development methods were used?
- Did you use some coding convention?
- Which languages, applications, tools were used during the development?
- Commend on the feasibility and usability of the used tools?
- Results
- Did you fulfill all requirements? (a chart would be nice)
- How did you fulfill the requirements, did you change any during the process?
- Have you kept in schedule?
- Budget?
- How was the maintenance of the system done?
- How much code was produced?
- How much time was consumed in the different parts of the project?
- What material was the most useful or instructive during the project?
- Work amount
- Did any of the risks realize?
- Which one appeared unexpected?
- What should be done differently according the authors, if they could have a chance to try again?
- Where did you get help at tough situations?