SlideShare a Scribd company logo
1 of 44
Download to read offline
Università degli Studi dell’Aquila




L21: Black Box/Functional Testing

                                      Henry Muccini
          DISIM, University of L’Aquila
 www.henrymuccini.com, henry.muccini@univaq.it
The material in these slides may be freely reproduced and
distributed, partially or totally, as far as an explicit
reference or acknowledge to the material author is
preserved.




Partially based on material from Alex Orso, Mauro Pezze’,
and Michal Young.
AGENDA
White box testing
                                 Representative values

                Systematic vs Random Testing
                               Equivalence Partitioning

                Category Partition Method
Where is the boundary between testing and other
 (analysis/verification) methods?

  What distinguishes software testing from “other” approaches
  is execution. This requires the ability to:
   →   launch the tests on some executable version (traceability problem),
       and
   →   analyse (observe and evaluate) the results (not granted for embedded
       systems)

I am not saying testing is superior and we should disregard other
   approaches: on the contrary, testing and other methods
   should complement/support each other
Any software test campaign involves a trade-off
  between
   →   Limiting resource utilization (time, effort)
         ⇒ as few tests as possible
   →   Augmenting our confidence
         ⇒ as many tests as possible
Two research challenges:
   →   Determining a feasible and meaningful stopping rule
   →   Evaluating test effectiveness (reliability, “coverage notion”,
       ....very tough problem
BLACK BOX/FUNCTIONAL TESTING
Functional testing: Deriving test cases from program
specifications
         ─ Functional refers to the source of information used in test case
            design, not to what is tested
Also known as:
  → specification-based testing (from specifications)
  → black-box testing (no view of the code)

Functional specification = description of intended
program behavior
  →   either formal or informal

(C) 2007 MAURO PEZZÈ & MICHAL YOUNG
Exploit some knowledge to choose samples that are more
likely to include “special” or trouble-prone regions of the
input space
 → Failures are sparse in the whole input space ...
 → ... but we may find regions in which they are dense



Desirable case: Each fault leads to failures that are dense
(easy to find) in some class of inputs
 → sampling each class in the quasi-partition selects at least one
   input that leads to a failure, revealing the fault
 → seldom guaranteed; we depend on experience-based heuristics

 (C) 2007 MAURO PEZZÈ & MICHAL YOUNG
Failures are sparse
                                     Failure (valuable test case)                            ... but dense in some
                                                                      in the space of
                                                                                               parts of the space
                                     No failure                       possible inputs ...
The space of possible input values
         (the haystack)




                                     If we systematically test some               Functional testing is one way of
                                     cases from each part, we will                drawing pink lines to isolate
                                     include the dense parts                      regions with likely failures
           (C) 2007 MAURO PEZZÈ & MICHAL YOUNG
Random (uniform):
  → Pickpossible inputs uniformly
  → Avoids designer bias
         ─ A real problem: The test designer can make the same
            logical mistakes and bad assumptions as the program
            designer (especially if they are the same person)
  → But     treats all inputs as equally valuable




(C) 2007 MAURO PEZZÈ & MICHAL YOUNG
Defects are not distributed uniformly!
•  Assume our printSum program fails if both
inputs are 0!
•  Random sampling is unlikely to choose a = 0
and b = 0!
We want bias!!
Systematic (non-uniform):
 → Try to select inputs that are especially valuable
 → Usually by choosing representatives of classes that
   are apt to fail often or not at all



Functional testing is systematic testing
•An independently testable feature (ITF) is a
functionality that can be tested independently of other
functionalities of the software under test.
•It need not correspond to a unit or subsystem of the
software.
•For example, a file sorting utility may be capable of
merging two sorted files, and it may be possible to test
the sorting and merging functionalities separately,
even though both features are implemented by much
of the same source code.
It is recommended to devise separate test cases for
each functionality of the system, whenever possible.
The design of different tests for different
functionalities can simplify the test generation
problem
Thus, identifying functional features does not
correspond to identifying single modules at the design
level, but rather to suitably slicing the specifications to
be able to attack their complexity incrementally
Feature-based view of the system
Functional testing uses the specification (formal or
informal) to partition the input space
  →   E.g., specification of “roots” program suggests division
      between cases with zero, one, and two real roots
Test each category, and boundaries between
categories
  →   No guarantees, but experience suggests failures often lie at
      the boundaries (as in the “roots” program)



(C) 2007 MAURO PEZZÈ & MICHAL YOUNG
•Try to select inputs that are especially valuable!
 •   Usually by choosing representatives of equivalence classes!
•Assumption: inputs in different categories behave
equivalently
 ⇒I can select one input per category
Consider a software module that is intended to accept the
name of a grocery item and a list of the different sizes the
item comes in, specified in ounces. The specifications state
that the item name is to be alphabetic characters 2 to 15
characters in length. Each size may be a value in the range
of 1 to 48, whole numbers only. The sizes are to be
entered in ascending order (smaller sizes first). A
maximum of five sizes may be entered for each item. The
item name is to be entered first, followed by a comma,
then followed by a list of sizes. A comma will be used to
separate each size. Spaces (blanks) are to be ignored
anywhere in the input.

Taken from: http://users.csc.calpoly.edu/~jdalbey/205/Resources/grocerystore.
Consider a software module that is intended to accept the
name of a grocery item and a list of the different sizes the
item comes in, specified in ounces.
The specifications state that the item name is to be alphabetic
characters 2 to 15 characters in length. Each size may be a
value in the range of 1 to 48, whole numbers only.
The sizes are to be entered in ascending order (smaller sizes
first). A maximum of five sizes may be entered for each item.
The item name is to be entered first, followed by a comma,
then followed by a list of sizes. A comma will be used to
separate each size. Spaces (blanks) are to be ignored
anywhere in the input.
Item name is alphabetic (valid)
Item name is not alphabetic (invalid)
Item name is less than 2 characters in length (invalid)
Item name is 2 to 15 characters in length (valid)
Item name is greater than 15 characters in length (invalid)
Size value is less than 1 (invalid)
Size value is in the range 1 to 48 (valid)
Size value is greater than 48 (invalid)
Size value is a whole number (valid)
Size value is a decimal (invalid)
Size value is numeric (valid)
Size value includes nonnumeric characters (invalid)
Size values entered in ascending order (valid)
Size values entered in nonascending order (invalid)
No size values entered (invalid)
One to five size values entered (valid)
More than five sizes entered (invalid)
Item name is first (valid)
…
Expected
#    Test Data                              Classes Covered
                                   Outcome

1    xy,1                          T        1,4,7,9,11,13,16,18,20,22
2    AbcDefghijklmno,1,2,3 ,4,48   T       1,4,7,9,11,13,16,18,20,23
3    a2x,1                         F       2
4    A,1                           F       3
5    abcdefghijklmnop              F       5
6    Xy,0                          F       6
7    XY,49                         F       8
8    Xy,2.5                        F       10
9    xy,2,1,3,4,5                  F       14
10   Xy                            F       15
11   XY,1,2,3,4,5,6                F       17
12   1,Xy,2,3,4,5                  F       19
13   XY2,3,4,5,6                   F       21
14   AB,2#7                        F       12
Item name is alphabetic (valid)
Item name is not alphabetic (invalid)
Item name is less than 2 characters in length (invalid)
Item name is 2 to 15 characters in length (valid)
Item name is greater than 15 characters in length (invalid)
Size value is less than 1 (invalid)
Size value is in the range 1 to 48 (valid)
Size value is greater than 48 (invalid)
Size value is a whole number (valid)
Size value is a decimal (invalid)
Size value is numeric (valid)
Size value includes nonnumeric characters (invalid)
Size values entered in ascending order (valid)
Size values entered in nonascending order (invalid)
No size values entered (invalid)
One to five size values entered (valid)
More than five sizes entered (invalid)
Item name is first (valid)
…
The main idea is to partition the input domain of
function being tested, and then select test data for
each class of the partition.


The problem of all the existing techniques is the lack of
systematic.


Solution: the Category Partition Method
Steps:
     ITF (Independently testable feature)
     Identify parameters and Environmental conditions
        Parameters: Explicit input to the functional unit
        Environmental Conditions: Characteristics of the
        system’s state
     Find categories that characterize each parameter and
    environment condition.
     Every category should be partitioned into distinct choices
     Test Spec
Command: find (a pattern into a file)


   Syntax:       find <pattern> <file>


Function:       The find command is used to locate one or more instance of a given
pattern in a text file. All lines in the file that contain the pattern are written to
standard output. A line containing the pattern is written only once, regardless of the
number of times the pattern occurs in it.
The pattern is any sequence of characters whose length does not exceed the
maximum length of a line in the file .To include a blank in the pattern, the entire
pattern must be enclosed in quotes (“).To include quotation mark in the pattern ,two
quotes in a row (“ “) must be used.
Example:
find john myfile
    display lines in the file myfile which contain john


find “john smith” in myfile
   display lines in the file myfile which contain john smith


find “john”” smith” in myfile
  display lines in the file myfile which contain john” smith
Parameters (explicit input to the functional unit)
Example:       size
find john myfile
    display lines in the file myfile which contain john
           quote              emb blank
find “john smith” in myfile
   display lines in the file myfile which contain john smith

                              emb quotes
find “john”” smith” in myfile
  display lines in the file myfile which contain john” smith
Parameters:
Pattern size:
    empty
    single character
    many character
    longer than any line in the file
Quoting:
   pattern is quoted
   pattern is not quoted
   pattern is improperly quoted
Embedded blanks:
  no embedded blank
  one embedded blank
  several embedded blanks
Embedded quotes:
   no embedded quotes
   one embedded quotes
   several embedded quotes

 File name:
    good file name
    no file with this name


Environments (characteristics of the system’s state):
 Number of occurrence of pattern in file:
  none
  exactly one                                     Total Tests frames:
  more than one                                          1944
 Pattern occurrences on target line:
   one
   more than one
Pattern size : empty
Quoting : pattern is quoted
Embedded blanks : several embedded blanks
Embedded quotes : no embedded quote
File name : good file name
Number of occurrence of pattern in file : none
Pattern occurrence on target line : one

However, not all combinations of value classes
correspond to reasonable test case specifications!!!
• Properties
– [property A, B, …]
– A and B are property names
– E.g., [property Empty]


• Selector expression
– [if A]
– E.g., [if Empty]
Parameters:
 Pattern size:
     empty                             [ property Empty ]
     single character                  [ property NonEmpty ]
     many character                     [ property NonEmpty ]
    longer than any line in the file     [ property NonEmpty ]


 Quoting:
    pattern is quoted                  [ property quoted ]
    pattern is not quoted               [ if NonEmpty ]
    pattern is improperly quoted        [ if NonEmpty ]


 Embedded blanks:
   no embedded blank                   [ if NonEmpty ]
   one embedded blank                  [ if NonEmpty and Quoted ]
   several embedded blanks             [ if NonEmpty and Quoted ]
Embedded quotes:
    no embedded quotes           [ if NonEmpty ]
   one embedded quotes           [ if NonEmpty ]
   several embedded quotes       [ if NonEmpty ]
File name:
   good file name
   no file with this name
Environments:                                                   Total Tests frames:
 Number of occurrence of pattern in file:                               678

    none                        [ if NonEmpty ]
   exactly one                  [ if NonEmpty ] [ property Match]

   more than one                 [ if NonEmpty ] [ property Match ]
 Pattern occurrences on target line:
   one                          [ if Match ]
   more than one                  [ if Match ]
The label [error] indicates a value class that need be
tried only once, in combination with non-error values
of other parameters.
Parameters:
 Pattern size:
     empty                             [ property Empty ]
     single character                  [ property NonEmpty ]
     many character                     [ property NonEmpty ]
    longer than any line in the file     [ error ]


 Quoting:
    pattern is quoted                  [ property quoted ]
    pattern is not quoted               [ if NonEmpty ]
    pattern is improperly quoted        [ error ]


 Embedded blanks:
   no embedded blank                   [ if NonEmpty ]
   one embedded blank                  [ if NonEmpty and Quoted ]
   several embedded blanks             [ if NonEmpty and Quoted ]
Embedded quotes:
    no embedded quotes          [ if NonEmpty ]
   one embedded quotes           [ if NonEmpty ]
   several embedded quotes       [ if NonEmpty ]


                                                                        [ single ]
File name:
   good file name
   no file with this name       [ error ]



Environments:                                                               Total Tests frames:
                                                                            Total Tests frames:
 Number of occurrence of pattern in file:                                           40
                                                                                    125
    none                        [ if NonEmpty ]

   exactly one                  [ if NonEmpty ] [ property Match]

   more than one                 [ if NonEmpty ] [ property Match ]



 Pattern occurrences on target line:                                  [ single ]
   one                         [ if Match ]
   more than one                  [ if Match ]


                                                                          [ single ]
• Use a constraint solver
• Choose specific values that satisfy the
constraints
A completely different approach:
 →We   cannot realistically presume to find and remove the last
 failure.
 →Then, we should invest test resources to find out the
 “biggest” ones.
“Goodness” here means to minimise the user
perceived faults, i.e.
 →Tryto find earlier those bugs that are more frequently
 encountered (neglect “small” bugs)
 →Not suitable for safety critical applications
Identify:
 •   Typical usage scenario
 •   Frequency of those scenarios


Test more, more frequent scenarios
Black box testing (an introduction to)

More Related Content

What's hot

Structural testing
Structural testingStructural testing
Structural testingSlideshare
 
White box testing-200709
White box testing-200709White box testing-200709
White box testing-200709pragati3009
 
White Box Testing
White Box TestingWhite Box Testing
White Box TestingAlisha Roy
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniquesFincy V.J
 
White box & Black box testing
White box & Black box testingWhite box & Black box testing
White box & Black box testingNitishMhaske1
 
An Insight into the Black Box and White Box Software Testing
An Insight into the Black Box and White Box Software Testing An Insight into the Black Box and White Box Software Testing
An Insight into the Black Box and White Box Software Testing BugRaptors
 
Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)Mani Kanth
 
