6 Concepts and concept location © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 61 Initiation Concept Location Impact Analysis Prefactoring.

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Search in Source Code Based on Identifying Popular Fragments Eduard Kuric and Mária Bieliková Faculty of Informatics and Information.
Programming Paradigms and languages
A Blended Curriculum for Bermuda Public Primary Schools
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Ch 3: Unified Process CSCI 4320: Software Engineering.
10 Software Engineering Foundations of Computer Science ã Cengage Learning.
© 2010 Bennett, McRobb and Farmer1 Use Case Description Supplementary material to support Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Alternate Software Development Methodologies
© 2012 Václav Rajlich Software Engineering: The Current Practice Ch Initial development First stage in software lifespan Makes the fundamental.
Object-Oriented Analysis and Design
10 Verification All changes in the code have to be verified –refactoring –actualization Essential difficulties –programmers very often produce imperfect.
Introduction To System Analysis and Design
Chapter 6: Design of Expert Systems
NaLIX: A Generic Natural Language Search Environment for XML Data Presented by: Erik Mathisen 02/12/2008.
Documenting Requirements using Use Case Diagrams
Automatically Extracting and Verifying Design Patterns in Java Code James Norris Ruchika Agrawal Computer Science Department Stanford University {jcn,
Creating Architectural Descriptions. Outline Standardizing architectural descriptions: The IEEE has published, “Recommended Practice for Architectural.
7 Impact analysis (IA) Determines the strategy and impact of change Classes identified in concept location are the initial impact set Class dependencies.
5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing.
Design, Implementation and Maintenance
BIS310: Week 7 BIS310: Structured Analysis and Design Data Modeling and Database Design.
The chapter will address the following questions:
Objects What are Objects Observations
OOSE 01/17 Institute of Computer Science and Information Engineering, National Cheng Kung University Member:Q 薛弘志 P 蔡文豪 F 周詩御.
18 Example of SIP Solo Iteration Process(SIP) Software begins by a very simple initial development Functionality is added one step at a time by software.
Introduction To System Analysis and design
Chapter 7 Software Engineering Objectives Understand the software life cycle. Describe the development process models.. Understand the concept of modularity.
UML Tools ● UML is a language, not a tool ● UML tools make use of UML possible ● Choice of tools, for individual or group use, has a large affect on acceptance.
S/W Project Management Software Process Models. Objectives To understand  Software process and process models, including the main characteristics of.
CMSC 345 Fall 2000 Unit Testing. The testing process.
CSE 303 – Software Design and Architecture
9 Refactoring Refactoring changes the software structure but does not change the functionality of the program –important activity during evolution Refactoring.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
Team Skill 6: Building the Right System From Use Cases to Implementation (25)
Introduction to Interactive Media The Interactive Media Development Process.
Prepared by: Sanaz Helmi Hoda Akbari Zahra Ahmadi Sharif University of Tech. Summer 2006 An Introduction to.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Introduction To System Analysis and Design
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
Hyper/J and Concern Manipulation Environment. The need for AOSD tools and development environment AOSD requires a variety of tools Life cycle – support.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
Professor Michael J. Losacco CIS 1110 – Using Computers Database Management Chapter 9.
8 Actualization Programmers implement the new functionality –according to change request The process of actualization varies –depends on the size of the.
© 2012 Václav Rajlich Software Engineering: The Current Practice Ch Software models Software is complex –often more than what people can handle –not.
UML Use Case Diagramming Guidelines. What is UML? The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing,
CSSE 375 Software Construction and Evolution: More SCM, and a loop back to Feathers! Shawn and Steve Left – On big systems, SCM is a well-defined process.
IFS310: Module 6 3/1/2007 Data Modeling and Entity-Relationship Diagrams.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
The Software Development Process
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
 Programming - the process of creating computer programs.
Design and Planning Or: What’s the next thing we should do for our project?
Software Quality Assurance and Testing Fazal Rehman Shamil.
© 2012 Václav Rajlich Software Engineering: The Current Practice Ch Conclusion of software change The last phase of software change The activities.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
1 Presentation Methodology Summary B. Golden. 2 Introduction Why use visualizations?  To facilitate user comprehension  To convey complexity and intricacy.
Winter 2007SEG2101 Chapter 121 Chapter 12 Verification and Validation.
Object Oriented Analysis & Design By Rashid Mahmood.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
6 Concepts and concept location © 2012 by Václav Rajlich1 Initiation Concept Location Impact Analysis Prefactoring Actualization Postfactoring Conclusion.
1 Process activities. 2 Software specification Software design and implementation Software validation Software evolution.
Complexity Time: 2 Hours.
University of Houston-Clear Lake
COSC 4506/ITEC 3506 Software Engineering
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
7 Impact analysis (IA) Determines the strategy and impact of change
Presentation transcript:

6 Concepts and concept location © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 61 Initiation Concept Location Impact Analysis Prefactoring Actualization Postfactoring Conclusion VERIFICATIONVERIFICATION

Role of concept location Concept location finds code snippet where a change is to be made Change requests are most often formulated in terms of domain concepts –Example: “Correct error that arises when trying to paste a text” –the programmer must find in the code the locations where concept “paste” is located –this is the start of the change © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 62

Partial comprehension of a code Large programs cannot be completely comprehended programmers seek the minimum essential understanding for the particular software task they use an as-needed strategy they attempt to understand how certain specific concepts are reflected in the code Analogy: visiting a large city © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 63

Search in the unknown parts of system © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 64

Concept triangle © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 65

Spelling corner (Merriam-Webster) Intension \in-’ten(t)-shən\ –synonym CONNOTATION the suggesting of a meaning by a word apart from the thing it explicitly names or describes b: something suggested by a word or thing — W. R. Inge> an essential property or group of properties of a thing named by a term in logic Intention \in-’ten(t)-shən\ –synonyms INTENT, PURPOSE, DESIGN, AIM, END, OBJECT, OBJECTIVE, GOAL mean what one intends to accomplish or attain. INTENTION implies little more than what one has in mind to do or bring about... 6© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 6

7 Dog as an example 7 > Dog / Pes / Hund > Hairy animal with teeth… Buck (in “Call of the wild” by Jack London) Lassie Fido

Concept location Concept extensions are implemented as code fragments variables, classes, methods, or other Programmers finds these code fragments easy in small programs or in the programs that the programmer knows well hard in large programs or programs that the programmer does not know Watchmaker anecdote © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 68

Formulating a query Extract the set of concepts used in the change request Delete the concepts intended for the communication with the programmers Delete the concepts that are unlikely to be implemented in the code concepts related to the things that are outside of the scope of the program concepts that are to be implemented in the future. Rank the remaining concepts by the likelihood that they can be easily located © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 69

Example Point of Sale system Change request is “Implement a credit card payment” Identify the concepts “Implement” “Credit card” “Payment” © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 610

Example Point of Sale system Change request is “Implement a credit card payment” Identify the concepts “Implement” … communication with programmer “Credit card” “Payment” © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 611

Example Point of Sale system Change request is “Implement a credit card payment” Identify the concepts “Implement” … communication with programmer “Credit card” … to be implemented, not in the old code “Payment” © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 612

Example Point of Sale system Change request is “Implement a credit card payment” Identify the concepts “Implement” … communication with programmer “Credit card” … to be implemented, not in the old code “Payment” !!! Significant concept, find it in the code 13© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 6

Recognize concept Reading code –Comments and identifiers –Characteristic algorithm (plan) Small modification –Change the code slightly, execute –Throw away this modification! Return the code to the original state! © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 614

Concept location methodologies Human knowledge Traceability tools Dynamic search (execution traces) Static search –dependency search –"grep" (pattern matching) –information retrieval techniques © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 615

GREP Search Technique GREP is an acronym for "global regular expression print". –GREP prints out the lines that contain a match for a regular expression. –Programmer iteratively formulates search query and then investigates the results. –If the results are too big to review, programmer either performs further search within these results or reformulates the search query. © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 616

Example: Art of Illusion 3D modeling studio, written in Java More than 600 classes, 100,838 LOC. Implement a zooming control –currently, the only way to zoom is to enter the zooming value into the specific text box a value of the zoom has to be typed in by the user the default value is 100%. –implement zooming control that uses arrow keys © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 617

Art of Illusion © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 618

GREP example First search: “zoom” –The query produced irrelevant 6 lines Second search: “scale” –returned in 1,544 lines, too large for inspection. Third search: “100” –default scaling value is 100 –search within the results of the previous search –returned 4 lines from the ViewerCanvas.java file. Inspection –one of the lines is the location © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 619

Dependency Search Technique Uses Class Dependency Graphs (CDG) –extracted form the existing code Local functionality –consists of concepts that are actually implemented in the module and are not delegated to others. Composite functionality –as the complete functionality of a module combined with all its supporting modules. Determined by reading code and documentation © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 620

Functionalities of component X Concept A Concept B Component X Local responsibility Composite responsibility … © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 621

Concept location by dependency search © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 622

Progress of the search © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 623

Dependency search part 1 Start at the ModelingApp class –concept not contained within its local responsibility The next step: inspect LayoutWindow –responsible for constructing the main AOI window –composite responsibility contains the concept, but the local responsibility does not. There were clues to search ValueField –it implements the text box. –concept is not present in the composite responsibility –backtrack to the LayoutWindow class © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 624

Dependency search part 2 The SceneViewer class –several functions are responsible for responding to events from the user –function updateImage() was responsible for repainting the screen –we determined that the composite responsibility of this function contained the concept. –local responsibility of SceneViewer still did not contain the concept ViewerCanvas class –contains the concept © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 625

Comparison of the Techniques The grep-based –depends on the use of naming conventions –independent of class structure GREP tools provide just the list of search results –suitable for explicit concepts only The static dependency search technique –utilizes the class structure –needs correct understanding of composite and local functionality –suitable for both explicit and implicit concepts © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 626

Example Violet Violet –Open source UML editor Supports drawing UML Diagrams –Class diagram, Sequence diagram, State diagram, Object diagram, Use case diagram 60 classes and 10,000 lines of code – © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 627

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 628 GUI of Violet

Change Request Record the author for each figure This change will make Violet more versatile –support for cooperative work –the author created a figure author knows the semantics of the figure Name of concept: “author” –implicit concept extension the extension is not present in the current code –belongs to the set of the figure properties © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 629

30 Status of components (marks) BlankThe class was never inspected and is not scheduled for an inspection. PropagatingThe programmers inspected the class and found that its composite responsibility contains the concept UnchangedThe programmers inspected the class and found that its composite responsibility does not contain the concept NextThe class is scheduled for inspection © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 6

31 Locating figure properties: Start UMLEditor SequenceDiagram Graph UseCaseDiagram Graph ClassDiagram Graph ObjectDiagram Graph StateDiagram Graph ClassRelationship Edge PackageNodeClassNodeInterfaceNodeNoteNode MultiLineStringRectangularNodeAbstractNode

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 632 Classes to inspect UMLEditor SequenceDiagram Graph UseCaseDiagram Graph ClassDiagram Graph ObjectDiagram Graph StateDiagram Graph ClassRelationship Edge PackageNodeClassNodeInterfaceNodeNoteNode MultiLineStringRectangularNodeAbstractNode

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 633 Most likely supplier UMLEditor SequenceDiagram Graph UseCaseDiagram Graph ClassDiagram Graph ObjectDiagram Graph StateDiagram Graph ClassRelationship Edge PackageNodeClassNodeInterfaceNodeNoteNode MultiLineStringRectangularNodeAbstractNode

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 634 Next classes to inspect UMLEditor SequenceDiagram Graph UseCaseDiagram Graph ClassDiagram Graph ObjectDiagram Graph StateDiagram Graph ClassRelationship Edge PackageNodeClassNodeInterfaceNodeNoteNode MultiLineStringRectangularNodeAbstractNode

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 635 Wrong way UMLEditor SequenceDiagram Graph UseCaseDiagram Graph ClassDiagram Graph ObjectDiagram Graph StateDiagram Graph ClassRelationship Edge PackageNodeClassNodeInterfaceNodeNoteNode MultiLineStringRectangularNodeAbstractNode

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 636 Backtrack UMLEditor SequenceDiagram Graph UseCaseDiagram Graph ClassDiagram Graph ObjectDiagram Graph StateDiagram Graph ClassRelationship Edge PackageNodeClassNodeInterfaceNodeNoteNode MultiLineStringRectangularNodeAbstractNode

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 637 Concept location found UMLEditor SequenceDiagram Graph UseCaseDiagram Graph ClassDiagram Graph ObjectDiagram Graph StateDiagram Graph ClassRelationship Edge PackageNodeClassNodeInterfaceNodeNoteNode MultiLineStringRectangularNodeAbstractNode

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 638 Possible extension of the search UMLEditor SequenceDiagram Graph UseCaseDiagram Graph ClassDiagram Graph ObjectDiagram Graph StateDiagram Graph ClassRelationship Edge PackageNodeClassNodeInterfaceNodeNoteNode MultiLineStringRectangularNodeAbstractNode

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 639 Another location found UMLEditor SequenceDiagram Graph UseCaseDiagram Graph ClassDiagram Graph ObjectDiagram Graph StateDiagram Graph ClassRelationship Edge PackageNodeClassNodeInterfaceNodeNoteNode RectangularNodeAbstractNodeMultiLineString

Interactive tool for concept location © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 6 40

Example 2: Eclipse 3.3 Eclipse – Integrated Development Environment for Java 15,479 classes, 156,334 functions Change request: BugID *: [Actions] When rename a file in one project’s navigator, the other selected file’s name is renamed * © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 641

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch Dependency search in Eclipse

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch Dependency search in Eclipse FrameworkCommandProvider MSG NLS

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch Dependency search in Eclipse

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch Dependency search in Eclipse

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch Dependency search in Eclipse

Results Main class: Launcher Minimum possible number of classes visited = 4 Maximum number of classes to be visited =1076 ( ) Developers have to use heuristics or intuition when there are too many suppliers © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 6 47

Concept location by grep Classical technique for concept location –based on pattern matching Programmer formulates a query –based on concept name(s) Grep searches the files –finds corresponding lines of code (“hits”) –programmer investigates the hits If a search fails, new query is tried –programmer learns from failed search © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 648

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 649 Example: “Anchors” bug in Mozilla* Change request –Anchors in s are broken (Clicking Anchor doesn't go to target in ) Initial knowledge *M. Petrenko, V. Rajlich, R. Vanciu, “Partial Domain Comprehension in Software Evolution and Maintenance”, ICPC 2008, HTML document HTML fragment Anchor typeOf partOf Targets

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 650 Knowledge after learning Result of repeated search –Programmer learns from the searches “mailbox: //" URI propertyOf partOf Winning grep query: mailbox: // HTML document HTML fragment Anchor typeOf partOf Targets