Object-Oriented Software Engineering Revision Paul J Krause.

Slides:



Advertisements
Similar presentations
Testing and Inspecting to Ensure High Quality
Advertisements

Object Oriented Analysis And Design-IT0207 iiI Semester
Use Case & Use Case Diagram
10 Software Engineering Foundations of Computer Science ã Cengage Learning.
1 Software Engineering Lecture 11 Software Testing.
Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
MIS 325 PSCJ. 2  Business processes can be quite complex  Process model: any abstract representation of a process  Process-modeling tools provide a.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Introduction To System Analysis and Design
1 CS 425 Software Engineering Project Preparation Use Case Modeling [Based on Chapters 3 & 4, Arlow and Neustadt, “UML and the Unified Process,” Addison-Wesley,
1 Software Testing and Quality Assurance Lecture 30 – Testing Systems.
Test Design Techniques
TK2023 Object-Oriented Software Engineering CHAPTER 6 SYSTEM SEQUENCE DIAGRAMS.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
1 Object-Oriented Testing CIS 375 Bruce R. Maxim UM-Dearborn.
Internet Software Development Testing and Inspections Paul J Krause.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation.
TESTING.
CompSci 230 Software Design and Construction
CMSC 345 Fall 2000 Unit Testing. The testing process.
Software Engineering DKT 311 Lecture 11 Verification and critical system validation.
Instructor: Peter Clarke
Internet Software Development Putting it all together Paul J Krause.
1 CMPT 275 Software Engineering Requirements Analysis Phase Requirements Analysis Activity (Identifying Objects, Scenarios) Janice Regan,
Lecture 11 Testing and Debugging SFDV Principles of Information Systems.
From Use Cases to Test Cases 1. A Tester’s Perspective  Without use cases testers will approach the system to be tested as a “black box”. “What, exactly,
Requirements Management with Use Cases Module 2: Introduction to RMUC Requirements Management with Use Cases Module 2: Introduction to RMUC.
 CS 5380 Software Engineering Chapter 8 Testing.
Executable UML The Models are the Code - Executable UML Lecture 3 - Modelling with Domains and Classes Paul Krause.
Software Requirements Engineering: What, Why, Who, When, and How
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 20. Review Software Requirements Requirements Engineering Process.
ZHRC/HTI Financial Management Training Session 9: Stores and Supplies Management.
Chapter SIX Implementation, Testing and Pragmatics Making it a reality.
Faculty of Computer & Information
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
Requirements as Usecases Capturing the REQUIREMENT ANALYSIS DESIGN IMPLEMENTATION TEST.
Rational Requirements Management with Use Cases v5.5 Copyright © Rational Software, all rights reserved 1 Requirements Management with Use Cases.
1 Object-Oriented Modeling Using UML CS 3331 Section 2.4 Modeling Requirements with Use Cases.
1 Capturing Requirements As Use Cases To be discussed –Artifacts created in the requirements workflow –Workers participating in the requirements workflow.
LESSON 3. Properties of Well-Engineered Software The attributes or properties of a software product are characteristics displayed by the product once.
CSC480 Software Engineering Lecture 8-9 September 20, 2002.
Software Engineering 2004 Jyrki Nummenmaa 1 BACKGROUND There is no way to generally test programs exhaustively (that is, going through all execution.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
Software Engineering Issues Software Engineering Concepts System Specifications Procedural Design Object-Oriented Design System Testing.
Testing and inspecting to ensure high quality An extreme and easily understood kind of failure is an outright crash. However, any violation of requirements.
Chapters 10, 11 SSD (Revision) SD DCD Exam Object-Oriented Design.
Software Quality Assurance and Testing Fazal Rehman Shamil.
Dynamic Testing.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Requirement Analysis SOFTWARE ENGINEERING. What are Requirements? Expression of desired behavior Deals with objects or entities, the states they can be.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
This chapter is extracted from Sommerville’s slides. Textbook chapter 22 1 Chapter 8 Validation and Verification 1.
Software Engineering Testing. These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright.
Object-Oriented Software Engineering CS288 Paul Krause.
Lecturer: Eng. Mohamed Adam Isak PH.D Researcher in CS M.Sc. and B.Sc. of Information Technology Engineering, Lecturer in University of Somalia and Mogadishu.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Testing Integral part of the software development process.
1 Object Oriented Analysis and Design System Events & Contracts.
Using Use Case Diagrams
Lecture 09:Software Testing
SAD ::: Spring 2018 Sabbir Muhammad Saleh
Software Requirements Specification Document
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Using Use Case Diagrams
Software metrics.
Object-Oriented Software Engineering
CS 425 Software Engineering
Chapter 7 Software Testing.
Presentation transcript:

Object-Oriented Software Engineering Revision Paul J Krause

Software Lifecycle Customer Requirements Functional Requirements Design Implementation Unit Test System Test Acceptance Test Lecture 10 Lecture 11 Lectures 6/8/9 Most of the rest! Lecture 18

Customer Requirements Functional Requirements Design Implementation Unit Test System Test Acceptance Test Lecture 10 Lecture 11 Lectures 6/8/9 Most of the rest! Lecture 18

Why Requirements? “The firms improving their development speed at the fastest rate actually spend more elapsed time and more effort in the customer requirements stage of the project …. These firms spend significantly less time in the testing and integration stage of development.…” Blackburn, Scudder, et al, in Improving Speed and Productivity of Software Development: A Global Survey of Software Developers (1996) Resources spent on Customer Requirements:

Tom on ‘Requirement’ Requirement: Concept *026 November 8, :16 Requirement: Concept *026 November 8, :16 A requirement is a stakeholder-desired Target or Constraint. A requirement is a stakeholder-desired Target or Constraint. Notes: Notes: 1. The constraints can apply to an engineering process, a design or an operational system. 1. The constraints can apply to an engineering process, a design or an operational system. 2. A requirement is an input to a defined level of design process. 2. A requirement is an input to a defined level of design process. 3. Requirements give information to the designer about the necessary nature of their design. 3. Requirements give information to the designer about the necessary nature of their design. 4. Consequently the design, specification or implementation, can be judged {Spec QC, review, test or in operation} in terms of how well it satisfies those requirements. 4. Consequently the design, specification or implementation, can be judged {Spec QC, review, test or in operation} in terms of how well it satisfies those requirements. INTRO

Requirement Specification. Requirement Specification. Concept *508. November 8, Requirement Specification. Concept *508. November 8, A requirement specification is the readable expression of a requirement and any requirement background. A requirement specification is the readable expression of a requirement and any requirement background.  Related Concepts:  requirement *026 the future state or constraint  specification *137 the readable artifact  background *507 additional information about the requirement

Stakeholders: requirements sources  ‘Stakeholders’ are: Any person, group or thing which Any person, group or thing which Can determine our system’s degree of success or failureCan determine our system’s degree of success or failure By having an “opinion” aboutBy having an “opinion” about system performance characteristics system performance characteristics system lifecycle constraints system lifecycle constraints Stakeholders determine requirements! Stakeholders determine requirements! Systems engineers determine which requirements the stakeholders need Systems engineers determine which requirements the stakeholders need Even if the stakeholders are not currently conscious of those needs!Even if the stakeholders are not currently conscious of those needs!

Non-functional Requirements  Functional Requirements What the system should do - the services it should provide What the system should do - the services it should provide  Non-Functional Requirements The constraints that must be adhered to during development The constraints that must be adhered to during development Performance, memory, reuse, usability, … Performance, memory, reuse, usability, … See Tom Gilb, and our Lecture 10 See Tom Gilb, and our Lecture 10

Functional Requirements Customer Requirements Functional Requirements Design Implementation Unit Test System Test Acceptance Test Lecture 10 Lecture 11 Lectures 6/8/9 Most of the rest! Lecture 18

What are Actors and Use Cases?  Actors - users of the system external entities (people or other systems) who interact with the system to achieve a desired goal. external entities (people or other systems) who interact with the system to achieve a desired goal.  Use Cases - what happens when Actors interact with the system by recording all the ways the system is used (“cases of use”) we accumulate all the goals or requirements of the system. by recording all the ways the system is used (“cases of use”) we accumulate all the goals or requirements of the system.

Identifying Actors  Who uses the system?  Who installs the system?  Who starts up the system?  Who maintains the system?  Who shuts down the system?  What other systems use the system?  Who gets information from this system?  Who provides information to the system?  Does anything automatically happen at preset times?

Examples of Actors CustomerClerkShipping Company Supplier

Use Case Diagram CustomerClerkShipping Company Supplier Place Order Get Order Status Calculate Postage Supply Product Deliver Package

Use Case: Place Order Customer Place Order

Place Order: Flow of Events Trigger: The Customer selects a Product category 1. The Customer browses the chosen Product category page 2. The Customer selects a specific Product to purchase 3. The Customer adds the Product to their Shopping Cart 4. The Customer may repeat events 1, 2 and 3 to add additional items to their Shopping Cart 5. When ready, the Customer requests that the Order be commited to 6. The Credit Company is notified to authorise the Customer’s credit rating 7. If the credit rating is positive, the Order will be placed

Nouns as Candidate Classes Trigger: The Customer selects a Product category 1. The Customer browses the chosen Product category page 2. The Customer selects a specific Product to purchase 3. The Customer adds the Product to their Shopping Cart 4. The Customer may repeat events 1, 2 and 3 to add additional items to their Shopping Cart 5. When ready, the Customer requests that the Order be commited to 6. The Credit Company is notified to authorise the Customer’s credit rating 7. If the credit rating is positive, the Order will be placed

Design Customer Requirements Functional Requirements Design Implementation Unit Test System Test Acceptance Test Lecture 10 Lecture 11 Lectures 6/8/9 Most of the rest! Lecture 18

Identifying classes  Think about general properties of the domain in which you are working  Identify the nouns  These form candidate classes A Publisher produces and markets a Book A Customer purchases a Book An Author writes a Book

Publisher name address webSite Book bookNumber title unitPrice Customer name shippingAddress Author name address webSite

Publisher name address webSite Book bookNumber title unitPrice Customer name shippingAdd Author name address webSite R1R3 R2 is produced and marketed by produces and markets purchases is sold to wrote was written by

Publisher name address webSite Book bookNumber title unitPrice Customer name shippingAdd Author name address webSite R1R3 R2 is produced and marketed by produces and markets purchases is sold to wrote was written by 10..*1..* 0..* 1..* There are books not sold to any customer To be a customer you must have purchased at least one book But where do I put the number of books a customer purchased?

Publisher name address webSite BookProduct bookNumber title unitPrice Customer name shippingAdd Author name address webSite R1R3 R2 is produced and marketed by produces and markets is a purchase of is sold as wrote was written by 10..*1..* 0..* 1..* Order quantity salePrice date makes1..* is made by 1

Interaction Diagrams  These are used to model the dynamic aspects of a software system  Typically, a class diagram and Use Cases are used as inputs to the development of interaction diagrams  In UML there are two kinds of interaction diagram Sequence diagrams Sequence diagrams Collaboration diagrams Collaboration diagrams

Sequence Diagram ATM Customer ATM CardATM Control Customer Interface Bank Server Card Inserted Get Pin PIN Prompt PIN Input Card Request Card Data PIN Entered Validate PIN

Order Item: Flow of Events Trigger: The Customer selects an item 1. A new Order is created 2. The selected item is addded to the Order 3. The Customer selects “check out” 4. A charge is made to the Customer’s Credit Card 5. Approval for the Credit Card Charge is requested from the Credit Card Company 6. The Customer is notified when the Credit Card Charge has been approved 7. Once the Credit Card Charge has been approved, then Shipment is approved …

Testing Customer Requirements Functional Requirements Design Implementation Unit Test System Test Acceptance Test Lecture 10 Lecture 11 Lectures 6/8/9 Most of the rest! Lecture 18

The Drive for Software Quality Low Defect Rates High User Satisfaction

But Testing is:-  Time consuming writing test cases writing test cases executing test cases executing test cases  Error prone

But Testing is:-  Time consuming writing test cases writing test cases executing test cases executing test cases  Error prone

Errors, defects, failures ErrorDefectFailure Introduces aMay result in one or more

Effective and Efficient Testing  To test effectively, you must use a strategy that uncovers as many defects as possible.  To test efficiently, you must find the largest possible number of defects using the fewest possible tests Testing is like detective work: Testing is like detective work: The tester must try to understand how programmers and designers think, so as to better find defects.The tester must try to understand how programmers and designers think, so as to better find defects. The tester must not leave anything uncovered, and must be suspicious of everything.The tester must not leave anything uncovered, and must be suspicious of everything. It does not pay to take an excessive amount of time; tester has to be efficient.It does not pay to take an excessive amount of time; tester has to be efficient.

Inspections  An inspection is an activity in which one or more people systematically Examine source code or documentation, looking for defects. Examine source code or documentation, looking for defects. Normally, inspection involves a meeting... Normally, inspection involves a meeting... Although participants can also inspect alone at their desks.Although participants can also inspect alone at their desks.

Black-box testing  Testers provide the system with inputs and observe the outputs They can see none of: They can see none of: The source codeThe source code The internal dataThe internal data Any of the design documentation describing the system’s internalsAny of the design documentation describing the system’s internals But they can see: But they can see: Requirements documents and/or specificationsRequirements documents and/or specifications

Glass-box testing  Also called ‘white-box’ or ‘structural’ testing  Testers have access to the system design They can They can Examine the design documentsExamine the design documents View the codeView the code Observe at run time the steps taken by algorithms and their internal dataObserve at run time the steps taken by algorithms and their internal data Individual programmers often informally employ glass-box testing to verify their own code Individual programmers often informally employ glass-box testing to verify their own code But they are testing what is implemented, and not necessarily what is required!

Recommended Practice  Use Black Box techniques for initial test design Check all requirements are covered Check all requirements are covered  Analyse the code or design to see to what extent the logical structure of the software under test is covered  Intelligently add in test cases to increase the structural coverage up to some agreed level

Defects in Timing and Co- ordination  Deadlock and livelock Testing strategies: Testing strategies: Deadlocks and livelocks occur due to unusual combinations of conditions that are hard to anticipate or reproduce.Deadlocks and livelocks occur due to unusual combinations of conditions that are hard to anticipate or reproduce. It is often most effective to use inspection to detect such defects, rather than testing alone.It is often most effective to use inspection to detect such defects, rather than testing alone. However, when testing:However, when testing: Vary the time consumption of different threads. Vary the time consumption of different threads. Run a large number of threads concurrently. Run a large number of threads concurrently. Deliberately deny resources to one or more threads. Deliberately deny resources to one or more threads.

Example of deadlock B:ThreadA:Thread waiting to lock O: waiting to lockP: lock P: O: lock

Example of critical race A:ThreadData:B:Thread get set a) Normal A:ThreadData:B:Thread get set b) Abnormal due to delay in thread A

Software Lifecycle Customer Requirements Functional Requirements Design Implementation Unit Test System Test Acceptance Test