Boundary and equivalnce systematic test design
Boundary and equivalnce   systematic test designBoundary and equivalnce   systematic test design
Boundary and equivalnce systematic test designIan McDonald
 
Test Case Design
Test Case DesignTest Case Design
Test Case Designacatalin
 
Whitebox testing
Whitebox testingWhitebox testing
Whitebox testingOana Feidi
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box TestingTestbytes
 
Software Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box TestingSoftware Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box TestingNikita Knysh
 
Testing Fundamentals
Testing FundamentalsTesting Fundamentals
Testing FundamentalsKiran Kumar
 

What's hot (20)

Structural testing
Structural testingStructural testing
Structural testing
 
White box testing-200709
White box testing-200709White box testing-200709
White box testing-200709
 
White box testing
White box testingWhite box testing
White box testing
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
White Box Testing
White Box TestingWhite Box Testing
White Box Testing
 
New software testing-techniques
New software testing-techniquesNew software testing-techniques
New software testing-techniques
 
White box & Black box testing
White box & Black box testingWhite box & Black box testing
White box & Black box testing
 
An Insight into the Black Box and White Box Software Testing
An Insight into the Black Box and White Box Software Testing An Insight into the Black Box and White Box Software Testing
An Insight into the Black Box and White Box Software Testing
 
Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)
 
