SOFTWARE CONSTRUCTION AND TESTING Software Construction
-
Upload
softwarecentral -
Category
Documents
-
view
467 -
download
3
Transcript of SOFTWARE CONSTRUCTION AND TESTING Software Construction
SOFTWARE CONSTRUCTION SOFTWARE CONSTRUCTION
AND TESTINGAND TESTING
Software Construction & TestingSoftware Construction & Testing
What is software construction? What is software testing? How important are construction & testing? What are some of the “critical success
factors” for construction & testing? Who should be involved in the
construction & testing activities?
Software Construction & TestingSoftware Construction & Testing
Labor intensive activityLabor intensive activity
Tools are requiredTools are required
Blueprints are essentialBlueprints are essential
Mistakes can be deadlyMistakes can be deadly
Weariness and Stress are commonWeariness and Stress are common
Software Construction & Testing - A Large ProjectSoftware Construction & Testing - A Large Projectfrom LORAL (formerly IBM Federal Systems Div) *from LORAL (formerly IBM Federal Systems Div) *
Flight Software in Space ShuttleFlight Software in Space Shuttle 500 KLOC 500 KLOC Software Production Facility SimulatorSoftware Production Facility Simulator 1,700 KLOC1,700 KLOC Mission & Payload Control CentersMission & Payload Control Centers 4,000 KLOC4,000 KLOC Launch Processing SystemLaunch Processing System 2,500 KLOC2,500 KLOC Space Lab (prototype version)Space Lab (prototype version) 800 KLOC 800 KLOC
Total:Total: 9,500 KLOC9,500 KLOC New Version every 4-8 monthsNew Version every 4-8 months 10-53 KLOC changes each time10-53 KLOC changes each time
* circa 1994
* Caldwell, Bruce, “Taming the Beast”, InformationWeek, 3/10/97, pp 38-48.
Software Construction & Testing -Software Construction & Testing -A Large Project from Inland Steel Industries, Inc. *A Large Project from Inland Steel Industries, Inc. *
$4.6B Revenue (#6) $74.4M I.S. Budget 466 I.S. Employees Order Fulfillment Sys 27 Integrated Applics. 18 Reeng bus. process Almost 4 years:
1993 - Feas & Analysis ‘94-’96 Dev, Imple. in 3
phases
400 Person-years with 200 technologists
Replaced 30-year old sys 65,000 Function Points 7 Million LOC Cost: $37M; Save: $25M
(one-time); $9M Annually Developed On-Time and
Within Budget - aka “A Miracle”
Software Construction & Testing Software Construction & Testing - Software Design Principles- Software Design Principles
Software should work correctlySoftware should work correctly
Software must conform to requirements specificationSoftware must conform to requirements specification
Software must be reliable over time and dataSoftware must be reliable over time and data
Software must be evolutionarySoftware must be evolutionary
Software must be easy to useSoftware must be easy to use
Software should be easy to test & implementSoftware should be easy to test & implement
Software should use computer resources efficientlySoftware should use computer resources efficiently
Verification and Validation*Verification and Validation* Verification: The process of evaluating a system or
component to determine whether the products of a given phase satisfy the conditions imposed at the start of that phase. (Mainly a paper-based activity that requires you to confirm that each stage of the development conforms to the requirements defined in the previous stage.)
Validation: The process of evaluating a system or component during or at the end of the development process to determine whether it satisfies specified requirements. (Mainly a confirmation that the implemented system/component actually works to specification.)
* IEEE Standard Glossary of Software Engineering Terminology, 1994
Hierarchical View of Software Construction
Statement(sequence, selection, iteration)
EXAMPLES
X = X + 1MOVE ACCT TO NEWACCTIF X = 25...DO WHILE ...
(one or more statementscombine to form a module)
Module(paragraph, procedure, subroutine)
COMPUTE-NET-PAYSALESTAX(AMT,TOTAL)
Program
(one or more modulescombine to form a program)
INVOICE PROGRAMORDER ENTRY PROGRAMELEVATOR PROGRAM
Sub-System or System
(one or more programs combineto form a sub-system or system)
HP
PDS
(software, hardware, people,procedures, data)
Hierarchical View ofObject-Oriented SoftwareConstructionStatement
(sequence, selection, iteration)
(one or more statementscombine to form a service)
Service
(one or more services belongto a Class or Class-with-Objects)
Sub-System or System
(one or more Class-with-Objects combineto form a sub-system or system)
HP
PDS
(software, hardware, people,procedures, data)
Class with Objects
Attributes
Services
Software Construction StrategiesSoftware Construction Strategies
TOP-DOWNTOP-DOWN
BOTTOM-UPBOTTOM-UP
MIDDLE-OUTMIDDLE-OUT
High-level to low-High-level to low-level; user interface level; user interface to detail logicto detail logic
Reverse of the aboveReverse of the above
Some of bothSome of both
These strategies are discussed in more detail in the Testing Section
Cohesion Coupling
Two Software Evaluation MetricsTwo Software Evaluation Metrics
COHESION: COHESION: The measure of strength The measure of strength
of the of the
interrelatedness of statements within interrelatedness of statements within
a modulea module
High (best)
Low (worst)
• Functional
• Informational
• Communicational
• Procedural
• Temporal
• Logical
• Coincidental
Cohesion*Cohesion*
* adapted from: Software Engineering, Pressman, R. S., McGraw Hill, 1987
“Scatter-brained” module “Single-minded” module
low (“worst”) high (“best”)
Coincidental Logical Temporal ..... Informational Functional
COHESION: COHESION: The measure of strength The measure of strength
of the of the
interrelatedness of statements within interrelatedness of statements within
a modulea module
High (best)
Low (worst)
• Functional - one action or goal
• Informational - multiple independent actions on
the same data
• Communicational - series of steps on same data
• Procedural - series of steps for an action
• Temporal - series of related actions related in time
• Logical - series of related actions
• Coincidental - multiple, unrelated actions
Cohesion - examples - 1 of 3Cohesion - examples - 1 of 3
• Coincidental cohesion module
Logic to produce Payroll reportLogic to produce Production reportLogic to produce Sales reportLogic to check e-mailetc...
Onemodule
Cohesion - examples - 2 of 3Cohesion - examples - 2 of 3
• With (x) = Coincidental cohesion• Without (x) = Logical cohesion
Display date & time on screenPrompt user for student id numberLook up student id number in STUDENT tableIF found: Prompt user for password Validate password Process course seat registration request Check to see if user has email waiting (x) Check to see if user’s health record is up-to-date (x)ELSE IF not found: do error processingEND
Cohesion - examples - 3 of 3Cohesion - examples - 3 of 3
• Functionally cohesive modules
Logic to display date
Logic to display time
Logic to prompt user for student id
Logic to validate student id
Logic to handle error condition
Logic to prompt user for password
Logic to ..... etc.
Each of theseis a separatemodule
COUPLING: COUPLING: The measure of strengthThe measure of strengthof the connection between modulesof the connection between modules
High (worst)
Low (best)
• Content
• Common
• Control
• Stamp
• Data
• No Coupling
Coupling*Coupling*
* adapted from: Software Engineering, Pressman, R. S., McGraw Hill, 1987
“highly independent” module “highly dependent” module
low (“best”) high (“worst”)
No coupling Data Stamp Control Common Content
COUPLING: COUPLING: The measure of strengthThe measure of strength
of the connection between modulesof the connection between modules
High (worst)
Low (best)
• Content - direct branch into middle of module
• Common - global reference of variables
• Control - control element being passed
• Stamp - pass an entire data structure
• Data - variables or fields only being passed
• No Coupling
Software Testing PrinciplesSoftware Testing Principles User-accepted test planUser-accepted test plan General testing strategy/philosophy:General testing strategy/philosophy:
Cause and discover errors Rules of reasonableness should prevail
Testing Strategies:Testing Strategies: Top-DownTop-Down Bottom-UpBottom-Up Middle-outMiddle-out HybridHybrid Black boxBlack box White boxWhite box AlphaAlpha BetaBeta
Software Testing Methodology Showing
Feedback/Fallback LoopUser Acceptance Testing
System Testing
Function Testing
Integration Testing
Unit Testing
Module A
Stub B Stub C Stub D
Module A
Module B Stub C Stub D
Stub E Stub F
Module A
Module B Stub C Stub D
Module E Stub F
Stub Testing (shaded module is the current one being tested)
Module A
Stub B Stub C Stub D
Module A
Do Stub BDo Stub CDo Stub D
End Module A
Stub B
Display “now in Stub B”Return
Stub C
Display “now in Stub C”Return
Stub D
Display “now in Stub D”Return
Calling Stub Modules During Construction & Testing
SystemsAnalysis
SystemsDesign
SoftwareDesign
ProgramDesign
ModuleDesign
UserSpecification
SystemSpecification
SoftwareSpecification
ProgramSpecification
ModuleSpecification
AcceptanceTesting
SystemTesting
FunctionTesting
IntegrationTesting
UnitTesting
Programming
Framework for Information Systems Testing
Validation and Verification Define the “Problem”
Solve the “Problem”
Prove it
Validation - process done by s/w
developer
Verification - process done by customer
1 of 2
Validation and Verification
2 of 2
Need(s)
Design and Implement
Component Test
Sub-system TestSub-system Requirements
System Requirements
Component Requirements
System Test
DeliveredSystem
That’s all folks!That’s all folks!