Transcript review

High Level Overview of CS 3500

C#

Programming techniques

Software architecture

Software development tools

Personal software practice

Other topics
C#
Programs organized into namespaces
 Namespaces contain classes and interfaces
 Programs can be assembled into executables
 Programs can be assembled into DLLs
 Implementing classes, methods, properties
 Inheritance and interfaces
 IEnumerable<T> and IEnumerator<T>
 Delegates
 Events
 LINQ

CS 3500
L20 - 2
Programming Techniques (1)

Iteration abstraction
– Iterative access to members of a collection
– Cursors (similar to Java iterators)
– IEnumerator interface
– C# iterators (via yield return)
– Visitor OO design pattern

Delegates
– Passing methods as parameters
– Customizing sorting and searching algorithms
– Registering callbacks
– Launching threads
Programming Techniques (2)

Events
– Asynchronous behavior that triggers callbacks
– Implementing GUI interfaces
– Using asynchronous sockets

Threading
– An approach to concurrency
– Synchronization with locks
– Avoiding deadlocks
– Critical sections
– GUI event thread
– Asynchronous sockets
Programming Techniques (3)

Socket Programming
– For communication over a network
– Servers accept, clients connect
– Synchronous blocking sockets
– Asynchronous non-blocking sockets

SQL Programming
–
–
–
–
–
Incorporating databases into programs
Designing database schema
Imposing keys and constraints
Queries (selection, projection, join)
Insert, delete, update
Programming Techniques (4)

Object-Oriented Design Patterns
– Solutions to commonly-encountered problems
– Singleton pattern
– Factory pattern
– Adapter pattern
– Decorator pattern
– Visitor pattern
– There are many more!
Software Architecture (1)

Object-oriented architecture
– Organizing programs around classes
– Information hiding
– Exploiting polymorphism via inheritance and
intefaces

Client/server architecture
– Network-based approach
– Server program that accepts connections from
remote clients
– Client programs that requests connections to
remote servers
– Typically involves sockets and threads
architecture
Software Architecture (2)

Event-driven architecture
– Programs organized around
asynchronous events that are handled via
calls to registered callbacks
– Typically involves threads

GUI architecture
– Users interact with programs via GUI
components
– Relies heavily on events and callbacks
Software Architecture (3)

MVC architecture
– Model: The “smarts” or “business logic”
– View: The user interface
– Controller: Mediates between model and
view

Database-oriented architecture
– Program makes use of database, typically
via remote server
– Program can benefit from ACID
properties of database (atomicity,
consistency, isolation, durability)
Software Development Tools
Program development (VS)
 GUI construction (VS)
 Version control (SVN)
 Debugging (from VS)
 Unit testing (from VS)
 Coded UI testing (from VS)
 Database management

CS 3500
L20 - 10
Software Engineering






Evolution from custom batch applications to
networked, parallel, object-oriented systems
Software crisis is an age-old issue in computer
science
Idealized vs. actual failure rates for software
Software engineering as intersection of systems
engineering, computer science, management, and
psychology
Software lifecycle: analysis, design, development,
testing, maintenance
Need process to identify and correct problems early
CS 3500
L20 - 11
Version Control

Keep track of the evolution of programs,
documentation, tests, etc. as they evolve

When developing alone, solves the multiple machine
problem, allows recovery from mistakes

When working with others, supports coordination of
efforts and resolution of conflicts
CS 3500
L20 - 12
Software Testing




Goal of testing is to affirm quality
Testing: process of executing a program with the
intent of finding an error (up to 40% of SE effort)
Testing cannot show the absence of defects
Testing models:
–
–
–
–


Black box testing
White box testing
Unit testing
Test-first approach
Testing in practice: unit tests
Testing in practice: coded UI tests
Debugging





A bug is a defect (a mistake) and you put it there!
Debugging is difficult, takes an unpredictable
amount of time, and most people aren’t systematic
Experienced debuggers are roughly 20 times better
at finding defects
Process: Stabilize the error, locate the error, fix the
error, test the fix, look for similar errors, reflect
Locating errors: Narrow the region of suspicious
code, come up with hypotheses, and devise tests to
confirm/refute them
Improving program performance






Making simple source modifications to improve
efficiency isn’t worth it because compilers are so good
However, no compiler can compensate for your choice
of an inefficient algorithm or data structure
Before attempting to improve program performance,
obtain timing measurements so you’ll know what to
target and whether you succeeded
Before attempting to improve program performance,
develop regression tests to assess correctness
Pareto principle: 80% of the result with 20% of the effort
Pay attention to virtual memory and cache effects
Pair programming



Two programmers working side-by-side at one
computer
Can produce higher-quality code with less effort
than two programmers working individually
Works because of pair-pressure, pair-think, and
pair-relaying, pair-reviews, and pair-learning
UML

Graphical notation for describing aspects of
software at a higher level of abstraction

Class diagrams are used to describe salient parts of
class hierarchies

Even though graphical, there is a syntax and
semantics
Intellectual property

Copyright: Protects creative expression in many
forms, including software
– Fair use doctrine provides exception to copyright
– Digital media allow perfect copies and easy transmission, all with
little expense
– Laws changing rapidly in digital age
– DMCA provides for notice and takedown and anticircumvention

Patent: Protects novel inventions
– Expensive and time-consuming to obtain
– System has been abused, especially for software patents


Trademarks: Protects symbols used for branding
Trade secrets: Alternative to patents
Ethics








Act consistently with the public interest
Act in the best interest of employer and client,
consistent with the public interest
Products should meet highest standards possible
Maintain integrity in professional judgment
Subscribe to ethical approach to management
Advance integrity and reputation of profession
Be fair to and supportive of colleagues
Participate in lifelong learning