DOC PREVIEW
MIT 16 01 - Introduction to Computers and Programming

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Introduction to Computers and Programming Prof. I. K. Lundqvist Lecture 14 April 21 2004 2 Outline • Bhorbugs and Heisenbugs • Designing Large Programs – Software design quality –Modularity – Design by Contract3 Real Bugs and Software Bugs adjust to the level of experience of the programmer invade the test environment replace previously caught bugs 4 Taxonomy of Bugs •Bugs •Bugs •Bugs • Reproducible bugs / Bohrbugs • Unreproducible / Heisenbugs • Tasking /Timing bugs5 Reproducible Bugs/ Bhorbugs Always cause a failure and can be reproduced • explaining what should be happing • Verbalization often clarifies muddled thoughts • friend do a quick sanity check • change things, your actions should have a purpose 6 Heisenbugs A bug that disappears or when you are trying to track it down • platforms • program stop everything when one is violated • • the bug Try Have a Don’t randomly changes behavior Try to make the bug reproducible by switching Insert checks for invariants and have the Verify each layer with small, simple tests Find the smallest system which demonstrates7 Tasking / Timing Bugs specified 8 Software Design Quality together with its application domain – – Quality predictors • Synchronization properties are not • Unconditional waits • Deadlocks and races • What is quality? – Construction quality – Aesthetic quality –Fit for purpose? • How can we measure quality? • Design quality : Fitness to purpose • Quality is a measure of Software Requirements analysis9 Quality Predictors • Simplicity decorations 10 Quality Predictors • Modularity is a logical partitioning of the software design that allows complex software to be manageable for purposes of implementation and maintenance – Coupling – Cohesion – Meets its objectives, without any extra – Look for complexity • Control flow complexity • Information flow complexity • Name space complexity • Property of a collection of modules • Property or characteristic of an individual module11 Coupling • or how interdependent they are two modules depends on their interface complexity 12 Classes of Coupling data stamp control common content low / best high / worst Coupling indicates: –how closely two modules interact –the degree of coupling between13 Coupling • Data coupling: Two modules are data coupled if they communicate via a parameter (+++) • Stamp coupling: Two modules are stamp coupled if they communicate through a composite data structure (+) • Control coupling: Data from one module is used to control the direction of the execution in the other module (0) 14 Coupling • Common Coupling: Two modules are said to be common coupled when both reference the same shared/global data (-) • Content Coupling: Two modules are said to be content coupled when they share code (---)15 Concept Question 16 Classes of Cohesion functional sequential communicational procedural temporal logical coincidental Degree ofcohesion Best / high Worst / low 1. Not Coupled 2. Are Content Coupled 3. Stamp Coupled 4. I still don’t understand coupling Test_stack.adb and my_stack package are:17 Cohesion • Coincidental cohesion exists when subprograms in the module relate to each other very loosely, if at all (---) • Logical cohesion exists when all elements in the module perform similar operations (---) 18 Cohesion • Temporal cohesion exists when a module contains tasks that must be executed within the same time span (+) • Procedural cohesion exists when the subprograms in the module are part of the same algorithm (+)19 Cohesion • Communication cohesion exists when all subprograms in the module reference or update the same data structure (+) • Sequential cohesion exists when elements of a module form different parts of a sequence, i.e., output from one element of the sequence is input to the next (++) 20 Cohesion • Functional cohesion exists when all subprograms in the module cooperate to achieve a single function (+++) Describe the functions in a single sentence Effects: initialize the data structures and initialize the screen display and initialize the history stack and initialize the layout defaults and display an introductory text Effects: if x =0 then returns size(a[]) x=1 then returns sum(a[]) x=2 then returns mean(a[]) x=3 then returns median(a[]) else if else if else if21 Concept Question my_stack package has: 1. Logical cohesion 2. Functional cohesion 3. No Cohesion 4. I still don’t understand


View Full Document

MIT 16 01 - Introduction to Computers and Programming

Documents in this Course
Fluids

Fluids

3 pages

Fluids

Fluids

4 pages

Fluids

Fluids

4 pages

Fluids

Fluids

5 pages

Load more
Download Introduction to Computers and Programming
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Introduction to Computers and Programming and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Introduction to Computers and Programming 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?