an overview of tools available in cs 501 ken hopkinson [email protected]

54
An Overview of Tools Available in CS 501 Ken Hopkinson [email protected]

Upload: madeline-johnston

Post on 04-Jan-2016

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

An Overview of Tools Available in CS 501

Ken [email protected]

Page 2: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

2CS 501 : An Overview of Helpful Tools

Talk Overview

Rational Rose for Design Source Management Tools A Selection of Available

Development Environments Debugging Techniques

Page 3: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

Using Rational Rose for Project Design

Page 4: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

4CS 501 : An Overview of Helpful Tools

Start Rational Rose

Page 5: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

5CS 501 : An Overview of Helpful Tools

Page 6: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

6CS 501 : An Overview of Helpful Tools

A Typical Design

Page 7: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

7CS 501 : An Overview of Helpful Tools

Another Sample Design Case

Page 8: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

8CS 501 : An Overview of Helpful Tools

Remember Your Specifications

Page 9: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

9CS 501 : An Overview of Helpful Tools

Specification Fields

Page 10: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

10CS 501 : An Overview of Helpful Tools

General Specification Fields

Page 11: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

11CS 501 : An Overview of Helpful Tools

Source Code Management

Also known as Configuration Management

Source Code Managers are tools that:

– Archive your development files– Serve as a single point of entry/exit

when adding or updating development files

Page 12: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

12CS 501 : An Overview of Helpful Tools

Why You Want A Source Control System

Supports concurrent development Manage diverging source code bases Records file/release versions Easy access to all previous revisions Can record why a revision was made Optimal disk space usage You’ll end up doing something equivalent

anyway so it may as well be automated

Page 13: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

13CS 501 : An Overview of Helpful Tools

Source Code Management Tools Are

Not A substitute for project

management A replacement for developer

communication

Page 14: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

14CS 501 : An Overview of Helpful Tools

How They Work

Central database of source code, documentation, build tools

Each file stored only once - all other versions are diffs of that one copy

To Make a Change– Check out the latest version of a file– Make the changes– Update the database

Page 15: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

15CS 501 : An Overview of Helpful Tools

What should be in the database

Source Code Documentation Build Tools– Often need old versions of the tools to

build old versions of the software– Ensures software is rebuilt exactly as

the customer received it Test Suites Anything else you might want later

Page 16: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

16CS 501 : An Overview of Helpful Tools

Version Control

Companies ship several products from the same source base (ie Win NT and Windows 2000 versions of MS Office)

When tracking down bugs you want to examine the code as it was when the product shipped

Page 17: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

17CS 501 : An Overview of Helpful Tools

Code Sharing

Multiple people can work on the same source base without colliding

– (1) Locks individual files so only one person at a time can modify it *OR*

– (2) Allows multiple people to modify a source file and the system will automatically merge the changes (usually)

Page 18: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

18CS 501 : An Overview of Helpful Tools

Locking Only one person can work on a file at once Works fairly well if developers work on

different areas of the project and don’t conflict often

Problem 1: People forget to unlock files when they are done

Problem 2: People work around locking by editing a private copy and checking in when the file is finally unlocked - easy to goof and lose changes

Page 19: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

19CS 501 : An Overview of Helpful Tools

Merging

Several people can work on a file at once

Before committing changes, each user merges their copy with the latest copy in the database

– This is normally done automatically by the system and usually works, but you should not blindly accept the result of the merge

Page 20: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

20CS 501 : An Overview of Helpful Tools

Labelling

Label all the files in the source base that make up a product at each milestone

Just before and just after a major change (eg. changing several interfaces)

When a new version ships

Page 21: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

21CS 501 : An Overview of Helpful Tools

Version Trees Each file in the database has a version

tree Can branch off the version tree to allow

separate development paths Typically a main path (trunk) for the

next major version and branches off of shipped versions for maintenance

Page 22: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

22CS 501 : An Overview of Helpful Tools

Branching

When a new version ships, typically create a branch in the version tree for maintenance

Double update: fix a defect in the latest version and then merge the changes (often by hand) into the maintenance version

Also create personal versions so you can make a change against a stable source base and then merge in the latest version later

Page 23: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

23CS 501 : An Overview of Helpful Tools

Examples RCS– Solaris: man rcsintro CVS– Solaris: man cvs– www.cyclic.com/cvs/info.html Visual SourceSafe– msdn.microsoft.com/SSAFE ClearCase– www.rational.com SourceForge– www.sourceforge.net

Page 24: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

24CS 501 : An Overview of Helpful Tools

RCS

File management only Transaction model– check out and lock– edit– check in and unlock Little support for binaries

Page 25: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

25CS 501 : An Overview of Helpful Tools

CVS

Built on top of RCS– Therefore little support for binaries Database can be remote No locking: merge before commit Fast Integrates with emacs

Page 26: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

26CS 501 : An Overview of Helpful Tools

SourceSafe

Microsoft’s entry into the field Project-based Checkout-edit-checkin model Built-in web site creation tools Integrates with MSDEV

Page 27: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

27CS 501 : An Overview of Helpful Tools

Clearcase

Clearcase is configuration management on steroids

You create a view of the database with a config spec, which describes how to select files from the database.

