Professional Documents
Culture Documents
BS (Computer Science)
Lecture-05
Date: 10-03-2012
Dr. S. N Ahsan
1
Layout
Review Software Metrics
08.10.2011
Review
08.10.2011
2. 3.
4. 1. 2. 3.
Concurrent Models Component Based Development The Formal Methods Model The Unified Process Model
08.10.2011
08.10.2011
08.10.2011
Agile Development
Agile Software Engineering combines a philosophy and a set of development guidelines.
The philosophy encourages customer satisfaction and early incremental delivery of software, Small highly motivated project teams Informal method Minimal Software Engineering work products Development simplicity
XP Practices (1-12)
1. 2. 3. 4. 5. 6. 7. 7. 8. 9. 10. 11.
06.03.2014
Planning game Small releases Metaphor Simple design Testing Refactoring Pair-programming Collective ownership Continuous integration 40-hour week On-site customer Coding standards
Dr. S. Nadeem Ahsan, IQRA-University 10
Refactoring
Refactoring: changes to the organization of a program, not its function. Behavior preserving program transformations. Why Refactoring is Important:
Only defense against software decay. Often needed to fix reusability bugs. Lets you add patterns after you have written a program; lets you transform program into framework. Lets you worry about generality tomorrow; just get it working today.
Laurie Williams North Carolina State University Robert Kessler University of Utah
Pair Programming
Driver and Navigator working together on one task Roles changing often. Collective responsibility for outcome. Bringing together of multiple perspectives, experiences, abilities, and expertise
Why Pair: Higher quality code Faster cycle time Enhanced trust/teamwork Knowledge transfer Enhanced learning More fun
Pair Programming
Williams/Kessler 2004
Individuals Collaborators
Elapsed Time
120.0% 100.0% 80.0% 60.0% 40.0% 20.0% 0.0% Program 1 Program 2 One Individual One Collaborator Program 3
...
199 5
1996
199 7
199 8
199 9
200 0
200 1
Total productivity was 175 lines per person-month (lppm) compared to a documented average individual productivity of only 77 lppm . . .
The error rate through software-system integration was three orders of magnitude lower than the organization's norm . . . A brief list of observed phenomena includes focused energy, brainstorming, problem solving, continuous design and code walkthroughs, mentoring and motivation.
Formal Method
Formal methods allow a software engineer to create a specification that is more complete, consistent, and unambiguous than those produced using conventional or object oriented methods.
Set theory and logic notation are used to create a clear statement of facts (requirements). This mathematical specification can then be analyzed to prove correctness and consistency. Because the specification is created using mathematical notation, it is inherently less ambiguous than informal modes of representation.
08.10.2011
19
Specification
Formal methods for specification of the concurrent systems CSP (Hoare 1985) Temporal Logic (Pnueli 1981) I/O Automata (Lynch and Tuttle 1987)
Verification
Two well established approaches to verification Model Checking Theorem Proving Model checking Build a finite model of system and perform an exhaustive search Theorem Proving Mechanization of a logical proof
Another example :
08.10.2011
24
08.10.2011
25
08.10.2011
26
No dependencies
Programming Paradigms
Procedural programming Executing a set of commands in a given sequence Fortran, C, Cobol Functional programming Evaluating a function defined in terms of other functions Lisp, ML, OCaml Logic programming Proving a theorem by finding values for the free variables Prolog Object-oriented programming (OOP) Organizing a set of objects, each with its own set of responsibilities Smalltalk, Java, C++ (to some extent) Aspect-oriented programming (AOP) Executing code whenever a program shows certain behaviors AspectJ (a Java extension) Does not replace O-O programming, but rather complements it
28
08.10.2011
29
Crosscutting Concerns
AOP addresses behaviors that span many, often unrelated, modules.
Core Concerns: Primary core functionality. Central functionality of a module. Crosscutting Concerns: System wide concerns that span multiple modules. Cuts across the typical division of responsibility. OOP creates a coupling between core and crosscutting concerns. AOP aims to modularize crosscutting concerns.
08.10.2011
30
Aspects
In AOP crosscutting concerns are implemented in aspects instead of fusing them into core modules. Aspects are an additional unit of modularity. Aspects can be reused. By reducing code tangling it makes it easier to understand what the core functionality of a module is. An aspect weaver takes the aspects and the core modules and composes the final system.
08.10.2011
31
Terminology cont
Core concerns Central functionality of a Business logic (single module) Customer and Account management, Interbanking transactions, ATM transactions Crosscut concerns System-level, peripheral requirements (multiple modules) Persistence of all entities, Transaction integrity, Authorization of access to various services, logging, Security, Error checking, Policy enforcement
19 August 2005
32
AOP Methodology
AOP Methodology
The idea behind AOP is Separation of concern AOP builds upon Existing Methodologies (OOP, Procedural programming), augmenting them with concepts and constructs in order to modularize crosscutting concerns. Now, concern consists of what?
19 August 2005
33
08.10.2011
34
08.10.2011
35
Case Studies
08.10.2011
36
Software Application
Procurement Management System
Software Metrics
08.10.2011
38
product
Why Do We Measure?
assess the status of an ongoing project track potential risks uncover problem areas before they go critical, adjust work flow or tasks, evaluate the project teams ability to control quality of software work products.
40
Measurement Principles
1. 2. 3. 4. 5. Formulation Collection Analysis: Interpretation Feedback
Metric Classification
1. Products Metrics:
I. Size Metrics (LOC and Function Points) II. Halsteads Product Metrics III. Complexity Metrics
Function Point: A measure which represents the functional size of application Function Point Analysis: A standard method for measuring software development and maintenance from the customers point of view. Function Point Count: The function point measurement of a particular application or project FP = count total [0.65+0.01 (Fj)]
Function Point Metrics are Comparable and Logical across Projects , Platform and Languages
06.03.2014
50