Boundary and equivalnce systematic test design
Boundary and equivalnce   systematic test designBoundary and equivalnce   systematic test design
Boundary and equivalnce systematic test design
 
Test Case Design
Test Case DesignTest Case Design
Test Case Design
 
Whitebox testing
Whitebox testingWhitebox testing
Whitebox testing
 
White box ppt
White box pptWhite box ppt
White box ppt
 
Lesson 2....PPT 1
Lesson 2....PPT 1Lesson 2....PPT 1
Lesson 2....PPT 1
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Introduction to White box testing
Introduction to White box testingIntroduction to White box testing
Introduction to White box testing
 
Software Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box TestingSoftware Testing Foundations Part 4 - Black Box Testing
Software Testing Foundations Part 4 - Black Box Testing
 
White Box Testing V0.2
White Box Testing V0.2White Box Testing V0.2
White Box Testing V0.2
 
Testing Fundamentals
Testing FundamentalsTesting Fundamentals
Testing Fundamentals
 
Whitebox
WhiteboxWhitebox
Whitebox
 

Viewers also liked

Software configuration items
Software configuration itemsSoftware configuration items
Software configuration itemsashok kumar
 
EquivalencePartition
EquivalencePartitionEquivalencePartition
EquivalencePartitionswornim nepal
 
