Tidying up Ruby code - SE-Wiki

18 downloads 31 Views 2MB Size Report
Tidying up Ruby code. Refactoring, Design Patterns, Code metrics. Antonio Navarro Perez. Agile Software Development Lab, Fall 2008. B-IT / IPEC Summer  ...
Tidying up Ruby code Refactoring, Design Patterns, Code metrics Antonio Navarro Perez Agile Software Development Lab, Fall 2008 B-IT / IPEC Summer School 2008

Outline I.

Motivation for tidy code

II. Refactoring III. Design Patterns IV. Code Metrics

Motivation for tidy code

What‘s the value of code tidiness? We want code that is... •

self-explanatory and natural to read



without hidden pitfalls



compact, simple and has little redundancy

...and therefore is •

easy to understand



easy to modify



easy to test



easy to maintain, extend and reuse

... for everyone in the team!

Bad example (in Java)... protected void verifyAntwortB(){ timerZeit.stop(); String tmpsa1[]=new String[4]; String tmpsa2[]=actQuiz.getFrage().getAntworten(); int tmpi; for(int i=0;i

Suggest Documents