Limited Business Circulation
Testing Essentials Unit 3 QSIT- Quality Solutions for Information Technology Pvt. Ltd., A 806 & 807, Mittal Tower, BANGALORE- 560 001,INDIA URL: www.qsitglobal.com PH: +91 80 41134334 Fax: +91 80 25597445
Software Testing Essentials
1
www.qsitglobal.com
Requirements Specification and Process Model Objective:
To Understand how to identify scenarios from various Models
To Prioritize requirements
Software Testing Essentials
QSIT Copyright
2
www.qsitglobal.com
Page:1
Limited Business Circulation
Requirements representation techniques
Diagrammatic
Data modeling, process modeling, object modeling
Tabular
Matrices, decision tables
Programming
Prototyping, simulation
Textual
Informal, Formal (pseudo code, structured English)
Software Testing Essentials
3
3
www.qsitglobal.com
Requirements Specification and Process Model Process Model A formal way of representing how a business operates Data flow diagramming shows business processes and the data flowing between them
In order to guarantee reliability, the process model must contain a specification of its requirements that includes the following properties: – The requirement specification must be unambiguous, – It must carry over to the IT model, – It must be verifiable in the IT model. Software Testing Essentials
QSIT Copyright
4
www.qsitglobal.com
Page:2
Limited Business Circulation
Few Popular Models
Data Context Diagram- DCD Data Flow Diagrams- DFD Entity Relationship Diagrams- ERD State-Transition Diagram – STD Use Case Model
Software Testing Essentials
5
www.qsitglobal.com
Data Context Diagram (DCD)
A picture of the system and its interfaces to external entities and systems Shows the boundary between the system and its environment, in perspective to real world, with all inputs and outputs identified. Represents all of the transformations performed by the system.
Software Testing Essentials
QSIT Copyright
6
www.qsitglobal.com
Page:3
Limited Business Circulation
Data Context Diagram (DCD) (Contd..)
External Entity
Boxes represent External Entities
Process
System-Circles/bubbles represent Processes
Data Flow
Arched Arrows represent Data Flows
Software Testing Essentials
7
www.qsitglobal.com
Context diagram of a Pizza joint ordering system – context diagram
Customer
Kitchen
0
Customer order Pizza ordering system Receipt
Food order
Management reports Restaurant manager
Software Testing Essentials
QSIT Copyright
8
www.qsitglobal.com
Page:4
Limited Business Circulation
Data Flow Diagrams- DFD
The data flow diagram partitions the system into its component parts. Picture of the system as a network of functional processes connected to each other by pipelines of data (Data Flows) and holding tanks of data (Data stores). The processes transform the data.
Software Testing Essentials
9
www.qsitglobal.com
Exploded diagram of a Pizza joint ordering system
Software Testing Essentials
QSIT Copyright
10
www.qsitglobal.com
Page:5
Limited Business Circulation
Data Model
Deals with the complexity of data organization Ensures completeness, adaptability and stability of data Communication tool for • Executives – what data for business? • Data admins – how to manage and control data • Database designers – how to access data efficiently Enterprise wide data model will remove redundancy across applications Abstract collection of data objects or entities and their relationships Set the stage for the design of databases later on in the SDLC
Software Testing Essentials
11
www.qsitglobal.com
Data Modeling: Entity Relationship DiagramsERD
The data is organized into meaningful groups and the relationships are drawn across these groups. ERD is a graphical representation of the data objects and their relationships. ERD defines all the data that can be – input – stored and – transformed and – produced within an application
Software Testing Essentials
QSIT Copyright
12
www.qsitglobal.com
Page:6
Limited Business Circulation
Data Modeling: Entity Relationship Diagrams-
Entities
Box represents Entity
Relationships
Lines represent Relationships
Cardinality
Cardinality is indicated by the symbols on the line connecting the two entities One-to-One One-to-Many Many-to-Many
Software Testing Essentials
13
www.qsitglobal.com
Can you read these ERDs? Involves selling of / Is sold in Sale
Software Testing Essentials
QSIT Copyright
Product
14
www.qsitglobal.com
Page:7
Limited Business Circulation
Functional requirements and Use Cases Functional requirements capture the intended behavior of the system. This behavior may be expressed as services, tasks or functions the system is required to perform. Use cases have quickly become a widespread practice for capturing functional requirements Definition of Use Case: “A specific way of using the system by using some part of the functionality. A use case constitutes a complete course of interaction that takes place between an actor and the system.” [Jacobson et al.,1992] “ The specification of sequences of actions, including variant sequences and error sequences, that a system, subsystem, or class can perform by interacting with outside actors that yields an observable result of value to a particular actor.” [Jacobson, Booch, and Rambaugh, 1999: 41; Kruchten, 1999: 94] Software Testing Essentials
15
www.qsitglobal.com
Benefits of Use Cases
Informal and imprecise modeling technique Conceptualize the behavior of the system. Capturing user requirements Describing WHAT the system will do at a high-level Used to capture the high level user-functional requirements of a system. Important as a unit of requirement definition
Can be used to rank requirements (e.g., level of importance,
risk, level of interoperability, etc.)
Can be used to publish requirements at various levels (e.g., detailed design requirements, hanger analysis requirements, document management: document creation requirements, etc.)
A unit of estimation and our unit of work Software Testing Essentials
QSIT Copyright
16
www.qsitglobal.com
Page:8
Limited Business Circulation
Scenario- Definition
A scenario is an instance of a use case, and represents a single path through the use case. Thus, one may construct a scenario for the main flow through the use case, and other scenarios for each possible variation of flow through the use case (e.g., triggered by options, error conditions, security breaches, etc.).
Actors are – Unique to use cases – Abstract roles – The basis for requirements
Book a Vacation
Schedule a Flight
Select a Seat
Software Testing Essentials
17
www.qsitglobal.com
An actor has goals; goals name use cases; a use case has scenarios naming sub-use cases
Actor has Goa l
names
See reqmts. in the form of goals
Use case
contains
calls
Scenario
Software Testing Essentials
QSIT Copyright
18
condition succeed / fail
www.qsitglobal.com
Page:9
Limited Business Circulation
Use case – goal and scenarios
The use case name is the goal statement: “ Order product from catalog”
Scenario (1): Everything works out well ... Scenario (2): Insufficient credit ... – Scenario (3): Product out of stock ... Use case is goal statement plus the scenarios.
Note the grammar: active verb first
– –
Software Testing Essentials
19
www.qsitglobal.com
Deriving Test Cases and Scenarios from Diagrammatic Use Case Representations
Steps involved in developing and performing use case scenario testing are: – Step 1: Create the Use Case Scenarios – Step 2: Derive Test Cases from Use Cases – Step 3: Execute Test Cases and report findings
Software Testing Essentials
QSIT Copyright
20
www.qsitglobal.com
Page:10
Limited Business Circulation
How to do it?
Identify ‘actors’ and goals Write the simple case: the goal delivery – the happy day case Write failure conditions as extensions – alternate scenarios For each failure, follow it till it ends or rejoins – extensions
Software Testing Essentials
21
www.qsitglobal.com
Step 1: Create the Use Case Scenarios: Example-Card Reader System Use Case
Enter Building
Employee Exit Building Door Look
Enter Security Zone Cleared Employee
Exit Security Zone
Security Supervisor
Software Testing Essentials
QSIT Copyright
System Maintenance
22
www.qsitglobal.com
Page:11
Limited Business Circulation
Step 1: Create the Use Case Scenarios:
Example-
Card Reader System Use Case (Contd..)
The brief descriptions for these Use Cases might read as: – Enter Building : Employee enters the building using card reader passage – Exit Building : Employee exits the building using card reader passage – Enter Security Zone: Cleared Employee enters the vault using card reader passage – Exit Security Zone: Cleared Employee exits the vault using card reader passage – System Maintenance: Authorized user enters/edits employee card data
Software Testing Essentials
23
Step 1: Create the Use Case Scenarios:
www.qsitglobal.com
Example-Card
Reader System Use Case (Contd..)
Looking now at one particular Use Case: Enter Building, we would expect an Event Flow such as: Enter Building Event Flow – Use case starts when user slides card through card-reader Card-reader scans employee ID from card [E1] – System validates employee access [E2] – System unlocks door for configured time period [E3] – Employee opens door [E4] – Employee enters and door shuts [E5] – System locks door [E6], Use Case ends
Software Testing Essentials
QSIT Copyright
24
www.qsitglobal.com
Page:12
Limited Business Circulation
Step 1: Create the Use Case Scenarios:
Example-
Card Reader System Use Case (Contd..)
Generation of associated exceptions for the Enter Building use case. Use case starts when the user slides a card through the cardreader – Card-reader scans employee ID from card Exception 1: Card can’t be read – Log event – Use case ends – System validates employee access Exception 2: Employee ID is invalid – Log event – Use case ends
Software Testing Essentials
25
Step 1: Create the Use Case Scenarios:
www.qsitglobal.com
Example-
Card Reader System Use Case (Contd..) –
–
System unlocks door for configured time period Exception 3: System unable to unlock door – Log event – Use case ends Employee opens door Exception 4: Door is not opened – System waits for timeout – System locks door – Use case ends
Software Testing Essentials
QSIT Copyright
26
www.qsitglobal.com
Page:13
Limited Business Circulation
Step 1: Create the Use Case Scenarios:
Example-
Card Reader System Use Case (Contd..) –
–
Employee enters and door shuts Exception 5: Door is not shut – System waits for timeout – System attempts to lock door – Log event – Set alarm condition – Use case ends System locks door, Use case ends Exception 6: Door fails to lock – System waits for timeout – System attempts to lock door – Log event – Set alarm condition – Use case ends
Software Testing Essentials
27
www.qsitglobal.com
Step 2: Derive Test Cases from Use Cases : Example-Card Reader System Use Case (Contd..)
Enter Building Test Case Test Condition 1: Happy days scenario – valid employee card is used – Swipe card – Verify door is unlocked – Enter building – Verify door is locked Test Condition 2: Card can’t be read – Swipe a card that is not valid – Verify event is logged
Software Testing Essentials
QSIT Copyright
28
www.qsitglobal.com
Page:14
Limited Business Circulation
Step 2: Derive Test Cases from Use Cases : Example-Card Reader System Use Case (Contd..)
Test Condition 3: Invalid employee ID – Swipe card with invalid employee ID – Verify door is not unlocked – Verify event is logged
Test Condition 4: System unable to unlock door – Swipe card – “Injected” failure of unlocking mechanism – Verify event is logged
Software Testing Essentials
29
www.qsitglobal.com
Step 2: Derive Test Cases from Use Cases : Example-Card Reader System Use Case (Contd..)
Test Condition 5: Door is not opened – Swipe card – Verify door is unlocked – Don’t open the door and wait until timeout is exceeded – Verify door is locked
Test Condition 6: Door is not shut after entry – Swipe card – Enter building – Hold door open until timeout is exceeded – Verify alarm is sounded – Verify event is logged
Software Testing Essentials
QSIT Copyright
30
www.qsitglobal.com
Page:15
Limited Business Circulation
Step 2: Derive Test Cases from Use Cases : Example-Card Reader System Use Case (Contd..)
Test Condition 7: Door fails to lock – Swipe card – Enter building – “Injected” failure of locking mechanism – Verify alarm is sounded – Verify event is logged
Test cases 4 and 7 would normally be verified at the unit test or integration test phase due to having to, presumably, use an intrusive method to fail the lock mechanism
Software Testing Essentials
31
www.qsitglobal.com
Step 3: Execute Test Cases and Report Findings: Example-Card Reader System Use Case
Execute Use Case based Test Cases and scenario Record findings in Use Case Testing Worksheet
Software Testing Essentials
QSIT Copyright
32
www.qsitglobal.com
Page:16
Limited Business Circulation
User Acceptance Testing
QUESTIONS?
Software Testing Essentials
QSIT Copyright
33
www.qsitglobal.com
Page:17