Software Development Study Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.

Slides:



Advertisements
Similar presentations
Defect testing Objectives
Advertisements

1 Integration Testing CS 4311 I. Burnstein. Practical Software Testing, Springer-Verlag, 2003.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Software Failure: Reasons Incorrect, missing, impossible requirements * Requirement validation. Incorrect specification * Specification verification. Faulty.
Object-Oriented Design & Programming Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
Testing L. Grewe Why test? Detect and eliminate errors in programDetect and eliminate errors in program Feedback to improve softwareFeedback to improve.
© The McGraw-Hill Companies, 2006 Chapter 9 Software quality.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Basic OOP Concepts and Terms
© 2005 Prentice Hall4-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Lecture 7 Model Development and Model Verification.
Department of Computer Science University of Maryland, College Park
16/22/2015 2:54 PM6/22/2015 2:54 PM6/22/2015 2:54 PMObject-Oriented Development Concept originated with simulating objects and their interactions. Adapted.
Program Testing Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 CMSC 132: Object-Oriented Programming II Software Development IV Department of Computer Science University of Maryland, College Park.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Chapter 1 Principles of Programming and Software Engineering.
Midterm 1 Overview Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Chapter 1 Software Engineering. Homework ► Read Section 2.2 (pages 79-98) ► Answer questions: ► 7, 8, 11, 12, & 13 on page 134. ► Answer on paper, hand.
Final Overview Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 CMSC 132: Object-Oriented Programming II Software Development III Department of Computer Science University of Maryland, College Park.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Software Engineering Principles and C++ Classes
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
UML Examples Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Object-Oriented Design 2 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Chapter 3 : Software Process and Other Models Juthawut Chantharamalee Curriculum of Computer Science Faculty of Science and Technology, Suan Dusit University.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
System Implementation. System Implementation and Seven major activities Coding Testing Installation Documentation Training Support Purpose To convert.
TESTING.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 8: More About OOP and GUIs.
程建群 博士(Dr. Jason Cheng) 年03月
CMSC 345 Fall 2000 Unit Testing. The testing process.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
1 Intro to Java Week 12 (Slides courtesy of Charatan & Kans, chapter 8)
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Data Structures Using C++1 Chapter 1 -Software Engineering Principles -ADT and Classes.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Data Structures Using C++ 2E
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Software Engineering 2004 Jyrki Nummenmaa 1 BACKGROUND There is no way to generally test programs exhaustively (that is, going through all execution.
Software testing techniques Software testing techniques Object-oriented software testing Presentation on the seminar Kaunas University of Technology.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Chapter 1 Software Engineering Principles. Problem analysis Requirements elicitation Software specification High- and low-level design Implementation.
UML - Development Process 1 Software Development Process Using UML.
Data Structures Using Java1 Chapter 1 Software Engineering Principles and Java Classes.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Principles of Programming & Software Engineering
The Movement To Objects
Principles of Programming and Software Engineering
About the Presentations
Requirements: Use Case Models and Narratives
Chapter 1 Software Engineering.
Lecture 09:Software Testing
Basic OOP Concepts and Terms
Presentation transcript:

Software Development Study Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park

Covered So Far Software life cycle Object-oriented design & programming Unified Modeling Language (UML)

Assume You Already Know Object-oriented programming in Java Class definitions State Behavior Identity Inheritance Extending a class Abstract classes Interfaces Polymorphism Class object If you need a refresher, read Chapter 3 in book

Today Case study in OOP Testing

Object-Oriented Design Case Study Problem specification Software design 1. Identifying classes 2. State and behavior 3. Inheritance and interfaces 4. UML diagrams Testing 1. Unit test 2. Integration test 3. Acceptance test

Problem Specification Specification document Build a heating simulation that models behavior of Living room Thermostat Furnace Environment outside room Advance simulation clock every 60 seconds Calculate temperature using formula (in book) Turn furnace on/off depending on room temperature Output temperature until simulation length reached

Software Design 1. Identifying classes 2. State and behavior 3. Inheritance and interfaces 4. UML diagrams

Design – Identifying Classes Find nouns in specification Simulation Room Thermostat Furnace Environment Clock Temperature

Design – Identifying Classes Find nouns in specification Simulation  Entity outside program Room  Entity in program Thermostat  Entity in program Furnace  Entity in program Environment  Entity in program Clock  Entity in program Temperature  State of entity

Design – State and Behavior Find state for each class Nouns in specification (not representing classes) State required for function Add to class as instance variables Find behavior for each class Verbs in specification Interactions between classes Constructors & destructors Add to class as methods

State – Instance Variables Environment Temperature Furnace On / off state Capacity, efficiency (from formula) Room Temperature Area (from formula) Reference to furnace Reference to environment

State – Instance Variables Thermostat Desired temperature setting Amount of overheating (from formula) Reference to furnace it controls Reference to room it is in Clock Current time Interval between ticks

Behavior Find verbs in specification Models (behavior) Advance (clock) Calculate (temperature) Turn on/off (furnace) Output (temperature)

Behavior Find verbs in specification Models (behavior)  outside scope of class Advance (clock)  mutator for Clock Calculate (temperature)  mutator for Room Turn on/off (furnace)  mutator for Furnace Output (temperature)  mutator for Room

Behavior – Class Methods Environment Double getTemperature() Void setTemperature(double t) Furnace Boolean isHeating(); Void setHeating(boolean onOff) Room Double getFloorArea() Furnace getFurnace() Environment getEnvironment() Void determineTemperatureChange()

Behavior – Class Methods Thermostat Room getRoom() Furnace getFurnace() Double getSetting() Void setSetting(double newSetting) Double overHeat() Void determineStateChange() Clock Clock(int tickInterval)

Design – Inheritance and Interfaces Select inheritance and interfaces Specialize existing classes Allow future sharing of state & behavior

Inheritance Add GasFurnace Add pilot light Specialize existing Furnace Example GasFurnace extends Furnace New state pilotLight New behavior Boolean isPilotOn() Void setPilot(boolean onOff)

Interfaces Add ClockListener Useful for simulations Allow objects to update their state based on clock Example Interface ClockListener Void preEvent(double timeInterval) Void event() Room implements ClockListener Thermostat implements ClockListener

Design – UML Diagrams

Testing Goal Detect and eliminate errors in program Feedback to improve software Specification changes Add new functionality Extremely important for success!

Testing Techniques Clear box testing Allowed to examine code Attempt to improve thoroughness of tests Black box testing Treat program as “black box” Test behavior in response to inputs

Testing Stages Alpha test Test components during development Usually clear box test Beta test Test in real user environment Always black box test Acceptance

Testing Empirical testing Test software with selected test cases More scalable than verification Not guaranteed to detect all errors Steps 1. Unit test 2. Integration test 3. Acceptance test

Unit Test Test individual units extensively Classes Methods Central part of “eXtreme Programming” (XP) Extensive unit testing during development Design unit tests along with specification Approach Test each method of class Test every possible flow path through method

Flow Path Unique execution sequence through program Example S1 while (B1) { if (B2) S2 else S3 } Flows S1 S1, S2 S1, S3 S1, S2, S2 S1, S2, S3 S1, S3, S2 S1, S3, S3 …

Unit Test Not possible to test all flow paths Many paths by combining conditionals, switches Infinite number of paths for loops New paths caused by exceptions Test coverage Alternative to flow path Ensure each line of code tested Does not capture all possible combinations

Integration Test Test interaction between units Possible units fail when combined May find problems in specifications Approach Test units together Proceed bottom up, in increasing size Example test sequence 1. AB, AC, AD, CD, CE 2. ACD 3. ABCDE B A C D E

Acceptance Test Test entire software Approach Place software in user environment Test software with Real-world data Real users Typical operating conditions Test cases selected by users Ensure software meets specifications

Testing – Heating Simulation Unit tests Constructors for each class Methods for each class Integration tests Test Room / Thermostat with Furnace Test Room / Thermostat with ClockListener Acceptance tests Run simulations with different parameters Check program produces correct results Ensure program terminates