CSC 532 SOFTWARE TESTING, QUALITY ASSURANCE AND MAINTENANCE Course Instructors: Professor Charles O. Uwadia Dr. Rukayat A. Koleoso Department of Computer Sciences University of Lagos •Lectures: – S014, Tuesday: 9:00 am to 10:00 am – S023, Friday: 8:00 am to 10:00 am + Course Outline •Introduction to Software Engineering •Software Testing – Basics •Software Testing techniques – White box and Black box •Software Configuration Management •Software Quality Assurance •Software Maintenance and Reengineering Course Material •Software Engineering by Ian Sommervile 10th Edition •Software Engineering – A practitioner’s Approach by R. S. Pressman 9th Edition, McGraw Hill •Software Engineering. Theory & Practice by S.L. Pfleeger & J. M. Atlee, 4th edition, Prentice Hall Use lecture notes as study guide Organization of this Lecture •What is Software Engineering? •Programs vs. Software Products •Evolution of Software Engineering •Software Development Practices •Introduction to Life Cycle Models •Summary 4 Objectives of the Class •Appreciate Software Engineering: – Build complex software systems in the context of frequent change •Understand how to – produce a high quality software system within time – while dealing with complexity and change •Acquire technical knowledge (main emphasis) •Acquire managerial knowledge – Understand the Software Lifecycle • Process vs Product • Learn about different software lifecycles Software Engineering •The economies of all developed nations are dependent on software. •More and more systems are software controlled. •Software engineering is concerned with theories, methods and tools for professional software development. •Software engineering expenditure represents a significant fraction of the GNP of developed countries. Software Costs •Software costs often dominate system costs. The costs of software on a PC are often greater than the hardware cost. •Software costs more to maintain than it does to develop. •Software engineering is concerned with cost-effective software development. What is Software Engineering? •State of the art of developing quality software system that are: • • • • on time within budget with acceptable performance with correct operation. •Systematic collection of techniques, methodologies, guidelines/tools that help with the production of •a high quality software system •with a given budget •before a given deadline while change occurs. 8 Why Study Software Engineering? •To acquire skills to develop large programs. – Exponential growth in complexity and difficulty level with size. •Ability to solve complex programming problems: – How to break large projects into smaller and manageable parts •Learn techniques of: – specification, design, interface development, testing, project management, etc. •To acquire skills to be a better programmer: – Higher Productivity – Better Quality Programs 9 Software Crisis •Software products: • fail to meet user requirements. • frequently crash. • expensive. • difficult to alter, debug, and enhance. • often delivered late. • use resources non-optimally. 10 Factors contributing to the software crisis •Larger problems • Complexity: – The system is so complex that no single programmer can understand it anymore – The introduction of one bug fix causes another bug •Lack of adequate training in software engineering, •Increasing skill shortage, •Low productivity improvements. 11 Programs versus Software Products • • • • • • Usually small in size Author himself is sole user Single developer Lacks proper user interface Lacks proper documentation Ad hoc development. • • • • Large Large number of users Team of developers Well-designed interface • Well documented & usermanual prepared • Systematic development 12 Software Products •Generic products: – Stand-alone systems which are produced by a development organization and sold on the open market to any customer. •Customized products: – Systems which are commissioned by a specific customer and developed specially by some contractor. •Product vs. process – Our goal is to develop software products – The process is how we do it Software Product Attributes •Performance •Usability •Maintainability •Reusability •Portability •Understandability Importance of Product Characteristics •The relative importance of these characteristics depends on the product and the environment in which it is to be used. •In some cases, some attributes may dominate – In safety-critical real-time systems, key attributes may be dependability and efficiency. •Costs tend to rise exponentially if very high levels of any one attribute are required. Efficiency Costs Cost Ef ficiency Software Development Activities Requirements Collection Establish customer’s needs Analysis Model and specify the requirements (“what”) Design Model and specify a solution (“how”) Implementation Construct a solution in software Testing Validate the solution against the requirements Maintenance Repair defects and adapt the solution to new requirements Evolution of Software Engineering Techniques •The improvements to the software design methodologies – are indeed very conspicuous. •In additions to the software design techniques: – several other techniques evolved. 18 Evolution of Software Engineering Techniques –life cycle models, –specification techniques, –project management techniques, –testing techniques, –debugging techniques, –quality assurance techniques, –software measurement techniques, –CASE (Computer Aided Software Engineering) tools, etc. 19 Modern Software development practices •Use of Life Cycle Models •Software is developed through several well-defined stages: – requirements analysis and specification, – design, – coding, – testing, etc. 20 Modern Software development practices •Emphasis has shifted – from error correction to error prevention. •Modern practices emphasize: – detection of errors as close to their point of introduction as possible. – focus is on detecting as many errors as possible in each phase of development. – coding is considered only a small part of program development effort. 21 Modern Software development practices •A lot of effort and attention is now being paid to: – requirements specification. •Also, now there is a distinct design phase: – standard design techniques are being used. •During all stages of development process: – Periodic reviews are being carried out •Software testing has become systematic: – standard testing techniques are available. 22 Modern Software development practices •There is better visibility of design and code: – visibility means production of good quality, consistent and standard documents. – In the past, very little attention was being given to producing good quality and consistent documents. – We will see later that increased visibility makes software project management easier. •Because of good documentation: – fault diagnosis and maintenance are smoother now. 23 Modern Software development practices •Several metrics are being used: – help in software project management, quality assurance, etc. •Projects are being thoroughly planned: – estimation, – scheduling, – monitoring mechanisms. •Use of CASE (Computer Aided Software Engineering) tools. 24 Software Life Cycle •Software life cycle (or software process): – series of identifiable stages that a software product undergoes during its life time: • • • • • • Feasibility study requirements analysis and specification, design, coding, testing maintenance. 25 Software Process •Structured set of activities required to develop a software system – – – – Specification Design Validation Evolution •Activities vary depending on the organization and the type of system being developed. •Must be explicitly modeled if it is to be managed. Process Model •Specification: Set out the requirements and constraints on the system. •Design: Produce a model of the system. •Manufacture: Build the system. •Test: Check the system meets the required specifications. •Install: Deliver the system to the customer and ensure it is operational. •Maintain: Repair faults in the system as they are discovered. Life Cycle Model •A software life cycle model (or process model): – a descriptive and diagrammatic model of software life cycle: • • • identifies all the activities required for product development, establishes a precedence ordering among the different activities, Divides life cycle into phases. •Several different activities may be carried out in each life cycle phase. – For example, the design stage might consist of: • structured analysis activity followed by • structured design activity. 28 Life Cycle Model •The development team must identify a suitable life cycle model: – and then adhere to it. – Primary advantage of adhering to a life cycle model: • helps development of software in a systematic and disciplined manner. •When a program is developed by a single programmer --– he has the freedom to decide his exact steps. 29 Life Cycle Model •When a software product is being developed by a team: – there must be a precise understanding among team members as to when to do what, – otherwise it would lead to chaos and project failure. •A software project will never succeed if: – one engineer starts writing code, – another concentrates on writing the test document first, – yet another engineer first defines the file structure – another defines the I/O for his portion first. 30 Life Cycle Model •A life cycle model: – defines entry and exit criteria for every phase. – A phase is considered to be complete: • only when all its exit criteria are satisfied. •The phase exit criteria for the software requirements specification phase: – Software Requirements Specification (SR S) document is complete, reviewed, and approved by the customer. •A phase can start: – only if its phase-entry criteria have been satisfied. 31 Life Cycle Model •It becomes easier for software project managers: – to monitor the progress of the project. •When a life cycle model is adhered to, – the project manager can at any time fairly accurately tell, • at which stage (e.g., design, code, test, etc. ) of the project is. – Otherwise, it becomes very difficult to track the progress of the project • the project manager would have to depend on the guesses of the team members. 32 Life Cycle Model •This usually leads to a problem: – known as the 99% complete syndrome. •Many life cycle models have been proposed. •We will confine our attention to a few important and commonly used models. – – – – – classical waterfall model iterative waterfall, evolutionary, prototyping, and spiral model 33 Generic Software Process Models •Waterfall – Separate and distinct phases of specification and development •Evolutionary – Specification and development are interleaved •Formal Transformation – A mathematical system model is formally transformed to an implementation •Reuse-based – The system is assembled from existing components Waterfall Process Model Requirements definition System and software design Implementation and unit testing Integr ation and system testing Operation and maintenance Evolutionary Process Model Concurr ent activities Outline description Specification Initial version Development Intermediate versions Validation Final version Process Model Problems •Waterfall – – High risk for new systems because of specification and design problems. Low risk for well-understood developments using familiar technology. •Prototyping – – Low risk for new applications because specification and program stay in step. High risk because of lack of process visibility. •Transformational – High risk because of need for advanced technology and staff skills. Hybrid Process Models •Large systems are usually made up of several sub-systems. •The same process model need not be used for all subsystems. •Prototyping for high-risk specifications. •Waterfall model for well-understood developments. Spiral Process Model Determine objectives alternatives and constraints Risk analysis Evaluate alternatives identify, resolve risks Risk analysis Risk analysis REVIEW Requirements plan Life-cycle plan Development plan Plan next phase Integration and test plan Prototype 3 Prototype 2 Risk analy sis Prototype 1 Concept of Operation Operational protoype Simulations, models, benchmarks S/W requirements Requirement validation Product design Detailed design Code Unit test Design V&V Integr ation test Acceptance test Develop, verify Service next-level product Spiral Model Advantages •Focuses attention on reuse options. •Focuses attention on early error elimination. •Puts quality objectives up front. •Integrates development and maintenance. •Provides a framework for hardware/software development. Spiral Model Problems •Contractual development often specifies process model and deliverables in advance. •Requires risk assessment expertise. Process Visibility •Software systems are intangible so managers need documents to assess progress. •Waterfall model is still the most widely used model. Waterfall Model Documents Activity Requirements analysis Requirements definition System specification Architectural design Interface design Detailed design Coding Unit testing Module testing Integration testing System testing Acceptance testing Output documents Feasibility study, Outline requirements Requirements document Functional specification, Acceptance test plan Draft user manual Architectural specification, System test plan Interface specification, Integration test plan Design specification, Unit test plan Program code Unit test report Module test report Integration test report, Final user manual System test report Final system plus documentation Process Model Visibility Process model Waterfall model Evolutionary development Formal transformations Reuse-oriented development Spiral model Process visibility Good visibility, each activity produces some deliverable Poor visibility, uneconomic to produce documents during rapid iteration Good visibility, documents must be produced from each phase for the process to continue Moderate visibility, it may be artificial to produce documents describing reuse and reusable components. Good visibility, each segment and each ring of the spiral should produce some document. Professional Responsibility •Software engineers should not just be concerned with technical considerations. They have wider ethical, social and professional responsibilities. •No clear rights and wrongs about many of these issues: – – Development of military systems Whistle blowing Ethical Issues •Confidentiality •Competence •Intellectual property rights •Computer misuse Why Model Life Cycle? •A written description: – forms a common understanding of activities among the software developers. – helps in identifying inconsistencies, redundancies, and omissions in the development process. – Helps in tailoring a process model for specific projects. •Processes are tailored for special projects. – A documented process model • helps to identify where the tailoring is to occur. 47 Summary •Software engineering is: – systematic collection of decades of programming experience – together with the innovations made by researchers. •A fundamental necessity while developing any large software product: – adoption of a life cycle model. •Adherence to a software life cycle model: – helps to do various development activities in a systematic and disciplined manner. – also makes it easier to manage a software development effort. 48