CSC 395 – Software Engineering Lecture 21: Overview of the Term & What Goes in a Data Dictionary.

Slides:



Advertisements
Similar presentations
Testing Relational Database
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Building Bug-Free O-O Software: An Introduction to Design By Contract A presentation about Design By Contract and the Eiffel software development tool.
Test process essentials Riitta Viitamäki,
Detecting Bugs Using Assertions Ben Scribner. Defining the Problem  Bugs exist  Unexpected errors happen Hardware failures Loss of data Data may exist.
1 Design by Contract Building Reliable Software. 2 Software Correctness Correctness is a relative notion  A program is correct with respect to its specification.
Software Quality Assurance Inspection by Ross Simmerman Software developers follow a method of software quality assurance and try to eliminate bugs prior.
Object Oriented Design An object combines data and operations on that data (object is an instance of class) data: class variables operations: methods Three.
Software Engineering and Design Principles Chapter 1.
Design Issues. Where to put class definitions  What goes in a source file? At most 1 public class At most 1 public class Other “helper” classes as needed.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
Unit 171 Algorithms and Problem Solving  Introduction  Algorithm Design  Algorithm Properties  Algorithm Control Flow  Examples  Comparing Algorithms.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
Karlstad University Computer Science Design Contracts and Error Management Design Contracts and Errors A Software Development Strategy (anpassad för PUMA)
Chapter 1 Principles of Programming and Software Engineering.
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Introduction to Software Engineering CS-300 Fall 2005 Supreeth Venkataraman.
PRE-PROGRAMMING PHASE
Programming Logic and System Analysis
Computer Science 340 Software Design & Testing Design By Contract.
Course: Software Engineering © Alessandra RussoUnit 1 - Introduction, slide Number 1 Unit 1: Introduction Course: C525 Software Engineering Lecturer: Alessandra.
Verification and Validation Overview References: Shach, Object Oriented and Classical Software Engineering Pressman, Software Engineering: a Practitioner’s.
The Program Development Cycle
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
CS Fall 2007 Dr. Barbara Boucher Owens. CS 2 Text –Main, Michael. Data Structures & Other Objects in Java Third Edition Objectives –Master building.
Software Life Cycle Requirements and problem analysis. –What exactly is this system supposed to do? Design –How will the system solve the problem? Coding.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
SWE 619 © Paul Ammann Procedural Abstraction and Design by Contract Paul Ammann Information & Software Engineering SWE 619 Software Construction cs.gmu.edu/~pammann/
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
PHY 107 – Programming For Science. History of C  Dennis Ritchie developed C from 1969 – 1973  Based upon B (& other) earlier languages  Since its creation,
SE: CHAPTER 7 Writing The Program
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Software Engineering Chapter 3 CPSC Pascal Brent M. Dingle Texas A&M University.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
Program Development Cycle Modern software developers base many of their techniques on traditional approaches to mathematical problem solving. One such.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Software Development p Data structure p A collection of data organized so that the data can be accessed using a set of specific techniques p Object-oriented.
Documentation Dr. Andrew Wallace PhD BEng(hons) EurIng
© Paul Ammann, 2008 Design by Contract Paul Ammann CS/SWE 332.
The Software Development Process
Software Reliability. Risks of faulty software  Example: –Therak 25, –AT&T network failure –Airport traffic control  Costs of software errors can be.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Class Design I Class Contracts Readings: 2 nd Ed: Section 9.5, Advanced Topic nd Ed: Section 8.5, Advanced Topic 8.2 Some ideas come from: “Practical.
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
SWE 4743 Abstract Data Types Richard Gesick. SWE Abstract Data Types Object-oriented design is based on the theory of abstract data types Domain.
Karlstad University Computer Science Design Contracts and Error Management External and internal errors and their contracts.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
PROGRAMMING PRE- AND POSTCONDITIONS, INVARIANTS AND METHOD CONTRACTS B MODULE 2: SOFTWARE SYSTEMS 13 NOVEMBER 2013.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
DBC NOTES. Design By Contract l A contract carries mutual obligations and benefits. l The client should only call a routine when the routine’s pre-condition.
CSCI 383 Object-Oriented Programming & Design Lecture 7 Martin van Bommel.
Effective Java, Chapter 9: Exceptions Items Last modified Fall 2012 Paul Ammann.
Chapter 1 The Phases of Software Development. Software Development Phases ● Specification of the task ● Design of a solution ● Implementation of solution.
Week # 4 Quality Assurance Software Quality Engineering 1.
In today’s lesson we will be looking at: what we mean by the software development lifecycle the phases in the lifecycle We will focus particularly on testing:
Chapter 1 The Phases of Software Development
Data Abstraction: The Walls
The Software Development Cycle
Principles of Programming and Software Engineering
Verification and Validation Overview
CSE 143 Error Handling [Section 2.8] 3/30/98 CSE 143.
Algorithm and Ambiguity
Design by Contract Fall 2016 Version.
Software Quality Engineering
CSC 143 Error Handling Kinds of errors: invalid input vs programming bugs How to handle: Bugs: use assert to trap during testing Bad data: should never.
Assertions References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 4/25/2019.
Computer Science 340 Software Design & Testing
Design Contracts and Errors A Software Development Strategy
Presentation transcript:

