Briones-Ruales(Source Code Maintenance Tools)

download Briones-Ruales(Source Code Maintenance Tools)

of 21

Transcript of Briones-Ruales(Source Code Maintenance Tools)

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    1/21

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    2/21

    Source Code MetricsSource Code

    program instructions written as an ASCII textfile; must be translated by a compiler or

    interpreter or assembler into the object codefor a particular computer before execution.

    Metric

    is the measurement of a particularcharacteristic of a program's performance orefficiency.

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    3/21

    Source Lines of Code (SLOC)

    are asoftware metricused to measure thesize of a software program by counting thenumber of lines in the text of the program's

    source code.

    SLOC is typically used to predict the amount ofeffort that will be required to develop a

    program, as well as to estimateprogramming productivityor effort once thesoftware is produced.

    http://en.wikipedia.org/wiki/Software_metrichttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Programming_productivityhttp://en.wikipedia.org/wiki/Programming_productivityhttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Software_metric
  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    4/21

    Software Metricsare a special kind of analysis focused on the structure of the

    source code.

    Classic software metrics range in variety from the very simpleSource Lines of Code (SLOC) to more complex measures suchas Cyclomatic Complexity measurements.

    The goal is obtaining objective, reproducible and quantifiablemeasurements, which may have numerous valuable applications inschedule and budget planning, cost estimation, quality assurancetesting, software debugging, software performance optimization, andoptimal personnel task assignments.

    http://localhost/var/www/apps/conversion/current/tmp/scratch_6/reportmonzons.ppthttp://localhost/var/www/apps/conversion/current/tmp/scratch_6/reportmonzons.ppthttp://localhost/var/www/apps/conversion/current/tmp/scratch_6/reportmonzons.ppthttp://localhost/var/www/apps/conversion/current/tmp/scratch_6/reportmonzons.ppthttp://localhost/var/www/apps/conversion/current/tmp/scratch_6/reportmonzons.ppt
  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    5/21

    Programming Productivity

    refers to a variety of software development issues andmethodologies affecting the quantity and quality of codeproduced by an individual or team.

    Amount of code that can be created or maintained perprogrammer (often measured in source lines of code per day)

    Detecting and avoiding errors

    Software cost estimation (cost being a direct consequence ofproductivity)

    http://en.wikipedia.org/wiki/Source_lines_of_codehttp://en.wikipedia.org/wiki/Source_lines_of_code
  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    6/21

    Cyclomatic complexity

    Cyclomatic complexity (orconditional complexity)

    is a software metric (measurement). It wasdeveloped by Thomas J. McCabe, Sr. in 1976 and isused to indicate the complexity of a program. It

    directly measures the number of linearlyindependent paths through a program'ssource code.

    Cyclomatic complexity may also be applied toindividual functions, modules, methods orclasseswithin a program.

    http://en.wikipedia.org/wiki/Software_metrichttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Function_%28computer_science%29http://en.wikipedia.org/wiki/Modular_programminghttp://en.wikipedia.org/wiki/Method_%28computer_science%29http://en.wikipedia.org/wiki/Class_%28computer_science%29http://en.wikipedia.org/wiki/Class_%28computer_science%29http://en.wikipedia.org/wiki/Method_%28computer_science%29http://en.wikipedia.org/wiki/Modular_programminghttp://en.wikipedia.org/wiki/Function_%28computer_science%29http://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Software_metric
  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    7/21

    Two Major Types of SLOC

    Measures

    Physical SLOC (LOC)

    is a count of lines in the text of theprogram's source code includingcomment lines. Blank lines are alsoincluded unless the lines of code in asection consist of more than 25% blanklines. In this case blank lines in excessof 25% are not counted toward lines ofcode.

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    8/21

    Logical SLOC (LLOC)

    measure the number of"statements", but their specific

    definitions are tied to specific

    computer languages (one simple

    logical SLOC measure forC-like

    programming languages is the

    number of statement-terminating

    semicolons).

    http://en.wikipedia.org/wiki/C_(programming_language)http://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/C_(programming_language)
  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    9/21

    Example

    for (i = 0; i < 100; i += 1) printf("hello"); /* How many lines of code is this? */

    In this example we have:

    1 Physical Lines of Code (LOC)

    2 Logical Line of Code (LLOC) (forstatement and printfstatement)

    1 comment line

    http://en.wikipedia.org/wiki/For_loophttp://en.wikipedia.org/wiki/Printfhttp://en.wikipedia.org/wiki/Printfhttp://en.wikipedia.org/wiki/For_loop
  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    10/21

    /* Now how many lines of code is this? */for (i = 0; i < 100; i += 1)

    {

    printf("hello");}

    In this example we have:5 Physical Lines of Code (LOC):

    2 Logical Line of Code (LLOC):

    1 comment line:

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    11/21

    SLOC

    is particularly ineffective atcomparing programs written indifferent languages unless

    adjustment factors are applied tonormalize languages.

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    12/21

    C COBOL

    #include 000100 IDENTIFICATION DIVISIONS.

    main(void) 000200 PROGRAM-ID HELLOWORLD.

    { 000300

    printf("\nHello\n");} 000400*

    000500 ENVIRONMENT DIVISION.

    000600 CONFIGURATION SECTION.

    000700 SOURCE-COMPUTER. RM-COBOL.

    000800 OBJECT-COMPUTER. RM-COBOL.

    000900

    001000 DATA DIVISION.

    001100 FILE SECTION.

    001200

    100000 PROCEDURE DIVISION.

    100100

    100200 MAIN-LOGIC SECTION.

    100300 BEGIN.

    100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS.100500 DISPLAY "Hello world!" LINE 15 POSITION 10.

    100600 STOP RUN.

    100700 MAIN-LOGIC-EXITS.

    100800 EXIT.

    Lines of code: 4(excluding whitespace) Lines of code: 17 (excluding whitespace)

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    13/21

    Maintenance Tools and

    Techniques

    Software maintenance tools are programs used bysoftware engineers to increase their productivity forgathering data, detecting bugs and managingtheir software. Without these tools, it would be

    nearly impossible for these engineers to go throughthousands of lines of code to find errors ordetermine why a particular server went down.

    Software maintenance involves a number ofspecific techniques. One technique is static slicing,which is used to identify all the program code thatcan modify some variable

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    14/21

    Needs of Maintenance

    Maintenance is needed to ensure that the software continuesto satisfy user requirements. Maintenance must be performedin order to:

    Correct faults Improve the design

    Implement enhancements

    Interface with other systems

    Adapt programs so that different hardware, software, system

    features, and telecommunications facilities can be used

    Migrate legacy software

    Retire software

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    15/21

    The functionality of software maintenance

    tools include the following:

    1. Program understanding:

    This function can provide two types of programknowledge syntactical knowledge, and semanticknowledge.

    *sub-divided into two types: analysis-oriented tools, and code-oriented tools.

    2. Ripple effect analysis:

    aims to trace the extent of these secondaryeffects. This function should not only trace the side effect inthe program due to code modification, it also be able toanalyzeripple effects at a higher abstraction level.

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    16/21

    3. Software Retesting:

    This functions are not very different from the originalsoftware testing during the initial software developmentphase. Should incorporate knowledge gained in previoustesting as well as information provided by the ripple effectanalysis.

    4. Knowledge redocumenting:

    A clear and precise documentation of the modifiedsystem is crucial to software maintainability. This function helpsto update existing documents to ensure that all changes tothe software are properly reflected in this documentation.

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    17/21

    5. Information repository:

    Two types of information are important: history databasewhich provides a recorded history of the system modifications.,and semantic database which preserves the integrity andcurrency of the system characteristics.

    6. Display function:

    This provides the capabilities to display in textual andgraphical format of the program information as a result of the

    maintenance modification.

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    18/21

    The user will also be able to navigate or browse theexisting program structure using maintenance tools. The tool

    must have the capability to represent and examine data andprogram structure from different viewpoints.

    7.Tool interconnections:

    Considered important during tool evaluations. Tool

    interconnections affect how toll works in an organization

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    19/21

    Maintenance consists of four

    parts:1. Corrective maintenance:

    Reactive modification of a software product performedafter delivery to correct discovered problems. It deals with

    fixing bugs in the code. Deals of repair of faults and defectsfound.

    2. Adaptive maintenance:

    Modification of a software product performed after

    delivery to keep a software product usable in a changed orchanging environment. It deals with adapting the software tonew environments

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    20/21

    3. Perfective maintenance:

    Modification of a software product after delivery toimprove performance or maintainability. It deals with updatingthe software according to changes in user requirements.

    4. Preventive maintenance:

    Modification of a software product after delivery todetect and correct latent faults in the software product beforethey become effective faults. It deals with updating

    documentation and making the software more maintainable.

  • 7/31/2019 Briones-Ruales(Source Code Maintenance Tools)

    21/21

    Thank you

    for

    Listening