Reaves.dev

v0.1.0

built using

Phoenix v1.7.12

Black Box Testing

Stephen M. Reaves

::

2023-10-08

Notes about Lesson 11 of CS-6300

Summary

Advantages

Approach

How to go from functional specification to test cases?

  1. Identify independently testable features
  2. Identify relevant inputs
  3. Derive test case specifications
  4. Generate test cases

Random Tests

Pick inputs at random

Needle in a haystack

Partition testing

Failures are generally sparse, but dense in some subdomains

  1. Identify partitions of domain
  2. Select inputs from each partition

Example

split(String str, int size)

Possible Partitions:

Possible Inputs:

Category-Partition Method

6 steps to go from specification to test cases, created by Ostrand & Balcer, CACM in June 1988

  1. Identify independently testable features
  2. Identify categories
  3. Partition categories into choices
  4. Identify constraints among choices
  5. Produce/Evaluate test case specifications
  6. Generate test cases from test case specifications

Identify Categories

Categories := characteristics of each input element

Partition Categories Into Choices

Interesting cases/subdomains

Identify Constraints Among Choices

This keeps us from generating nonsensical test cases later and to reduce number of test cases.

3 types:

Produce and Evaluate Test Case Specifications

Can be automated

Produces test frame

Test Frame #36
  input str
    length: size - 1
    content: special characters
  input size
    value: > 0

Generate Test Cases from Test Case Specifications

Simple instantiation of frames

Final Result : Set of concrete tests

Test Case #36
  str = "ABCC!\nt0"
  size = 10

Model Based Testing

Different ways to identify relevant inputs and derive test case specifications

Finite State Machine

Graph where nodes represents states and edges represent state transitions and labels mean event/action.

Test cases can cover state transitions