Software Architecture: Test Case Writing
-
Upload
sitdhibong-laokok -
Category
Technology
-
view
15.037 -
download
4
Transcript of Software Architecture: Test Case Writing
Software ArchitectureSoftware Architectural Test Case Writing
Sitdhibong [email protected]
Agenda
• Software Development Methodology
• Software Testing
• Architectural Test Case Writing
Agenda
• Software Development Methodology
• Software Testing
• Architectural Test Case Writing
Software Dev. Methodology
• Waterfall Model
• Iterative and Incremental Model
WaterfallRequirements
Implementation
Maintenance
Verification
Design
Iterative and Incremental
Critical RequirementBusiness Goal
System Analysis
Architecture Design
Test Case Design
Requirement
Coding
TEST
Vilfredo ParetoItalian economist(1848 - 1923)
80
20
0
25
50
75
100
Actions Results
20%
80%
20%
80%
Iterative and Incremental
Critical RequirementBusiness Goal
System Analysis
Architecture Design
Test Case Design
Requirement
Coding
TEST
Business Goals
System Feature
Function Requirement
Test Case
Comes from Critical Requirement
Agenda
• Software Development Methodology
• Software Testing
• Architectural Test Case Writing
Test Plan : “SPACEDIRT”• Scope
• People
• Approach
• Criteria
• Environment
• Deliverable
• Incidentals
• Risks
• Tasks
Goals
• To improve quality
• For reliability estimation
• For Verification and Validation (V&V)
Verification & Validation• Functionality
• Correctness
• Reliability
• Usability
• Engineering
• Efficiency
• Testability
• Documentation
• Structure
• Adaptability
• Flexibility
• Reusability
• Maintainability
Software Dimension
W3C Semantic Web Logo - http://www.w3.org/2007/10/sw-logos.html
Quality Functionality
Security
Usability
W3C Semantic Web Logo - http://www.w3.org/2007/10/sw-logos.html
Software Dimension
Software Testing
• Unit Test
• Functional Test
• Reliability Test
• Performance Test
• Architectural Test
Functional & Non-Functional
FunctionalityEnter PIN no., Select account type, Choose or Enter Amount, Receive money
Non-FunctionalityVerify PIN no. with bank, Check total
amount in machine, Check user’s account balance, Error Handling
Quality Attributes*
• Availability
• Modifiability
• Performance
• Security
• Traceability
• Usability
*Or Non-Functionality Requirement
Quality Attribute Scenarios
• Source of stimulus
• Stimulus
• Environment
• Artifact
• Response
• Response measure
Artifact
Source of stimulus
StimulusEnvironment
Response
Response measure
Artifact
Source of Stimulus
StimulusEnvironment
Response
Response measure
Source of Stimulus Developer
Stimulus Wishes to change the UI
Artifact Code
Environment At design time
Response Modification is made with no side effect
Response measure In 3 hours
In the case of developer want to change UI Design
Vision
Business Goals
Vision
BG1 BG2 BG3
SF1 SF2 SF3 SF4 SF5
FR1
FR2
FR3
FR4
FR5
FR6
FR7
FR8FR9 FR10
System Feature
Function Requirement
TC1
TC2
TC4
TC3TC5
TC6
TC7
TC8
TC9
TC10
TC11
TC12 TC13
TC14
TC16
Test Case
http://faculty.ksu.edu.sa/ghazy/CSC342_Tools/Test%20Case%20Template.pdf
Software Engineering – Dr Ghazy Assassa Page 2 of 5
Test Case Template (Doc:T_01)
Test Case #: Test Case Name: Page: 1 of ..
System: Subsystem:
Designed by: Design Date:
Executed by: Execution Date:
Short Description:
Pre-conditions
Step Action Expected System Response Pass/Fail
Comment
1 2
Post-conditions
http://faculty.ksu.edu.sa/ghazy/CSC342_Tools/Test%20Case%20Template.pdf
Software Engineering – Dr Ghazy Assassa Page 3 of 5
Test Case Example1 (simple test)
Test Case #: 2.2 Test Case Name: Change PIN Page: 1 of 1
System: ATM Subsystem: PIN
Designed by: ABC Design Date: 28/11/2004
Executed by: Execution Date:
Short Description: Test the ATM Change PIN service
Pre-conditions The user has a valid ATM card - The user has accessed the ATM by placing his ATM card in the machine The current PIN is 1234 The system displays the main menu
Step Action Expected System Response Pass/
Fail Comment
1 Click the 'Change PIN' button The system displays a message asking the user to enter the new PIN 2 Enter '5555' The system displays a message asking the user to confirm (re-enter)
the new PIN
3 Re-enter '5555' The system displays a message of successful operation The system asks the user if he wants to perform other operations
4 Click 'YES' button The system displays the main menu 5 Check post-condition 1 Post-conditions 1. The new PIN '5555' is saved in the database
Vision
Business Goals
System Feature
Function Requirement
Test Case
Agenda
• Software Development Methodology
• Software Testing
• Architectural Test Case Writing
Architecture Design is Shaped by KPIs
KPI #1
KPI #2KPI #3
KPI #4
Architecture
Developer
Artifact
Source of Stimulus
StimulusEnvironment
Response
Response measure
Source of Stimulus Developer
Stimulus Wishes to change the UI
Artifact Code
Environment At design time
Response Modification is made with no side effect
Response measure In 3 hours
In the case of developer want to change UI Design
Architecture Design is Shaped by KPIs
KPI #1: Developer have to change UI within 3 hours at design time
KPI #2KPI #3
KPI #4
Architecture
Developer
System Qualities• Availability
• Modifiability
• Usability
• Performance
• Security
• Testability
• Scalability
• Extensibility
• Reliability
• Interoperability
• Integrability
• Supportability
• Customizability
• Safety
• Maintainability
Test Case ElementsApproaches
Test Scripts
Input
Expected Output and Outcome
ObjectiveName
Sample ScenarioSample ScenarioSample Scenario
Scenario refinement for Scenario: Scenario refinement for Scenario: Scenario refinement for Scenario:
Scenario(s):Scenario(s):Scenario(s):
Business Goals:Business Goals:Business Goals:
Relevant Quantity Attribute(s):Relevant Quantity Attribute(s):Relevant Quantity Attribute(s):
Stimulus:
Source of Stimulus:
Environment:
Artifact:
Response:
Response Measure:
Questions:Questions:Questions:
Issues:Issues:Issues:
Scen
ario
Com
pone
nts
Narong Chansoi, “Software Architecture Test Case Writing”
Artifact
Source of Stimulus
StimulusEnvironment
Response
Response measure
Source of Stimulus Developer
Stimulus Wishes to change the UI
Artifact Code
Environment At design time
Response Modification is made with no side effect
Response measure In 3 hours
In the case of developer want to change UI Design
Sample ScenarioSample ScenarioSample Scenario
Scenario refinement for Scenario: PR1-SCE1-CHANGEUIScenario refinement for Scenario: PR1-SCE1-CHANGEUIScenario refinement for Scenario: PR1-SCE1-CHANGEUI
Scenario(s): Developer want to change UI at design timeScenario(s): Developer want to change UI at design timeScenario(s): Developer want to change UI at design time
Business Goals:Business Goals:Business Goals:
Relevant Quantity Attribute(s): MaintainabilityRelevant Quantity Attribute(s): MaintainabilityRelevant Quantity Attribute(s): Maintainability
Stimulus: Wishes to change the UI
Source of Stimulus: Developer
Environment: At design time
Artifact: Code
Response: Modification made no side effect
Response Measure: In 3 hours
Questions: Developer change the UI in test server before deploy to production server?Questions: Developer change the UI in test server before deploy to production server?Questions: Developer change the UI in test server before deploy to production server?
Issues: Issues: Issues:
Scen
ario
Com
pone
nts
Narong Chansoi, “Software Architecture Test Case Writing”
http://faculty.ksu.edu.sa/ghazy/CSC342_Tools/Test%20Case%20Template.pdf
Software Engineering – Dr Ghazy Assassa Page 3 of 5
Test Case Example1 (simple test)
Test Case #: 2.2 Test Case Name: Change PIN Page: 1 of 1
System: ATM Subsystem: PIN
Designed by: ABC Design Date: 28/11/2004
Executed by: Execution Date:
Short Description: Test the ATM Change PIN service
Pre-conditions The user has a valid ATM card - The user has accessed the ATM by placing his ATM card in the machine The current PIN is 1234 The system displays the main menu
Step Action Expected System Response Pass/
Fail Comment
1 Click the 'Change PIN' button The system displays a message asking the user to enter the new PIN 2 Enter '5555' The system displays a message asking the user to confirm (re-enter)
the new PIN
3 Re-enter '5555' The system displays a message of successful operation The system asks the user if he wants to perform other operations
4 Click 'YES' button The system displays the main menu 5 Check post-condition 1 Post-conditions 1. The new PIN '5555' is saved in the database
Exam
ple
References• Narong Chansoi: “Software Architectural Test Case Writing”
• Dr.Varanyu, “80-20” http://varanyu.blogspot.com/2008/10/8020.html
• “List of Quality Attribute” - http://en.wikipedia.org/wiki/List_of_system_quality_attributes
• Donald Graham, “Quality Attribute Scenarios”, http://www.spin.org.za/spin21/SPIN%2021%20-%20QAS.pdf
• Christoph Stoermer, “Moving Towards Quality Attribute Driven Software Architecture Reconstruction”, http://www.cs.vu.nl/~x/square/qadsar.pdf
• Ed, “Patterns & Practices Test : Architecture Testing”, http://blogs.msdn.com/pagtest/archive/2005/03/18/398678.aspx
• Louis Marshall, “Project Management for the Web: Quality Test Plan”, http://pm4web.blogspot.com/2008/07/quality-test-plan.html
• Dr Ghazy Assassa, “Software Engineering: Test Case Template and Example”, http://faculty.ksu.edu.sa/ghazy/CSC342_Tools/Test%20Case%20Template.pdf
• GSA, “FIPS 201 Evaliation Program - Template Generator Test Procedure”, http://fips201ep.cio.gov/documents/Template%20Generator_Test%20Procedure_v2.0.0.pdf
References• QA Plan, “Test Suite”, http://readyset.tigris.org/nonav/templates/test-suite.html