Source Code Inspection and Software Reuse - PowerPoint PPT Presentation

Loading...

PPT – Source Code Inspection and Software Reuse PowerPoint presentation | free to download - id: 5b6670-MGY3Z



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Source Code Inspection and Software Reuse

Description:

Source Code Inspection and Software Reuse Chapter 7 Digging into source code Coder To Developer - Mike Gunderloy Respected Professor: Dr. James Fawcett – PowerPoint PPT presentation

Number of Views:86
Avg rating:3.0/5.0
Slides: 31
Provided by: lcs3SyrEd
Learn more at: http://lcs3.syr.edu
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Source Code Inspection and Software Reuse


1
Source Code Inspection and Software Reuse
  • Chapter 7 Digging into source code
  • Coder To Developer - Mike Gunderloy
  • Respected Professor Dr. James Fawcett
  • Presented By Ghanashyam N

2
Digging Into Source Code
  • Looking more deeply at available code can clarify
    several details that are not immediately evident
    regarding this codes functioning
  • Code inspection helps us use existing code
    efficiently
  • Seeing how someone else solved a particular
    problem can be very helpful in producing more
    elegant and efficient code

3
.NET Fundamentals
  • All .NET code is executed by the CLR
  • Each of the .NET language compilers (C, VB .NET,
    Managed C etc.) convert source code into MSIL
    (and Metadata)
  • CLR understands only MSIL code and knows nothing
    about the .NET language that was used to generate
    this MSIL code

4
.NET Code Is Open
  • There are several utilities (Ildasm, .NET
    Reflector etc.) that allow you to work on MSIL
    code directly
  • Thus it is possible to find out quite a bit about
    .NET code for a library or an application even if
    its source code is not available

5
.NET Code Is Open
  • All the code for .NET FCL is present in the form
    of MSIL (and Metadata) on any machine that has
    .NET installed
  • Thus it is possible to look more closely at the
    implementation of the .NET FCL
  • Looking at code for the .NET FCL can prove
    extremely useful especially when the
    documentation for a certain FCL class or method
    is obscure

6
Using Ildasm
  • The .NET Framework SDK comes with a tool named
    Ildasm that allows you to work directly with MSIL
    code
  • It displays MSIL code in a somewhat human
    readable format
  • Ildasms output cannot be easily deciphered even
    though it is much more readable than MSIL itself

7
Using Ildasm
  • Ildasm
  • Start Menu ? Programs ? Microsoft Visual Studio
    .NET 2003 ? Visual Studio .NET Tools ? Visual
    Studio .NET 2003 Command Prompt
  • Type ildasm on command prompt and press enter

8
(No Transcript)
9
(No Transcript)
10
(No Transcript)
11
Using .NET Reflector
  • .NET Reflector is available at
  • http//www.aisto.com/roeder/dotnet
  • It is much easier to use than Ildasm since it
    displays the source code that was used to
    generate a supplied .NET assembly
  • It also has many useful features like
    decompilation to either C or VB .NET and display
    of call trees for any selected method

12
(No Transcript)
13
(No Transcript)
14
(No Transcript)
15
(No Transcript)
16
(No Transcript)
17
(No Transcript)
18
Reflection Obfuscation
  • MSIL, Metadata and Reflection make it possible to
    do a deep analysis of any .NET application or
    library, even without source code
  • Obfuscation aims at protecting intellectual
    property by taking source code and automatically
    changing it to make it difficult to understand
  • Obfuscators typically change class names, member
    names etc. in the source code to make it very
    difficult to decipher the assembly generated
    using this code

19
Some Obfuscators
  • Demanor for .NET
  • http//www.wiseowl.com/products/Products.aspx
  • Salamander
  • http//www.remotesoft.com/salamander/obfuscator.h
    tml
  • Dotfuscator
  • http//www.preemptive.com/dotfuscator/index.html
  • Species .NET
  • http//www.9rays.net/cgi-bin/components.cgi

20
Experimenting With Code
  • There are times when you need to actually run the
    code to gain a complete understanding of its
    functioning
  • But writing a complete VS .NET solution to test
    the behavior of a simple component is a lot of
    work

21
Experimenting With Code
  • Snippet Compiler
  • http//www.sliver.com/dotnet/SnippetCompiler/
  • An IDE that allows you to write code to exercise
    some small piece of code with minimal overhead
  • Supports C and VB .NET
  • Supports Winforms and ASP .NET
  • Modest set of features
  • Gets code up and running quickly

22
(No Transcript)
23
Software Reuse
  • Try to avoid reinventing the wheel
  • Try and find code that you dont have to write
  • There is an astonishing amount of free,
    high-quality, reusable code out there

24
Software Reuse
  • Make full use of the .NET FCL
  • Code for most of the common programming tasks
    already exists in the FCL
  • Hashtables, queues etc. System.Collections
  • Event log, performance counters
    System.Diagnostics
  • WMI System.Management
  • XML System.XML
  • Sending SMTP mail System.Web.Mail
  • Reqular Expressions System.Text.RegularExpressio
    ns

25
Software Reuse
  • Some Libraries
  • SQLXML Library
  • http//www.msdn.microsoft.com/sqlxml/
  • Add-on XML functionality for Microsoft SQL
    Server 2003
  • WSE (Web Services Enhancements)
  • http//www.msdn.microsoft.com/webservices/buildin
    g/wse/default.aspx
  • Set of implementations of web services
    specifications such as WS-Security, WS-Routing,
    WS-Referral etc.

26
Software Reuse
  • Some Libraries
  • Logidex .NET Library
  • http//www.msdn.microsoft.com/sqlxml/
  • Add-in to VS .NET that lets you locate and
    download .NET patterns and sample code from
    within Visual Studio .NET

27
Software Reuse
  • More sources of free code
  • The Code Project
  • http//www.codeproject.com
  • GotDotNet User Samples
  • http//www.gotdotnet.com/Community/UserSamples

28
Evaluating Code
  • Using FxCop
  • http//www.gotdotnet.com/team/fxcop
  • A code analysis tool that checks .NET managed
    code assemblies for conformance to the Microsoft
    .NET Framework Design Guidelines
  • Can check conformance for third party libraries
    as well as own classes

29
(No Transcript)
30
  • Thank You
About PowerShow.com