30
Spoilers and Counter-Spoilers How to Measure Software Maintainability Riccardo Bernardini [email protected] FOSDEM 2013 – February 2, 2013

Spoilers fosdem-2013

Embed Size (px)

Citation preview

Page 1: Spoilers fosdem-2013

Spoilers and Counter-SpoilersHow to Measure Software Maintainability

Riccardo Bernardini

[email protected]

FOSDEM 2013 – February 2, 2013

Page 2: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

Outline

• My objective

• The problem

• The solution

• What now?

• Conclusion

1

Page 3: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

My objective

• Competitions about SW maintainability

• I want to tell you about it

• Why?

– Let you know

– Promote the idea

– Get feedback

– Finding competitors

2

Page 4: Spoilers fosdem-2013

The problem

Page 5: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

MotivationWhy measuring SW quality?

• Many SW competitions reward

– Fast coding (i.e., IEEExtreme programming)

– Efficiency

– Ingenuity

• SW competitions that reward

– Readability

– Maintainability

– Robustness

are not common

Let’s organize a SW quality competition!

3

Page 6: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

The problem

• Qualities like efficiency, coding speed, are quantitative

⇒ they are easy to measure objectively

• Qualities like readability, maintainability, . . . are qualitative

⇒ how can we measure them?

⇒ peer review?

– Peer review is subjective . . .

. . . especially with code readability

4

Page 7: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

The problem with peer-reviewHungarian Notation

i counter sz name p foo

love it or hate it

5

Page 8: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

The problem with peer-reviewCasing

with underscores CamelConvention Mixed Convention

6

Page 9: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

The problem with peer-reviewCode blocksif (x==NULL) {

a_convention();}

if (x==NULL){

another_one();}

if (x==NULL){

use_large_indent();if (a==0){

deeper_and_deeper();}

}

7

Page 10: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

The problem with peer-reviewObject-oriented

fAttribute mMethod() pPrivateMethod()

attribute method() private method()

8

Page 11: Spoilers fosdem-2013

The solution

Page 12: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

How it worksStep 1

Once upon a time, there were few programmers. . .

9

Page 13: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

How it worksStep 2

. . . who submited code to the competition

10

Page 14: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

How it worksStep 3

Some evil spoilers. . .

11

Page 15: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

How it worksStep 4

acquired the code. . .

12

Page 16: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

How it worksStep 5

and introduced some (nasty, subtle) bugs. . .

13

Page 17: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

How it worksStep 6

But then some counter-spoilers (in shining armours) arrived. . .

14

Page 18: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

How it worksStep 7

. . . rescued the code. . .

15

Page 19: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

How it works

. . . and debugged it! The debugging time was registered

16

Page 20: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

How it works

Debugging time components: how to separate them?

17

Page 21: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

We need a //////hero model

At the end we have a sequence of 5-ple

We suppose that

18

Page 22: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

Solving for the scores

Problem: given the 5-ples, find all SP , SS and SC

• N. of unknown

NP + NS + NC

• N. of 5-ple

N. programs × N. spoilers/code × N. CS/spoiled

• We need

N. 5-ple ≥ NP + NS + NC

19

Page 23: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

Prizes for everyone!

Best programmer, best spoiler and best counter-spoiler

1 23

1 23 1 23

20

Page 24: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

Variation: B’n’W competition

Add s and s to the code

21

Page 25: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

Variation: B’n’W competition (2)

Time components

Faster Slower

22

Page 26: Spoilers fosdem-2013

What now?

Page 27: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

What now?

• Web interface

• Score model

• Experiments

• Details, details, details, . . .

23

Page 28: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

Keep in touch

• LinkedIn group

Spoiling and Counter-Spoiling for Software Competitions

• Web site (temporary & mostly empty)

https://sites.google.com/site/counterspoiling/

24

Page 29: Spoilers fosdem-2013

Conclusions

Page 30: Spoilers fosdem-2013

Spoilers and Counter-Spoilers

Conclusions

• A method to measure SW maintainability

• Using spoilers and counter-spoilers

• Possible to mix with other metrics

• Work in progress. First competition (hoepfully) soon

Thank you to inkscape and OpenClipArt for the graphics. . .

25