1 / 21

Robo – Software Engineering

Robo – Software Engineering. …software engineering example exercise. David Davenport Computer Eng. Dept., Bilkent University Ankara - Turkey. email: david@bilkent.edu.tr. House Problem Who has attempted it?. 250x250x250. 2. roof. 50x50. 250. 1. 100x50. Pre-cond. Post-cond. main.

Download Presentation

Robo – Software Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Robo – Software Engineering …software engineering example exercise ... David Davenport Computer Eng. Dept., Bilkent UniversityAnkara - Turkey. email: david@bilkent.edu.tr

  2. House Problem Who has attempted it?

  3. 250x250x250 2 roof 50x50 250 1 100x50 Pre-cond. Post-cond. main Robo – House Problem (1) • Specify pieces & order

  4. 1 7 3 5 main walls 2 4 6 main d walls d movetoleftwin d window d movetorightwin d window d movetodoor d door d movetoendpoint 150x25 Pre-cond. 150x75 150 window door Post-cond. movetoleftwin movetorightwin movetodoor Robo – House Problem (2) • Then solve pieces…

  5. Software Engineering Exercise Form teams, implement, then reflect!

  6. (2a + 2b) (a) (a) (b) base side topleft (a) (2b) toprightbottom (a) (a) (2a + b) moveup movedown topright (a) (a) 45 (2a + 2b) diamond Pre-cond. movetoleft Post-cond. Basic Pieces… (b) (a) lefttop

  7. slice ( a, b, c) slicetop ( a, b) bc ( a, b) d base( b, c) d moveup( a) d slicetop( b, c) d movedown( a) d movetoleft( a, b)d topleft( b)d holder( 100, a, a)d topright( a, b) d side( b)x a slice( b, 12, 10)d side( b) holder ( a, b, c) d lefttop( a, b)d diamond( c)d toprightbottom( a, b) Composite Pieces…

  8. Software Engineering Exercise The overall design!

  9. Birthday Cake Design

  10. tofirstcandle Birthday Cake Design 1 2 3 // birthdaycake d Rect(200,450) //cakebody d tofirstcandle d candles

  11. tofirstcandle To First Candle // tofirstcandle p f(200) r(90) f(50) l(90) p

  12. Candles // candles x 4 candle

  13. 1 2 3 4 Candle // candle d Rect(200,50) // candlebody d candlebodytoflame d Rect(40,40) // candleflame d flametonextcandle // candlebodytoflame p f(200) r(90) f(25) l(135) p // flametonextcandle p r(135) f(25) r(90) f(200) l(90) f(50) l(90) p

  14. SUMMARY • Advantages of TDSD • The TDSD methodology

  15. Relating Design & Code • Big problems -> lots of pieces! • Difficult to understand & track • relation of pieces to each other • & between pieces of design & code • Pieces of design numbered 1, 2, 3… • Number sub-pieces 1.1, 1.2… & 2.1, 2.2… • Methods require naming pieces in design • Include piece numbers in code too.

  16. The TDSD Methodology • Understand the problem requirements • Break into natural pieces, making sure to fully specify them and the order in which they are to be done • Check whether these pieces done in this sequence solve the problem • If no, revise & recheck until you have a set & order that do correctly solve it! • If/when yes… repeat process with any non-trivial sub-pieces and so on until you only have trivial pieces! • Finally, implement & test each of them separately, then integrate & test whole!

  17. Tips… • Have you FULLY specified ALL the sub-pieces? and exactly how they fit together? • Sub-contracting Have you described the sub-problem in sufficient detail that someone would be able to solve it without any additional knowledge of the original problem? • Don’t be afraid to revise solutions or even scrap them entirely. It is not always possible to find best solution first time! • Don’t start to solve sub-problems until you are absolutely sure that the your proposed solution is correct. Doing so may waste time & effort. • Must go from BIG to small -not small to big!! • Your solutions must demonstrate you understand top-down design –require at least 2 or 3 levels • Robo limited to 20 line methods This must include comments! So ~10 comments + 10 commands (max, remember 7 +- 2)

  18. Advantages of TDSD • Small pieces easier to solve correctly! • Projects easier to manage • divides work naturally • Projects can be completed quicker • easıer to reuse pieces • pieces can be done simultaneously • Projects done in secrecy • workers don’t see big picture • Testing & integration is simplified

  19. Summary • You should have learnt about& understand the rationale for… • Comments • White space • Meaningfully named methods • Method parameters • Pre & post conditions • Repetition • Top down structured design! Happy programming ...BYE

  20. (a) 100x100 base Library pieces! 3 2 1

More Related