38
Software Architecture Software Architectural Test Case Writing Sitdhibong Laokok [email protected] 2009.11.08

Software Architecture: Test Case Writing

Embed Size (px)

Citation preview

Page 1: Software Architecture: Test Case Writing

Software ArchitectureSoftware Architectural Test Case Writing

Sitdhibong [email protected]

Page 2: Software Architecture: Test Case Writing

Agenda

• Software Development Methodology

• Software Testing

• Architectural Test Case Writing

Page 3: Software Architecture: Test Case Writing

Agenda

• Software Development Methodology

• Software Testing

• Architectural Test Case Writing

Page 4: Software Architecture: Test Case Writing

Software Dev. Methodology

• Waterfall Model

• Iterative and Incremental Model

Page 5: Software Architecture: Test Case Writing

WaterfallRequirements

Implementation

Maintenance

Verification

Design

Page 6: Software Architecture: Test Case Writing

Iterative and Incremental

Critical RequirementBusiness Goal

System Analysis

Architecture Design

Test Case Design

Requirement

Coding

TEST

Page 7: Software Architecture: Test Case Writing

Vilfredo ParetoItalian economist(1848 - 1923)

Page 8: Software Architecture: Test Case Writing

80

20

Page 9: Software Architecture: Test Case Writing

0

25

50

75

100

Actions Results

20%

80%

20%

80%

Page 10: Software Architecture: Test Case Writing

Iterative and Incremental

Critical RequirementBusiness Goal

System Analysis

Architecture Design

Test Case Design

Requirement

Coding

TEST

Page 11: Software Architecture: Test Case Writing

Business Goals

System Feature

Function Requirement

Test Case

Comes from Critical Requirement

Page 12: Software Architecture: Test Case Writing

Agenda

• Software Development Methodology

• Software Testing

• Architectural Test Case Writing

Page 13: Software Architecture: Test Case Writing

Test Plan : “SPACEDIRT”• Scope

• People

• Approach

• Criteria

• Environment

• Deliverable

• Incidentals

• Risks

• Tasks

Page 14: Software Architecture: Test Case Writing

Goals

• To improve quality

• For reliability estimation

• For Verification and Validation (V&V)

Page 15: Software Architecture: Test Case Writing

Verification & Validation• Functionality

• Correctness

• Reliability

• Usability

• Engineering

• Efficiency

• Testability

• Documentation

• Structure

• Adaptability

• Flexibility

• Reusability

• Maintainability

Page 16: Software Architecture: Test Case Writing

Software Dimension

W3C Semantic Web Logo - http://www.w3.org/2007/10/sw-logos.html

Page 17: Software Architecture: Test Case Writing

Quality Functionality

Security

Usability

W3C Semantic Web Logo - http://www.w3.org/2007/10/sw-logos.html

Software Dimension

Page 18: Software Architecture: Test Case Writing

Software Testing

• Unit Test

• Functional Test

• Reliability Test

• Performance Test

• Architectural Test

Page 19: Software Architecture: Test Case Writing

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

Page 20: Software Architecture: Test Case Writing

Quality Attributes*

• Availability

• Modifiability

• Performance

• Security

• Traceability

• Usability

*Or Non-Functionality Requirement

Page 21: Software Architecture: Test Case Writing

Quality Attribute Scenarios

• Source of stimulus

• Stimulus

• Environment

• Artifact

• Response

• Response measure

Artifact

Source of stimulus

StimulusEnvironment

Response

Response measure

Page 22: 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

Page 23: Software Architecture: Test Case Writing

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

Page 24: Software Architecture: Test Case Writing

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

Page 25: 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

Page 26: Software Architecture: Test Case Writing

Vision

Business Goals

System Feature

Function Requirement

Test Case

Page 27: Software Architecture: Test Case Writing

Agenda

• Software Development Methodology

• Software Testing

• Architectural Test Case Writing

Page 28: Software Architecture: Test Case Writing

Architecture Design is Shaped by KPIs

KPI #1

KPI #2KPI #3

KPI #4

Architecture

Developer

Page 29: 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

Page 30: Software Architecture: Test Case Writing

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

Page 31: Software Architecture: Test Case Writing

System Qualities• Availability

• Modifiability

• Usability

• Performance

• Security

• Testability

• Scalability

• Extensibility

• Reliability

• Interoperability

• Integrability

• Supportability

• Customizability

• Safety

• Maintainability

Page 32: Software Architecture: Test Case Writing

Test Case ElementsApproaches

Test Scripts

Input

Expected Output and Outcome

ObjectiveName

Page 33: Software Architecture: Test Case Writing

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”

Page 34: 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

Page 35: Software Architecture: Test Case Writing

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”

Page 36: 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

Page 37: Software Architecture: Test Case Writing

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

Page 38: Software Architecture: Test Case Writing

References• QA Plan, “Test Suite”, http://readyset.tigris.org/nonav/templates/test-suite.html