Transcript Qbasic5A

Qbasic
Modular
Programming
© 2000 John Urrutia. All rights reserved.
1
Structured Programming
Good Programming Fundamentals
Reliability
 Consistently produces correct output.
Understandable (read-able)
 It shouldn’t be harder to understand than to code
Robust
 Bullet Proof.
Flexible
 Easy to fix and modify.
© 2000 John Urrutia. All rights reserved.
2
Top Down Design
Phase 1
Stepwise Refinement
Divide and conquer
 Functional Decomposition
 Data Definition
© 2000 John Urrutia. All rights reserved.
3
Top Down Design
Phase 2
Modular development
modularization
 Single functionality
 Re-usability
© 2000 John Urrutia. All rights reserved.
4
Top Down Design
Phase 2
Cohesion
The “internal strength” of a module
The minimal number of statements to
accomplish the task.
Coupling
The separation of the workings of the
module with its interface
© 2000 John Urrutia. All rights reserved.
5
Top Down Design
Phase 3
Program coding
HIPO
 Hierarchical Input Process Output Charts
Flowcharts
© 2000 John Urrutia. All rights reserved.
6
Top Down Design
Phase 3
Testing
Program Stubs
 Modules
 Functions
 Sub-routines
Blackbox VS Whitebox
© 2000 John Urrutia. All rights reserved.
7
Top Down Design
Phase 3
Testing
Black box
 Functional testing
White box
 Path testing
© 2000 John Urrutia. All rights reserved.
8