Boundary value analysis and equivalence partitioning
Boundary value analysis and equivalence partitioningBoundary value analysis and equivalence partitioning
Boundary value analysis and equivalence partitioningSneha Singh
 
Equivalence partitions analysis
Equivalence partitions analysisEquivalence partitions analysis
Equivalence partitions analysisVadym Muliavka
 
Software Configuration Management
Software Configuration ManagementSoftware Configuration Management
Software Configuration ManagementArunnima B S
 
Software configuration management
Software configuration managementSoftware configuration management
Software configuration managementfizamustanser
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testingHimanshu
 
Equivalence partitioning
Equivalence partitioningEquivalence partitioning
Equivalence partitioningSarjana Muda
 
Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisniharika5412
 
Techniques in black box testing
Techniques in black box testingTechniques in black box testing
Techniques in black box testingDuy Tan Geek
 
Software Configuration Management
Software Configuration ManagementSoftware Configuration Management
Software Configuration Managementelliando dias
 
Aims, goals and objectives
Aims, goals and objectivesAims, goals and objectives
Aims, goals and objectivesMohamed Benhima
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing TechniquesKiran Kumar
 

Viewers also liked (20)

Black box
Black boxBlack box
Black box
 
Software configuration items
Software configuration itemsSoftware configuration items
Software configuration items
 
EquivalencePartition
EquivalencePartitionEquivalencePartition
EquivalencePartition
 
Boundary value analysis and equivalence partitioning
Boundary value analysis and equivalence partitioningBoundary value analysis and equivalence partitioning
Boundary value analysis and equivalence partitioning
 
Project Report
Project ReportProject Report
Project Report
 
Equivalence partitions analysis
Equivalence partitions analysisEquivalence partitions analysis
Equivalence partitions analysis
 
Software Configuration Management
Software Configuration ManagementSoftware Configuration Management
Software Configuration Management
 
Software configuration management
Software configuration managementSoftware configuration management
Software configuration management
 
The importance of quality software
The importance of quality softwareThe importance of quality software
The importance of quality software
 
Structural and functional testing
Structural and functional testingStructural and functional testing
Structural and functional testing
 
Equivalence partitioning
Equivalence partitioningEquivalence partitioning
Equivalence partitioning
 
Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
 
Code coverage
Code coverageCode coverage
Code coverage
 
End1
End1End1
End1
 
Techniques in black box testing
Techniques in black box testingTechniques in black box testing
Techniques in black box testing
 
Software Configuration Management
Software Configuration ManagementSoftware Configuration Management
Software Configuration Management
 
Aims, goals and objectives
Aims, goals and objectivesAims, goals and objectives
Aims, goals and objectives
 
Software Testing Techniques
Software Testing TechniquesSoftware Testing Techniques
Software Testing Techniques
 
Ch8.testing
Ch8.testingCh8.testing
Ch8.testing
 
Black box
Black boxBlack box
Black box
 

Similar to Black box testing (an introduction to)

Similar to Black box testing (an introduction to) (20)

black-box-1.pdf
black-box-1.pdfblack-box-1.pdf
black-box-1.pdf
 
SE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptxSE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptx
 
Fu agile#2 unit_testing
Fu agile#2 unit_testingFu agile#2 unit_testing
Fu agile#2 unit_testing
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
 
Software testing
Software testingSoftware testing
Software testing
 
Unit testing - A&BP CC
Unit testing - A&BP CCUnit testing - A&BP CC
Unit testing - A&BP CC
 
Testing
TestingTesting
Testing
 
Black box testing
Black box testingBlack box testing
Black box testing
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Why unit testingl
Why unit testinglWhy unit testingl
Why unit testingl
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
ISTQB, ISEB Lecture Notes- 4
ISTQB, ISEB Lecture Notes- 4ISTQB, ISEB Lecture Notes- 4
ISTQB, ISEB Lecture Notes- 4
 
TDD Best Practices
TDD Best PracticesTDD Best Practices
TDD Best Practices
 
Dynamic analysis in Software Testing
Dynamic analysis in Software TestingDynamic analysis in Software Testing
Dynamic analysis in Software Testing
 
Input Space Partitioning
Input Space PartitioningInput Space Partitioning
Input Space Partitioning
 
Blackbox
BlackboxBlackbox
Blackbox
 
DSR Testing (Part 1)
DSR Testing (Part 1)DSR Testing (Part 1)
DSR Testing (Part 1)
 
5 black box and grey box testing
5   black box and grey box testing5   black box and grey box testing
5 black box and grey box testing
 
