SlideShare a Scribd company logo
1 of 34
Dependency Finder




     Tutorial
for Dependency Finder

   by Jean Tessier,
     March 30, 2004




                           1
Dependency Finder



   What are dependencies?
    Functioning of A requires the presence of B.



            A                                          B
source               outbound           inbound                  target
dependent                                                   dependable



 UML:       C1                                         C2


            P1                                         P2
                                                   2
Dependency Finder



Why Should I Care?
• Improve compilation time
  – Smaller parts are easier on the compiler
• Verify encapsulation
  – Validate design assumptions
• Indicator of complexity
• Assist with maintenance
  – Impact of change

                                      3
Dependency Finder



Where Do They Come From?
           • Class-to-Class
P1    P2
             – Class inheritance via
               extends keyword
C1    C2
             – Interface realization via
F1    F2       implements keyword
             – From fields and methods
               of the class


                                 4
Dependency Finder



Where Do They Come From?
           • Feature-to-Class
P1    P2
             – Field type
C1    C2     – Method parameter type
             – Exception types in
F1    F2       throws clause
             – Local variable type



                                 5
Dependency Finder



Where Do They Come From?
           • Feature-to-Feature
P1    P2
             – Field access
C1    C2     – Method call
             – Method cannot depend on
F1    F2       itself, as in recursive calls




                                 6
Dependency Finder



No Dependency on Self
           • Does not add information
  P        • Compile time
             – Class is unit of compilation
  C
           • Runtime
  F          – Class is unit of loading
           • Maintenance
             – Already editing class or
               feature

                                  7
Dependency Finder



Explicit Dependencies
             • Source code
P1     P2      – static final constants

C1     C2      – Needed for compilation
             • Compiled code
F1     F2
               – Fully qualified names
               – No 3rd party JARs
               – Needed for runtime

                                  8
Dependency Finder



Implicit Dependencies
            • Derived from explicit
P1     P2
            • Minimize
C1     C2      – Reduce space
               – Augment time
F1     F2
            • Maximize
               – Augment space
               – Reduce time

                                  9
Dependency Finder



Implicit Dependencies

  classes of        features of            self
  a package           a class

       P                      P               P

  C1       C2                 C               C

  F1       F2       F1              F2        F



                                         10
Dependency Finder



Package Instability (from Robert C. Martin)
        Number of classes outside the package that
   Ca   depend upon classes inside the package.
        Number of classes outside the package that
  Ce    classes inside the package depend upon.

                          Ce
          I =           Ca + C e
• High Ce or low Ca means hard to change
• If Ca and Ce are 0, then I = 0
• Depend on packages with lower I than you
                                            11
Dependency Finder



     A vs I Graph (from Robert C. Martin)
1
               uselessness      • Depend on abstract
                                  packages
           A
           +




A                               • Concrete packages
               I–
                   1
                   =




                                  should have no
                    0




    pain                          dependents
0              I         1




                                                 12
Dependency Finder



Are Dependencies Transitive?
    A                  B                      C

             ?          ?            ?


• It depends! 
• Case-by-case, not automatic
• Is part of B that A depends on
  impacted by changes in C?

                                         13
Dependency Finder



Transitive Closure




          callers                  dependencies
      dependents
                                             14
Dependency Finder



      Transitive Closure
+ 2         1        0            0       1   2   +




                                         15
Dependency Finder



Package-to-Package Example




        Default configuration
    Complete package-level graph
                                  16
Dependency Finder



  Package-to-Package Example




             Excluding /java/
Don’t list dependencies on anything with java
                                      17
Dependency Finder



  Why Do I See java <-- jeantessier?
                                     Scope
   P1      P2
                                    Factory
                                                Filter
   C1      C2           P1            P2        Factory

   F1      F2           C1            C2       P1    P2


                        F1            F2       C1    C2
original
                                copy           F1    F2

                                              18
Dependency Finder



Package-to-Package Example




         Excluding /^java/
  Don’t list dependencies on java.*
                                  19
Dependency Finder



Package-to-Package Example




        Including /^com.jean/
 Only list dependencies with com.jean*
                                   20
Dependency Finder



Package-to-Package Example




   Including /^com.jean/,         /^test/

 Only list with com.jean* and test.*
                                    21
Dependency Finder



Package-to-Package Example




         Excluding /^java/
    Don’t list packages in java.*
                                  22
Dependency Finder



Package-to-Package Example




   Including /com.jean/,           /^test/

    Only list test.* and com.jean*
                                     23
Dependency Finder



Feature-to-Feature Example




      Including /Node.Accept/
   Calls to *Node.Accept() methods
                                  24
Dependency Finder



  Feature-to-Feature Example




        Including /Node.Accept(/
Calls to *Node.Accept() methods, less output
                                      25
Dependency Finder



Feature-to-Feature Example




      Including /(Node).1(/
     Calls to constructors of Node
                                   26
Dependency Finder



  Feature-to-Feature Example




        Including /(w*Node).1(/
Calls to constructors of classes ending in Node
                                       27
Dependency Finder



Feature-to-Feature Example




      Including /NodeFactory/
   Calls to methods of NodeFactory
                                  28
Dependency Finder



Transitive Closure Example




    Shows Accept*() methods
                                  29
Dependency Finder



Transitive Closure Example




     Direct callers of Accept*()
                                  30
Dependency Finder



Transitive Closure Example




 Second degree callers of Accept*()
                                  31
Dependency Finder



Transitive Closure Example




Everything reachable from Accept*()
                                  32
Dependency Finder



Perl Regular Expressions
• [A-Z] Capitals
• w    Alphanumeric [A-Za-z0-9_]
• W    Non-alpha [^A-Za-z0-9_]
• w+   At least one alphanumeric
• s    Space, including tab and eol
• s*   Zero or more white space
• .    ‘.’ as opposed to any character
                                   33
Dependency Finder



The End



depfind.sourceforge.net



                              34

More Related Content

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Dependency Finder Tutorial