expanding our testing horizons

36
Expanding our Testing Horizons Mark Micallef PEST Research Lab, Malta 6/28/22

Upload: mark-micallef

Post on 12-Apr-2017

158 views

Category:

Software


3 download

TRANSCRIPT

Page 1: Expanding our Testing Horizons

Expanding our Testing Horizons

Mark MicallefPEST Research Lab, MaltaWednesday, May 3, 2023

Page 2: Expanding our Testing Horizons
Page 3: Expanding our Testing Horizons
Page 4: Expanding our Testing Horizons
Page 5: Expanding our Testing Horizons
Page 6: Expanding our Testing Horizons
Page 7: Expanding our Testing Horizons
Page 8: Expanding our Testing Horizons

Two Worlds

• Understanding• Clean Solutions• Complete• Perfect

• Value• Pragmatic• Working

Page 9: Expanding our Testing Horizons
Page 10: Expanding our Testing Horizons

Idea: Catching problems earlier makes them easier to fix

Page 11: Expanding our Testing Horizons

Static Analysis

ParserSource Code

Analyser

IntermediateRepresentation

Analysis

Page 12: Expanding our Testing Horizons

Static Analysis

Source Code

Page 13: Expanding our Testing Horizons
Page 14: Expanding our Testing Horizons

The Problem Static analysis tools can identify thousands of alerts This leads to cognitive overload… … which in turn leads to… … the technique being abandoned

Concept: Actionable Alert Identification Techniques (AAIT)

Page 15: Expanding our Testing Horizons
Page 16: Expanding our Testing Horizons

Some discoveries

Priority of alert

Size/Length of the

method

Size/Length of the class

Age of alert Date of last modification

Code churn Complexity of a method

Nesting of a line of code

Code (line) coverage

0

1

2

3

4

5

Very useful Somewhat useful Slightly useful Irrelevant Missing

Num

ber

of In

terv

iew

ees

Page 17: Expanding our Testing Horizons

A context-specific AAIT

Expert SystemAlerts

ContextFiltered and Ranked

Alerts

Page 18: Expanding our Testing Horizons

Idea: We should be aware of the effectiveness of our test suites

Page 19: Expanding our Testing Horizons
Page 20: Expanding our Testing Horizons

Statement coverage can be misleading

public int multiply(int x, int y){

return (x y); }

@Test public void testMultiply(){ assertEquals(5, multiply(5, 1));}

*/

Passesx

Page 21: Expanding our Testing Horizons

Mutation Testing

Page 22: Expanding our Testing Horizons

Mutation Testing

Test Suite

Mutant 1 Mutant n

Program

Page 23: Expanding our Testing Horizons

Problems with Mutation Testing

Generating mutants is expensive Executing tests is expensive Susceptible to equivalent mutants Manual investigation of unkilled mutants

Page 24: Expanding our Testing Horizons

Applying context

Version n

δ

δ

δ

δ

Version n+1

δ

δ

Version n+1 changes

δ δ

δ

δ

δ

δ

Page 25: Expanding our Testing Horizons

The results

Code Churn Affected LOC

Unchanged code

Decrease in mutants

Decrease in execution time

Low 12 99.8% 91% 91%Medium 60 98.8% 62% 88%High 720 85.6% 46% 89%

Page 26: Expanding our Testing Horizons

Insight: Testing will never provide guarantees that bugs do not exists

Page 27: Expanding our Testing Horizons

Testing Activities

Test Planning Test Case Design Execution Reporting &

Management

Page 28: Expanding our Testing Horizons

Testing Activities

Test Planning Test Case Design Execution Reporting &

ManagementRuntime Testing

Page 29: Expanding our Testing Horizons

Testing(Multiple Paths) Runtime Testing

(Single user-generated Path)

Runtime Testing

Page 30: Expanding our Testing Horizons

Problems with Runtime Testing

Defining mathematical properties may not come naturally to people

Performance Overheads How do you fit this into your

development process?

Page 31: Expanding our Testing Horizons

Applying Context

Given I am a bank teller processing a transactionAnd account 67 has $100 and account 113 has $50When I transfer $50 from account 67 to account 113Then account 67 will have $50 And account 113 will have $100And this should happen within 3 secondsAnd the transfer should be loggedAnd a receipt should be printedAnd the respective clients should be notified

Relevant to feature

Cross-Cutting Criteria

Page 32: Expanding our Testing Horizons

Applying Context

Cross-Cutting Criteria

Feature 1 Feature 2 Feature 3

Page 33: Expanding our Testing Horizons

What can I do?

Page 34: Expanding our Testing Horizons

You can… Periodically scan academic journals for new ideas

Try Google Scholar, set up alerts for your favourite topics Sell the benefits of research to yourself and

colleagues Actively seek out collaborations with research groups,

local or otherwise Consider pursuing research for academic credit

yourself or sponsor and employee to do so

Page 35: Expanding our Testing Horizons

Some collaboration models

Provide a case study Sponsor an intern Hand off a problem to a research group Contribute to a research trust