prova4
prova4prova4
prova4
 
provalast
provalastprovalast
provalast
 

More from Henry Muccini

Human Behaviour Centred Design
Human Behaviour Centred Design Human Behaviour Centred Design
Human Behaviour Centred Design Henry Muccini
 
How cultural heritage, cyber-physical spaces, and software engineering can wo...
How cultural heritage, cyber-physical spaces, and software engineering can wo...How cultural heritage, cyber-physical spaces, and software engineering can wo...
How cultural heritage, cyber-physical spaces, and software engineering can wo...Henry Muccini
 
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle Segreterie
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle SegreterieLa gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle Segreterie
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle SegreterieHenry Muccini
 
Turismo 4.0: l'ICT a supporto del turismo sostenibile
Turismo 4.0: l'ICT a supporto del turismo sostenibileTurismo 4.0: l'ICT a supporto del turismo sostenibile
Turismo 4.0: l'ICT a supporto del turismo sostenibileHenry Muccini
 
Sustainable Tourism - IoT and crowd management
Sustainable Tourism - IoT and crowd managementSustainable Tourism - IoT and crowd management
Sustainable Tourism - IoT and crowd managementHenry Muccini
 
Software Engineering at the age of the Internet of Things
Software Engineering at the age of the Internet of ThingsSoftware Engineering at the age of the Internet of Things
Software Engineering at the age of the Internet of ThingsHenry Muccini
 
The influence of Group Decision Making on Architecture Design Decisions
The influence of Group Decision Making on Architecture Design DecisionsThe influence of Group Decision Making on Architecture Design Decisions
The influence of Group Decision Making on Architecture Design DecisionsHenry Muccini
 
An IoT Software Architecture for an Evacuable Building Architecture
An IoT Software Architecture for an Evacuable Building ArchitectureAn IoT Software Architecture for an Evacuable Building Architecture
An IoT Software Architecture for an Evacuable Building ArchitectureHenry Muccini
 
Web Engineering L8: User-centered Design (8/8)
Web Engineering L8: User-centered Design (8/8)Web Engineering L8: User-centered Design (8/8)
Web Engineering L8: User-centered Design (8/8)Henry Muccini
 
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)Henry Muccini
 
Web Engineering L6: Software Architecture for the Web (6/8)
Web Engineering L6: Software Architecture for the Web (6/8)Web Engineering L6: Software Architecture for the Web (6/8)
Web Engineering L6: Software Architecture for the Web (6/8)Henry Muccini
 
Web Engineering L5: Content Model (5/8)
Web Engineering L5: Content Model (5/8)Web Engineering L5: Content Model (5/8)
Web Engineering L5: Content Model (5/8)Henry Muccini
 
Web Engineering L3: Project Planning (3/8)
Web Engineering L3: Project Planning (3/8)Web Engineering L3: Project Planning (3/8)
Web Engineering L3: Project Planning (3/8)Henry Muccini
 
Web Engineering L2: Requirements Elicitation for the Web (2/8)
Web Engineering L2: Requirements Elicitation for the Web (2/8)Web Engineering L2: Requirements Elicitation for the Web (2/8)
Web Engineering L2: Requirements Elicitation for the Web (2/8)Henry Muccini
 
Web Engineering L1: introduction to Web Engineering (1/8)
Web Engineering L1: introduction to Web Engineering (1/8)Web Engineering L1: introduction to Web Engineering (1/8)
Web Engineering L1: introduction to Web Engineering (1/8)Henry Muccini
 
Web Engineering L4: Requirements and Planning in concrete (4/8)
Web Engineering L4: Requirements and Planning in concrete (4/8)Web Engineering L4: Requirements and Planning in concrete (4/8)
Web Engineering L4: Requirements and Planning in concrete (4/8)Henry Muccini
 
Collaborative aspects of Decision Making and its impact on Sustainability
Collaborative aspects of Decision Making and its impact on SustainabilityCollaborative aspects of Decision Making and its impact on Sustainability
Collaborative aspects of Decision Making and its impact on SustainabilityHenry Muccini
 
Engineering Cyber Physical Spaces
Engineering Cyber Physical SpacesEngineering Cyber Physical Spaces
Engineering Cyber Physical SpacesHenry Muccini
 
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPIS
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPISI progetti UnivAq-UFFIZI, INCIPICT, e  CUSPIS
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPISHenry Muccini
 
Exploring the Temporal Aspects of Software Architecture
Exploring the Temporal Aspects of Software ArchitectureExploring the Temporal Aspects of Software Architecture
Exploring the Temporal Aspects of Software ArchitectureHenry Muccini
 

More from Henry Muccini (20)

Human Behaviour Centred Design
Human Behaviour Centred Design Human Behaviour Centred Design
Human Behaviour Centred Design
 
How cultural heritage, cyber-physical spaces, and software engineering can wo...
How cultural heritage, cyber-physical spaces, and software engineering can wo...How cultural heritage, cyber-physical spaces, and software engineering can wo...
How cultural heritage, cyber-physical spaces, and software engineering can wo...
 
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle Segreterie
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle SegreterieLa gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle Segreterie
La gestione dell’utenza numerosa - dalle Segreterie, ai Musei, alle Segreterie
 
