Program Comprehension1 Program Comprehension During Software Maintenance and Evolution IEEE Computer, August 1995 Von Mayrhauser, A. and Vans, A. M.

Slides:



Advertisements
Similar presentations
Verification and Validation
Advertisements

Lecture # 2 : Process Models
SSP Re-hosting System Development: CLBM Overview and Module Recognition SSP Team Department of ECE Stevens Institute of Technology Presented by Hongbing.
Managing Data Resources
Software Testing and Quality Assurance
SE curriculum in CC2001 made by IEEE and ACM: Overview and Ideas for Our Work Katerina Zdravkova Institute of Informatics
Knowledge Acquisitioning. Definition The transfer and transformation of potential problem solving expertise from some knowledge source to a program.
1 SYSTEM and MODULE DESIGN Elements and Definitions.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Requirements Analysis Concepts & Principles
1 Keeping Track: Coordinating Multiple Representations in Programming Pablo Romero, Benedict du Boulay & Rudi Lutz IDEAs Lab, Human Centred Technology.
Creating Architectural Descriptions. Outline Standardizing architectural descriptions: The IEEE has published, “Recommended Practice for Architectural.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 8 Slide 1 System models.
CS350/550 Software Engineering Lecture 1. Class Work The main part of the class is a practical software engineering project, in teams of 3-5 people There.
An Introduction to Software Visualization Dr. Jonathan I. Maletic Software DevelopMent Laboratory Department of Computer Science Kent State University.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation.
Verification and Validation
Domain-Specific Software Engineering Alex Adamec.
Semantic Web Technologies Lecture # 2 Faculty of Computer Science, IBA.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 1 Introduction to Software Engineering CEN 4010.
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation.
Chapter 2 The process Process, Methods, and Tools
*Graduate School of Engineering Science, Osaka University
Software Evolution and Maintenance (Chapter 8: Program Comprehension) © Tripathy & Naik 1 Software Evolution and Maintenance A Practitioner’s Approach.
1 IDI, NTNU Programvarekvalitet og prosessforbedring vår 2000, Forrest Shull et al., Univ. Maryland and Reidar Conradi, NTNU (p.t. Univ.
TOPIC R Software Maintenance, Evolution, Program Comprehension, and Reverse Engineering SEG4110 Advanced Software Design and Reengineering.
Dr. Tom WayCSC Code Reviews & Inspections CSC 4700 Software Engineering.
SLB /04/07 Thinking and Communicating “The Spiritual Life is Thinking!” (R.B. Thieme, Jr.)
INT-Evry (Masters IT– Soft Eng)IntegrationTesting.1 (OO) Integration Testing What: Integration testing is a phase of software testing in which.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Cognitive Architectures: A Way Forward for the Psychology of Programming Michael Hansen Ph.D Student in Comp/Cog Sci CREST / Percepts & Concepts Lab Indiana.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
Prepared By Ms.R.K.Dharme Head Computer Department.
1 Systems Analysis and Design in a Changing World, Thursday, January 18, 2007.
1 Introduction to Software Engineering Lecture 1.
1 Asking and Answering Questions during a Programming Change Task, By Jonathan Sillito, Member, IEEE, Gail C. Murphy, Member, IEEE, and Kris De Volder.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Systems Analysis and Design in a Changing World, Fourth Edition
Chapter 12: Software Inspection Omar Meqdadi SE 3860 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Human Computer Interaction
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Experimentation in Computer Science (Part 2). Experimentation in Software Engineering --- Outline  Empirical Strategies  Measurement  Experiment Process.
Introduction The design, development and maintenance of concurrent software are difficult tasks. Truly effective support methodologies have yet to be developed.
Formal Specification: a Roadmap Axel van Lamsweerde published on ICSE (International Conference on Software Engineering) Jing Ai 10/28/2003.
CPSC 871 John D. McGregor Module 8 Session 1 Testing.
1 Lecture 15: Chapter 19 Testing Object-Oriented Applications Slide Set to accompany Software Engineering: A Practitioner’s Approach, 7/e by Roger S. Pressman.
Development of Expertise. Expertise We are very good (perhaps even expert) at many things: - driving - reading - writing - talking What are some other.
11 Software Design CSCU 411 Software Engineering.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 4 Slide 1 Software Processes.
21/1/ Analysis - Model of real-world situation - What ? System Design - Overall architecture (sub-systems) Object Design - Refinement of Design.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
1 Software Testing and Quality Assurance Lecture 17 - Test Analysis & Design Models (Chapter 4, A Practical Guide to Testing Object-Oriented Software)
OBJECT-ORIENTED TESTING. TESTING OOA AND OOD MODELS Analysis and design models cannot be tested in the conventional sense. However, formal technical reviews.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Introduction to Software Engineering 1. Software Engineering Failures – Complexity – Change 2. What is Software Engineering? – Using engineering approaches.
DESIGN PROCESS AND CONCEPTS. Design process s/w design is an iterative process through which requirements are translated into a “blueprint” for constructing.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
CPSC 372 John D. McGregor Module 8 Session 1 Testing.
Program Comprehension Program Understanding Behavior During Debugging Of Large Scale Software Anneliese von Mayrhauser (Andrews) and A. Marie Vans Rizal.
John D. McGregor Session 9 Testing Vocabulary
CSC 480 Software Engineering
Introduction to Design Patterns
Program comprehension during Software maintenance and evolution Armeliese von Mayrhauser , A. Marie Vans Colorado State University Summary By- Fardina.
Software Engineering (CSI 321)
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Simulation-driven Enterprise Modelling: WHY ?
Presentation transcript:

Program Comprehension1 Program Comprehension During Software Maintenance and Evolution IEEE Computer, August 1995 Von Mayrhauser, A. and Vans, A. M.

Program Comprehension2 Outline l Overview l Mental models l Cognitive models l Tools l Research topics

Program Comprehension3 Program comprehension l Program comprehension is the study of how software engineers understand programs. l Program comprehension is needed for: Debugging Code inspection Test case design Re-documentation Design recovery Code revisions

Program Comprehension4 Program comprehension process l Involves the use of existing knowledge to acquire new knowledge about a program. l Existing knowledge: Programming languages Computing environment Programming principles Architectural models Possible algorithms and solution approaches Domain-specific information Any previous knowledge about the code l New knowledge: Code functionality Architecture Algorithm implementation details Control flow Data flow

Program Comprehension5 Comprehension techniques l Reading by step-wise abstraction Determine the function of critical subroutines, work through the program hierarchy until the function of the program is determined. l Checklist-based reading Readers are given a checklist to focus their attention on particular issues within the document. Different readers were given different checklists, therefore each reader would concentrate on different aspects of the document. l Defect-based reading Defects are categorized and characterized (e.g., data type inconsistency, incorrect functionality, missing functionality, etc.) A set of steps (a scenario) is then developed for each defect class to guide the reader to find those defects. l Perspective-based reading Similar to defect-based reading, but instead of different defect classes, readers have different roles (tester, designer and user) to guide them in reading.

Program Comprehension6 Reading by step-wise abstraction l Determine the function of critical subroutines, works through the program hierarchy until the function of the program is determined. l A bottom-up strategy – map the code to suggested problem domain activity. l Empirical validation (Basili & Selby ’87) The technique detects more software faults, and has a higher fault detection rate than functional or structural testing.

Program Comprehension7 Defect-based reading l Defects are categorized and characterized, a set of questions developed for each defect class to guide the reader. l Experiments conducted at the University of Maryland (Porter, Basili and Votta, ’95) suggest that defect-based reading is more effective to ad hoc reading.

Program Comprehension8 Perspective-based reading l Similar to defect-based reading, but instead of defects readers have different roles (tester, designer and user) to guide them in reading. l Experiments conducted at the University of Maryland (Laitenberger ’95) suggest that defect- based reading is more effective to ad hoc reading. l Perspective-based reading has been applied to the inspection of requirements documents.

Program Comprehension9 Sources of variation l Aside from the issue of how comprehension occurs, comprehension performance and effectiveness are affected by many factors: Maintainer characteristics Program characteristics Task characteristics

Program Comprehension10 Maintainer characteristics l Familiarity with code base l Application domain knowledge l Programming language knowledge l Programming expertise l Tool expertise l Individual differences

Program Comprehension11 Program characteristics l Application domain l Programming domain l Quality of problem to be understood l Program size and complexity l Availability and accuracy of documentation

Program Comprehension12 Task characteristics l Task type Experimental: recall, modification Perfective, corrective, adaptive, reuse, extension. l Task size and complexity l Time constraints l Environmental factors

Program Comprehension13 Outline l Overview l Mental models l Cognitive models l Tools l Research topics

Program Comprehension14 Models l Mental models Internal working representation of the software under consideration. l Cognitive models Theories of the processes by which software engineers arrive at a mental model. Program Mental Model Cognitive Model

Program Comprehension15 Mental models l Static elements Text structure knowledge Microstructure Chunks (macrostructure) Plans (objects) Hypotheses l Dynamic elements Strategies (chunking and cross-referencing) l Supporting elements Beacons Rules of discourse

Program Comprehension16 Text structure l The program text and its structure Control structure: iterations, sequences, conditional constructs Variable definitions Calling hierarchies Parameter definitions l Microstructure – actual program statements and their relationships.

Program Comprehension17 Chunks l Contain various levels of text structure abstractions. l Also called macrostructure. l Can be identified by a descriptive label. l Can be composed into higher level chunks.

Program Comprehension18 Plans (objects) l Knowledge elements for developing and validating expectations, interpretations, and inferences. l Include causal knowledge about information flow and relationships between parts of a program. l Programming plans Based on programming concepts. Low level: iteration and conditional code segments. Intermediate level: searching, sorting, summing algorithms; linked lists and trees. High level l Domain plans All knowledge about the problem area. Examples: problem domain objects, system environment, domain-specific solutions and architectures.

Program Comprehension19 Hypotheses l Conjectures that are results of comprehension activities that can take seconds or minutes to occur. l Three types: Why – hypothesize the purpose/rationale of a function of design choice. How – hypothesize the method for accomplishing a certain goal. What – hypothesize classification. l Hypotheses are drivers of cognition. They help to define the direction of further investigation. l Code cognition formulates hypotheses, checks them whether they are true or false, and revises them when necessary. l Hypotheses fail for several reasons: Can’t find code to support a hypothesis. Confusion due to one piece of code satisfying different hypothesis. Code cannot be explained.

Program Comprehension20 Supporting elements l Beacons Cues that index into existing knowledge. A swap routine can be a beacon for a sorting function. Experienced programmers recognize beacons much faster than novice programmers. Used commonly in top-down comprehension. l Rules of discourse Rules that specify programming conventions. Examples: coding standards, algorithm implementations, expected use of data structures.

Program Comprehension21 Mental models – dynamic elements l Strategies Sequences of actions that lead to a particular goal. l Actions Classify programmer activities implcitly and explicitly during a maintenance task. l Episodes Sequences of actions. l Processes Aggregations of episodes.

Program Comprehension22 Strategies l Guide the sequence of actions while following a plan to reach a goal. l Match programming plans to code. Shallow reasoning – do not perform in-depth analysis; stop upon recognition of familiar idioms and programming plans. Deep reasoning – perform detailed analysis. l Mechanisms for understanding Chunking Cross-referencing

Program Comprehension23 Chunking l Creates new, higher-level abstraction structures l Labels replace the detail of the lower level chunks.

Program Comprehension24 Cross-referencing l Map program parts to functional descriptions temp = a; a = b; b = temp; for (i=0; i<size; i++) if (array[i]==target) return true; swap sequential search

Program Comprehension25 Outline l Overview l Mental models l Cognitive models l Tools l Research topics

Program Comprehension26 Cognitive models l Letovsky l Shneiderman and Mayer l Brooks l Soloway, Adelson and Ehrlich l Pennington l Mayrhauser and Vans (Integrated)

Program Comprehension27 Letovsky model Prior knowledge Mental model: Specification layer Implementation layer Mapping Unresolved mappings Opportunistic assimilation process (top-down or bottom-up, as needed)

Program Comprehension28 Shneiderman model e.g., Programming languages e.g., Programming experience Programs are encoded into chunks Chunks are collected into a layered internal representation Developed for both design and comprehension activities.

Program Comprehension29 Brooks model Bridges the gap between problem domain & program domain Relate objects between different domains & representations Top-down process: hypotheses generated and successively refined from knowledge (triangles).

Program Comprehension30 Soloway model Also known as domain model. Developers familiar with domain can understand the code in top-down process. Strategic plans: global strategy used Tactical plans: local strategies Implementation plans: code fragments that implement tactical plans Help decompose goals into plans. Top-down decomposition of goals into plans and into lower level plans.

Program Comprehension31 Pennington model Use beacons Chunking Use beacons

Program Comprehension32 Integrated model

Program Comprehension33 Distributed cognition l Traditional cognitive models deal the cognitive processes inside one person’s brain. l On real projects, software developers: Work in teams Can ask people questions Can surf the web for answers l How do these affect the cognitive process?

Program Comprehension34 Outline l Overview l Mental models l Cognitive models l Tools l Research topics

Program Comprehension35 Generic tool pipeline

Program Comprehension36 Code browser example: SeeSoft

Program Comprehension37 Outline l Overview l Mental models l Cognitive models l Tools l Research topics

Program Comprehension38 Research topics l Empirical studies of cognitive models Larger systems (multiple programmers) Modern architectures Borrow techniques from psychology Use of recognition and recall as dependent variables l Tool support for comprehension tasks Information foraging Automated suggestions for program investigation Text mining application to code exploration Source code analysis Support for newer languages

Program Comprehension39 Additional references l Susan Elliott Sim. Research in Program Comprehension (UC Irvine lecture notes). l Jonathan Maletic. Program Comprehension & The Psychology of Programming (Kent State University lecture notes). l Richard Upchurch. Program Comprehension. From Software Process Resource Collection. UMass – Dartmouth, sion.html. sion.html