Requirements and Specifications Software Testing and Verification Lecture

Requirements and Specifications Software Testing and Verification Lecture

Requirements and Specifications Software Testing and Verification Lecture 3 Prepared by Stephen M. Thebaut, Ph.D. University of Florida What are Requirements and Specifications? Requirement:

something required; something wanted or needed; an essential requisite... To Specify: to name; to state explicitly or in (sufficient) detail... Roles of Requirements in Testing and Verification How are requirements used in testing? Serve as basis for black-box test case design.

Source of expected results for ALL test cases. What do requirements have to do with the formal correctness assertions: {P} S {Q} ? f = [S] ? What if there are no requirements? Roles of Requirements in Testing and Verification

(contd) Bottom Line: testing and verification only make sense when requirements in some form are available to work with. Exercise Consider the following pseudocode program: Sum := 0 J := 1 while J<=N do Sum := Sum + X[J] J := J+1

end_while What does it do? Is it correct? Requirement/Specification Types Functional versus Non-Functional Formal versus Informal Structured versus Unstructured State-model based versus Operational Graphical versus Textual A Sampling of Requirement

Representations Natural language prose Numbered paragraphs (ala DoD standards) Functions, Attributes, and Constraints (ala Gause & Weinberg) Structured templates (of various sorts and levels) e.g., Volere shell, XP user stories Decision tables Pseudocode programs (contd) A Sampling of Requirement

Representations (contd) PDL models (PSL, RSL, etc.) Cause-Effect models State-Transition models Pre- and Post-conditions Recursive (intended) function definitions Algebraic specifications Z-based Schemas Etc. Exercise Identify each of the following requirements

representations: Sample.specs.pdf Requirements Sources at Different Levels Typical System-Level Sources Objectives document User manuals (e.g., MAN Pages) Installation documents Service manuals Requirements definition/specification

(contd) Requirements Sources at Different Levels (contd) Typical Unit-Level Sources Module/function/procedure specifications Pseudocode Logic specifications Object class/method specifications (contd)

Requirements Sources at Different Levels (contd) Typical Intermediate- (e.g., Product/ Component) Level Sources Product/component specification Functional specification Object use-include relations, sequence/collaboration diagrams, package specification (Some) Key Attributes

Completeness Consistency Unambiguousness Verifiability/Testability Correctness (?) Completeness Possible Definition for Functional Requirements: The desired response is specified for every possible stimulus and every system state.

Definition for Non-Functional Requirements: Constraints and preferences for every relevant attribute of every desired function are specified. Consistency Possible Definition: There are no contradictions or conflicts in any specified functional or non-functional requirements.

Unambiguousness Possible Definition: Requirements are not subject to multiple interpretations. Gause & Weinbergs heuristics for identifying potential ambiguity: Mary Had a Little Lamb (emphasize different words) Mary Conned the Trader (substitute synonyms) Mary had a little lamb

Heuristic Mary had a little lamb. Mary had a little lamb. Mary had a little lamb. Mary had a little lamb.

Mary had a little lamb. Mary conned the trader Heuristic Mary owned a petite lamb. Mary consumed a small amount of lamb. Mary had a little lamb.

Mary was involved with a young sheep. Mary conned the trader. Verifiability/Testability Possible Definition: Objective criteria exist for determining whether or not requirements will have been satisfied.

What about CORRECTNESS? The notion of a PROGRAM being correct (with respect to its requirements) is relatively straightforward, but what does it mean to say that a programs REQUIREMENTS are correct? (contd) What about CORRECTNESS? (contd)

Possible Definition: The REQUIREMENTS for a (sub-) program are correct if the PROGRAM DESIGN which incorporates those requirements is correct with respect to its requirements. Requirements for C A E B

C D F G H J

K Design for A I L What about CORRECTNESS? (contd) In other words, the correctness of a (requirements) specification would be considered with respect to a design that

incorporates that specification. For example, you might ask: Was the decision to take this course correct with respect to my overall plan of study? A self-imposed requirement. (contd) What about CORRECTNESS? (contd)

Based on our definition, the answer would be yes if your plan of study (a design that incorporates this course) satisfies your educational goals (i.e., the requirements for your plan). Role of testers in Requirements Engineering? What role can/should testers play in assessing/verifying the degree to which requirements are: complete,

consistent, unambiguous, verifiable, correct? Requirements and Specifications Software Testing and Verification Lecture 3 Prepared by Stephen M. Thebaut, Ph.D.

University of Florida

Recently Viewed Presentations

  • Exploration and Environmental Geophysics

    Exploration and Environmental Geophysics

    Exploration and Environmental Geophysics Free-Air Gravity Exercise ... (0.3086 mGal·m-1) is multiplied by the elevation of the station and the result is added, producing the free-air anomaly. The free-air gravity anomaly is given by the formula: FA = go -...
  • Title of Training Presentation

    Title of Training Presentation

    The subform use Iframe( NetSmart create the table inside the Iframe object ) - so we need to wait until the subformdata get loaded before we can manipulate the subform. When you want reference subform data from main form you...
  • World Map - St. Charles Parish Public School System

    World Map - St. Charles Parish Public School System

    AP Geography Map Places Study List Continents: Africa, Asia, Australia, Europe, North America, South America Oceans: Atlantic, Arctic, Indian, Pacific, Southern
  • Contributors to the Cell Theory

    Contributors to the Cell Theory

    Mitochondrion - ? trucking company power plant recycling center storage company fence surrounding city post office factory border patrol city hall restaurant A Cell Is Like A City Cell Membrane - Cell Wall - Nucleus - Ribosome - ER -...
  • Special Topics in Computer Science Advanced Topics in

    Special Topics in Computer Science Advanced Topics in

    Monday / Tuesday An interesting solution: compare dictionary definitions Uses in IR Query expansion Add synonyms of the word to the query and process normally Flexible, slow Best for lexical synonymy: few synonyms, doubtful Reducing at index time When reading...
  • CINCO DE MAYO - Caldwell-West Caldwell Public Schools

    CINCO DE MAYO - Caldwell-West Caldwell Public Schools

    CINCO DE MAYO ¡Viva México! ¡Viva Juárez! WHY? In 1861, the Mexican Congress suspended repayment of foreign debts for 2 years, due to financial instability. Creditors in England, Spain and France decided intervention was needed. France secretly planned to impose...
  • Russia and Central Asia - mrdgeography

    Russia and Central Asia - mrdgeography

    Russia and Central Asia Economic Geography Natural Resources Russia and Central Asia have many different types of natural resources, both renewable and nonrenewable. Renewable Resources Russia has timber in Siberia. Most of Siberia is covered in Taiga. Russia has a...
  • La Diversité… Pour LES NULS

    La Diversité… Pour LES NULS

    La mention, dans une annonce ou un descriptif de poste, « vous justifiez d'au moins 5 ans d'expérience professionnelle » est-elle légale ? Oui Non. Réponse cas pratique Gen 1.