Turismo 4.0: l'ICT a supporto del turismo sostenibile
Turismo 4.0: l'ICT a supporto del turismo sostenibileTurismo 4.0: l'ICT a supporto del turismo sostenibile
Turismo 4.0: l'ICT a supporto del turismo sostenibile
 
Sustainable Tourism - IoT and crowd management
Sustainable Tourism - IoT and crowd managementSustainable Tourism - IoT and crowd management
Sustainable Tourism - IoT and crowd management
 
Software Engineering at the age of the Internet of Things
Software Engineering at the age of the Internet of ThingsSoftware Engineering at the age of the Internet of Things
Software Engineering at the age of the Internet of Things
 
The influence of Group Decision Making on Architecture Design Decisions
The influence of Group Decision Making on Architecture Design DecisionsThe influence of Group Decision Making on Architecture Design Decisions
The influence of Group Decision Making on Architecture Design Decisions
 
An IoT Software Architecture for an Evacuable Building Architecture
An IoT Software Architecture for an Evacuable Building ArchitectureAn IoT Software Architecture for an Evacuable Building Architecture
An IoT Software Architecture for an Evacuable Building Architecture
 
Web Engineering L8: User-centered Design (8/8)
Web Engineering L8: User-centered Design (8/8)Web Engineering L8: User-centered Design (8/8)
Web Engineering L8: User-centered Design (8/8)
 
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)
Web Engineering L7: Sequence Diagrams and Design Decisions (7/8)
 
Web Engineering L6: Software Architecture for the Web (6/8)
Web Engineering L6: Software Architecture for the Web (6/8)Web Engineering L6: Software Architecture for the Web (6/8)
Web Engineering L6: Software Architecture for the Web (6/8)
 
Web Engineering L5: Content Model (5/8)
Web Engineering L5: Content Model (5/8)Web Engineering L5: Content Model (5/8)
Web Engineering L5: Content Model (5/8)
 
Web Engineering L3: Project Planning (3/8)
Web Engineering L3: Project Planning (3/8)Web Engineering L3: Project Planning (3/8)
Web Engineering L3: Project Planning (3/8)
 
Web Engineering L2: Requirements Elicitation for the Web (2/8)
Web Engineering L2: Requirements Elicitation for the Web (2/8)Web Engineering L2: Requirements Elicitation for the Web (2/8)
Web Engineering L2: Requirements Elicitation for the Web (2/8)
 
Web Engineering L1: introduction to Web Engineering (1/8)
Web Engineering L1: introduction to Web Engineering (1/8)Web Engineering L1: introduction to Web Engineering (1/8)
Web Engineering L1: introduction to Web Engineering (1/8)
 
Web Engineering L4: Requirements and Planning in concrete (4/8)
Web Engineering L4: Requirements and Planning in concrete (4/8)Web Engineering L4: Requirements and Planning in concrete (4/8)
Web Engineering L4: Requirements and Planning in concrete (4/8)
 
Collaborative aspects of Decision Making and its impact on Sustainability
Collaborative aspects of Decision Making and its impact on SustainabilityCollaborative aspects of Decision Making and its impact on Sustainability
Collaborative aspects of Decision Making and its impact on Sustainability
 
Engineering Cyber Physical Spaces
Engineering Cyber Physical SpacesEngineering Cyber Physical Spaces
Engineering Cyber Physical Spaces
 
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPIS
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPISI progetti UnivAq-UFFIZI, INCIPICT, e  CUSPIS
I progetti UnivAq-UFFIZI, INCIPICT, e  CUSPIS
 
Exploring the Temporal Aspects of Software Architecture
Exploring the Temporal Aspects of Software ArchitectureExploring the Temporal Aspects of Software Architecture
Exploring the Temporal Aspects of Software Architecture
 

Recently uploaded

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

