C0 Testing - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

C0 Testing

Description:

1990's - applied to software measurement. measure18. 7. Representational TOM ... one of the two or three most commonly used measures ... – PowerPoint PPT presentation

Number of Views:14
Avg rating:3.0/5.0
Slides: 21
Provided by: people5
Category:

less

Transcript and Presenter's Notes

Title: C0 Testing


1
C0 Testing
  • Instrumented code
  • Output files (processed)
  • Description of code not covered and why

2
SRC Comments final doc
  • Comments are important and will be graded in the
    final documentation grading
  • This will be subjective
  • Guidelines
  • Every class/function should have a description of
    purpose, internal data, inputs, outputs, author
  • Every section should have brief description of
    purpose and algorithm (if not obvious)
  • Points will be deducted for useless comments

3
Software Measurement
  • quantifying software and
  • software development

4
Software Measures
  • The purpose of software measures is to quantify
    characteristics of programs.
  • Lord Kelvin is credited with claiming that a
    subject is not a science unless you can measure
    it.
  • Unless we can measure characteristics of
    software, it will be very hard to develop a sound
    science of software engineering.

5
Measurement
  • the process by which numbers or symbols are
    assigned to attributes of entities in the real
    world in such a way as to describe them according
    to clearly defined rules

6
Measurement Theory
  • circa 1900 - applied to physics
  • 1940s - applied to psychology, sociology
  • 1990s - applied to software measurement

7
Representational TOM
  • empirical relation system
  • (C,R)
  • numerical relation system
  • (N,P)
  • M maps (C,R) to (N,P)
  • representation condition
  • xlty iff M(x)ltM(y)

8
The Mapping
  • The representation condition
  • M(x) rel M(y) if x rel y
  • x rel y iff M(x) rel M(y)
  • Both have been used by classical measurement
    theory authors
  • Fenton prefers the second definition

9
Scales
  • nominal
  • ordinal
  • interval
  • ratio
  • absolute

10
McCabe's Complexity Measure
  • also called the Cyclomatic Number
  • introduced 1976
  • one of the two or three most commonly used
    measures
  • premise - complexity is related to control flow
    of the program

11
Graph Theory
  • the cyclomatic number
  • minimal basis for describing any path in the
    graph
  • not assumed to be complexity in graph theory

12
Cyclomatic Number - arcs and nodes
  • C e - n 2p
  • where
  • e number of edges,
  • n number of nodes,
  • p number of strongly connected components

TTYP1 what is e,n for triangle CFG? Assume
p1, what is cyclomatic number?
13
CFG for triangle problem
14
Euler (1707-1783)
  • for planar graphs
  • 2 n - e r
  • where r number of regions, e number of edges,
    and n number of nodes
  • 2 n - e r r e - n 2
  • Therefore, the number of regions on a planar
    graph equals the cyclomatic number

15
Cyclomatic Number - regions
  • C r

TTYP2 label the regions on the triangle CFG
16
Cyclomatic Number - decisions
  • C Pi 1
  • where Pi is the number of decisions

TTYP3 label the decisions on the triangle CFG
17
Threshold
  • McCabe analyzed a large project and discovered
    that for modules with complexity over 10, the
    modules had histories of errors and difficulties
    in maintenance

18
Calculate McCabes cyclomatic
cin gtgt a gtgt b gtgt c if (a gt b) cout ltlt
hello if (c lt a)cout ltlt part 1 if ( c gt
b)cout ltlt part 2 else cout ltlt
part 3 elseif (clta)coutltltpart
4 cout ltlt exiting
TTYP4 draw the CFG and count e,n calculate
cyclomatic , label the regions and decisions
19
Summary
McCabes cyclomatic number is not the
ultimate answer for complexity. It is a good
general indicator of relative size.
20
Rest of Semester
  • No more PLQs
  • 11/28, 11/30, 12/5
  • Security Presentations
  • 12/7
  • Review for 543 final
  • Final Doc due Friday Dec 8th, 5pm
  • Monday, Dec 11th 543 final 200-350
Write a Comment
User Comments (0)
About PowerShow.com