Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 10: Software Engineering Presentation slides for Java Software Solutions Foundations of Program Design Second Edition by John Lewis and William.

Similar presentations


Presentation on theme: "Chapter 10: Software Engineering Presentation slides for Java Software Solutions Foundations of Program Design Second Edition by John Lewis and William."— Presentation transcript:

1 Chapter 10: Software Engineering Presentation slides for Java Software Solutions Foundations of Program Design Second Edition by John Lewis and William Loftus Java Software Solutions is published by Addison-Wesley Presentation slides are copyright 2000 by John Lewis and William Loftus. All rights reserved. Instructors using the textbook may use and modify these slides for pedagogical purposes.

2 2 Software Engineering b The quality of the software we create is a direct result of the process we follow to develop it b Chapter 10 focuses on: software development modelssoftware development models the software life cyclethe software life cycle linear and iterative development approacheslinear and iterative development approaches an evolutionary approach to object-oriented developmentan evolutionary approach to object-oriented development

3 3 The Program Life Cycle b The overall life cycle of a program includes use and maintenance: Use Development Maintenance

4 4 Maintenance b Maintenance tasks include any modifications to an existing program b It includes defect removal and enhancements b The characteristics of a program that make it easy to develop also make it easy to maintain b Maintenance efforts tend to far outweigh the development effort in today’s software b Small increases in effort at the development stage can greatly reduce maintenance tasks

5 5 Development vs. Maintenance Use and Maintenance Development

6 6 Development and Maintenance Effort DevelopmentMaintenance Small increases in development effort can reduce maintenance effort

7 7 Development Process Models b Too many programmers follow a build-and-fix approach b They write a program and modify it until it is functional, without regard to system design b Errors are haphazardly addressed as they are discovered b It is not really a development model at all

8 8 The Build-and-Fix Approach Write program Modify program

9 9 The Waterfall Model b The waterfall model was developed in the mid 1970s b Activities that must be specifically addressed during development include: Establishing clear and unambiguous requirementsEstablishing clear and unambiguous requirements Creating a clean design from the requirementsCreating a clean design from the requirements Implementing the designImplementing the design Testing the implementationTesting the implementation b Originally it was proposed as a linear model, with little or no backtracking b It is a nice goal, but is generally unrealistic

10 10 The Waterfall Model Establish requirements Create design Implement code Test system

11 11 An Iterative Process b Allows the developer to cycle through the different development stages b Essentially the waterfall model with backtracking b However backtracking should not be used irresponsibly b It should be used as a technique available to the developer in order to deal with unexpected problems that may arise in later stages of development

12 12 An Iterative Development Process Establish requirements Create design Implement code Test system

13 13 Prototype b A prototype is a program created to explore a particular concept b More useful, time-effective, and cost-effective than merely acting on an assumption that may later backfire b Usually created to communicate to the client: a particular taska particular task the feasibility of a requirementthe feasibility of a requirement a user interfacea user interface b A way of validating requirements

14 14 Evaluation b The results of each stage should be evaluated carefully prior to going on to the next stage b Before moving on to the design, for example, the requirements should be evaluated to ensure completeness, consistency, and clarity b A design evaluation should ensure that each requirement was adequately addressed b Prior to testing, the implementation should be give a thorough code walkthrough

15 15 Testing Techniques b Generally, the goal of testing is to find errors b It is often called defect testing b A good test will uncover problems in a program b A test case includes a set of inputsa set of inputs user actions or other initial conditionsuser actions or other initial conditions expected outputexpected output b It is not feasible to exhaust every possible case

16 16 Black-Box Testing b Black-box testing maps a set of specific inputs to a set of expected outputs b An equivalence category is a collection of input sets b Two input sets belong to the same equivalence category if there is no reason to believe that if one works, the other will not b Therefore testing one input set essentially tests the entire category

17 17 White-Box Testing b White-box testing is also referred to as glass-box testing b It focuses on the internal logic such as the implementation of a method b Statement coverage guarantees that all statements in a method are executed b Condition coverage guarantes that all paths through a method are executed

18 18 An Evolutionary Development Model b We will now divide the process of design into architectural design - primary classes and interactionarchitectural design - primary classes and interaction detailed design - specific classes, methods, and algorithmsdetailed design - specific classes, methods, and algorithms b This allows us to create a refinement cycle b Each refinement focuses on one aspect of the system b As each refinement is addressed, the system evolves

19 19 An Evolutionary Development Model Establish requirements Architectural design Establish refinement scope Unit and integration test Implementation System test Identify classes & objects Identify relationships Detailed design

20 20 Refinement Cycle b First, we establish refinement scope to define the specific nature of the next refinement b Such as: the user interfacethe user interface a particular algorithma particular algorithm a particular requirementa particular requirement b Choosing the most appropriate next refinement is important and requires experience

21 21 Refinement Cycle b Next, we identify classes and objects b The ones that relate to the current refinement b These may overlap with other refinements b Can often define by focusing on the roles they play in the system b Consider reusing existing classes

22 22 Refinement Cycle b Then we identify relationships among classes b Inheritance (is-a) relationships b The uses relationship establishes another kind of bond between classes Class A uses class B in some wayClass A uses class B in some way Can express cardinalityCan express cardinality Example: A Car has (uses) four wheelsExample: A Car has (uses) four wheels

23 23 Refinement Cycle b Finally, detailed design, implementation and test b Design of specific methods and their translation into code b A unit test focuses on one particular component, such as a method or class b An integration test focuses on the interaction between components

24 The PaintBox Project b We can explore the evolutionary development model using a larger project b The PaintBox program will allow the user to create drawings with various shapes and colors b After establishing the requirements, the following refinement steps were established: create the basic user interfacecreate the basic user interface allow the user to draw shapes and change colorallow the user to draw shapes and change color allow the user to select, move, and fill shapesallow the user to select, move, and fill shapes allow the user to edit the dimensions of shapesallow the user to edit the dimensions of shapes allow the user to save and reload drawingsallow the user to save and reload drawings

25 PaintBox Refinement 1 b The first refinement establishes the basic user interface  See PaintBox.java PaintBox.java  See PaintFrame.java PaintFrame.java  See ButtonPanel.java ButtonPanel.java b See DrawingPanel.java DrawingPanel.java

26 PaintBox Refinement 2  See PaintBox.java PaintBox.java  See PaintFrame.java PaintFrame.java  See ButtonPanel.java ButtonPanel.java b See DrawingPanel.java DrawingPanel.java  See Shape.java Shape.java  See Line.java Line.java  See BoundedShape.java BoundedShape.java  See Rect.java Rect.java b See Oval.javaOval.java b See Poly.javaPoly.java b The second refinement allows the user to draw shapes and change colors


Download ppt "Chapter 10: Software Engineering Presentation slides for Java Software Solutions Foundations of Program Design Second Edition by John Lewis and William."

Similar presentations


Ads by Google