Software Analytics: The Dark Side and the Test Side

49
Software Analytics: The Dark Side and the Test Side SEN Symposium 2016 Andy Zaidman, TU Delft

Transcript of Software Analytics: The Dark Side and the Test Side

Page 1: Software Analytics: The Dark Side and the Test Side

Software Analytics: The Dark Side and the Test Side

SEN Symposium 2016 Andy Zaidman, TU Delft

Page 2: Software Analytics: The Dark Side and the Test Side

I like to tell stories…

Andy

Page 3: Software Analytics: The Dark Side and the Test Side

Jurgen/Frank: Can you give a keynote on

software testing and software analytics at the

SEN Symposium?Me:

Sure I can, I’m honored by the invitation.

Jurgen/Frank: Can you give us a title and

abstract?Me:

<<PANIC>> what should I talk about? Subject so broad...

ARRGHHH...

Page 4: Software Analytics: The Dark Side and the Test Side

1. “Software Engineering”

2. “Software Testing”

3. “Software Analytics”

I started by asking

Page 5: Software Analytics: The Dark Side and the Test Side
Page 6: Software Analytics: The Dark Side and the Test Side

I turned to again

Page 7: Software Analytics: The Dark Side and the Test Side
Page 8: Software Analytics: The Dark Side and the Test Side

The Dark Side

@ work (Dec. 2015)

Page 9: Software Analytics: The Dark Side and the Test Side

http://www.popularmechanics.com/technology/infrastructure/a18721/washington-state-released-3200-inmates-early/

Page 10: Software Analytics: The Dark Side and the Test Side

http://townhall.com/tipsheet/mattvespa/2015/12/22/good-news-computer-glitch-caused-the-irs-to-issue-46-million-worth-of-questionable-refunds-n2096374

Bad

Page 11: Software Analytics: The Dark Side and the Test Side

http://deredactie.be/cm/vrtnieuws/cultuur%2Ben%2Bmedia/kunsten/1.2490758

Page 12: Software Analytics: The Dark Side and the Test Side

vs.

3 - 0

Page 13: Software Analytics: The Dark Side and the Test Side

Bring balance, you must!

Test more, you should!

Page 14: Software Analytics: The Dark Side and the Test Side
Page 15: Software Analytics: The Dark Side and the Test Side

“it depends”

“50% of your time”

Page 16: Software Analytics: The Dark Side and the Test Side

What is the (likely) origin of the 50%?

Page 17: Software Analytics: The Dark Side and the Test Side

The Mythical Man-Month?Brooks “observed” that testing and debugging took 50% of the time

How? “Calendar research”

When± 40 years ago…

Page 18: Software Analytics: The Dark Side and the Test Side
Page 19: Software Analytics: The Dark Side and the Test Side

Lack of critical thinking has allowed wrong

claims to take root in the discipline and become

entrenched.

Page 20: Software Analytics: The Dark Side and the Test Side

Chinese whispers / telephone game

Page 21: Software Analytics: The Dark Side and the Test Side

Folklore/evidence test approximately 50%

Lack of knowledgeHow much time is actually

spent on testing?

Page 22: Software Analytics: The Dark Side and the Test Side
Page 23: Software Analytics: The Dark Side and the Test Side

NWO Vidi project

Page 24: Software Analytics: The Dark Side and the Test Side

Research Tool Software Analytics“Big Brother” in your IDE measures testing activities

• 416 Softw. Engineers, 68 countries • Java / Eclipse • 13.7 man years of development

observed

Immediate feedback for developers

Page 25: Software Analytics: The Dark Side and the Test Side

WatchDog Pre-Test Questionnaire

Can you estimate how much time you spend on engineering test code versus production code?

50% 50%test code production code

30% 70%test code production code

Page 26: Software Analytics: The Dark Side and the Test Side

WatchDog Pre-Test Questionnaire

Can you estimate how much time you spend on engineering test code versus production code?

48% - 52%test code production code

Page 27: Software Analytics: The Dark Side and the Test Side

After measuring ≥ 3 months

25% - 75%test code

engineering

Most participants overestimate their test engineering activities

production codeengineering

Page 28: Software Analytics: The Dark Side and the Test Side

Other observations

Page 29: Software Analytics: The Dark Side and the Test Side

Not all Java projects do unit testing

Likely, an underestimation…

Page 30: Software Analytics: The Dark Side and the Test Side

No test engineering

For projects with unit test code: 53% of developer did not execute, read, or modify a single test within five months.

Page 31: Software Analytics: The Dark Side and the Test Side

Do sets of unit test executions take…

< 5 seconds ≥ 5 seconds

Page 32: Software Analytics: The Dark Side and the Test Side

Swift tests

Execution of set of unit tests takes 0.54 seconds (median).

Page 33: Software Analytics: The Dark Side and the Test Side

Ad hoc test selection

Developers frequently select a specific set of tests to run in the IDE. In most cases, developers execute one single test.

Page 34: Software Analytics: The Dark Side and the Test Side

Tests fail

65% of test executions in the IDE fail.

Page 35: Software Analytics: The Dark Side and the Test Side

Test Driven Development

TDD is not widely practiced. Programmers who claim to do it, neither follow it strictly nor for all their modifications.

Page 36: Software Analytics: The Dark Side and the Test Side
Page 37: Software Analytics: The Dark Side and the Test Side

Software Analytics?

What about

Page 38: Software Analytics: The Dark Side and the Test Side

Testing Analytics?What about

Page 39: Software Analytics: The Dark Side and the Test Side

Software analytics =

bait / intrinsic motivation

Page 40: Software Analytics: The Dark Side and the Test Side
Page 41: Software Analytics: The Dark Side and the Test Side
Page 42: Software Analytics: The Dark Side and the Test Side

From an experienced developer…“Estimated time working on tests: 20%,

actual time: 6%. Cool statistics! ”

Testing analytics helps developers to get a better understanding about their own

development behavior

Page 43: Software Analytics: The Dark Side and the Test Side

Hawthorne effect?

Page 44: Software Analytics: The Dark Side and the Test Side

Hawthorne effect?“Keeping up appearances” > 3 months?

Page 45: Software Analytics: The Dark Side and the Test Side

Takeaways

Page 46: Software Analytics: The Dark Side and the Test Side

Triangulate your results mixed methods research

Be critical towards “folklore” Core might be true, but is it (still) valid,

valid in your context, etc.

Don’t talk testing, but act testing

Takeaways

Page 47: Software Analytics: The Dark Side and the Test Side

Critique?• Only developer testing ( ≠ Brooks)• Only Java, only Eclipse• Only 416 developers • Only inside the IDE

Extending to IntelliJ and > 1500 developers

Also looking into Continuous Integration

Page 48: Software Analytics: The Dark Side and the Test Side

Software engineering

folklore

Perception w.r.t. dev. testing

Measured developer testing

48% - 52%

25% - 75%

Software analytics help engineers to better understand

their own behavior

azaidman

WatchDog Team

Page 49: Software Analytics: The Dark Side and the Test Side

References• M. Beller, G. Gousios, A. Panichella, A. Zaidman. When, How and Why

Developers (Do Not) Test in Their IDEs. Proceedings of the Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC/FSE), pages 179-190, 2015.