Black box testing (an introduction to)

  • 1. Università degli Studi dell’Aquila L21: Black Box/Functional Testing Henry Muccini DISIM, University of L’Aquila www.henrymuccini.com, henry.muccini@univaq.it
  • 2. The material in these slides may be freely reproduced and distributed, partially or totally, as far as an explicit reference or acknowledge to the material author is preserved. Partially based on material from Alex Orso, Mauro Pezze’, and Michal Young.
  • 3. AGENDA White box testing Representative values Systematic vs Random Testing Equivalence Partitioning Category Partition Method
  • 4. Where is the boundary between testing and other (analysis/verification) methods? What distinguishes software testing from “other” approaches is execution. This requires the ability to: → launch the tests on some executable version (traceability problem), and → analyse (observe and evaluate) the results (not granted for embedded systems) I am not saying testing is superior and we should disregard other approaches: on the contrary, testing and other methods should complement/support each other
  • 5. Any software test campaign involves a trade-off between → Limiting resource utilization (time, effort) ⇒ as few tests as possible → Augmenting our confidence ⇒ as many tests as possible Two research challenges: → Determining a feasible and meaningful stopping rule → Evaluating test effectiveness (reliability, “coverage notion”, ....very tough problem
  • 7. Functional testing: Deriving test cases from program specifications ─ Functional refers to the source of information used in test case design, not to what is tested Also known as: → specification-based testing (from specifications) → black-box testing (no view of the code) Functional specification = description of intended program behavior → either formal or informal (C) 2007 MAURO PEZZÈ & MICHAL YOUNG
  • 8. Exploit some knowledge to choose samples that are more likely to include “special” or trouble-prone regions of the input space → Failures are sparse in the whole input space ... → ... but we may find regions in which they are dense Desirable case: Each fault leads to failures that are dense (easy to find) in some class of inputs → sampling each class in the quasi-partition selects at least one input that leads to a failure, revealing the fault → seldom guaranteed; we depend on experience-based heuristics (C) 2007 MAURO PEZZÈ & MICHAL YOUNG
  • 9. Failures are sparse Failure (valuable test case) ... but dense in some in the space of parts of the space No failure possible inputs ... The space of possible input values (the haystack) If we systematically test some Functional testing is one way of cases from each part, we will drawing pink lines to isolate include the dense parts regions with likely failures (C) 2007 MAURO PEZZÈ & MICHAL YOUNG
  • 10. Random (uniform): → Pickpossible inputs uniformly → Avoids designer bias ─ A real problem: The test designer can make the same logical mistakes and bad assumptions as the program designer (especially if they are the same person) → But treats all inputs as equally valuable (C) 2007 MAURO PEZZÈ & MICHAL YOUNG
  • 11.
  • 12. Defects are not distributed uniformly! •  Assume our printSum program fails if both inputs are 0! •  Random sampling is unlikely to choose a = 0 and b = 0! We want bias!!
  • 13. Systematic (non-uniform): → Try to select inputs that are especially valuable → Usually by choosing representatives of classes that are apt to fail often or not at all Functional testing is systematic testing
  • 14.
  • 15. •An independently testable feature (ITF) is a functionality that can be tested independently of other functionalities of the software under test. •It need not correspond to a unit or subsystem of the software. •For example, a file sorting utility may be capable of merging two sorted files, and it may be possible to test the sorting and merging functionalities separately, even though both features are implemented by much of the same source code.
  • 16. It is recommended to devise separate test cases for each functionality of the system, whenever possible. The design of different tests for different functionalities can simplify the test generation problem Thus, identifying functional features does not correspond to identifying single modules at the design level, but rather to suitably slicing the specifications to be able to attack their complexity incrementally Feature-based view of the system
  • 17.
  • 18. Functional testing uses the specification (formal or informal) to partition the input space → E.g., specification of “roots” program suggests division between cases with zero, one, and two real roots Test each category, and boundaries between categories → No guarantees, but experience suggests failures often lie at the boundaries (as in the “roots” program) (C) 2007 MAURO PEZZÈ & MICHAL YOUNG
  • 19. •Try to select inputs that are especially valuable! • Usually by choosing representatives of equivalence classes! •Assumption: inputs in different categories behave equivalently ⇒I can select one input per category
  • 20. Consider a software module that is intended to accept the name of a grocery item and a list of the different sizes the item comes in, specified in ounces. The specifications state that the item name is to be alphabetic characters 2 to 15 characters in length. Each size may be a value in the range of 1 to 48, whole numbers only. The sizes are to be entered in ascending order (smaller sizes first). A maximum of five sizes may be entered for each item. The item name is to be entered first, followed by a comma, then followed by a list of sizes. A comma will be used to separate each size. Spaces (blanks) are to be ignored anywhere in the input. Taken from: http://users.csc.calpoly.edu/~jdalbey/205/Resources/grocerystore.
  • 21. Consider a software module that is intended to accept the name of a grocery item and a list of the different sizes the item comes in, specified in ounces. The specifications state that the item name is to be alphabetic characters 2 to 15 characters in length. Each size may be a value in the range of 1 to 48, whole numbers only. The sizes are to be entered in ascending order (smaller sizes first). A maximum of five sizes may be entered for each item. The item name is to be entered first, followed by a comma, then followed by a list of sizes. A comma will be used to separate each size. Spaces (blanks) are to be ignored anywhere in the input.
  • 22. Item name is alphabetic (valid) Item name is not alphabetic (invalid) Item name is less than 2 characters in length (invalid) Item name is 2 to 15 characters in length (valid) Item name is greater than 15 characters in length (invalid) Size value is less than 1 (invalid) Size value is in the range 1 to 48 (valid) Size value is greater than 48 (invalid) Size value is a whole number (valid) Size value is a decimal (invalid) Size value is numeric (valid) Size value includes nonnumeric characters (invalid) Size values entered in ascending order (valid) Size values entered in nonascending order (invalid) No size values entered (invalid) One to five size values entered (valid) More than five sizes entered (invalid) Item name is first (valid) …
  • 23. Expected # Test Data Classes Covered Outcome 1 xy,1 T 1,4,7,9,11,13,16,18,20,22 2 AbcDefghijklmno,1,2,3 ,4,48 T 1,4,7,9,11,13,16,18,20,23 3 a2x,1 F 2 4 A,1 F 3 5 abcdefghijklmnop F 5 6 Xy,0 F 6 7 XY,49 F 8 8 Xy,2.5 F 10 9 xy,2,1,3,4,5 F 14 10 Xy F 15 11 XY,1,2,3,4,5,6 F 17 12 1,Xy,2,3,4,5 F 19 13 XY2,3,4,5,6 F 21 14 AB,2#7 F 12
  • 24.
  • 25. Item name is alphabetic (valid) Item name is not alphabetic (invalid) Item name is less than 2 characters in length (invalid) Item name is 2 to 15 characters in length (valid) Item name is greater than 15 characters in length (invalid) Size value is less than 1 (invalid) Size value is in the range 1 to 48 (valid) Size value is greater than 48 (invalid) Size value is a whole number (valid) Size value is a decimal (invalid) Size value is numeric (valid) Size value includes nonnumeric characters (invalid) Size values entered in ascending order (valid) Size values entered in nonascending order (invalid) No size values entered (invalid) One to five size values entered (valid) More than five sizes entered (invalid) Item name is first (valid) …
  • 26. The main idea is to partition the input domain of function being tested, and then select test data for each class of the partition. The problem of all the existing techniques is the lack of systematic. Solution: the Category Partition Method
  • 27. Steps: ITF (Independently testable feature) Identify parameters and Environmental conditions Parameters: Explicit input to the functional unit Environmental Conditions: Characteristics of the system’s state Find categories that characterize each parameter and environment condition. Every category should be partitioned into distinct choices Test Spec
  • 28. Command: find (a pattern into a file) Syntax: find <pattern> <file> Function: The find command is used to locate one or more instance of a given pattern in a text file. All lines in the file that contain the pattern are written to standard output. A line containing the pattern is written only once, regardless of the number of times the pattern occurs in it. The pattern is any sequence of characters whose length does not exceed the maximum length of a line in the file .To include a blank in the pattern, the entire pattern must be enclosed in quotes (“).To include quotation mark in the pattern ,two quotes in a row (“ “) must be used.
  • 29. Example: find john myfile display lines in the file myfile which contain john find “john smith” in myfile display lines in the file myfile which contain john smith find “john”” smith” in myfile display lines in the file myfile which contain john” smith
  • 30. Parameters (explicit input to the functional unit) Example: size find john myfile display lines in the file myfile which contain john quote emb blank find “john smith” in myfile display lines in the file myfile which contain john smith emb quotes find “john”” smith” in myfile display lines in the file myfile which contain john” smith
  • 31. Parameters: Pattern size: empty single character many character longer than any line in the file Quoting: pattern is quoted pattern is not quoted pattern is improperly quoted Embedded blanks: no embedded blank one embedded blank several embedded blanks
  • 32. Embedded quotes: no embedded quotes one embedded quotes several embedded quotes File name: good file name no file with this name Environments (characteristics of the system’s state): Number of occurrence of pattern in file: none exactly one Total Tests frames: more than one 1944 Pattern occurrences on target line: one more than one
  • 33. Pattern size : empty Quoting : pattern is quoted Embedded blanks : several embedded blanks Embedded quotes : no embedded quote File name : good file name Number of occurrence of pattern in file : none Pattern occurrence on target line : one However, not all combinations of value classes correspond to reasonable test case specifications!!!
  • 34. • Properties – [property A, B, …] – A and B are property names – E.g., [property Empty] • Selector expression – [if A] – E.g., [if Empty]
  • 35. Parameters: Pattern size: empty [ property Empty ] single character [ property NonEmpty ] many character [ property NonEmpty ] longer than any line in the file [ property NonEmpty ] Quoting: pattern is quoted [ property quoted ] pattern is not quoted [ if NonEmpty ] pattern is improperly quoted [ if NonEmpty ] Embedded blanks: no embedded blank [ if NonEmpty ] one embedded blank [ if NonEmpty and Quoted ] several embedded blanks [ if NonEmpty and Quoted ]
  • 36. Embedded quotes: no embedded quotes [ if NonEmpty ] one embedded quotes [ if NonEmpty ] several embedded quotes [ if NonEmpty ] File name: good file name no file with this name Environments: Total Tests frames: Number of occurrence of pattern in file: 678 none [ if NonEmpty ] exactly one [ if NonEmpty ] [ property Match] more than one [ if NonEmpty ] [ property Match ] Pattern occurrences on target line: one [ if Match ] more than one [ if Match ]
  • 37. The label [error] indicates a value class that need be tried only once, in combination with non-error values of other parameters.
  • 38. Parameters: Pattern size: empty [ property Empty ] single character [ property NonEmpty ] many character [ property NonEmpty ] longer than any line in the file [ error ] Quoting: pattern is quoted [ property quoted ] pattern is not quoted [ if NonEmpty ] pattern is improperly quoted [ error ] Embedded blanks: no embedded blank [ if NonEmpty ] one embedded blank [ if NonEmpty and Quoted ] several embedded blanks [ if NonEmpty and Quoted ]
  • 39. Embedded quotes: no embedded quotes [ if NonEmpty ] one embedded quotes [ if NonEmpty ] several embedded quotes [ if NonEmpty ] [ single ] File name: good file name no file with this name [ error ] Environments: Total Tests frames: Total Tests frames: Number of occurrence of pattern in file: 40 125 none [ if NonEmpty ] exactly one [ if NonEmpty ] [ property Match] more than one [ if NonEmpty ] [ property Match ] Pattern occurrences on target line: [ single ] one [ if Match ] more than one [ if Match ] [ single ]
  • 40. • Use a constraint solver • Choose specific values that satisfy the constraints
  • 41.
  • 42. A completely different approach: →We cannot realistically presume to find and remove the last failure. →Then, we should invest test resources to find out the “biggest” ones. “Goodness” here means to minimise the user perceived faults, i.e. →Tryto find earlier those bugs that are more frequently encountered (neglect “small” bugs) →Not suitable for safety critical applications
  • 43. Identify: • Typical usage scenario • Frequency of those scenarios Test more, more frequent scenarios