07-SoftwareDesign

07-SoftwareDesign - CS/ENGRD 2110 Object-Oriented...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
15/02/2011 1 CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2010 Thorsten Joachims Lecture 7: Software Design Software Engineering The art by which we start with a problem statement and gradually evolve a solution. There are whole books on this topic and most companies try to use a fairly uniform approach that all employees are expected to follow. The IDE can help by standardizing the steps. Top-Down Design Building a Search Engine: Refine the design at each step Decomposition / “Divide and Conquer” Search Engine Crawler Indexer User Interface Queue HTTP Client Inverted Index Ranking Function Database HTTP Server Spelling Correction Term Weighting Pagerank List Hashmap Bottom-Up Design Just the opposite: start with parts: Composition Build-It-Yourself (e.g. IKEA furniture) Search Engine Crawler Indexer User Interface Queue HTTP Client Inverted Index Ranking Function Database HTTP Server Spelling Correction Term Weighting Pagerank List Hashmap Top-Down vs. Bottom-Up Is one of these ways better? Not really! It’s sometimes good to alternate By coming to a problem from multiple angles you might notice something you had previously overlooked Not the only ways to go about it With Top-Down it’s harder to test early because parts needed may not have been designed yet With Bottom-Up , you may end up needing things different from how you built them Software Process For simple programs, a simple process… But to use this process, you need to be sure that the requirements are fixed and well understood! Many software problems are not like that Often customer refines the requirements when you try to deliver the initial solution! “Waterfall”
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
15/02/2011 2 Deliver versions of the system in several small cycles: Recognizes that for some settings, software development is like gardening. You plant seeds… see what does well… then replace the plants that did poorly. TESTING AND TEST-DRIVEN DEVELOPMENT The Importance of Testing Famous last words “Its all done, I just have not tested it yet”. Many people Write code without being sure it will work Press run and pray If it fails, they change something random Never work, and ruins weekend social plans. Test-Driven Development! The Example A collection class SmallSet containing up to N objects (hence “small”) typical operations: we’ll implement add(), size() add adds item contains is item in the set? size # items Test Driven Development We’ll go about in small iterations 1.add a test 2.run all tests and watch the new one fail 3.make a small change 4.run all tests and see them all succeed 5.refactor (as needed) We’ll use JUnit JUnit What do JUnit tests look like? SmallSet.java
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 7

07-SoftwareDesign - CS/ENGRD 2110 Object-Oriented...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online