When you set a view, Clearcase creates a virtual filesystem containing only those versions of the files selected by the config spec

Page 28: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

28CS 501 : An Overview of Helpful Tools

Clearcase Features

Distributed System– Several groups at different locations

can work on the same database Can install triggers– Example: e-mail the author of a file

when some one makes a change to it Uses merging model like CVS, but

can also lock files

Page 29: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

29CS 501 : An Overview of Helpful Tools

More Clearcase Features

Integrates with MSDEV Build Management– Knows to rebuild out-of-date files

even if your makefile doesn’t Slow and a bit buggy

Page 30: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

30CS 501 : An Overview of Helpful Tools

SourceForge

On-line Version Control System Projects are available for public

discovery and development A very good environment for open

source projects

Page 31: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

31CS 501 : An Overview of Helpful Tools

Helpful Rules for Version Control Bliss

Archived Files Should Always Compile

Code Review Files Before Check-in Compile and run latest archived

files *as a set* before Check-in No Cheating (even “simple bug

fixes” need to undergo this process)

Page 32: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

Development Tools Available at Cornell at

No Charge to You

Page 33: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

33CS 501 : An Overview of Helpful Tools

MSDNAA

Windows XP Visual Studio .Net Windows CE Development Tools Microsoft SQL Server Visual SourceSafe

Page 34: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

34CS 501 : An Overview of Helpful Tools

Freely Available Software

GNU Free Software Foundation Other Public Software Freely

Distributed

Page 35: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

35CS 501 : An Overview of Helpful Tools

Useful Public Software

Apache Web Server g++/gdb Perl Python CVS

Page 36: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

36CS 501 : An Overview of Helpful Tools

Software Installed in Public Windows/Unix

Labs Microsoft Office including MS

Access Purify CVS Server Unix Shell Access

Page 37: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

37CS 501 : An Overview of Helpful Tools

Key Points to Remember

Use the most appropriate tools for the job

Check available Cornell software before buying anything

Ignore licensing agreements at your peril

No extra credit is given for a one week project that does the same work as a one-line library call.

Page 38: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

38CS 501 : An Overview of Helpful Tools

A Closer Look at Two Cool Development

ToolsPurify

Microsoft Visual Debugger

Page 39: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

39CS 501 : An Overview of Helpful Tools

Purify

Purify is a tool for locating runtime errors in a C/C++ program

Purify can find Array bounds errors

Accesses through dangling pointers

Uninitialized memory reads

Memory allocation errors

Memory leaks

Purify is available on Windows and UNIX systems and is a product of Rational Software www.rational.com

Page 40: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

40CS 501 : An Overview of Helpful Tools

How Purify Works

Purify instruments a program by adding protection instructions around every load and store operation

When program is executed a viewer will be created to display errors as they happen

Purify is flexible and can be run standalone with any executable (written in C) or within a debugging environment like Visual Studio

Purify is customizable and can be set to ignore certain types of errors

Page 41: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

41CS 501 : An Overview of Helpful Tools

How to Use Purify

add purify command to link command program: $(OBJS) purify [-option ...] $(CC) $(CFLAGS) -

o\ program $(OBJS) $(LIBS)

OR run purify in Visual Studio OR load file in purify executable

Page 42: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

42CS 501 : An Overview of Helpful Tools

Page 43: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

43CS 501 : An Overview of Helpful Tools

Page 44: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

44CS 501 : An Overview of Helpful Tools

Visual Debugger

Graphically Oriented Run from Visual Studio Can debug a failed process by selecting

the Yes button at “Debug Application” dialog after a memory or other failure occurs

Can attach to a running process by choosing the Tools->Start Debug->Attach to Process menu option

Page 45: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

45CS 501 : An Overview of Helpful Tools

The Visual Debugger

Page 46: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

46CS 501 : An Overview of Helpful Tools

Breakpoints

Can stop execution at any line and in any function. (Location)

Can set conditions on breakpoints if you are only interested in specific passes through a piece of code (Location->Condition)

Conditional breakpoints detached from any one line in the program are also possible, but make program execution very slow (Data).

Page 47: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

47CS 501 : An Overview of Helpful Tools

Breakpoint Window

Page 48: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

48CS 501 : An Overview of Helpful Tools

Conditional Window

Page 49: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

49CS 501 : An Overview of Helpful Tools

Conditional Data Breakpoint

Page 50: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

50CS 501 : An Overview of Helpful Tools

Examining Program State

Print and/or Change variable state. Walk up/down the stack trace. View disassembled code.

Page 51: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

51CS 501 : An Overview of Helpful Tools

Page 52: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

52CS 501 : An Overview of Helpful Tools

Quick Print/Change Variables

Page 53: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

53CS 501 : An Overview of Helpful Tools

Common Pointer Problems

Pointer to bogus memory Corrupt data structure segments Data sharing errors Accessing data elements of the

wrong type Attempting to use memory areas

after freeing them

Page 54: An Overview of Tools Available in CS 501 Ken Hopkinson hopkik@cs.cornell.edu

54CS 501 : An Overview of Helpful Tools

Conclusion

Rational Rose is an Excellent Design Tool

Version Control Software is Very Helpful

Many Good Project Tools Available at Cornell

Using Development Tools Well Can Make a Big Difference in Your Project’s Success