HINT: Consider the number of “valuable” digits in large natural numbers calculated with MS Excel™!
Homework Assignments (example 1)
Using Manchester Encoding Format, encode a bit-stream that represents two first letters of your last name previously written in the ASCII (7-bit) Coding Standard. Using MS Word, plot a diagram that illustrates your Manchester code.
Homework Assignments (example 2)
Plot a diagram that illustrates a virtual private connection from your home computer to the Rivier College Network. Briefly describe issues that should be resolved for establishing this connection.
Homework Assignments (example 3)
A LAN has a data rate of r=4 Mbps and a propagation delay between two stations at opposite ends of d=20 ìs. For what range of PDU sizes (S, measured in bits) does the stop-and-wait flow control give an efficiency of at least 50%, E > 0.5? (neglect the transmission time for the ACK signal). The efficiency, E is defined as a ratio of the PDU transmission time (time for inserting the PDU onto the medium) to the total time the medium is occupied for this one PDU.
a unique methodology for software testing proposed by McCabe in 1976;
approved as the NIST Standard (1996) in the structured testing;
a leading tool in computer, military, and aerospace industries
(HP, GTE, AT&T, Alcatel, GIG, Boeing, NASA, etc.) since 1977;
provides Code Coverage Capacity.
Author’s Experience with McCabe IQ Tools since 1998
leaded three projects in networking industry that required Code Analysis, Code Coverage, and Test Coverage;
completed BCN Code Analysis with McCabe Tools;
completed BSNCode Analysis with McCabe Tools;
studied BSN-OSPF Code Coverage & Test Coverage;
included these topics into Software Engineering and Networking classes since 1999.
McCabe’s Structured Testing Methodology Basics
The key requirement of structured testing is that all decision outcomes must be exercised independently during testing.
The number of tests required for a software module is equal to the cyclomatic complexityof that module.
The software complexity is measured by metrics:
cyclomatic complexity, v
essential complexity, ev
module design complexity, iv
system design, S0, and system integration complexity, S1,
Halstead metrics, and 52 metrics more.
The testing methodology allows to identify unreliable-and- unmaintainable code, predict number of code errors and maintenance efforts, develop strategies for unit/module testing, integration testing, and test/code coverage.
Basics: Analyzing a Module
For each module (a function or subroutine with a single entry point and a single exit point), an annotated source listing and flowgraph is generated.
Flowgraph is an architectural diagram of a software module’s logic.
Flowgraph Notation (in C)
Flowgraph and Its Annotated Source Listing
Would you buy a used car from this software?
Problem: There are size and complexity boundaries beyond which software becomes hopeless
Too error-prone to use
Too complex to fix
Too large to redevelop
Solution: Control complexity during development and maintenance
Stay away from the boundaries.
Important Complexity Measures
Cyclomatic complexity: v = e - n + 2
Amount of decision logic
Essential complexity: ev
Amount of poorly-structured logic
Module design complexity: iv
Amount of logic involved with subroutine calls
System design complexity: S0 =iv
Amount of independent unit (module) tests for a system
System integration complexity: S1 = S0 - N + 1
Amount of integration tests for a system of N modules.
Cyclomatic complexity, v - A measure of the decision logic of a software module.
Applies to decision logic embedded within written code.
Is derived from predicates in decision logic.
Is calculated for each module in the Battlemap.
Grows from 1 to high, finite number based on the amount of decision logic.
Is correlated to software quality and testing quantity; units with higher v, v>10, are less reliable and require high levels of testing.
Essential Complexity - Unstructured Logic
Essential Complexity, ev
Flowgraph and reduced flowgraph after structured constructs have been removed, revealing decisions that are unstructured.
Improve software quality using detailed reports and visualization
Shorten the time
plans to address
Processing with McCabe Tools
Project B: Backbone™ Concentration Node
This system has been designed to support carrier networks. It provides both services of conventional Layer 2 switches and the routing and control services of Layer 3 devices.
Nine protocol-based subtrees of the code (3400 modules written in the C programming language for BGP, DVMRP, Frame Relay, ISIS, IP, MOSPF, OSPF2, PIM, and PPP protocols) were analyzed.
Project-B Protocol-Based Code Analysis
Unreliable modules: 38% of the code modules have the Cyclomatic Complexity more than 10 (including 592 functions with v > 20);
Only two code parts (FR,ISIS) are reliable;
BGP and PIM have the worst characteristics (49% of the code modules have v > 10);
1147 modules (34%) are unreliable and unmaintainable with v > 10 and ev > 4;
BGP, DVMRP, and MOSPF are the most unreliable and unmaintainable (42% modules);
The Project-B was cancelled.
Project-B Code Protocol-Based Analysis (continue)
1066 functions (31%) have the Module Design Complexity more than 5. The System Integration Complexity is 16026, which is a top estimation of the number of integration tests;
Only FR, ISIS, IP, and PPP modules require 4 integration tests per module. BGP, MOSPF, and PIM have the worst characteristics (42% of the code modules require more than 7 integration tests per module);
B-188.8.131.52int18 Release potentially contains 2920 errors estimated by the Halstead approach. FR, ISIS, and IP have relatively low (significantly less than average level of 0.86 error per module) B-error metrics. For BGP, DVMRP, MOSPF, and PIM, the error level is the highest one (more than one error per module).
Comparing Project-B Core Code Releases
NEW B-1.3 Release (262 modules) vs. OLD B-1.2 Release (271 modules);
16 modules were deleted (7 with v >10);
7 new modules were added (all with v < 10, ev = 1);
Sixty percent of changes have been made in the code modules with the parameters of the Cyclomatic Complexity metric more than 20.
63 modules are still unreliable and unmainaitable;
39 out of 70 (56%) modules with v >10 were targeted for changing and remained unreliable;
7 out of 12 (58%) modules have increased v > 10;
Significant reduction achieved in System Design (S0) and System Integration Metrics (S1):
S1 from 1126 to 1033; S0 from 1396 to 1294.
New Release potentially contains 187 errors (vs. 206 errors) estimated by the Halstead approach.
Nevertheless, the Project-B was cancelled.
Project C: Broadband Service Node
Broadband Service Node (BSN) allows service providers to aggregate tens of thousands of subscribers onto one platform and apply customized IP services to these subscribers;
Different networking services [IP-VPNs, Firewalls, Network Address Translations (NAT), IP Quality-of-Service (QoS), Web steering, and others] are provided.