Measure18 1 Software Measurement Halstead’s Software Science.

Slides:



Advertisements
Similar presentations
1 Lecture 16:User-Definded function I Introduction to Computer Science Spring 2006.
Advertisements

C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
Chapter 2: Basic Elements of C++
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
1 September 6, 2005CS150 Introduction to Computer Science I What Actions Do We Have Part 1 CS150 Introduction to Computer Science I.
Chapter 2: Basic Elements of C++
COMP205 Comparative Programming Languages Part 1: Introduction to programming languages Lecture 2: Structure of programs and programming languages as communication.
Chapter 2: Basic Elements of C++
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
Programming is instructing a computer to perform a task for you with the help of a programming language.
Introduction to C++ Programming
Software Engineering 1 (Chap. 1) Object-Centered Design.
Hello World 2 What does all that mean?.
CSE 1301 Lecture 2 Data Types Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Instructor - C. BoyleFall Semester
Chapter 02 (Part III) Introduction to C++ Programming.
Software Function, Source Lines Of Code, and Development Effort Prediction: A Software Science Validation ALLAN J. ALBRECHT AND JOHN E.GAFFNEY,JR., MEMBER,IEEE.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 2: Basic Elements of C++
Rossella Lau Lecture 1, DCO10105, Semester B, DCO10105 Object-Oriented Programming and Design  Lecture 1: Introduction What this course is about:
Course websites CS201 page link at my website: Lecture slides Assistant’s Information Recitations Office Hours Make-up.
Software Metrics (Part II). Product Metrics  Product metrics are generally concerned with the structure of the source code (example LOC).  Product metrics.
Chapter 2 Problem Solving On A Computer 2.1 Problem Solving Steps Solving a problem on a computer requires steps similar to those followed when solving.
CHAPTER 4: CONTROL STRUCTURES - SEQUENCING 10/14/2014 PROBLEM SOLVING & ALGORITHM (DCT 1123)
CIS-165 C++ Programming I CIS-165 C++ Programming I Bergen Community College Prof. Faisal Aljamal.
USER-DEFINED FUNCTIONS. STANDARD (PREDEFINED) FUNCTIONS  In college algebra a function is defined as a rule or correspondence between values called the.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
Introduction to C++ Basic Elements of C++. C++ Programming: From Problem Analysis to Program Design, Fourth Edition2 The Basics of a C++ Program Function:
Chapter 7 Selection Dept of Computer Engineering Khon Kaen University.
COSC 235: Programming and Problem Solving Ch. 2: Your first programs!!! Instructor: Dr. X.
1 Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
CS Class 08 Today  Exercises  Nested loops  for statement  Built-in functions Announcements  Homework #3, group solution to in-class.
Control Structures (B) Topics to cover here: Sequencing in C++ language.
C++ Basics. Compilation What does compilation do? g++ hello.cpp g++ -o hello.cpp hello.
Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.
Objective: Students will be able to: Declare and use variables Input integers.
Structured Programming (4 Credits) HNDIT Week 2 – Learning Outcomes Design an algorithmic solution for simple problem such as computation of a factorial,
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 6: User-Defined Functions I.
Review for Final Exam. Contents 5 questions (20 points each) + 1 bonus question (20 points) – Basic concepts in Chapters 1-4 – Chapters 5-9 – Bonus: Chapter.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 2: Basic Elements of C++
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 2: Basic Elements of C++
Functions Math library functions Function definition Function invocation Argument passing Scope of an variable Programming 1 DCT 1033.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 6: User-Defined Functions I.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 2: Basic Elements of C++
Chapter 3: User-Defined Functions I
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 6: User-Defined Functions I.
Chapter 3 – Variables and Arithmetic Operations. First Program – volume of a box /************************************************************/ /* Program.
Software Measurement: A Necessary Scientific Basis By Norman Fenton Presented by Siv Hilde Houmb Friday 1 November.
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
CS201 Introduction to Sabancı University 1 Chapter 2 Writing and Understanding C++ l Writing programs in any language requires understanding.
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
CMSC 104, Version 8/061L09VariablesInC.ppt Variables in C Topics Naming Variables Declaring Variables Using Variables The Assignment Statement Reading.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 2: Basic Elements of C++
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
Fundamental Programming Fundamental Programming Data Processing and Expressions.
CS 31 Discussion, Week 2 Faisal Alquaddoomi, Office Hours: BH 2432, MW 4:30-6:30pm, F 12:30-1:30pm (today)
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 2: Basic Elements of C++
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 2: Basic Elements of C++
Software METRICS. Intro Measurement is essential to life economic measurement... clinical measurement... air traffic control... etc., etc., etc....
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 3: Input/Output Samples.
Debugging. Design Well A careful design limits the necessary debugging - think “top-down” Write comments as you go, especially invariants –You can test.
Data Types and Expressions
Halstead’s software science: An analystical model
CS149D Elements of Computer Science
Hello World 2 What does all that mean?.
Halstead software science measures and other metrics for source code
Engineering Problem Solving with C++ An Object Based Approach
Engineering Problem Solving with C++ An Object Based Approach
Pseudocode For Program Design.
Presentation transcript:

measure18 1 Software Measurement Halstead’s Software Science

measure18 2 Maurice Halstead u Originally a meteorologist –Involved in first cloud seeding u In 1970’s he did empirical studies looking for relationships between code and the “ilities” – maintainability, readability, testability, etc u Wanted to find the intrinsic things to measure

measure18 3 Vs Physics Study blue metal balls vs white tennis balls. Conclude that blue balls made bigger dents than white balls.

measure18 4 Halstead's software science u every token is either an operator or an operand u tokens with a value are operands   2 is the number of unique operands u other tokens are operators   1 is the number of unique operators   is the total number of unique tokens   =  1 +  2

measure18 5 Sample Program Z = 0; while X > 0 Z = Z + Y ; X = X - 1 ; end-while ; print (Z) ;

measure18 6 Counts u =3 u ;5 u while-endwhile1 u >1 u +1 u -1 u print1 u ()1 uZ4u02uX3uY1u11uZ4u02uX3uY1u11

measure18 7 Counting Rules u Halstead also was concerned about algorithms and not about declarations, i/o statements, etc. u Thus, he did not count declarations, input or output statements, or comments.

measure18 8 Counting Rules u There is a lot of debate about counting rules. In fact there was a conference that dealt just with counting rules. One conclusion, the results are not very sensitive to the counting rules. Pick a set of rules and be consistent. u Suggest syntax-oriented counting rules

measure18 9 Counting Rules u if two symbols always occur together, count them as one operator. u if there are two different structures that are semantically the same, still count them as two different operators. u count declarations, i/o, etc. Count everything that is necessary for expressing the program. u operators are basically keywords. user-defined items are basically operands.

measure18 10 Length, N u N = N 1 + N 2 u where, N 1 is the total number of operators and N 2 is the total number of operands

measure18 11 estimate of the length, est N u If N and est N are not within 30% of each other, it is not reasonable to apply any of the other software science measures.

measure18 12 TTYP1 - Calculate Halstead’s cin >> a >> b >> c; if (a > b){ cout << “hello”; if (c < a){cout << “part 1”; if ( c > b){cout << “part 2”; } else{ cout << “part 3”;} } else{if (c<a){cout<<”part 4”;} } cout << “exiting”;