Software Engineering: CS/ENGRD 2110 Object-Oriented Programming and Data Structures
Software Engineering: CS/ENGRD 2110 Object-Oriented Programming and Data Structures
Software Engineering: CS/ENGRD 2110 Object-Oriented Programming and Data Structures
Software Engineering
CS/ENGRD 2110
Object-Oriented Programming • The art by which we start with a problem
and Data Structures statement and gradually evolve a solution.
Spring 2012
Thorsten Joachims
• There are whole books on this topic and most
companies try to use a fairly uniform
Lecture 7: Software Design approach that all employees are expected to
follow.
User User
Crawler Indexer Crawler Indexer
Interface Interface
HTTP Inverted Ranking Spelling HTTP HTTP Inverted Ranking Spelling HTTP
Queue Database Queue Database
Client Index Function Correction Server Client Index Function Correction Server
Term Term
Hashmap List Pagerank Hashmap List Pagerank
Weighting Weighting
1
13/02/2012
2
13/02/2012
3
13/02/2012
• As expected, the test fails... • All tests pass, so we can refactor that loop...
4
13/02/2012
– DRYing up at any cost can increase dependencies – If your application later gets used as part of a Nasa mission
between code to Mars, it won’t make mistakes
– Every place that the gravitational constant shows up in your
– “3 strikes and you refactor” (i.e., clean up) program a reader will realize that this is what she is looking
at
– The compiler may actually produce better code
5
13/02/2012
6
13/02/2012
How people write really big programs Testing is a part of that style!
• When applications are small, you can understand • Once you no longer know how big parts of the
every element of the system system even work (or if they work), you instead
begin to think in terms of
• But as systems get very large and complex, you – Code you’ve written yourself. You tested it and know
that it works!
increasingly need to think in terms of interfaces,
documentation that defines how modules work, – Modules you make use of. You wrote experiments to
confirm that they work the way you need them to
and your code is more fragmented work
– Tests of the entire complete system, to detect issues
• This forces you into a more experimental style visible only when the whole thing is running or only
under heavy load
• Thus companies think of software as having a very • So never believe that software will be flawless
long “life cycle”. Developing the first version is
only the beginning of a long road! • Our goal in cs2110 is to do as well as possible
• In later CS courses we’ll study “fault tolerance”!