Halstead’s software science: An analystical model

Slides:



Advertisements
Similar presentations
Classes & Objects INTRODUCTION : This chapter introduces classes ; explains data hiding, abstraction & encapsulation and shows how a class implements these.
Advertisements

Functions Function: The strength of C language is to define and use function. The strength of C language is that C function are easy to define and use.
Spring Semester 2013 Lecture 5
Programming Languages and Paradigms
What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the.
An Approach to Evaluate Data Trustworthiness Based on Data Provenance Department of Computer Science Purdue University.
SIM5102 Software Evaluation Measuring Internal Product Attribute.
Software Metrics.
CS 201 Functions Debzani Deb.
Differences between Java and C CS-2303, C-Term Differences between Java and C CS-2303, System Programming Concepts (Slides include materials from.
Software Metrics II Speaker: Jerry Gao Ph.D. San Jose State University URL: Sept., 2001.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
Software metrics Selected key concepts. Introduction Motivation:  Management:  Appraisal  Assurance  Control  Improvement  Research:  Cause-effect.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
C++ fundamentals.
1 Cost Estimation CIS 375 Bruce R. Maxim UM-Dearborn.
Overview Software Quality Metrics Black Box Metrics White Box Metrics
Functions in C. Function Terminology Identifier scope Function declaration, definition, and use Parameters and arguments Parameter order, number, and.
Software Metrics.
1 COMP 2130 Introduction to Computer Systems Computing Science Thompson Rivers University.
Introduction to complexity Prof. Sin-Min Lee Department of Computer Science San Jose State University.
1 K.Becker & J.R.Parker Serious Games + Computer Science = Serious CS.
1 Software Quality CIS 375 Bruce R. Maxim UM-Dearborn.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
C Tokens Identifiers Keywords Constants Operators Special symbols.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 15b: Product Metrics for Software Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Software Metrics Software Engineering.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 23 Instructor Paulo Alencar.
Software Function, Source Lines Of Code, and Development Effort Prediction: A Software Science Validation ALLAN J. ALBRECHT AND JOHN E.GAFFNEY,JR., MEMBER,IEEE.
Machine Learning Queens College Lecture 2: Decision Trees.
Software Metrics (Part II). Product Metrics  Product metrics are generally concerned with the structure of the source code (example LOC).  Product metrics.
RDF and XML 인공지능 연구실 한기덕. 2 개요  1. Basic of RDF  2. Example of RDF  3. How XML Namespaces Work  4. The Abbreviated RDF Syntax  5. RDF Resource Collections.
Chapter 8: Arrays and Functions Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills
Learners Support Publications Functions in C++
Project Estimation techniques Estimation of various project parameters is a basic project planning activity. The important project parameters that are.
VARIABLES, CONSTANTS, OPERATORS ANS EXPRESSION
Computer Science and Software Engineering© 2014 Project Lead The Way, Inc. Procedural Abstraction Object-Oriented Code.
Measure18 1 Software Measurement Halstead’s Software Science.
Software Metrics.
Definition of function Types of Function Built-in User Defined Catagories of Function No argument No return value Argument but No return value No argument.
Types of C Variables:  The following are some types of C variables on the basis of constants values it has. For example: ○ An integer variable can hold.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Modularity using Functions Chapter 4. Modularity In programming blocks of code often can be "called up" and reused whenever necessary, for example code.
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
Software Measurement: A Necessary Scientific Basis By Norman Fenton Presented by Siv Hilde Houmb Friday 1 November.
Object Oriented Programming Session # 03.  Abstraction: Process of forming of general and relevant information from a complex scenarios.  Encapsulation:
CISC105 – General Computer Science Class 4 – 06/14/2006.
2. C FUNDAMENTALS. Example: Printing a Message /* Illustrates comments, strings, and the printf function */ #include int main(void) { printf("To C, or.
CS223: Software Engineering Lecture 21: Unit Testing Metric.
Software METRICS. Intro Measurement is essential to life economic measurement... clinical measurement... air traffic control... etc., etc., etc....
Static Software Metrics Tool
Computers’ Basic Organization
Software Metrics 1.
Computer Science 210 Computer Organization
Design Characteristics and Metrics
FIGURE 4-10 Function Return Statements
Functions in C Mrs. Chitra M. Gaikwad.
11/10/2018.
Computer Science 210 Computer Organization
CSI-121 Structured Programming Language Lecture 14 Functions (Part 2)
CS223: Software Engineering
Halstead software science measures and other metrics for source code
Differences between Java and C
What would be our focus ? Geometry deals with Declarative or “What is” knowledge. Computer Science deals with Imperative or “How to” knowledge 2/23/2019.
In C Programming Language
Introduction to C Programming
Coupling Interaction: It occurs due to methods of a class invoking methods of other classes. Component Coupling: refers to interaction between two classes.
Rudra Dutta CSC Spring 2007, Section 001
Chapter 8: Design: Characteristics and Metrics
Scope Rules.
Presentation transcript:

Halstead’s software science: An analystical model

Halstead’s Software Science Source Code Metrics Overall program length Potential minimum algorithm volume Actual algorithm volume number of bits used to specify program Program level software complexity Language level constant for given language

Halstead’s Software Science (entropy measures)‏ – n1 - number of distinct operators – n2 - number of distinct operands – N1 - total number of operators – N2 - total number of operands

An example if (k < 2)‏ { if (k > 3)‏ x = x*k; } • Distinct operators: if ( ) { } > < = * ; • Distinct operands: k 2 3 x • n1 = 10 • n2 = 4 • N1 = 13 • N2 = 7

Operators ( [ . , -> * + _ ! ~ ^ < > <= & % && ? / *= ; IF ELSE SWITCH WHILE DO FOR CONTINUE GOTO BREAK etc a = &b here a and b are operands and = & are operators Function name in a function definition not an operator Function name in a function call is an operator and arguments of the function call are operands. However, parameter list of a function in the function declaration statement is not treated as operands.

Halstead’s Metrics Program length: N = N1 + N2 Program vocabulary: n = n1 + n2 Estimated length: = n1 log2 n1 + n2 log2 n2 Close estimate of length for well structured programs Purity ratio: PR = /N

Program Complexity Volume: V = Estimated Length * log2 n Number of bits to provide a unique designator for each of the n items in the program vocabulary. V is the minimum no. of bits needed to encode the program Difficulty Program effort: E=D*V This is a good measure of program understandability

Example main()‏ { int a,b,c,avg; scanf(“%d %d %d”, &a, &b, &c); avg = (a+b+c)/3; printf(“avg = %d”, avg); } Unique operators: main, (), {}, int, scanf, &, “,”,”;”, =, +, /, printf Unique operands: a,b,c, &a, &b, &c, a+b+c, avg, 3,”%d %d %d”, “avg=%d” Therefore, n1 = 12, n2 = 11

Estimated length = (12 * log 12 + 11 * log 11)‏ = 81 Volume = Length * log(23) = 81 *4.52 = 366

Conclusion Halstead’s theory tries to provide a formal definiton and quantification of such attributes as program complexity, ease of understanding and level of abstraction based on some low-level parameters such as the number of operands and operators appearing in the program Provides gross estimates of properties of a large collection of s/w, but extends to individual cases rather inaccurately