Swe2007 Scam
Swe2007 Scam
Swe2007 Scam
CONSTRUCTION DESIGN
Topics to be discussed
Design Challenges
Key Design Concepts
Design Building Blocks
Design Challenges
Software Design
Scheme for turning a specification of a computer
program into an operational program.
Activity that links requirements to coding and
debugging.
Design Challenges
Design is Emergent
evolve and improve through design reviews,
informal discussions, experience writing the code ,
and experience revising the code itself.
Key Design Concepts
Characteristics :
Minimal Complexity
Avoid making clever designs
Make simpler and easy to understand
Ease of Maintenance
Design for the Maintenance programmer
Design the system to be self explanatory
Minimal Connectedness
Strong Cohesion and loose coupling
Information hiding to design classes with minimal connections
Minimizes the work during integration , testing and
Maintenance
Key Design Concepts
Extensibility
Enhance system without damaging the underlying structure
Reusability
Reuse the pieces of it for other system
High Fan –In
High no. of classes that use a given class
implies that a system has been designed to make
good use of utility classes at the lower levels in the
system.
Low – Medium Fan-Out
given class use a low-to-medium number of other
classes
Key Design Concepts
Portability
designing the system so that you can easily move it to
another environment.
Leanness
designing the system so that it has no extra parts
Stratification
trying to keep the levels of decomposition stratified
so that you can view the system at any single level
and get a consistent view.
Design Building Blocks
Black Boxes
Construction Languages : Coding
Defensive Programming:
Approach to improve software quality by “Making the
software behave in a predictable manner despite
unexpected input or user actions
Protecting your program from Invalid Inputs
Assertions
Error Handling Techniques
Exceptions
Protecting Ur Program From Invalid Inputs
A good program uses “garbage in, nothing out”;
“garbage in, error message out”; or “no garbage allowed
in” instead.
There are three general ways to handle garbage in:
Ex:
assert denominator != 0 : "denominator is unexpectedly equal to
0.";
Error Handling Techniques
public class JavaExceptionExample{
public static void main(String args[]){
try{
//code that may raise exception
int data=100/0;
}catch(ArithmeticException e){System.out.println(e);}
//rest code of the program
System.out.println("rest of the code...");
}
}
The Pseudo code Programming Process
Steps in building Classes and Routines
Steps in creating a Class
Implicit Declarations
Ex : Visual Basic – Don’t declare compiler
declares(compiler settings)
Using a variable in body of a routine Have to
declare explicitly.
Turn off Implicit Declarations
Declare all Variables as you type in
Use naming Conventions
Check Variable names
Guidelines to Initialize Variables
Write the nominal path through the code first; then write
the unusual cases
Put the normal case after the if rather than after the else
Wrong way
Systematic way
Contd..,
Follow the if clause with a meaningful statement
Ex: Wrong way
if ( SomeTest )
;
else {
// do something
...
}
Proper way
if ( ! SomeTest ) {
// do something
...
}
LEVELS OF
TESTING
Low-level testing --- individual program
components, one at a time or in combination.
Unit (module) testing
Integration testing
It occurs with access to code being tested and with the support
of development environment
Defects are fixed as soon as they are found with out formally
recording incident
Bottom-up integration
Top-down integration
Incremental Integration
testing
Takes more time and effort
Identifying errors is easier
Errors can be added in the last added module
Top down Integration Testing
b c d Stubs
B C D
e f g Stubs A
B C D
E F G
Bottom up Integration
Testing
Start with the Scratch module
Move towards the topmost module
Super ordinate modules are simulated using
dummy module called drivers
In bottom up integration a module can be
integrated if all of its subordinate modules
are tested earlier
Bottom-Up Integration testing
a Driver
B C D
E F G
E F G D
Cost of developing stubs and drivers
generally, Driver modules are easier to develop --
so, bottom-up integration testing is less costly.
With Top-Down Integration Testing, major modules
are coded and tested first - strong psychological
boost when major modules are done. It gives skeletal
structure
With Bottom-Up Integration testing, no working
program can be demonstrated until the last module
is tested -- major design errors may not be detected
till the end, when entire programs may need revision!
Meet-in-the-middle approach may be best.
Usability testing
Process of attempting to identify discrepancies
between the user interfaces of a product and the
human engineering requirements of its potential
users.
Requirement based
Validation activity rather than a verification activity
Characteristics :
Accessibility
Responsiveness
Efficiency
Comprehensibility
Function testing
Process of attempting to defect discrepancies
Between a program’s functional specification and its
actual behavior.
Performed by a testing group before the product is
made available to customers
Function coverage is measured with function
coverage matrix form
Functions/Inputs
Priority
Test cases
System testing
Process of attempting to demonstrate that a
program or system does not meet its original
requirements and objectives, as stated in the
requirements specification.
It is difficult
Needs a great deal of creativity
Designed by analyzing the requirements
specification and then formulated by analyzing
the functional design specification or user
documentation.
Types/goals of System Testing
Volume Testing
Load/stress Testing
Security testing
Usability testing
Performance testing
Resource usage testing
Configuration testing
Compatibility/conversion testing
Installability testing
Recovery testing
Serviceability testing
Reliability/availability testing
Steps of system testing
Decompose and analyze the requirements specification
Partition the requirements into logical categories and ,
for each components, make a list of the detailed
requirements
For each type of system testing
Determine inputs and outputs
Develop the requirements test cases
Develop a requirements coverage matrix
Execute the test cases and measure logic coverage
Develop additional tests, by combined coverage
information
Acceptance testing
Process of comparing the end product to the current
needs of its end users.