CSC 395 – Software Engineering Lecture 21: Overview of the Term & What Goes in a Data Dictionary

In This Lecture Review software engineering process so far One benefit of software engineering Problems that arise when developing software How software engineering tries to solve them What this means for the data dictionary Approaches that can help fix this How to write documentation that might eventually help someone

Eliminating Bugs is (NP-)Hard Halting problem states we cannot develop system that proves if a program halts Also cannot prove program free from bugs People seem to like software that works Also demand program be reliable & not crash This ignores several other basic problems Maintaining software years beyond creation Average programmer’s… unique social skills

Software Engineering Task of developing software is impossible And given last slide, we CAN prove this Most incapable of performing the impossible Enable specialization & proficiency development Software engineering includes the client Clients/customers are only source of information Starts with use-cases defining ACTUAL problem Everything flows from these initial use-cases

Faults != Good (Software) Companies care about money Not particularly interested in anything else Will not discuss this point further (this is CSC395, not PHI395) Companies act to improve their profitability Faults take time to fix Time == money Bugs therefore take money to fix Companies therefore care about faults

Good Software Lifecycles Then performs actions developing solution None of these actions performed alone Interlocking methods check & recheck results Each new action begins by reproving result Uses this check to take next step forward Periodically recheck all of the results Prevents building castles on sand Exposes bugs early

What Else Is There? Ambiguity equals

Why Ambiguity? Faults can be solved; ambiguity cannot Literally, ambiguity created by lack of solutions Once in existence, destroys everything it touches Ambiguity also cannot be detected Rather ironic if we could develop test, though Software engineering creates laborious process to limit ambiguity Unfortunately, nothing limit this work

How SE Avoids Ambiguity Insure all possible cases included Develop scenario after scenario after scenario Language is ambiguous Develop entirely new, precise, language to use Give each symbol & connection specific meaning Require everything live up to this level of precision Ambiguity can be created in translations Require documentation of everything Trace all ideas back to the original problem Document everything at obscene levels

Data Dictionary Bad idea Work in English again! Worse idea Leave documentation in programmer’s hand Ugly idea Make documentation main decider of code reuse Good idea Make $%&# certain documentation is perfect Develop precise ways of describing code

Details in Data Dictionary Do not discuss implementation details List what someone else needs to use this code Describe class & methods in detail What each can do, why each can do it, limits of where each is defined, & what each cannot do Describe expected values for all parameters and what these values mean Describe what a result will be, why it will be that way, and what the result means Describe exceptional situations

Details in Data Dictionary Document important maintenance information Associations on which class or method relies: what is associated are, why association exists, and importance of class#method Each of the class’ attributes (fields), value it holds, what value means, limits for which value defined Algorithms to be used in implementation Data structures on which it relies Documentation hidden after design phase Move from javadoc to inside module

What About Ambiguity? Previous documentation avoids errors Does not prevent ambiguity from entering debate Use three custom javadoc tags Custom tags documented only when specified on command-line Tags make assumptions explicit If assumptions revisited, allows for proper fixes javadoc -tag pre:cm:“Preconditions:” -tag post:cm:“Postconditions:” –tag inv:cmt: “Invariants:”

Assumptions & Restrictions Precondition must be true at method start Calling method responsible for ensuring met Method only defined for these situations Postcondition true when method completes Called method responsible for guaranteeing this Should consider what will happen when precondition not met Enables programming-by-contract Lack of implementation details improves reuse

Pre & Post Silly Example /** * Compute & print out square root of a number. * x Value whose square root we use x ≥ 0. System crashes when not met. x 1/2 printed out on System.err */ public void printSquareRoot(int x) { System.err.println(“…”); }

Invariants Invariants define properties met at all times Field values that are somehow linked Range over which field is defined Assumptions about how fields, parameters, or other values used Listed tag Normally included as part of class definition In limited situations, could also include in method

Why List Assumptions? Ambiguity equals

Why List Assumptions? Makes code-correctness proofs easier Can feed to theorem provers to automate proof Brings correctness proofs to nearly reasonable levels Removes ambiguities during implementation Clarifies responsibilities and actions in modules Reduces need to understand code before use Greatly reduces maintenance costs & improves reuse