Presentation is loading. Please wait.

Presentation is loading. Please wait.

Robo – Software Engineering David Davenport Computer Eng. Dept., Bilkent University Ankara - Turkey. engineering.

Similar presentations


Presentation on theme: "Robo – Software Engineering David Davenport Computer Eng. Dept., Bilkent University Ankara - Turkey. engineering."— Presentation transcript:

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

2 House Problem Who has attempted it?

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

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

5 Pretty – design! a – rect width b – rect height c – num. of rects d – angle btw rects (b) (a) (d) degrees (c) times rectturn (b) (a) (c) degrees rect 21 pretty( a, b, c, d) x c rectturn( a, b, d) rectturn( a, b, c) d rect( b, a) r( c)

6 Software Engineering Exercise Form teams, implement, then reflect!

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

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

9 Software Engineering Exercise The overall design!

10 Birthday Cake Design 3 2 1 a timesb

11 SUMMARY Advantages of TDSD The TDSD methodology

12 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.

13 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!

14 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)

15 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

16 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 programmin g...BYE

17

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


Download ppt "Robo – Software Engineering David Davenport Computer Eng. Dept., Bilkent University Ankara - Turkey. engineering."

Similar presentations


Ads by Google